/* ============================================================
   COMPONENT — Header
   - .siteHeader : conteneur global (navbar blanche + barre menu grise)
   - .navbar     : bande blanche supérieure avec logo Capgemini
   - .navMenu    : bande grise inférieure avec liens + sélecteur pays/langue
   Tokens Figma : NAV BAR (361:1565) + MENU (296:1149).
   ============================================================ */

/* ----- Conteneur ---------------------------------------------------------- */
.siteHeader {
    position: relative;
    z-index: 50;
    width: 100%;
}

/* ----- Navbar (bande blanche, logo + CTA Souscrire) ---------------------- */
.navbar {
    background: var(--color-primary-white);
    padding: var(--space-4) var(--content-gutter);
    min-height: var(--navbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-5);
}

.navbar__logo {
    display: inline-block;
}

.navbar__logo img {
    display: block;
    width: 100px;
    height: 22px;
    color: var(--color-primary-blue);
}

/* CTA Souscrire — extrême droite de la navbar (Figma 296:1133) */
.navbar__cta {
    display: inline-flex;
    align-items: center;
}

/* ----- Menu (bande grise, liens + sélecteur pays) ------------------------ */
.navMenu {
    background: var(--color-primary-light-grey);
    box-shadow: 0 10px 5px rgba(0, 0, 0, 0.10);
    padding: var(--space-2) var(--content-gutter);
    display: flex;
    align-items: center;
    gap: var(--space-5);
    min-height: var(--menu-height);
    position: relative;
    z-index: 50;
}

.navMenu__list {
    display: flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-5);
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Le sélecteur pays est traité comme un item normal : même spacing que les
   autres via justify-content: space-between du parent .navMenu__list. */
.navMenu__item--country {
    position: relative;
}


.navMenu__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.navMenu__link {
    display: inline-flex;
    align-items: center;
    padding: 5px 0;
    font-family: var(--font-family-base);
    font-size: var(--font-size-nav);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-tight);
    color: var(--color-primary-dark-blue);
    text-decoration: none;
    transition: color 0.15s ease;
    white-space: nowrap;
}

.navMenu__link:hover,
.navMenu__link:focus-visible {
    color: var(--color-secondary-teal);
    outline: none;
}

.navMenu__item.is-active .navMenu__link {
    color: var(--color-secondary-teal);
    font-weight: var(--font-weight-bold);
}

/* ----- Sélecteur pays + langue (côté droit du menu) --------------------- */
.countrySwitch {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) 0;
    position: relative;
    font-family: var(--font-family-base);
    font-size: var(--font-size-nav);
    color: var(--color-primary-dark-blue);
}

.countrySwitch__btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

.countrySwitch__name {
    white-space: nowrap;
}

.countrySwitch__divider {
    display: inline-block;
    width: 1px;
    height: 12px;
    background: var(--color-primary-dark-blue);
    margin: 0 var(--space-1);
    flex-shrink: 0;
}

.countrySwitch__lang {
    text-transform: uppercase;
    white-space: nowrap;
}

.countrySwitch__chevron {
    width: 8px;
    height: 5px;
    margin-left: var(--space-1);
    transition: transform 0.2s ease;
}

.countrySwitch.is-open .countrySwitch__chevron {
    transform: rotate(180deg);
}

.countrySwitch__list {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 140px;
    background: var(--color-primary-white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    padding: var(--space-2) 0;
    margin: 0;
    list-style: none;
    display: none;
    z-index: 100;
}

.countrySwitch.is-open .countrySwitch__list {
    display: block;
}

.countrySwitch__option {
    display: block;
    padding: var(--space-2) var(--space-4);
    color: var(--color-primary-dark-blue);
    text-decoration: none;
    font-size: var(--font-size-nav);
    transition: background-color 0.15s ease;
}

.countrySwitch__option:hover,
.countrySwitch__option:focus-visible {
    background: var(--color-primary-light-grey);
    outline: none;
}

.countrySwitch__option.is-current {
    font-weight: var(--font-weight-bold);
    color: var(--color-secondary-teal);
}

/* ----- Bouton burger mobile (caché en desktop) -------------------------- */
.navMenu__burger {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: 0;
    padding: var(--space-2);
    cursor: pointer;
    margin-left: auto;
}

.navMenu__burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-primary-dark-blue);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ----- Responsive : burger + menu déroulant --------------------------- */
@media (max-width: 1024px) {
    .navbar,
    .navMenu {
        padding-left: var(--space-5);
        padding-right: var(--space-5);
    }

    .navMenu {
        flex-wrap: wrap;
        gap: var(--space-2);
    }

    .navMenu__burger {
        display: inline-flex;
    }

    .navMenu__list {
        display: none;
        flex-direction: column;
        flex-basis: 100%;
        align-items: stretch;
        gap: 0;
        margin-top: var(--space-2);
        padding-top: var(--space-2);
        border-top: 1px solid var(--color-border);
    }

    .navMenu.is-open .navMenu__list {
        display: flex;
    }

    .navMenu__item {
        justify-content: flex-start;
    }

    .navMenu__link {
        padding: var(--space-3) 0;
        width: 100%;
    }
}
