/*
 * En-tête + navigation (desktop : recherche + méga-menu + compte ;
 * mobile : barre d'app + barre d'onglets basse + panneaux plein écran).
 * Les deux rendus (desktop/mobile) partagent le même état d'ouverture
 * (`header-menu` controller, voir assets/controllers/header-menu_controller.js) :
 * chaque panneau porte `data-header-menu-panel="menu|account|search"` et seul
 * celui qui correspond à la largeur d'écran courante devient visible — c'est
 * pour ça que le `[hidden]` natif ne suffit jamais seul ci-dessous, il est
 * toujours combiné à un media query.
 */

.mbb-header2 {
    position: relative;
    font-family: var(--mbb-font-body);
    color: var(--mbb-ink);
}

/* Empêche le scroll de fond pendant qu'un panneau (méga-menu, dropdown
   compte, panneau plein écran mobile) est ouvert. */
html.mbb-scroll-lock {
    overflow: hidden;
}

.mbb-header2__backdrop {
    display: none;
}

@media (min-width: 992px) {
    .mbb-header2__backdrop:not([hidden]) {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(43, 31, 23, .2);
        z-index: 1030;
    }
}

/* ---------- Marque (desktop + mobile) ---------- */

.mbb-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--mbb-ink);
    font-family: var(--mbb-font-display);
    font-weight: 600;
    font-size: 1.375rem;
    white-space: nowrap;
}

.mbb-brand:hover {
    color: var(--mbb-ink);
}

.mbb-brand__logo {
    flex: none;
}

.mbb-brand--sm {
    font-size: 1.0625rem;
}

/* ---------- Barre desktop ---------- */

.mbb-header2__bar {
    display: none;
}

@media (min-width: 992px) {
    .mbb-header2__bar {
        display: block;
        position: relative;
        z-index: 1031;
        background: #FFFFFF;
        border-bottom: 1px solid var(--mbb-border);
    }
}

.mbb-header2__inner {
    height: 64px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
}

.mbb-header2__search-slot {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    justify-content: center;
}

.mbb-header2__search-slot .mbb-search-bar--sm {
    margin-right: 0;
}

.mbb-header2__actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: none;
}

.mbb-icon-btn {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: var(--mbb-radius-pill);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mbb-ink);
    text-decoration: none;
    flex: none;
}

.mbb-icon-btn:hover {
    background: var(--mbb-crumb);
    color: var(--mbb-ink);
}

.mbb-link-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 14px;
    border-radius: var(--mbb-radius-pill);
    color: var(--mbb-ink);
    text-decoration: none;
    font-size: .9375rem;
    font-weight: 500;
}

.mbb-link-btn:hover {
    background: var(--mbb-crumb);
    color: var(--mbb-ink);
}

.mbb-btn-outline-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 16px;
    border-radius: var(--mbb-radius-pill);
    border: 1.5px solid var(--mbb-crust);
    color: var(--mbb-crust);
    text-decoration: none;
    font-size: .9375rem;
    background: transparent;
}

.mbb-btn-outline-pill:hover {
    background: var(--mbb-crust);
    color: #FFFFFF;
}

.mbb-btn-fill-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 16px;
    border-radius: var(--mbb-radius-pill);
    background: var(--mbb-crust);
    color: #FFFFFF;
    text-decoration: none;
    font-size: .9375rem;
}

.mbb-btn-fill-pill:hover {
    background: var(--mbb-crust-dark);
    color: #FFFFFF;
}

.mbb-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--mbb-crust-light);
    color: var(--mbb-crust-dark);
    font-weight: 600;
    font-size: .8125rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    border: 1px solid var(--mbb-border);
}

.mbb-avatar--lg {
    width: 44px;
    height: 44px;
    font-size: 1.0625rem;
}

.mbb-account-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 12px 0 6px;
    border-radius: var(--mbb-radius-pill);
    border: 1px solid var(--mbb-border);
    background: #FFFFFF;
    color: var(--mbb-ink);
    font-size: .9375rem;
    font-weight: 500;
}

.mbb-account-trigger:hover,
.mbb-account-trigger.is-open {
    border-color: var(--mbb-crust);
}

.mbb-account-trigger.is-open {
    background: var(--mbb-crust-light);
}

.mbb-account-trigger__chevron {
    transition: transform .15s var(--mbb-ease, ease);
}

.mbb-account-trigger.is-open .mbb-account-trigger__chevron {
    transform: rotate(180deg);
}

.mbb-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 16px 0 12px;
    border-radius: var(--mbb-radius-pill);
    border: 1px solid var(--mbb-border);
    background: #FFFFFF;
    color: var(--mbb-ink);
    font-size: .9375rem;
    font-weight: 500;
}

.mbb-menu-btn:hover:not(.is-open) {
    border-color: var(--mbb-crust);
    color: var(--mbb-crust);
}

.mbb-menu-btn.is-open {
    border-color: var(--mbb-crust);
    background: var(--mbb-crust-light);
    color: var(--mbb-crust-dark);
}

/* ---------- Picto grigne (bouton Menu) ---------- */

.mbb-grigne {
    display: inline-flex;
    line-height: 1;
}

.mbb-grigne__open {
    display: none;
}

.is-open .mbb-grigne__closed {
    display: none;
}

.is-open .mbb-grigne__open {
    display: inline-flex;
}

/* ---------- Méga-menu (desktop) ---------- */

.mbb-megamenu {
    display: none;
}

@media (min-width: 992px) {
    .mbb-megamenu:not([hidden]) {
        display: block;
        position: absolute;
        left: 0;
        right: 0;
        top: 65px;
        background: #FFFFFF;
        border-bottom: 1px solid var(--mbb-border);
        box-shadow: var(--mbb-shadow-popover);
        z-index: 1032;
        max-height: calc(100vh - 65px);
        overflow-y: auto;
    }
}

.mbb-megamenu__grid {
    max-width: var(--mbb-content-max, 1200px);
    margin: 0 auto;
    padding: 32px 24px;
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr 1.25fr;
    gap: 32px;
}

.mbb-megamenu__grid--3col {
    grid-template-columns: 1.2fr 1fr 1fr;
}

.mbb-megamenu__title,
.mbb-megamenu__subtitle {
    font-size: .75rem;
    font-weight: 500;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--mbb-ink-2);
    margin: 0 0 12px;
}

.mbb-megamenu__title--with-badge {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mbb-megamenu__title--with-badge .mbb-badge {
    text-transform: none;
    letter-spacing: normal;
}

.mbb-megamenu__subtitle {
    margin: 20px 0 10px;
}

.mbb-megamenu__subtitle--flush {
    margin: 0 0 6px;
}

.mbb-megamenu__link,
.mbb-megamenu__geoform .mbb-megamenu__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    color: var(--mbb-ink);
    text-decoration: none;
    font-size: .9375rem;
    border: 0;
    background: none;
    width: 100%;
    text-align: left;
}

.mbb-megamenu__link i {
    color: var(--mbb-crust);
    font-size: 1.0625rem;
    flex: none;
}

.mbb-megamenu__link:hover {
    color: var(--mbb-crust);
}

.mbb-megamenu__link .mbb-badge {
    margin-left: auto;
}

.mbb-megamenu__link--disabled,
.mbb-megamenu__link--disabled:hover {
    color: var(--mbb-ink-2);
    cursor: default;
}

.mbb-megamenu__cities {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mbb-megamenu__city {
    font-size: .8125rem;
    padding: 4px 12px;
    border-radius: var(--mbb-radius-pill);
    border: 1px solid var(--mbb-border);
    color: var(--mbb-ink);
    text-decoration: none;
}

.mbb-megamenu__city:hover {
    background: var(--mbb-crust-light);
    border-color: var(--mbb-crust-light);
    color: var(--mbb-crust-dark);
}

.mbb-megamenu__cta {
    background: var(--mbb-crumb);
    border-radius: var(--mbb-radius-card);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mbb-megamenu__cta-title {
    font-family: var(--mbb-font-display);
    font-weight: 600;
    font-size: 1.375rem;
    line-height: 1.2;
}

.mbb-megamenu__cta-text {
    margin: 0;
    color: var(--mbb-ink-2);
    font-size: .9375rem;
}

.mbb-megamenu__cta .mbb-btn-outline-pill {
    margin-top: auto;
    align-self: flex-start;
}

/* ---------- Dropdown compte (desktop) ---------- */

.mbb-account-panel {
    display: none;
}

@media (min-width: 992px) {
    .mbb-account-panel:not([hidden]) {
        display: block;
        position: absolute;
        right: 24px;
        top: 72px;
        width: 300px;
        background: #FFFFFF;
        border: 1px solid var(--mbb-border);
        border-radius: 14px;
        box-shadow: var(--mbb-shadow-popover);
        padding: 8px;
        z-index: 1032;
    }
}

.mbb-account-panel__head {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 8px 12px 12px;
}

.mbb-account-panel__name {
    font-weight: 600;
}

.mbb-account-panel__email {
    font-size: .8125rem;
    color: var(--mbb-ink-2);
}

.mbb-account-panel__row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    height: 44px;
    border-radius: 8px;
    color: var(--mbb-ink);
    text-decoration: none;
    font-size: .9375rem;
}

.mbb-account-panel__row:hover {
    background: var(--mbb-crust-light);
    color: var(--mbb-ink);
}

.mbb-account-panel__row i {
    color: var(--mbb-ink-2);
    flex: none;
}

.mbb-account-panel__row span {
    flex: 1;
}

.mbb-account-panel__row--highlight {
    background: var(--mbb-crumb);
    margin-bottom: 4px;
}

.mbb-account-panel__row--highlight i {
    color: var(--mbb-crust);
}

.mbb-account-panel__divider {
    height: 1px;
    background: var(--mbb-border);
    margin: 6px 4px;
}

/* ---------- Barre d'app mobile ---------- */

.mbb-mobile-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    background: #FFFFFF;
    border-bottom: 1px solid var(--mbb-border);
    padding: 0 12px 0 16px;
}

@media (min-width: 992px) {
    .mbb-mobile-top {
        display: none;
    }
}

.mbb-mobile-top__account {
    border: 0;
    background: none;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.mbb-mobile-top__login {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 44px;
    padding: 0 6px;
    border: 0;
    background: none;
    color: var(--mbb-ink);
    font-weight: 500;
    font-size: .9375rem;
}

/* ---------- Panneaux plein écran (mobile) ---------- */

.mbb-sheet {
    display: none;
}

@media (max-width: 991.98px) {
    .mbb-sheet:not([hidden]) {
        display: flex;
        flex-direction: column;
        position: fixed;
        inset: 0;
        z-index: 1050;
        background: #FFFFFF;
    }
}

.mbb-sheet__header {
    flex: none;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px 0 16px;
    border-bottom: 1px solid var(--mbb-border);
}

.mbb-sheet__title {
    font-family: var(--mbb-font-display);
    font-weight: 600;
    font-size: 1.25rem;
}

.mbb-sheet__close {
    width: 44px;
    height: 44px;
    border: 0;
    background: none;
    color: var(--mbb-ink);
}

.mbb-sheet__body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px calc(80px + env(safe-area-inset-bottom, 0px));
}

.mbb-sheet__body--search {
    padding-top: 12px;
}

.mbb-sheet__section + .mbb-sheet__section {
    margin-top: 20px;
}

.mbb-sheet__quickgrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.mbb-sheet__quickcard {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    border-radius: var(--mbb-radius-card);
    border: 0;
    background: var(--mbb-crumb);
    color: var(--mbb-ink);
    text-decoration: none;
    font-weight: 500;
    font-size: .9375rem;
    text-align: left;
    width: 100%;
}

.mbb-sheet__quickcard i {
    color: var(--mbb-crust);
    font-size: 1.25rem;
}

.mbb-sheet__quickcard--season {
    background: var(--mbb-badge-season-bg);
    color: var(--mbb-badge-season-fg);
}

.mbb-sheet__quickcard--season i {
    color: var(--mbb-raspberry);
}

.mbb-sheet__row {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 52px;
    padding: 0 2px;
    color: var(--mbb-ink);
    text-decoration: none;
    font-size: 1rem;
    border-bottom: 1px solid var(--mbb-crust-light);
}

.mbb-sheet__row i:first-child {
    color: var(--mbb-crust);
}

.mbb-sheet__row i:last-child {
    color: var(--mbb-ink-2);
    font-size: .875rem;
}

.mbb-sheet__row span {
    flex: 1;
}

.mbb-sheet__row--disabled {
    color: var(--mbb-ink-2);
    cursor: default;
}

.mbb-sheet__highlight-card {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 14px 16px;
    border-radius: var(--mbb-radius-card);
    background: var(--mbb-crumb);
    color: var(--mbb-ink);
    text-decoration: none;
    font-weight: 600;
}

.mbb-sheet__highlight-card i:first-child {
    color: var(--mbb-crust);
    font-size: 1.25rem;
}

.mbb-sheet__highlight-card span {
    flex: 1;
}

.mbb-sheet__highlight-card i:last-child {
    color: var(--mbb-crust);
}

.mbb-sheet__cta {
    margin-top: 20px;
    padding: 20px;
    border-radius: var(--mbb-radius-card);
    background: var(--mbb-crumb);
}

.mbb-sheet__cta .mbb-megamenu__cta-title {
    margin-bottom: 12px;
}

.mbb-account-panel__head--sheet {
    padding: 8px 2px 16px;
}

.mbb-sheet__guest {
    padding: 24px 8px;
    text-align: center;
}

.mbb-sheet__guest-icon {
    width: 64px;
    height: 64px;
    margin: 8px auto 16px;
    border-radius: 50%;
    background: var(--mbb-crumb);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.625rem;
    color: var(--mbb-crust);
}

.mbb-sheet__guest-title {
    font-family: var(--mbb-font-display);
    font-weight: 600;
    font-size: 1.375rem;
    margin-bottom: 6px;
}

.mbb-sheet__guest-text {
    color: var(--mbb-ink-2);
    margin: 0 0 20px;
}

.mbb-sheet__guest .mbb-btn-fill-pill,
.mbb-sheet__guest .mbb-btn-outline-pill {
    width: 100%;
    margin-bottom: 8px;
}

/* ---------- Barre d'onglets basse (mobile) ---------- */

.mbb-tabbar {
    display: none;
}

@media (max-width: 991.98px) {
    .mbb-tabbar {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1040;
        background: #FFFFFF;
        border-top: 1px solid var(--mbb-border);
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    }

    body {
        padding-bottom: 64px;
    }
}

.mbb-tabbar__form {
    display: contents;
}

.mbb-tabbar__item {
    border: 0;
    background: none;
    min-height: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--mbb-ink-2);
    text-decoration: none;
    position: relative;
    font-size: .75rem;
    font-weight: 500;
    line-height: 1;
}

.mbb-tabbar__item i {
    font-size: 1.3125rem;
}

.mbb-tabbar__item.is-active,
.mbb-tabbar__item.is-open {
    color: var(--mbb-crust);
    font-weight: 600;
}

.mbb-tabbar__item.is-active::before,
.mbb-tabbar__item.is-open::before {
    content: '';
    position: absolute;
    top: -6px;
    width: 28px;
    height: 3px;
    border-radius: 3px;
    background: var(--mbb-crust);
}
