.navbar-header {
    padding: 15px 10px;
    box-shadow: rgba(0, 0, 0, 0.1) 0 0 10px 0;
}

.header-container {
    max-width: 1324px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.header-right-mobile {
    display: none;
}

.navbar-brand {
    flex-shrink: 0;
    padding: 0;
}

.navbar-header img {
    height: 50px;
    width: auto;
}

.navbar-interactions {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}

.navbar-toggler {
    display: flex !important;
    border: none !important;
    background: transparent;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    box-shadow: none !important;
}

.navbar-toggler:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.burger-icon {
    width: 24px;
    height: 18px;
    display: inline-flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.burger-line {
    width: 100%;
    height: 2px;
    background-color: var(--black-color, #1b1b1b);
    border-radius: 10px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.navbar-toggler[aria-expanded="true"] .burger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.navbar-toggler[aria-expanded="true"] .burger-line:nth-child(2) {
    opacity: 0;
}

.navbar-toggler[aria-expanded="true"] .burger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

@media (min-width: 992px) {
    .navbar-toggler {
        display: none !important;
    }

    .header-right-mobile {
        display: none !important;
    }
}

@media (max-width: 991px) {
    .navbar-header img {
        height: 50px;
    }

    .header-container {
        flex-wrap: wrap;
    }

    .navbar-brand {
        order: 1;
    }

    .header-right-mobile {
        display: flex;
        align-items: center;
        gap: 8px;
        order: 2;
    }

    .navbar-collapse {
        order: 4;
        width: 100%;
        flex-basis: 100%;
        margin-top: 0;
    }

    .header-subcontent {
        gap: 16px;
        width: 100%;
        flex-direction: column;
    }

    .header-subcontent i {
        box-sizing: border-box;
    }

    .navbar-header .texte-header {
        width: 100%;
        text-align: center;
    }

    .navbar-header .texte-header-button {
        white-space: nowrap;
    }

    .navbar {
        padding: 10px 0 0 0 !important;
    }

    .navbar-brand {
        padding: 5px 0 15px 20px;
    }

    .header-right-mobile {
        padding: 10px 20px 20px 0;
        gap: 20px;
    }

    .navbar-collapse.show {
        margin-top: 0;
    }

    .navbar-header {
        padding: 8px 0;
    }

    .header-container {
        padding: 0;
    }

    .navbar-interactions {
        gap: 12px;
        padding: 0;
    }

    .navbar-header .texte-header {
        padding: 20px;
    }

    .texte-header:hover {
        background-color: var(--secondary);
        color: var(--black-color);
    }

    .navbar-collapse.show {
        animation: slideDown 0.3s ease;
    }

    #navbarContent a:first-child{
        box-shadow: inset rgba(0, 0, 0, 0.1) 0 10px 10px -10px;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        padding: 11px 0 22px 5px;
    }

    .header-right-mobile {
        padding: 10px 10px 20px 0;
        gap: 8px;
    }

    .navbar-header img {
        height: 34px;
    }
}

.texte-header {
    border-radius: 0 !important;
}

@media (min-width: 992px) {
    .subcategory {
        display: none;
        position: absolute;
        top: 50px;
        background-color: var(--white-color);
        border-bottom-right-radius: 12px;
        border-bottom-left-radius: 12px;
        cursor: pointer;
        padding-top: 30px;
        z-index: 50;
    }

    .subcategory::after {
        content: "";
        position: absolute;
        top: 30px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--white-color);
        border-bottom-right-radius: 12px;
        border-bottom-left-radius: 12px;
        box-shadow: rgba(0, 0, 0, 0.1) 0 8px 16px -2px;
        pointer-events: none;
    }

    .subcategory a:last-child {
        border-bottom-right-radius: 12px;
        border-bottom-left-radius: 12px;
    }

    .subcategory a:first-child {
        box-shadow: inset rgba(0, 0, 0, 0.1) 0 10px 10px -10px;
    }

    /* Chaque entree du menu (lien + sous-menu) est positionnee : le sous-menu
       se centre sous son lien, quel que soit le nombre d'entrees. */
    .hnav-item {
        position: relative;
    }

    /* top:100% + padding-top : la boite demarre au ras du lien, le survol
       reste continu en descendant vers le sous-menu. */
    .hnav-item > .subcategory {
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        min-width: 220px;
        max-width: min(320px, calc(100vw - 2rem));
        padding-top: 14px;
        white-space: normal;
    }

    .hnav-item > .subcategory::after {
        top: 14px;
    }

    .subcategory a {
        display: block;
        padding: 15px;
        position: relative;
        z-index: 1;
    }

    .hnav-item:hover > .texte-header,
    .hnav-item:focus-within > .texte-header {
        color: var(--primary);
    }

    .hnav-item:hover > .subcategory,
    .hnav-item:focus-within > .subcategory {
        display: flex;
    }

    .subcategory:hover {
        display: flex;
    }

    .subcategory a:hover {
        background-color: var(--secondary);
        transition: background-color .4s;
    }
}

@media (max-width: 991.98px) {
    .subcategory {
        display: none;
    }
}

@media (max-width: 991.98px) {
    .hnav-item {
        width: 100%;
        text-align: center;
    }

    .hnav-item > .texte-header {
        display: block;
    }
}

/* Selecteur de langue a drapeaux (desktop), en tete des actions du header. */
/* Bouton carre, meme hauteur et meme arrondi que les boutons voisins
   (panier, compte) : la rangee les etire tous a la meme hauteur. */
.language-switcher {
    display: flex;
    align-self: stretch;
}

.language-switcher-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    height: 100%;
    min-height: 36px;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    background: var(--white-color, #fff);
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.language-switcher-toggle:hover,
.language-switcher-toggle:focus-visible,
.language-switcher-toggle[aria-expanded="true"] {
    border-color: rgba(0, 0, 0, 0.35);
    background: var(--secondary, #fbe3e6);
}

/* Specificite > .navbar-header img (logo). */
.language-switcher .language-switcher-flag {
    width: 22px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.language-switcher-menu {
    min-width: 0;
    margin-top: 6px !important;
    padding: 6px;
    border: none;
    border-radius: 12px;
    box-shadow: rgba(0, 0, 0, 0.12) 0 6px 20px 0;
    font-size: 14px;
}

.language-switcher-menu .dropdown-item {
    border-radius: 8px;
}

.language-switcher-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.language-switcher-item.is-active {
    font-weight: 600;
    background: transparent;
    color: inherit;
}

/* Bandeau de premiere visite : langue du navigateur differente de la page. */
.language-banner {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    z-index: 1040;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    max-width: calc(100% - 32px);
    padding: 10px 16px;
    border-radius: 12px;
    background: var(--white-color, #fff);
    color: var(--black-color, #1b1b1b);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
    font-size: 14px;
}

.language-banner .language-switcher-flag {
    width: 20px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
}

.language-banner-switch {
    font-weight: 600;
    color: var(--primary, #e94f6b);
}

.language-banner-stay {
    color: inherit;
    opacity: 0.6;
}

/* Actions du header (option A) : langue et compte, puis panier et Reserver.
   Tous les boutons font la meme hauteur ; le panier, en icone claire, reste
   distinct du bouton plein Reserver qu'il jouxte. */
.header-actions {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.header-icon-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    color: var(--black-color);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.header-icon-button i {
    font-size: 20px;
}

.header-account {
    background-color: var(--primary);
}

.header-cart {
    background-color: var(--secondary);
}

.header-icon-button:hover,
.header-icon-button:focus-visible {
    background-color: var(--black-color);
    color: var(--white-color);
}

.header-cart-count {
    position: absolute;
    top: -7px;
    right: -7px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    box-sizing: border-box;
    padding: 0 6px;
    border: 2px solid var(--white-color);
    border-radius: 11px;
    background-color: var(--accent);
    color: var(--white-color);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.header-cart-count[hidden] {
    display: none;
}

.header-book {
    display: inline-flex;
    align-items: center;
    height: 44px;
    max-height: none;
    white-space: nowrap;
}

.header-actions .language-switcher-toggle {
    width: 44px;
    height: 44px;
}

/* Bas du menu deroulant (mobile) : compte et langue. */
.header-menu-footer {
    display: none;
}

@media (min-width: 992px) {
    .header-actions-desktop {
        display: flex;
    }
}

@media (max-width: 991px) {
    .header-actions-desktop {
        display: none;
    }

    .header-book {
        padding: 0 16px;
    }

    .header-menu-footer {
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
        box-sizing: border-box;
        padding: 20px;
        background-color: var(--secondary);
    }

    .header-menu-account {
        display: flex;
        align-items: center;
        gap: 12px;
        height: 48px;
        padding: 0 16px;
        border-radius: 12px;
        background-color: var(--white-color);
        color: var(--black-color);
        font-weight: 600;
        text-decoration: none;
    }

    .header-menu-account i {
        font-size: 20px;
    }

    .header-menu-languages {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 8px;
    }

    .header-menu-language {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        height: 44px;
        border-radius: 12px;
        background-color: var(--white-color);
        color: var(--black-color);
        font-weight: 600;
        text-decoration: none;
    }

    .header-menu-language.is-active {
        background-color: var(--black-color);
        color: var(--white-color);
    }

    /* Specificite > .navbar-header img (logo). */
    .navbar-header .header-menu-language img {
        width: 22px;
        height: 16px;
        border-radius: 2px;
        object-fit: cover;
    }
}

@media (max-width: 400px) {
    .header-right-mobile .header-actions {
        gap: 6px;
    }

    .header-book {
        padding: 0 12px;
        font-size: 15px;
    }
}

/* Entre 992 et 1199 px (tablette paysage, petit portable), le menu complet et
   les quatre actions tiennent a peine sur une ligne : on resserre. */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .header-container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .navbar-header img {
        height: 42px;
    }

    .navbar-header .navbar-interactions {
        gap: 12px !important;
    }

    .navbar-header .header-subcontent {
        gap: 14px !important;
    }

    .navbar-header .texte-header {
        font-size: 15px;
    }

    .header-actions {
        gap: 6px;
    }

    .header-book {
        padding: 0 14px;
    }
}

/* Parite avec le header du site vitrine (WordPress, snippet « Collab header ») :
   meme menu centre, memes chevrons, memes survols, meme menu mobile. */
.hnav-toggle {
    display: none;
}

@media (min-width: 992px) {
    /* Le menu se centre entre le logo et les actions. */
    .navbar-collapse {
        flex-grow: 1;
    }

    .header-subcontent {
        margin-inline: auto;
    }

    .hnav-item:hover > .texte-header,
    .hnav-item:focus-within > .texte-header {
        color: var(--accent);
    }

    .hnav-item.has-sub > .texte-header::after {
        content: "";
        display: inline-block;
        width: 14px;
        height: 14px;
        margin-left: 6px;
        vertical-align: middle;
        background-color: currentColor;
        -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
        transition: transform 0.2s ease;
    }

    .hnav-item.has-sub:hover > .texte-header::after,
    .hnav-item.has-sub:focus-within > .texte-header::after {
        transform: rotate(180deg);
    }

    .language-switcher-menu {
        font-size: 15px;
    }

    .language-switcher-item.is-active {
        font-weight: 400;
    }
}

@media (max-width: 991.98px) {
    /* Barre : 74 px de haut, 20 px de marge laterale, comme le site. */
    .navbar.navbar-header {
        padding: 15px 20px !important;
    }

    .navbar-header .header-container {
        padding: 0;
    }

    .navbar-header .navbar-brand {
        padding: 0;
    }

    .navbar-header .navbar-brand img {
        height: 36px;
    }

    .navbar-header .header-right-mobile,
    .navbar-header .header-right-mobile .header-actions {
        padding: 0;
        gap: 8px;
    }

    .navbar-header .navbar-toggler {
        justify-content: center !important;
        width: 44px;
        height: 44px;
        padding: 10px !important;
    }

    .navbar-header .header-book {
        padding: 0 16px;
        font-size: 16px;
    }

    /* Menu ouvert : toute la hauteur, entrees alignees a gauche, separateurs. */
    .navbar-header .navbar-collapse {
        width: calc(100% + 40px);
        flex-basis: calc(100% + 40px);
        margin: 15px -20px -15px;
    }

    .navbar-header .navbar-collapse.show {
        height: calc(100dvh - 74px);
        overflow-y: auto;
    }

    .navbar-header .navbar-interactions {
        min-height: 100%;
        justify-content: flex-start !important;
        align-items: stretch !important;
        gap: 0 !important;
    }

    .navbar-header .header-subcontent {
        align-items: stretch !important;
        gap: 0 !important;
    }

    .navbar-header .hnav-item {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        border-bottom: 1px solid #ececec;
        text-align: left;
    }

    .navbar-header .hnav-item > .texte-header {
        flex: 1 1 auto;
        width: auto;
        padding: 16px 20px;
        text-align: left;
    }

    .navbar-header .texte-header:hover {
        background-color: transparent;
        color: var(--accent);
    }

    #navbarContent a:first-child {
        box-shadow: none;
    }

    .hnav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        margin-right: 10px;
        padding: 0;
        border: 0;
        background: transparent;
        color: var(--black-color);
        transition: transform 0.2s ease, color 0.2s ease;
    }

    .hnav-item.is-open > .hnav-toggle {
        transform: rotate(180deg);
        color: var(--accent);
    }

    .hnav-item.is-open > .texte-header {
        color: var(--accent);
    }

    .navbar-header .hnav-item.is-open > .subcategory {
        display: flex;
        flex-basis: 100%;
        background-color: #fafafa;
    }

    .navbar-header .subcategory a {
        padding: 12px 20px 12px 36px;
        color: var(--black-color);
        font-size: 17px;
        text-align: left;
        text-decoration: none;
    }

    .navbar-header .header-menu-footer {
        margin-top: auto;
        padding: 20px 20px 32px;
    }

    .navbar-header .header-menu-account,
    .navbar-header .header-menu-language {
        font-weight: 400;
    }
}

@media (max-width: 400px) {
    .navbar-header .header-book {
        padding: 0 14px;
        font-size: 15px;
    }
}

/* Menu des langues (ordinateur) aligne sur le site vitrine : memes
   dimensions de lignes, meme decalage sous le bouton, survol rose. */
@media (min-width: 992px) {
    .header-actions .language-switcher-menu {
        min-width: 160px;
        margin-top: 8px !important;
    }

    .header-actions .language-switcher-menu .language-switcher-item {
        padding: 10px 12px 10px 14px;
        line-height: 19px;
    }

    .header-actions .language-switcher-menu .language-switcher-item:hover,
    .header-actions .language-switcher-menu .language-switcher-item:focus-visible {
        background-color: var(--secondary);
        color: var(--black-color);
    }
}

/* Sous-menus (ordinateur) : la boite blanche part du bas du header, comme
   sur le site vitrine. La marge transparente au-dessus garde le survol
   continu entre le lien et le sous-menu. */
@media (min-width: 992px) {
    .hnav-item > .subcategory {
        padding-top: 25px;
    }

    .hnav-item > .subcategory::after {
        top: 25px;
    }
}

@media (min-width: 1200px) {
    .hnav-item > .subcategory {
        padding-top: 28px;
    }

    .hnav-item > .subcategory::after {
        top: 28px;
    }
}

/* Menu des langues (ordinateur) : il part lui aussi du bas du header, coins
   hauts droits, comme les sous-menus et le site vitrine. */
@media (min-width: 992px) {
    .header-actions .language-switcher-menu {
        margin-top: 15px !important;
        border-radius: 0 0 12px 12px;
    }
}

@media (min-width: 1200px) {
    .header-actions .language-switcher-menu {
        margin-top: 18px !important;
    }
}

/* Ombre du header dessinee par-dessus les menus deroulants (sous-menus,
   langues, menu mobile) : tous passent derriere l'ombre, comme sur le site
   vitrine. La fausse ombre du premier lien des sous-menus est retiree. */
.navbar-header {
    box-shadow: none;
}

.navbar-header::after {
    content: "";
    position: absolute;
    inset: 0;
    box-shadow: rgba(0, 0, 0, 0.1) 0 0 10px 0;
    pointer-events: none;
    z-index: 1100;
}

.subcategory a:first-child {
    box-shadow: none;
}

/* Police Neulis partout dans le header (le menu des langues, la pastille du
   panier et le bas du menu mobile tombaient sur la police systeme). */
.navbar-header .header-cart-count,
.language-switcher-menu,
.language-switcher-menu .language-switcher-item,
.navbar-header .header-menu-account,
.navbar-header .header-menu-language {
    font-family: neulis-sans, sans-serif;
}

/* Sous-menus (ordinateur) : survol en pastille arrondie avec marge, comme le
   menu des langues et le site vitrine. */
@media (min-width: 992px) {
    .hnav-item > .subcategory {
        padding: 31px 6px 6px;
    }

    .subcategory a,
    .subcategory a:last-child {
        padding: 12px 14px;
        line-height: 19px;
        border-radius: 8px;
        white-space: nowrap;
    }
}

@media (min-width: 1200px) {
    .hnav-item > .subcategory {
        padding-top: 34px;
    }
}

/* Drapeaux du bas du menu mobile : meme arrondi et meme liseré que dans
   le menu des langues (ordinateur) et sur le site vitrine. */
.header-menu-language img {
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
    object-fit: cover;
}
