/* Overrides mobile globaux — chargé en dernier sur toutes les pages */

@media (max-width: 992px) {
    /* ── Header : logo + actions sur une ligne, menu en dessous ── */
    header .navbar {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: center !important;
    }

    .logo-block {
        flex: 0 0 auto !important;
        width: min(148px, 42vw) !important;
        height: 44px !important;
        order: 1 !important;
    }

    header nav {
        display: none !important;
    }

    .mobile-header-actions {
        margin-left: auto !important;
        flex: 0 0 auto !important;
        order: 2 !important;
    }

    body.nav-open header nav {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 1 100% !important;
        width: 100% !important;
        order: 10 !important;
        align-items: stretch !important;
    }

    body.nav-open header nav > ul,
    header nav > ul {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
    }

    header nav > ul > li {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
    }

    header nav > ul > li.has-dropdown > ul.dropdown-menu {
        position: static !important;
        display: none !important;
        width: 100% !important;
        box-shadow: none !important;
    }

    header nav > ul > li.has-dropdown.nav-dropdown-open > ul.dropdown-menu {
        display: block !important;
    }

    /* ── Hero pages produit (tendeurs, filets, câbles, accessoires) ── */
    .product-page-hero .product-intro,
    .tendeurs-product-hero.product-page-hero .product-intro,
    .cables-product-hero.product-page-hero .product-intro,
    .filets-product-hero.product-page-hero .product-intro {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 24px !important;
        align-items: start !important;
    }

    .product-page-hero .product-gallery,
    .tendeurs-product-hero.product-page-hero .product-gallery,
    .cables-product-hero.product-page-hero .product-gallery,
    .filets-product-hero.product-page-hero .product-gallery {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
        justify-self: center !important;
        margin: 0 auto !important;
        overflow: visible !important;
    }

    .tendeurs-product-hero.product-page-hero .product-gallery img:not(.fil-hero-logo),
    .cables-product-hero.product-page-hero .product-gallery img:not(.fil-hero-logo),
    .filets-product-hero.product-page-hero .product-gallery .fil-hero-photo,
    .filets-product-hero.product-page-hero .product-gallery img:not(.fil-hero-logo),
    .product-page-hero .product-gallery img:not(.fil-hero-logo) {
        display: block !important;
        width: auto !important;
        max-width: min(320px, 100%) !important;
        height: auto !important;
        max-height: 260px !important;
        margin: 0 auto !important;
        object-fit: contain !important;
    }

    .product-page-hero .product-details {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .product-page-hero .product-details h1,
    .product-page-hero .product-details p {
        overflow-wrap: break-word;
        word-wrap: break-word;
    }

    .product-page-hero {
        overflow-x: clip;
    }

    /* ── Végétalisation intro ── */
    .veg-embase-intro,
    .veg-cables-intro {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .veg-page-section > .veg-detail-header {
        display: block !important;
        flex-direction: unset !important;
        align-items: stretch !important;
        padding: 0 !important;
        gap: 0 !important;
        margin-bottom: 16px !important;
    }

    .veg-embase-intro-photo,
    .veg-cables-intro-photo {
        max-width: min(200px, 72vw) !important;
        width: 100% !important;
        margin: 0 auto !important;
        justify-self: center !important;
    }

    .veg-embase-intro-photo img,
    .veg-cables-intro-photo img {
        width: auto !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: 160px !important;
        object-fit: contain !important;
        display: block !important;
        margin: 0 auto !important;
    }

    .veg-back-btn {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
        text-align: center !important;
        min-height: 44px !important;
        line-height: 1.25 !important;
        padding: 12px 16px !important;
        text-decoration: none !important;
        color: #444 !important;
    }

    /* Tableau embase → cartes (992px, même breakpoint que le reste du site) */
    .veg-embase-scroll {
        border: none !important;
        overflow: visible !important;
        background: transparent !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    .veg-embase-scroll::after {
        display: none !important;
    }

    .tendeur-catalog-table.veg-embase-table {
        min-width: 0 !important;
        display: block !important;
        width: 100% !important;
    }

    .veg-embase-table thead {
        display: none !important;
    }

    .veg-embase-table tbody {
        display: flex !important;
        flex-direction: column !important;
        gap: 14px !important;
    }

    .veg-embase-table tbody tr {
        display: grid !important;
        grid-template-columns: 64px 1fr !important;
        grid-template-areas:
            "photo ref"
            "photo nom"
            "mat mat"
            "qty qty"
            "action action" !important;
        gap: 8px 12px !important;
        padding: 14px !important;
        border: 1px solid #e4e4e4 !important;
        border-radius: 12px !important;
        background: #fff !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
    }

    .veg-embase-table tbody td {
        padding: 0 !important;
        border: none !important;
    }

    .veg-embase-table .tendeur-photo-cell {
        grid-area: photo !important;
        width: auto !important;
    }

    .veg-embase-table .tendeur-col-ref {
        grid-area: ref !important;
        min-width: 0 !important;
    }

    .veg-embase-table .tendeur-col-nom {
        grid-area: nom !important;
        min-width: 0 !important;
        max-width: none !important;
    }

    .veg-embase-table .veg-embase-cell-matiere {
        grid-area: mat !important;
        grid-column: 1 / -1 !important;
    }

    .veg-embase-table .veg-embase-cell-unite {
        display: none !important;
    }

    .veg-embase-table .veg-embase-qty-cell {
        grid-area: qty !important;
        grid-column: 1 / -1 !important;
    }

    .veg-embase-table .veg-embase-cell-action {
        grid-area: action !important;
        grid-column: 1 / -1 !important;
    }

    .veg-embase-table .veg-embase-cell-action .add-quote-btn {
        width: 100% !important;
        display: block !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }

    .veg-embase-table th:last-child,
    .veg-embase-table td:last-child {
        position: static !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    /* ── Fiches détail catalogue (tendeurs, filets, végétalisation-tendeurs) ── */
    .tendeur-detail-header,
    .tendeur-detail-header.has-gallery,
    .fil-detail-header,
    .fil-detail-header.has-gallery {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        grid-template-columns: none !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        gap: 16px !important;
        padding: 14px !important;
    }

    .tendeur-detail-header > div,
    .fil-detail-header > div {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .tendeur-detail-header .tendeur-detail-hero,
    .tendeur-detail-header.has-gallery .tendeur-detail-hero,
    .fil-detail-header .fil-detail-hero,
    .fil-detail-header.has-gallery .fil-detail-hero,
    .tendeur-detail-hero.tendeur-detail-hero--gallery,
    .fil-detail-hero.fil-detail-hero--gallery {
        order: 1 !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        align-self: stretch !important;
    }

    .tendeur-detail-gallery,
    .fil-detail-gallery {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    .tendeur-detail-header > div:not(.tendeur-detail-hero),
    .fil-detail-header > div:not(.fil-detail-hero) {
        order: 2 !important;
    }

    #tendeur-detail-title,
    #fil-detail-title,
    #tendeur-detail-meta,
    #fil-detail-meta {
        width: 100% !important;
        max-width: 100% !important;
        overflow-wrap: break-word;
        word-wrap: break-word;
        white-space: normal !important;
    }

    #tendeur-level-detail,
    #fil-level-detail,
    #veg-level-detail {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: clip;
    }

    .specs-section.container,
    .product-page-hero .container {
        max-width: 100% !important;
        overflow-x: clip;
    }

    /* ── Installation / pages avec product-intro générique ── */
    .product-intro {
        grid-template-columns: 1fr !important;
    }
}
