/* ═══════════════════════════════════════════════════════
   B.EASE Configurator — v6.7.9 — Spized-style layout
   Mobile-first · Icon sidebar · 3D dominant
   ═══════════════════════════════════════════════════════ */

/* ─── RESET & BASE ─── */
.bease-configurator-wrapper {
    position: fixed;
    top: var(--header-height, 160px);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    background: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-text-size-adjust: 100%;
    line-height: 1.4;
}
.bease-configurator-wrapper * { box-sizing: border-box; }

/* Cacher le header/footer WordPress sur la page configurateur */
body.page-id-30571 header.elementor-location-header,
body.page-id-30571 footer.elementor-location-footer,
body.page-id-30571 #top-bar {
    display: none !important;
}
body.page-id-30571 .bease-configurator-wrapper {
    top: 0 !important;
}
body.page-id-30571 #main {
    padding: 0 !important;
    margin: 0 !important;
}

/* ─── NOTICES ─── */
.bease-notice { padding: 14px 16px; border-radius: 8px; background: #f0f9ff; border-left: 4px solid #0ea5e9; margin: 12px; font-size: 14px; }
.bease-notice-error { background: #fef2f2; border-left-color: #ef4444; }

/* ─── PRODUCT GRID (selection page) ─── */
.bease-products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 16px 12px;
}
.bease-products-grid h2 { padding: 0 12px; }
.bease-product-card {
    background: #fff;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    text-decoration: none;
    color: #333;
    display: block;
    transition: transform .2s, box-shadow .2s;
    -webkit-tap-highlight-color: transparent;
}
.bease-product-card:active { transform: scale(0.98); }
.bease-product-thumb {
    width: 100%; height: 120px;
    background: #f3f4f6; border-radius: 8px;
    margin-bottom: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 48px; overflow: hidden;
}
.bease-product-thumb img { max-height: 100%; border-radius: 8px; }

/* ═══════════════════════════════════════════════════════
   CONFIGURATOR APP LAYOUT
   Mobile: icon bar top + 3D + panel below
   Desktop: icon sidebar left + panel + 3D right
   ═══════════════════════════════════════════════════════ */

.bease-app {
    display: flex;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* ─── ICON NAVIGATION BAR (mobile: horizontal top) ─── */
.bease-icon-nav {
    display: flex;
    flex-direction: row;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-shrink: 0;
    z-index: 10;
}
.bease-icon-nav::-webkit-scrollbar { display: none; }

.bease-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 14px;
    min-width: 60px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    transition: color .15s, background .15s;
    border-bottom: 2px solid transparent;
}
.bease-nav-item .bease-nav-icon { font-size: 20px; line-height: 1; }
.bease-nav-item.active {
    color: #0ea5e9;
    border-bottom-color: #0ea5e9;
    background: #f0f9ff;
}
.bease-nav-item:active { background: #f1f5f9; }

/* ─── MAIN AREA (3D + panel) ─── */
.bease-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ─── 3D VIEWPORT ─── */
.bease-viewport {
    flex: 1;
    min-height: 250px;
    background: #f0f4f8;
    position: relative;
    overflow: hidden;
    touch-action: pan-y pinch-zoom;
}
#bease-3d-container {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    cursor: grab;
}
.bease-3d-hint {
    position: absolute;
    bottom: 8px; left: 0; right: 0;
    text-align: center;
    font-size: 11px; color: #94a3b8;
    pointer-events: none;
}
.bease-view-controls {
    position: absolute;
    top: 10px; right: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 5;
}
.bease-view-btn {
    width: 36px; height: 36px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #e5e7eb;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    -webkit-tap-highlight-color: transparent;
}
.bease-view-btn:active { background: #f1f5f9; }

/* ─── SIDE PANEL (slides from bottom on mobile) ─── */
.bease-panel {
    background: #fff;
    border-top: 1px solid #e5e7eb;
    max-height: 45vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0;
    transition: max-height .3s ease;
}
.bease-panel-inner { padding: 16px; }
.bease-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.bease-panel-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}
.bease-panel-toggle {
    display: flex;
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background: #fff;
    align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 14px;
}

/* Tab content visibility */
.bease-panel-content { display: none; }
.bease-panel-content.active { display: block; }

/* ─── DESIGN GALLERY ─── */
.bease-design-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.bease-design-card {
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    background: #fff;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
    transition: border-color .2s, box-shadow .2s;
}
.bease-design-card.active,
.bease-design-card:active {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14,165,233,.15);
}
.bease-design-thumb {
    height: 100px;
    background: #f3f4f6;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.bease-design-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bease-design-name {
    padding: 6px 8px;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Category filters */
.bease-cat-filters {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
}
.bease-cat-filters::-webkit-scrollbar { display: none; }
.bease-cat-btn {
    padding: 6px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background: #fff;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.bease-cat-btn.active { background: #0ea5e9; color: #fff; border-color: #0ea5e9; }

/* ─── COULEURS PANEL ─── */
.bease-zone-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 4px;
    cursor: pointer;
    background: #fff;
    -webkit-tap-highlight-color: transparent;
}
.bease-zone-btn.active { border-color: #0ea5e9; }
.bease-zone-preview {
    width: 28px; height: 28px;
    border-radius: 6px;
    border: 1px solid rgba(0,0,0,.15);
    flex-shrink: 0;
}
.bease-quick-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
.bease-qcolor {
    width: 32px; height: 32px;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform .1s;
}
.bease-qcolor:active { transform: scale(1.15); }
.bease-qcolor.selected { border-color: #0ea5e9; box-shadow: 0 0 0 2px rgba(14,165,233,.3); }
.bease-color-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

/* ─── LOGO PANEL ─── */
.bease-dropzone {
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: border-color .2s;
    margin-bottom: 12px;
}
.bease-dropzone:active { border-color: #0ea5e9; background: #f0f9ff; }
.bease-dropzone-icon { font-size: 28px; margin-bottom: 4px; }

/* ─── TEXTE PANEL ─── */
.bease-add-btn {
    width: 100%;
    padding: 12px;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    -webkit-tap-highlight-color: transparent;
    margin-top: 8px;
}
.bease-add-btn:active { background: #f0f9ff; border-color: #0ea5e9; }

/* ─── ROSTER / ÉQUIPE PANEL ─── */
.bease-roster-header {
    display: grid;
    gap: 4px;
    padding: 8px 4px;
    background: #f8fafc;
    border-radius: 8px 8px 0 0;
    border: 1px solid #e5e7eb;
    border-bottom: 2px solid #0ea5e9;
    font-size: 10px;
    color: #64748b;
    font-weight: 700;
    letter-spacing: .5px;
}
#bease-roster-list {
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ─── INPUTS (touch-friendly) ─── */
.bease-label { font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px; display: block; }

input[type="color"] {
    width: 44px; height: 44px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer; padding: 2px;
}
input[type="range"] {
    -webkit-appearance: none;
    height: 6px; background: #e5e7eb;
    border-radius: 3px; outline: none; width: 100%;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px; height: 24px; border-radius: 50%;
    background: #0ea5e9; cursor: pointer;
    border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
input[type="range"]::-moz-range-thumb {
    width: 24px; height: 24px; border-radius: 50%;
    background: #0ea5e9; cursor: pointer;
    border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
select, input[type="text"], input[type="number"], input[type="url"] {
    font-size: 16px;   /* prevents iOS zoom */
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    width: 100%; box-sizing: border-box;
}

/* ─── BOTTOM ACTION BAR (always visible) ─── */
.bease-bottom-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,.06);
    gap: 8px;
}
.bease-bottom-price {
    font-size: 13px;
    color: #64748b;
    white-space: nowrap;
}
.bease-bottom-price strong {
    font-size: 16px;
    color: #0ea5e9;
}
.bease-bottom-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.bease-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    white-space: nowrap;
}
.bease-btn-outline { background: #f1f5f9; color: #475569; border: 1px solid #e5e7eb; }
.bease-btn-outline:active { background: #e2e8f0; }
.bease-btn-primary { background: #10b981; color: #fff; }
.bease-btn-primary:active { background: #059669; }

/* ─── OVERLAY ELEMENTS — hidden since v6.8.8 (logos/texts rendered only in 3D texture) ─── */
#bease-elements-overlay {
    display: none !important;
}

.bease-overlay-element {
    display: none !important;
}

.bease-overlay-element.selected {
    display: none !important;
}

.bease-overlay-handles {
    display: none !important;
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    gap: 4px;
    background: rgba(0,0,0,0.7);
    border-radius: 6px;
    padding: 3px 6px;
    white-space: nowrap;
}

.bease-overlay-element.selected .bease-overlay-handles {
    display: none !important;
}

.bease-overlay-handle {
    width: 22px;
    height: 22px;
    background: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.bease-overlay-handle:hover { background: #e5e7eb; }

.bease-overlay-resize {
    position: absolute;
    bottom: -6px;
    right: -6px;
    width: 14px;
    height: 14px;
    background: #0ea5e9;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: se-resize;
    display: none;
    pointer-events: all;
}

.bease-overlay-element.selected .bease-overlay-resize {
    display: block;
}

/* Overlays HTML = poignées de drag seulement — le vrai rendu est dans le canvas 3D */
.bease-overlay-element:not(.selected) {
    opacity: 0.4;
}
.bease-overlay-element.selected {
    opacity: 0.85;
    background: rgba(14, 165, 233, 0.08);
    border-radius: 4px;
}
.bease-overlay-element .bease-drag-handle-icon {
    min-width: 44px;
    min-height: 44px;
}
/* Les poignées restent toujours visibles */
.bease-overlay-element .bease-overlay-handles,
.bease-overlay-element .bease-overlay-resize {
    opacity: 1 !important;
}

/* ─── CANVAS (hidden, used for texture) ─── */
.bease-canvas-offscreen {
    position: absolute;
    left: -9999px; top: -9999px;
    width: 500px; height: 600px;
    pointer-events: none;
}


/* ═══════════════════════════════════════════════════════
   TABLET (≥ 640px)
   ═══════════════════════════════════════════════════════ */
@media (min-width: 640px) {
    .bease-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px; margin: 20px 16px;
    }
    .bease-design-grid { grid-template-columns: repeat(3, 1fr); }
    .bease-design-thumb { height: 120px; }
    .bease-viewport { min-height: 350px; }

    .bease-bottom-price strong { font-size: 18px; }
    .bease-btn { padding: 10px 20px; font-size: 14px; }
}


/* ═══════════════════════════════════════════════════════
   DESKTOP (≥ 960px) — Spized-style layout
   Icon sidebar (vertical) | Panel | 3D viewport
   ═══════════════════════════════════════════════════════ */
@media (min-width: 960px) {
    .bease-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px; margin: 20px;
    }
    .bease-product-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 20px rgba(0,0,0,.15);
    }

    .bease-app {
        flex-direction: row;
    }

    /* Vertical icon sidebar */
    .bease-icon-nav {
        flex-direction: column;
        border-bottom: none;
        border-right: 1px solid #e5e7eb;
        width: 72px;
        flex-shrink: 0;
        overflow-x: visible;
        overflow-y: auto;
        padding-top: 8px;
    }
    .bease-nav-item {
        padding: 12px 8px;
        min-width: auto;
        border-bottom: none;
        border-left: 3px solid transparent;
        border-radius: 0;
    }
    .bease-nav-item.active {
        border-bottom: none;
        border-left-color: #0ea5e9;
        background: #f0f9ff;
    }

    /* Main = panel + viewport side by side */
    .bease-main {
        flex-direction: row;
        flex: 1;
    }

    /* Side panel */
    .bease-panel {
        width: 340px;
        max-height: none;
        height: 100%;
        overflow-y: auto;
        border-top: none;
        border-right: 1px solid #e5e7eb;
        flex-shrink: 0;
    }
    .bease-panel-toggle { display: none; }

    /* 3D viewport takes remaining space */
    .bease-viewport {
        flex: 1;
        min-height: auto;
    }

    .bease-design-grid { grid-template-columns: repeat(2, 1fr); }
    .bease-design-thumb { height: 110px; }

    /* Bottom bar stays fixed */
    .bease-bottom-bar { padding: 10px 20px; }
}


/* ═══════════════════════════════════════════════════════
   WIDE DESKTOP (≥ 1400px)
   ═══════════════════════════════════════════════════════ */
@media (min-width: 1400px) {
    .bease-panel { width: 400px; }
    .bease-design-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .bease-design-thumb { height: 130px; }
}


/* ═══════════════════════════════════════════════════════
   MOBILE (< 768px) — sidebar en bas, viewport en haut
   ═══════════════════════════════════════════════════════ */
@media (max-width: 767px) {
    .bease-configurator-wrapper {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }

    .bease-app {
        flex-direction: column;
    }

    /* Viewport 3D occupe le haut */
    .bease-viewport {
        flex: 1;
        min-height: 0;
    }

    /* Panel en bas, hauteur fixe */
    .bease-panel {
        height: 45vh;
        max-height: 45vh;
        border-top: 1px solid #e5e7eb;
        border-right: none;
        overflow-y: auto;
    }

    /* Navigation icônes en ligne en bas du panel */
    .bease-icon-nav {
        flex-direction: row;
        height: 56px;
        border-top: 1px solid #e5e7eb;
        border-right: none;
        border-bottom: none;
        overflow-x: auto;
        width: 100%;
        order: 2;
    }

    .bease-icon-nav .bease-nav-item {
        flex: 1;
        min-width: 56px;
    }

    /* Réorganiser : viewport en haut, nav en bas */
    .bease-main {
        flex-direction: column;
        flex: 1;
        min-height: 0;
    }

    /* Barre du bas */
    .bease-bottom-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 200;
    }
}


/* ═══════════════════════════════════════════════════════
   ANIMATIONS & A11Y
   ═══════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: no-preference) {
    .bease-product-card, .bease-design-card, .bease-nav-item, .bease-btn { transition: all .2s ease; }
}
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
