/* ============================================================
   === RESPONSIVE — 4 breakpoints + mode paysage
   ============================================================ */

/* === TABLET (≤ 900px) === */
@media (max-width: 900px) {
    .wc3dc-overlay__body {
        grid-template-columns: 1fr !important;
        grid-template-rows: minmax(0, 1fr) auto !important;
    }
    .wc3dc-sidebar {
        border-left: none !important;
        border-top: 1px solid var(--wc3dc-grid-strong) !important;
        max-height: 55vh !important;
        padding: 22px 20px !important;
        -webkit-overflow-scrolling: touch;
    }
    .wc3dc-overlay__header {
        padding: 14px 20px !important;
    }
    .wc3dc-overlay__title {
        display: none !important;
    }
    .wc3dc-overlay__footer {
        padding: 14px 20px !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 12px !important;
    }
    .wc3dc-overlay__actions {
        flex: 1 1 auto;
        gap: 10px;
    }
    .wc3dc-overlay__price {
        flex: 0 0 auto;
        font-size: 11px !important;
        letter-spacing: 0.1em !important;
    }
    .wc3dc-overlay__price strong {
        font-size: 16px !important;
        margin-left: 6px;
    }
    .wc3dc-overlay .wc3dc-btn {
        padding: 13px 18px !important;
        font-size: 11px !important;
        letter-spacing: 0.12em !important;
        min-height: 44px;
    }
    .wc3dc-sidebar__intro { font-size: 15px !important; margin-bottom: 4px !important; }
    .wc3dc-sidebar__product { font-size: 19px !important; margin-bottom: 22px !important; }
    .wc3dc-section { margin-bottom: 22px !important; padding-bottom: 22px !important; }
    .wc3dc-swatch { width: 34px; height: 34px; }
    .wc3dc-color-swatches { gap: 12px; }
    .wc3dc-viewer__hint { font-size: 10px !important; letter-spacing: 0.15em !important; bottom: 12px; }
}

/* === MOBILE (≤ 600px) === */
@media (max-width: 600px) {
    .wc3dc-overlay__header {
        padding: 12px 14px !important;
    }
    .wc3dc-overlay .wc3dc-brand-logo,
    .wc3dc-overlay img.wc3dc-brand-logo {
        height: 26px !important;
        max-height: 26px !important;
        max-width: 130px !important;
    }
    .wc3dc-overlay__close,
    .wc3dc-overlay button.wc3dc-overlay__close {
        width: 36px !important;
        height: 36px !important;
        font-size: 16px !important;
        min-height: 36px;
        min-width: 36px;
    }
    .wc3dc-sidebar {
        max-height: 58vh !important;
        padding: 20px 16px !important;
    }
    .wc3dc-sidebar__intro { font-size: 14px !important; }
    .wc3dc-sidebar__product { font-size: 17px !important; margin-bottom: 18px !important; }
    .wc3dc-section { margin-bottom: 18px !important; padding-bottom: 18px !important; }
    .wc3dc-section__label { font-size: 10px !important; letter-spacing: 0.18em !important; margin-bottom: 10px !important; }
    .wc3dc-input { font-size: 16px !important; padding: 10px 0 !important; } /* 16px évite le zoom iOS */
    .wc3dc-color-swatches { gap: 10px; }
    .wc3dc-swatch { width: 36px; height: 36px; } /* tactile : remonte à 36px pour confort */
    .wc3dc-overlay__footer {
        padding: 12px 14px !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }
    .wc3dc-overlay__price {
        text-align: center;
        order: 2;
        font-size: 10px !important;
    }
    .wc3dc-overlay__actions {
        flex-direction: row !important;
        width: 100%;
        gap: 10px;
    }
    .wc3dc-overlay .wc3dc-btn {
        flex: 1;
        padding: 14px 10px !important;
        font-size: 11px !important;
        letter-spacing: 0.08em !important;
        min-height: 48px;
    }
}

/* === TRÈS PETIT MOBILE (≤ 380px) === */
@media (max-width: 380px) {
    .wc3dc-overlay__header { padding: 10px 12px !important; }
    .wc3dc-overlay .wc3dc-brand-logo,
    .wc3dc-overlay img.wc3dc-brand-logo {
        height: 22px !important;
        max-height: 22px !important;
        max-width: 110px !important;
    }
    .wc3dc-sidebar { padding: 16px 12px !important; }
    .wc3dc-sidebar__product { font-size: 15px !important; }
    .wc3dc-overlay .wc3dc-btn {
        font-size: 10px !important;
        padding: 12px 6px !important;
        letter-spacing: 0.05em !important;
    }
    .wc3dc-section__label { font-size: 9px !important; letter-spacing: 0.14em !important; }
    .wc3dc-swatch { width: 32px; height: 32px; }
}

/* === MOBILE PAYSAGE (orientation landscape, hauteur réduite) === */
@media (orientation: landscape) and (max-height: 600px) and (max-width: 1024px) {
    .wc3dc-overlay__body {
        grid-template-columns: 1fr 260px !important;
        grid-template-rows: 1fr !important;
    }
    .wc3dc-sidebar {
        max-height: none !important;
        border-left: 1px solid var(--wc3dc-grid-strong) !important;
        border-top: none !important;
        padding: 14px 14px !important;
    }
    .wc3dc-overlay__header {
        padding: 8px 16px !important;
    }
    .wc3dc-overlay__footer {
        padding: 8px 16px !important;
        flex-direction: row !important;
        align-items: center !important;
    }
    .wc3dc-overlay__title { display: block !important; font-size: 9px !important; }
    .wc3dc-overlay__price { order: 0; flex: 0 0 auto; font-size: 10px !important; }
    .wc3dc-overlay__actions { flex-direction: row !important; flex: 1 1 auto; justify-content: flex-end; }
    .wc3dc-overlay .wc3dc-btn { padding: 9px 14px !important; font-size: 10px !important; min-height: 36px; }
    .wc3dc-sidebar__intro { font-size: 12px !important; margin-bottom: 2px !important; }
    .wc3dc-sidebar__product { font-size: 14px !important; margin-bottom: 12px !important; }
    .wc3dc-section { margin-bottom: 12px !important; padding-bottom: 12px !important; }
    .wc3dc-overlay .wc3dc-brand-logo { height: 22px !important; max-height: 22px !important; }
    .wc3dc-overlay__close { width: 30px !important; height: 30px !important; font-size: 14px !important; }
    .wc3dc-swatch { width: 28px; height: 28px; }
    .wc3dc-viewer__hint { display: none; }
}

/* === SCROLL CUSTOM dans sidebar (touch + desktop) === */
.wc3dc-sidebar::-webkit-scrollbar { width: 4px; }
.wc3dc-sidebar::-webkit-scrollbar-track { background: transparent; }
.wc3dc-sidebar::-webkit-scrollbar-thumb { background: rgba(255,214,0,0.3); border-radius: 0; }
.wc3dc-sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,214,0,0.6); }
.wc3dc-sidebar { scrollbar-width: thin; scrollbar-color: rgba(255,214,0,0.3) transparent; }

/* === TOUCH FEEDBACK (mobile tap) === */
@media (hover: none) and (pointer: coarse) {
    .wc3dc-overlay .wc3dc-btn:active { transform: scale(0.98); }
    .wc3dc-swatch:active { transform: scale(0.95); }
    .wc3dc-overlay__close:active { transform: scale(0.92); }
}

/* Admin — lignes couleur (réutilisé depuis l'onglet produit) */

.wc3dc-color-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.wc3dc-color-row input[type="text"] {
    flex: 1;
}
