/*
 * Mobile : en-tête et tiroir du menu
 * Même univers que le bureau : barre brune, logo sur fond blanc, entrées en BISON majuscules, entrée active en jaune.
 * Le seuil est celui de The7 : mobile jusqu'à 992 px inclus. Tout est dans le @media : le bureau ne change pas.
 * Author: EcareWeb
 * 2026
 */

@media (max-width: 992px) {

    /* ---- Barre d'en-tête : menu à gauche, logo au centre, panier et compte à droite ---- */

    .masthead.masthead-mobile-header,
    .masthead .mobile-header-bar {
        background-color: var(--color-brown) !important;
    }

    .masthead .mobile-header-bar {
        display: grid !important;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        height: 64px;
        min-height: 64px;
        padding: 0 8px !important;
        box-sizing: border-box;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
    }

    .masthead .mobile-header-bar::after {
        display: none !important;
    }

    .mobile-header-space {
        height: 64px !important;
    }

    .masthead .mobile-header-bar .mobile-navigation {
        grid-column: 1;
        grid-row: 1;
        justify-self: start;
        margin: 0 !important;
    }

    .masthead .mobile-header-bar .mobile-branding {
        grid-column: 2;
        grid-row: 1;
        justify-self: center;
        margin: 0 !important;
        padding: 4px 6px;
        background: var(--color-white);
        border-radius: 10px;
        line-height: 0;
    }

    .masthead .mobile-header-bar .mobile-branding a img,
    .masthead.show-device-logo .mobile-header-bar .mobile-branding img {
        display: block;
        width: auto;
        max-width: 100%;
        height: auto;
        max-height: 42px;
    }

    .masthead .mobile-header-bar .mobile-mini-widgets {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
        display: flex !important;
        flex-flow: row nowrap !important;
        align-items: center;
        margin: 0 !important;
    }

    .masthead .mobile-header-bar .mobile-mini-widgets > * {
        margin: 0 !important;
    }

    /* La recherche vit dans le tiroir (champ en tête de liste). */
    .masthead .mobile-header-bar .mobile-mini-widgets .mini-search {
        display: none !important;
    }

    /* Bouton du menu : trois traits blancs, zone de 48 px. */
    .masthead .mobile-header-bar .dt-mobile-menu-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 48px;
        min-height: 48px;
        padding: 0 !important;
        margin: 0 !important;
    }

    .masthead .mobile-header-bar .dt-mobile-menu-icon .menu-line,
    .masthead .mobile-header-bar .dt-mobile-menu-icon .menu-line::before,
    .masthead .mobile-header-bar .dt-mobile-menu-icon .menu-line::after {
        background-color: var(--color-white) !important;
    }

    /* Panier : icône et total, puis pastille du nombre d'articles comme au bureau. */
    .masthead .mobile-header-bar .mobile-mini-widgets .shopping-cart {
        display: inline-flex !important;
    }

    .masthead .mobile-header-bar .mobile-mini-widgets .shopping-cart a {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        min-height: 44px;
        padding: 0 4px;
        color: var(--color-white) !important;
        font-size: 14px;
        font-weight: 700;
    }

    .masthead .mobile-header-bar .mobile-mini-widgets .shopping-cart a *,
    .masthead .mobile-header-bar .mobile-mini-widgets .shopping-cart i {
        color: var(--color-white) !important;
    }

    .masthead .mobile-header-bar .mobile-mini-widgets .shopping-cart .counter {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 18px;
        height: 18px;
        padding: 0 4px;
        border-radius: 9px;
        background: var(--color-white) !important;
        color: var(--color-orange) !important;
        font-size: 11px;
        font-weight: 700;
        line-height: 18px;
    }

    .masthead .mobile-header-bar .mobile-mini-widgets .shopping-cart .counter * {
        color: var(--color-orange) !important;
    }

    /* Accès au compte (ajouté par assets/js/mobile-entete.js). */
    /* Zone cliquable de 44 x 48 px ; la marge négative à droite garde l'encombrement d'avant (40 px). */
    .masthead .mobile-header-bar .mobile-mini-widgets > .mobile-compte {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 48px;
        margin: 0 -4px 0 0 !important;
        color: var(--color-white);
    }

    .mobile-compte svg {
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }


    /* ---- Tiroir : panneau brun qui glisse depuis la gauche ---- */

    .dt-mobile-header {
        --entree-active: #eeee22;
        display: block !important;
        left: 0 !important;
        right: auto !important;
        width: min(88vw, 380px) !important;
        padding: 0 !important;
        background-color: var(--color-brown) !important;
        transform: translate3d(-100%, 0, 0) !important;
        transition: transform 0.35s ease !important;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* The7 enveloppe le contenu du tiroir (marges de 30 px, largeur fixe) : on l'étire et on l'empile en colonne. */
    .dt-mobile-header .mobile-header-scrollbar-wrap {
        display: flex;
        flex-direction: column;
        width: 100% !important;
        max-width: none !important;
        min-height: 100%;
        padding: 0 !important;
        box-sizing: border-box;
    }

    .dt-mobile-header {
        scrollbar-width: none;
    }

    html .dt-mobile-header::-webkit-scrollbar,
    html:not(.touchevents) .dt-mobile-header::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }

    .show-mobile-header .dt-mobile-header {
        transform: translate3d(0, 0, 0) !important;
        box-shadow: 8px 0 30px rgba(0, 0, 0, 0.35);
    }

    /* Bouton Fermer : carré orange, croix blanche, en haut à droite du tiroir. */
    .dt-close-mobile-menu-icon {
        position: fixed !important;
        top: 10px !important;
        right: auto !important;
        left: calc(min(88vw, 380px) - 58px) !important;
        width: 48px;
        height: 48px;
        padding: 0 !important;
        border-radius: 10px;
        background-color: var(--color-orange) !important;
        pointer-events: none;
    }

    .show-mobile-header .dt-close-mobile-menu-icon {
        pointer-events: auto;
    }

    .dt-close-mobile-menu-icon::before,
    .dt-close-mobile-menu-icon::after {
        background-color: var(--color-orange) !important;
    }

    .dt-close-mobile-menu-icon .mobile-menu-close-caption {
        display: none;
    }

    .dt-close-mobile-menu-icon .close-line,
    .dt-close-mobile-menu-icon .close-line::before,
    .dt-close-mobile-menu-icon .close-line::after {
        background-color: var(--color-white) !important;
    }

    .dt-mobile-header .mobile-mini-widgets-in-menu {
        display: none !important;
    }

    .dt-mobile-header .mobile-main-nav,
    .dt-mobile-header #mobile-menu {
        flex: 1 0 auto;
        width: 100% !important;
        margin: 0 !important;
        padding: 80px 0 0 !important;
    }

    /* Entrées : icône à gauche, nom en BISON majuscules, trait fin entre chaque. */
    .dt-mobile-header .mobile-main-nav > li {
        border-top: 1px solid rgba(255, 255, 255, 0.18);
    }

    .dt-mobile-header .mobile-main-nav > li::before {
        display: none !important;
    }

    .dt-mobile-header .mobile-main-nav > li > a {
        flex-flow: row nowrap !important;
        justify-content: flex-start !important;
        align-items: center;
        gap: 14px;
        min-height: 56px;
        padding: 12px 64px 12px 20px !important;
        color: var(--color-white);
    }

    .dt-mobile-header .mobile-main-nav > li > a i {
        flex: 0 0 26px;
        margin: 0;
        font-size: 20px;
        text-align: center;
        color: var(--color-white);
    }

    .dt-mobile-header .mobile-main-nav > li > a .menu-text {
        font-family: "BISON", Arial, sans-serif;
        font-size: 19px;
        line-height: 1.2;
        letter-spacing: 0.7px;
        text-transform: uppercase;
        color: var(--color-white);
    }

    .dt-mobile-header .mobile-main-nav > li.act > a,
    .dt-mobile-header .mobile-main-nav > li.act > a i,
    .dt-mobile-header .mobile-main-nav > li.act > a .menu-text,
    .dt-mobile-header .mobile-main-nav > li:not(.act) > a:hover,
    .dt-mobile-header .mobile-main-nav > li:not(.act) > a:hover i,
    .dt-mobile-header .mobile-main-nav > li:not(.act) > a:hover .menu-text {
        color: var(--entree-active);
    }

    .dt-mobile-header .mobile-main-nav > li.act > a {
        box-shadow: inset 4px 0 0 var(--entree-active);
    }

    /* Signe + des entrées à sous-menu (il devient une croix une fois ouvert). */
    .dt-mobile-header .mobile-main-nav > li > .next-level-button {
        position: absolute !important;
        top: 6px;
        right: 8px;
        width: 44px;
        height: 44px;
        margin: 0 !important;
    }

    .dt-mobile-header .mobile-main-nav .next-level-button svg {
        width: 18px;
        color: var(--color-white);
        fill: var(--color-white);
    }

    .dt-mobile-header .mobile-main-nav .sub-nav {
        margin-left: 0 !important;
        background: rgba(0, 0, 0, 0.18) !important;
    }

    .dt-mobile-header .mobile-main-nav .sub-nav > li > a {
        min-height: 48px;
        padding: 10px 20px 10px 60px !important;
    }

    .dt-mobile-header .mobile-main-nav .sub-nav > li > a .menu-text,
    .dt-mobile-header .mobile-main-nav .sub-nav > li > a i {
        color: var(--color-white);
        font-size: 16px;
    }

    /* Recherche : champ blanc et bouton orange, en tête de liste. */
    .dt-mobile-header .mobile-main-nav > li.mobile-recherche {
        display: block;
        padding: 0 20px 16px;
        border-top: 0;
    }

    .mobile-recherche form {
        display: flex;
        margin: 0;
        border-radius: 10px;
        overflow: hidden;
        background: var(--color-white);
    }

    .mobile-recherche input[type="search"] {
        flex: 1 1 auto;
        min-width: 0;
        height: 48px;
        margin: 0;
        padding: 0 14px;
        border: 0;
        border-radius: 0;
        background: transparent;
        color: var(--color-black);
        font-size: 16px;
        box-shadow: none;
    }

    .mobile-recherche button {
        flex: 0 0 52px;
        width: 52px;
        height: 48px;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: var(--color-orange);
        color: var(--color-white);
        cursor: pointer;
    }

    .mobile-recherche button svg {
        fill: none;
        stroke: currentColor;
        stroke-width: 2.2;
        stroke-linecap: round;
    }

    /* Pied du tiroir : le téléphone, seul, cliquable. */
    .dt-mobile-header .mobile-main-nav > li.mobile-telephone {
        margin-top: auto;
        border-top: 1px solid rgba(255, 255, 255, 0.18);
    }

    .mobile-telephone a {
        display: flex;
        align-items: center;
        gap: 14px;
        width: 100%;
        min-height: 72px;
        padding: 14px 20px;
        color: var(--color-white);
        text-decoration: none;
    }

    .mobile-telephone svg {
        flex: 0 0 24px;
        fill: none;
        stroke: var(--color-orange);
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .mobile-telephone__texte {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .mobile-telephone__label {
        font-size: 13px;
        color: rgba(255, 255, 255, 0.75);
    }

    .mobile-telephone__numero {
        font-family: "BISON", Arial, sans-serif;
        font-size: 24px;
        letter-spacing: 0.7px;
        line-height: 1.1;
    }
}

/* Très petits écrans : panier un peu plus serré pour laisser sa place au logo. */
@media (max-width: 380px) {
    .masthead .mobile-header-bar .mobile-mini-widgets .shopping-cart a {
        gap: 3px;
        padding: 0 2px;
        font-size: 13px;
    }
}
