/* Hide Woodmart Elements */
body.fd-active-product .product-image-summary-wrap,
body.fd-active-product .woodmart-product-container,
body.fd-active-product .woocommerce-tabs,
body.fd-active-product .related-products,
body.fd-active-product .upsells,
body.fd-active-product .entry-summary,
body.fd-active-product .product-images {
    display: none !important;
}

/* Layout */
#floor-designer-root { 
    width: 100%; max-width: 1200px; margin: 20px auto; min-height: 750px; 
    border: 1px solid #e0e0e0; background: #fff; display: flex; flex-direction: column; 
    position: relative; z-index: 10; box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.fd-loading { padding: 50px; text-align: center; font-size: 18px; color: #666; }

/* Workspace */
.fd-workspace { display: flex; flex: 1; overflow: hidden; min-height: 600px; position: relative; }

/* Sidebar */
.fd-sidebar {
    width: 340px; background: #f9fafb; border-right: 1px solid #e0e0e0;
    display: flex; flex-direction: column; overflow-y: auto; flex-shrink: 0;
    transition: all 0.3s ease;
}
.fd-sidebar.collapsed { margin-left: -340px; }

.fd-sidebar-header { padding: 20px; background: #fff; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
.fd-sidebar-header h2 { margin: 0; font-size: 1.2rem; color: #333; }

/* Toggle */
.fd-sidebar-toggle {
    display: none; position: absolute; top: 10px; left: 10px; z-index: 100;
    background: #2271b1; color: white; border: none; border-radius: 4px;
    width: 40px; height: 40px; font-size: 20px; cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Tools */
.fd-tool-group { padding: 20px; border-bottom: 1px solid #eee; }
.fd-tool-title { font-size: 0.85rem; text-transform: uppercase; color: #888; margin-bottom: 12px; font-weight: 700; }

/* Inputs */
.fd-input-row { display: flex; gap: 10px; margin-bottom: 10px; }
.fd-input-group { flex: 1; }
.fd-input-group label { display: block; font-size: 0.8rem; margin-bottom: 4px; color: #555; }
.fd-input-group input { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; }

.fd-btn {
    background: #f0f0f1; color: #333; border: 1px solid #ccc; padding: 8px 15px;
    border-radius: 4px; cursor: pointer; font-size: 14px;
}
.fd-btn:hover { background: #e5e5e5; }
.fd-btn-outline { background: #fff; color: #333; border: 1px solid #ccc; }

/* Grids */
.fd-tile-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.fd-tile-option {
    aspect-ratio: 1; border: 2px solid transparent; border-radius: 4px;
    cursor: pointer; background-size: cover; background-position: center;
    transition: all 0.2s;
}
.fd-tile-option:hover { transform: scale(1.05); box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.fd-tile-option.selected { border-color: #2271b1; box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.2); }

/* Canvas */
.fd-canvas-area {
    flex: 1; background-color: #f0f2f5;
    background-image: radial-gradient(#dfe3e8 1px, transparent 1px);
    background-size: 20px 20px;
    cursor: crosshair; overflow: hidden; position: relative;
    touch-action: none; user-select: none; -webkit-user-select: none;
}

/* Footer */
.fd-footer {
    border-top: 1px solid #eee; padding: 20px;
    display: flex; justify-content: space-between; align-items: center;
    background: #fff; min-height: 80px; flex-wrap: wrap; gap: 10px;
}
.fd-price-box { font-size: 1.2rem; color: #333; }
.fd-price-box span { font-weight: bold; color: #2271b1; font-size: 1.5rem; }

.fd-footer button {
    background: #2271b1; color: #fff; border: none;
    padding: 12px 30px; border-radius: 4px; font-size: 1rem;
    font-weight: bold; cursor: pointer;
}
.fd-footer button:hover { background: #135e96; }

/* Modal */
.fd-modal {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); z-index: 2000;
    display: flex; justify-content: center; align-items: center;
    backdrop-filter: blur(2px);
}
.fd-modal-content {
    background: #fff; padding: 30px; border-radius: 8px;
    text-align: center; max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.fd-modal-content h3 { margin-top: 0; color: #2271b1; }
.fd-modal-icon { font-size: 40px; color: #4caf50; margin-bottom: 15px; }
.fd-modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 20px; }
.fd-modal-btn {
    padding: 10px 20px; border: 1px solid #ccc; background: #f0f0f1;
    cursor: pointer; border-radius: 4px; text-decoration: none;
    color: #333; font-weight: bold;
}
.fd-modal-btn.primary { background: #2271b1; color: #fff; border-color: #2271b1; }
.fd-modal-btn:hover { opacity: 0.9; }

/* Responsive */
@media (max-width: 768px) {
    .fd-workspace { flex-direction: column-reverse; }
    .fd-sidebar { width: 100%; height: 50vh; border-right: none; border-top: 1px solid #e0e0e0; margin-left: 0; }
    .fd-sidebar.collapsed { height: 0; overflow: hidden; border: none; padding: 0; }
    .fd-canvas-area { height: 50vh; transition: height 0.3s ease; }
    .fd-workspace.mobile-fullscreen .fd-canvas-area { height: 100vh; }
    .fd-footer { position: relative; width: 100%; z-index: 9; box-shadow: none; flex-direction: column; align-items: stretch; padding-bottom: 90px; }
    .fd-footer .fd-price-box { text-align: center; margin-bottom: 15px; }
    .fd-footer > div:last-child { display: flex; flex-direction: column; width: 100%; gap: 10px; }
    .fd-footer button { width: 100%; padding: 15px; }
    .fd-sidebar-toggle { display: block; }
}