/* ============================================================
   HEADER - VERSION AMÉLIORÉE
   ============================================================ */

header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: #031535;
    padding: 16px clamp(16px, 4vw, 60px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: padding 0.3s ease;
}

/* ========== LOGO ========== */
.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: clamp(20px, 2.2vw, 28px);
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    font-family: "Montserrat", sans-serif;
    line-height: 1;
    flex-shrink: 0;
}

.logo span em {
    font-style: normal;
    color: #0AAA66;
}

.logo-img {
    height: 40px;
    width: auto;
    display: block;
    object-fit: contain;
    transition: height 0.3s ease;
}

/* ========== MENU TOGGLE (Hamburger) ========== */
.menu-toggle {
    display: none;
    background: transparent;
    border: 0;
    padding: 8px;
    cursor: pointer;
    z-index: 30;
    flex-shrink: 0;
    margin-left: auto;
}

.menu-toggle span {
    display: block;
    width: 26px;
    height: 2.5px;
    background: #ffffff;
    margin: 5px 0;
    border-radius: 999px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

/* Animation du hamburger -> croix */
.menu-toggle.active span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}

/* ========== NAVIGATION PRINCIPALE ========== */
.main-nav {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.main-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: clamp(8px, 1.5vw, 30px);
    margin: 0;
    padding: 0;
}

.main-nav ul li a {
    text-decoration: none;
    color: #ffffff;
    font-size: clamp(13px, 1.1vw, 16px);
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 8px 12px;
    border-radius: 999px;
    font-family: "Montserrat", sans-serif;
    white-space: nowrap;
    position: relative;
}

.main-nav ul li a:hover,
.main-nav ul li a.active {
    color: #ffffff;
    background-color: #0AAA66;
    box-shadow: 0 8px 20px rgba(10, 184, 106, 0.3);
}

/* ========== BOUTON JOIN SPÉCIAL ========== */
.main-nav ul li a.NPS {
    /* Style de base : identique aux autres liens */
    text-decoration: none;
    color: #ffffff;
    font-size: clamp(13px, 1.1vw, 16px);
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 8px 12px;
    border: 1px solid #ffffff;
    border-radius: 10px;
    font-family: "Montserrat", sans-serif;
    white-space: nowrap;
    position: relative;
}

/* Image dans le bouton Join - masquée par défaut */
.main-nav ul li a.NPS img {
    height: 20px;
    vertical-align: middle;
    margin-right: 4px;
    transition: all 0.3s ease;
    opacity: 0; /* Masquée par défaut */
    width: 0; /* Pour éviter qu'elle prenne de la place */
    display: none; /* Alternative : complètement invisible */
}

/* Au hover, l'image apparaît */
.main-nav ul li a.NPS:hover img,
.main-nav ul li a.NPS.active img {
    opacity: 1;
    width: auto; /* Rétablit la largeur normale */
    display: inline-block; /* Rétablit l'affichage */
    filter: brightness(0) saturate(100%) invert(15%);
}

/* Hover : style différent des autres liens */
.main-nav ul li a.NPS:hover {
    color: #031535;
    background-color: #f3f8f5;
    box-shadow: 0 8px 25px rgba(243, 248, 245, 0.3);
    transform: translateY(-2px);
}

/* Active : style différent des autres liens */
.main-nav ul li a.NPS.active {
    color: #031535;
    background-color: #f3f8f5;
    box-shadow: 0 8px 25px rgba(243, 248, 245, 0.4);
    border: 2px solid #ffffff;
}

/* ========== SÉLECTEUR DE LANGUE ========== */
.language-dropdown {
    position: relative;
    font-family: "Montserrat", sans-serif;
    flex-shrink: 0;
}

.language-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: clamp(13px, 1.1vw, 15px);
    font-weight: 500;
    font-family: "Montserrat", sans-serif;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 999px;
    transition: all 0.3s ease;
}

.language-dropdown-toggle:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
}

.language-dropdown-toggle .dropdown-label {
    font-weight: 500;
}

.language-dropdown-toggle .dropdown-arrow {
    font-size: 9px;
    transition: transform 0.3s ease;
}

.language-dropdown-toggle[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
}

.language-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 80px;
    background-color: #0a2040;
    border-radius: 12px;
    padding: 8px 0;
    margin: 0;
    list-style: none;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 50;
    overflow: hidden;
}

.language-dropdown-menu.open {
    display: block;
    animation: dropDown 0.25s ease forwards;
}

@keyframes dropDown {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.language-dropdown-menu li a {
    display: block;
    padding: 8px 20px;
    text-decoration: none;
    color: #ffffff;
    font-size: clamp(13px, 1vw, 15px);
    font-weight: 500;
    font-family: "Montserrat", sans-serif;
    transition: all 0.2s ease;
    text-align: center;
}

.language-dropdown-menu li a:hover {
    background-color: rgba(10, 184, 106, 0.15);
    color: #0AAA66;
}

.language-dropdown-menu li a.active {
    background-color: #0AAA66;
    color: #ffffff;
}

.language-dropdown-menu li a img {
    height: 10px;
}

/* ============================================================
   RESPONSIVE - TABLETTE (≤ 900px)
   ============================================================ */
@media (max-width: 900px) {
    header {
        padding: 14px 24px;
        gap: 12px;
    }

    .main-nav ul {
        gap: 12px;
    }

    .main-nav ul li a {
        font-size: 14px;
        padding: 6px 10px;
    }

    .logo-img {
        height: 36px;
    }
}

/* ============================================================
   RESPONSIVE - MOBILE (≤ 640px)
   ============================================================ */
@media (max-width: 640px) {
    header {
        padding: 12px 16px;
        gap: 10px;
        flex-wrap: nowrap;
    }

    /* Logo plus petit sur mobile */
    .logo {
        font-size: 18px;
        gap: 6px;
    }

    .logo-img {
        height: 32px;
    }

    /* ===== MENU HAMBURGER ===== */
    .menu-toggle {
        display: block;
        margin-left: auto;
    }

    /* ===== NAVIGATION ===== */
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #031535;
        padding: 16px 20px 24px;
        border-radius: 0 0 16px 16px;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        flex: unset;
        justify-content: center;
        z-index: 25;
    }

    .main-nav.open {
        display: block;
        animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }

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

    .main-nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        width: 100%;
        padding: 0;
    }

    .main-nav ul li {
        width: 100%;
    }

    .main-nav ul li a {
        display: block;
        padding: 12px 16px;
        font-size: 15px;
        font-weight: 500;
        border-radius: 10px;
        white-space: normal;
        text-align: center;
        transition: all 0.2s ease;
    }

    .main-nav ul li a:hover,
    .main-nav ul li a.active {
        background-color: #0AAA66;
        color: #ffffff;
        padding: 12px 16px;
        border-radius: 10px;
        box-shadow: 0 4px 16px rgba(10, 184, 106, 0.25);
    }

    /* ===== SÉLECTEUR DE LANGUE ===== */
    .language-dropdown {
        margin-left: 8px;
        flex-shrink: 0;
    }

    .language-dropdown-toggle {
        padding: 5px 10px;
        font-size: 13px;
        border-radius: 999px;
        border: 1px solid rgba(255, 255, 255, 0.12);
    }

    .language-dropdown-toggle .dropdown-label {
        font-size: 12px;
    }

    .language-dropdown-menu {
        right: -8px;
        min-width: 70px;
        background-color: #0a2040;
    }

    .language-dropdown-menu li a {
        padding: 8px 16px;
        font-size: 13px;
    }

    /* ===== GESTION DU MENU OUVERT ===== */
    /* Quand le menu est ouvert, on ajuste le header */
    .main-nav.open + .language-dropdown {
        /* On laisse le dropdown visible mais on l'ajuste */
        position: relative;
        z-index: 26;
    }

    /* Si le menu est ouvert, on cache le dropdown pour éviter les conflits */
    /* Alternative : on le déplace en bas du menu */
    .menu-open .language-dropdown {
        display: none;
    }
}

/* ============================================================
   RESPONSIVE - TRÈS PETIT MOBILE (≤ 400px)
   ============================================================ */
@media (max-width: 400px) {
    header {
        padding: 10px 12px;
        gap: 8px;
    }

    .logo {
        font-size: 15px;
        gap: 4px;
    }

    .logo-img {
        height: 26px;
    }

    .menu-toggle span {
        width: 22px;
        height: 2px;
        margin: 4px 0;
    }

    .menu-toggle.active span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .menu-toggle.active span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    .main-nav {
        padding: 12px 14px 18px;
    }

    .main-nav ul li a {
        padding: 10px 14px;
        font-size: 14px;
    }

    .main-nav ul li a:hover,
    .main-nav ul li a.active {
        padding: 10px 14px;
    }

    .language-dropdown-toggle {
        padding: 4px 8px;
        font-size: 11px;
    }

    .language-dropdown-toggle .dropdown-label {
        font-size: 10px;
    }

    .language-dropdown-menu {
        min-width: 60px;
        right: -4px;
    }

    .language-dropdown-menu li a {
        padding: 6px 12px;
        font-size: 11px;
    }
}

/* ============================================================
   PREFERENCES : Réduction de mouvement
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .main-nav.open {
        animation: none;
    }

    .language-dropdown-menu.open {
        animation: none;
    }

    .menu-toggle span,
    .main-nav ul li a,
    .language-dropdown-toggle {
        transition: none;
    }
}

.contact-menu {
    position: relative;
}

.contact-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    background: transparent;
    border: 0;

    color: #ffffff;
    font-family: "Montserrat", sans-serif;
    font-size: clamp(13px, 1.1vw, 16px);
    font-weight: 500;

    padding: 8px 12px;
    border-radius: 999px;

    cursor: pointer;

    transition: all 0.3s ease;
}

.contact-toggle:hover,
.contact-toggle.active,
.contact-toggle[aria-expanded="true"] {
    color: #ffffff;
    background-color: #0AAA66;
    box-shadow: 0 8px 20px rgba(10, 184, 106, 0.3);
}

.contact-arrow {
    font-size: 8px;
    transition: transform 0.3s ease;
}

.contact-toggle[aria-expanded="true"] .contact-arrow {
    transform: rotate(180deg);
}


/* ============================================================
   OPTIONS CONTACT
   ============================================================ */

.contact-submenu {
    display: none;

    position: absolute;
    top: calc(100% + 8px);
    right: 0;

    min-width: 210px;

    padding: 8px;

    background-color: #0a2040;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;

    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);

    z-index: 100;
}

.contact-menu.open .contact-submenu {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.contact-submenu a {
    display: block;

    padding: 10px 14px;

    color: #ffffff;
    text-decoration: none;

    font-family: "Montserrat", sans-serif;
    font-size: 14px;
    font-weight: 500;

    border-radius: 8px;

    transition: all 0.2s ease;
}

.contact-submenu a:hover {
    background-color: #0AAA66;
    color: #ffffff;
}

@media (max-width: 640px) {

    .contact-menu {
        width: 100%;
    }

    .contact-toggle {
        width: 100%;
        justify-content: center;

        padding: 12px 16px;
        border-radius: 10px;
        font-size: 15px;
    }

    .contact-submenu {
        position: static;

        width: 100%;
        min-width: unset;

        margin-top: 4px;
        padding: 4px;

        background-color: #071c39;

        border-radius: 10px;
        box-shadow: none;
    }

    .contact-submenu a {
        text-align: center;
        padding: 10px 14px;
        font-size: 14px;
    }
}