/* =========================================================
   VERINADERM — COUCHE RESPONSIVE PREMIUM GLOBALE
   Objectif : harmoniser mobile/tablette/desktop sans modifier
   les routes, contrôleurs, formulaires ni fonctionnalités.
   Chargé en dernier pour neutraliser les conflits des CSS de page.
   ========================================================= */

:root {
    --vd-rp-dark: #1f261d;
    --vd-rp-green: #263729;
    --vd-rp-paper: #fffaf4;
    --vd-rp-cream: #fbf7f1;
    --vd-rp-gold: #b28a57;
    --vd-rp-text: #43382f;
    --vd-rp-muted: #8c8175;
    --vd-rp-border: #e8ded2;
    --vd-rp-shadow: 0 22px 60px rgba(31, 38, 29, .12);
}

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    background: var(--vd-rp-cream);
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}

img,
video,
canvas,
svg,
iframe {
    max-width: 100%;
}

button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

/* Header unique et stable sur toutes les pages */
.topbar {
    width: 100% !important;
    min-height: 34px;
    height: auto !important;
    padding: 8px clamp(18px, 4vw, 48px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
    background: var(--vd-rp-dark) !important;
    color: #efe7dc !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
}

.site-header {
    width: 100% !important;
    height: 110px !important;
    min-height: 110px !important;
    padding: 0 clamp(24px, 6vw, 72px) !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 18px !important;
    background: rgba(255, 250, 244, .94) !important;
    border-bottom: 1px solid rgba(232, 222, 210, .82) !important;
    box-shadow: 0 8px 28px rgba(31, 38, 29, .045) !important;
    z-index: 100 !important;
}

.mobile-menu-check,
.mobile-menu-btn {
    display: none;
}

.nav-left,
.header-icons {
    display: flex !important;
    align-items: center !important;
    min-width: 0 !important;
}

.nav-left {
    justify-content: flex-start !important;
    gap: clamp(18px, 3vw, 34px) !important;
}

.header-icons {
    justify-content: flex-end !important;
    gap: 16px !important;
}

.site-header a {
    color: var(--vd-rp-text) !important;
    text-decoration: none !important;
}

.nav-left a {
    font-size: 13px !important;
    letter-spacing: .08em !important;
    text-transform: uppercase !important;
    padding: 0 !important;
    border-bottom: 0 !important;
}

.nav-left a.active,
.site-header .active {
    color: var(--vd-rp-gold) !important;
    font-weight: 700 !important;
}

.brand,
.brand-logo {
    height: 110px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    min-width: 0 !important;
    line-height: 1 !important;
}

.site-logo {
    width: auto !important;
    height: clamp(130px, 12vw, 190px) !important;
    max-width: min(280px, 28vw) !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: center !important;
    display: block !important;
}

.cart {
    position: relative !important;
    min-width: 38px !important;
    min-height: 38px !important;
    display: inline-grid !important;
    place-items: center !important;
    border-radius: 999px !important;
}

.cart span,
.cart b {
    position: absolute !important;
    top: -7px !important;
    right: -8px !important;
    min-width: 18px !important;
    width: auto !important;
    height: 18px !important;
    padding: 0 5px !important;
    border-radius: 999px !important;
    background: var(--vd-rp-gold) !important;
    color: #fff !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    display: grid !important;
    place-items: center !important;
}

/* Largeurs et grilles desktop/tablette */
main,
.shop-page,
.cart-page,
.checkout-page,
.product-section,
.details-tabs,
.recommended {
    max-width: 100% !important;
}

.hero,
.product-grid,
.shop-layout,
.cart-layout,
.checkout-layout,
.details-grid,
.products-grid,
.cards,
.vd-footer,
.vd-footer-grid {
    min-width: 0 !important;
}

.product-card,
.category-card,
.cart-item,
.summary-card,
.checkout-form-card,
.confirmation-card,
.gallery,
.main-image,
.product-info {
    min-width: 0 !important;
}

.product-card,
.category-card,
.summary-card,
.checkout-form-card,
.confirmation-card,
.empty-cart {
    border-radius: 18px;
}

.product-card img,
.category-card img,
.cards img,
.main-image,
.summary-card,
.checkout-form-card,
.confirmation-card,
.empty-cart {
    box-shadow: 0 14px 40px rgba(31, 38, 29, .07);
}

/* Footer harmonisé */
.vd-footer {
    width: 100% !important;
    background: linear-gradient(115deg, #263729 0%, #41513a 68%, #5b6145 100%) !important;
    color: #fff !important;
}

.vd-footer-grid {
    gap: clamp(18px, 3vw, 30px) !important;
}

.vd-footer-card {
    min-width: 0 !important;
}

/* Tablette */
@media (max-width: 1100px) {
    .hero {
        grid-template-columns: 1fr !important;
        min-height: auto !important;
    }

    .hero-content {
        padding: 58px 7vw 28px !important;
        text-align: center !important;
    }

    .hero-text {
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .hero-badges {
        justify-content: center !important;
        margin-top: 32px !important;
    }

    .hero-visual {
        min-height: auto !important;
        padding: 0 7vw 45px !important;
    }

    .shop-layout,
    .product-grid,
    .cart-layout,
    .checkout-layout,
    .details-grid {
        grid-template-columns: 1fr !important;
    }

    .products-grid,
    .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .filters {
        border-right: 0 !important;
        border-bottom: 1px solid var(--vd-rp-border) !important;
        padding-right: 0 !important;
        padding-bottom: 18px !important;
    }

    .vd-footer {
        grid-template-columns: 1fr !important;
    }

    .vd-footer-image {
        display: none !important;
    }

    .vd-footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* Mobile premium */
@media (max-width: 900px) {
    .topbar {
        display: none !important;
    }

    .site-header {
        position: sticky !important;
        top: 0 !important;
        height: 84px !important;
        min-height: 84px !important;
        padding: 0 16px !important;
        grid-template-columns: 46px minmax(0, 1fr) 46px !important;
        gap: 8px !important;
        background: rgba(255, 250, 244, .88) !important;
        backdrop-filter: blur(16px) !important;
        -webkit-backdrop-filter: blur(16px) !important;
        box-shadow: 0 16px 38px rgba(31, 38, 29, .10) !important;
        overflow: visible !important;
    }

    .mobile-menu-btn {
        display: inline-flex !important;
        width: 42px !important;
        height: 42px !important;
        align-items: center !important;
        justify-content: center !important;
        flex-direction: column !important;
        gap: 5px !important;
        justify-self: start !important;
        border: 1px solid rgba(178, 138, 87, .40) !important;
        border-radius: 999px !important;
        background: linear-gradient(145deg, rgba(255,255,255,.86), rgba(251,247,241,.96)) !important;
        box-shadow: 0 12px 26px rgba(31, 38, 29, .10) !important;
        cursor: pointer !important;
    }

    .mobile-menu-btn span {
        display: block !important;
        width: 18px !important;
        height: 2px !important;
        border-radius: 999px !important;
        background: var(--vd-rp-dark) !important;
        transition: transform .25s ease, opacity .25s ease !important;
    }

    .mobile-menu-check:checked + .mobile-menu-btn span:nth-child(1) {
        transform: translateY(7px) rotate(45deg) !important;
    }

    .mobile-menu-check:checked + .mobile-menu-btn span:nth-child(2) {
        opacity: 0 !important;
    }

    .mobile-menu-check:checked + .mobile-menu-btn span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg) !important;
    }

    .brand,
    .brand-logo,
    .header-icons {
        height: 84px !important;
    }

    .brand,
    .brand-logo {
        justify-self: center !important;
        order: initial !important;
    }

    .site-logo {
        height: 102px !important;
        max-width: min(52vw, 205px) !important;
    }

    .header-icons {
        justify-self: end !important;
        position: static !important;
        top: auto !important;
        right: auto !important;
        justify-content: flex-end !important;
    }

    .cart {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        min-height: 42px !important;
        background: rgba(255, 250, 244, .80) !important;
        border: 1px solid rgba(178, 138, 87, .26) !important;
        box-shadow: 0 10px 24px rgba(31, 38, 29, .08) !important;
    }

    .cart span,
    .cart b {
        top: -4px !important;
        right: -4px !important;
    }

    .nav-left {
        position: absolute !important;
        top: calc(100% + 10px) !important;
        left: 14px !important;
        right: 14px !important;
        z-index: 110 !important;
        height: auto !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        padding: 14px !important;
        background: rgba(255, 250, 244, .98) !important;
        border: 1px solid rgba(232, 222, 210, .96) !important;
        border-radius: 22px !important;
        box-shadow: 0 22px 58px rgba(31, 38, 29, .16) !important;
        transform: translateY(-10px) scale(.98) !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transition: opacity .24s ease, transform .24s ease, visibility .24s ease !important;
        overflow: visible !important;
    }

    .mobile-menu-check:checked ~ .nav-left {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: translateY(0) scale(1) !important;
    }

    .nav-left a {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        min-height: 48px !important;
        padding: 0 16px !important;
        border-radius: 16px !important;
        background: linear-gradient(135deg, rgba(251,247,241,.90), rgba(255,255,255,.98)) !important;
        border: 1px solid rgba(232, 222, 210, .78) !important;
        font-size: 13px !important;
        letter-spacing: .08em !important;
        text-transform: uppercase !important;
    }

    .nav-left a::after {
        content: "→";
        color: var(--vd-rp-gold);
        font-size: 15px;
    }

    .nav-left a.active {
        background: linear-gradient(135deg, rgba(178,138,87,.14), rgba(255,255,255,.96)) !important;
    }

    .shop-page,
    .cart-page,
    .checkout-page,
    .product-section,
    .details-tabs,
    .recommended,
    .essentials {
        padding-left: 18px !important;
        padding-right: 18px !important;
    }

    .hero-content h1,
    .shop-title h1,
    .product-info h1,
    .cart-page h1,
    .checkout-title h1 {
        overflow-wrap: anywhere !important;
    }

    .hero h1 {
        font-size: clamp(42px, 13vw, 64px) !important;
        line-height: .96 !important;
    }

    .eyebrow {
        letter-spacing: .20em !important;
        font-size: 12px !important;
    }

    .btn-primary,
    .add-btn,
    .summary-card button,
    .summary-card .checkout-button,
    .empty-cart a,
    .confirmation-card a {
        width: 100% !important;
        min-height: 52px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        border-radius: 999px !important;
    }

    .gallery {
        grid-template-columns: 1fr !important;
    }

    .thumbs {
        order: 2 !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        padding-bottom: 4px !important;
        scroll-snap-type: x mandatory !important;
    }

    .thumbs button {
        min-width: 74px !important;
        width: 74px !important;
        height: 74px !important;
        scroll-snap-align: start !important;
        border-radius: 14px !important;
        overflow: hidden !important;
    }

    .main-image {
        min-height: 340px !important;
        border-radius: 24px !important;
    }

    .product-info {
        padding-top: 0 !important;
    }

    .cart-row {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }

    .qty {
        width: 100% !important;
        justify-content: center !important;
        border-radius: 999px !important;
        overflow: hidden !important;
    }

    .qty button,
    .qty input {
        flex: 1 1 0 !important;
    }

    .tabs {
        gap: 18px !important;
        overflow-x: auto !important;
        padding-bottom: 2px !important;
    }

    .tabs button {
        white-space: nowrap !important;
    }

    .cart-head {
        display: none !important;
    }

    .cart-item {
        grid-template-columns: 1fr !important;
        gap: 13px !important;
        padding: 18px !important;
        margin-bottom: 14px !important;
        background: #fffaf5 !important;
        border: 1px solid var(--vd-rp-border) !important;
        border-radius: 20px !important;
    }

    .product-cell {
        align-items: flex-start !important;
    }

    .product-cell img {
        width: 82px !important;
        height: 82px !important;
        border-radius: 16px !important;
        object-fit: contain !important;
        background: #f6efe7 !important;
    }

    .qty-cell {
        width: 100% !important;
        max-width: 210px !important;
        border-radius: 999px !important;
        overflow: hidden !important;
    }

    .price-cell:before {
        content: "Prix : " !important;
        font-weight: 700 !important;
    }

    .total-cell:before {
        content: "Total : " !important;
        font-weight: 700 !important;
    }

    .summary-card,
    .checkout-form-card,
    .confirmation-card,
    .empty-cart {
        padding: 24px 20px !important;
    }

    .checkout-two-cols,
    .promo-row,
    .confirmation-details {
        grid-template-columns: 1fr !important;
    }

    .checkout-steps {
        grid-template-columns: 1fr !important;
        text-align: center !important;
        gap: 10px !important;
    }

    .checkout-steps .active {
        margin: auto !important;
    }

    .shop-services,
    .cart-services,
    .checkout-benefits {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        text-align: center !important;
        margin-left: 0 !important;
    }

    .vd-footer-grid {
        grid-template-columns: 1fr !important;
        padding: 40px 24px !important;
        gap: 30px !important;
    }
}

/* Petit mobile */
@media (max-width: 560px) {
    .site-header {
        height: 78px !important;
        min-height: 78px !important;
        padding: 0 12px !important;
        grid-template-columns: 44px minmax(0, 1fr) 44px !important;
    }

    .brand,
    .brand-logo,
    .header-icons {
        height: 78px !important;
    }

    .site-logo {
        height: 92px !important;
        max-width: min(58vw, 168px) !important;
    }

    .mobile-menu-btn,
    .cart {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
    }

    .nav-left {
        left: 10px !important;
        right: 10px !important;
        border-radius: 20px !important;
    }

    .hero-content {
        padding: 42px 18px 22px !important;
    }

    .hero-text,
    .subtitle,
    .description,
    .long-text {
        font-size: 14px !important;
        line-height: 1.75 !important;
    }

    .hero-badges,
    .benefits {
        gap: 12px !important;
        justify-content: center !important;
    }

    .products-grid,
    .cards,
    .category-grid {
        grid-template-columns: 1fr !important;
    }

    .product-card img,
    .category-card img {
        border-radius: 22px !important;
    }

    .main-image {
        min-height: 300px !important;
    }

    .summary-products article {
        grid-template-columns: 58px 1fr !important;
    }

    .summary-products strong {
        grid-column: 2 !important;
        text-align: left !important;
    }

    .delivery-option {
        grid-template-columns: 34px 1fr 22px !important;
        padding: 10px !important;
    }

    .delivery-note {
        align-items: flex-start !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
