/* Dans ton style.css */

#header {
    position: relative;
    width: 100%;
    background-color: white;
    z-index: 1000;
}

#header .container {
    position: relative;
    width: 100%;
    background-color: white;
    padding-right: 25px;
}

/* Nouvelle classe qui sera ajoutée par le JS */
.menu-fixe {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    /* Jolie ombre quand c'est collé */
    animation: slideDown 0s ease-out;
    z-index: 9999;
}


/* Animation pour l'arrivée du menu */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(0);
    }
}

/* CORRECTION BARRE WORDPRESS (Admin Bar) */
/* Si l'admin bar est là, on décale le menu de 32px vers le bas */
body.admin-bar .menu-fixe {
    top: 32px !important;
}

/* Ajustement mobile pour la barre admin (elle est plus grande parfois sur mobile) */
@media screen and (max-width: 782px) {
    body.admin-bar .menu-fixe {
        top: 46px !important;
    }
}

#header .entete-don {
    background-color: var(--dark-blue-color);
    text-align: end;
    padding: 20px 40px;
}

.btn-entete-don {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    background-color: var(--red-site);
    border: 2px solid var(--red-site);
    border-radius: 10px;
    font-size: 18px;
    max-width: max-content;
}

.btn-entete-don:hover {
    background-color: white;
    color: var(--red-site);
    transform: translateY(-2px);
}


@media (max-width: 1024px) {
    .btn-entete-don {
        font-size: 16px;
        padding: 6px 12px;
    }
}

#header .container {
    display: flex;
    justify-content: space-between;
    background-color: white;
    width: 100%;
    z-index: 1000;
    position: relative;
}

#header .container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    z-index: -1;
}

.main-navigation {
    display: flex;
    padding-right: 20px;
}

#primary-menu {
    display: flex;
}

#primary-menu {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    /* Bonnes pratiques : reset margin */
    padding: 0;
    /* Bonnes pratiques : reset padding */
}

#primary-menu li {
    display: flex;
    position: relative;
}

#primary-menu li::before {
    content: "";
    position: absolute;
    width: 0%;
    height: 5px;
    bottom: 0;
    left: 0;
    background-color: var(--yellow-site);
    transition: all 0.3s ease-in-out;
}

#primary-menu li:hover::before {
    width: 100%;
}

#primary-menu li.current_page_item:before {
    width: 100%;
}

#primary-menu li a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    display: flex;
    align-items: center;
    font-size: 1.25rem;
}

.custom-logo-link {
    display: flex;
    padding: 20px;
}

.custom-logo-link img {
    width: 225px;
    height: auto;
}


@media screen and (max-width: 768px) {

    .main-navigation {
        display: none;
    }

    .custom-logo-link img {
        width: 125px;
    }
}



#primary-menu>li .sub-menu {
    position: fixed;
    left: 0;
    width: 100vw;
    background-color: white;
    padding: 0 25px;
    min-height: 100px;
    display: flex;
    justify-content: center;
    gap: 20px;
    visibility: hidden;
    opacity: 0;
    z-index: -2;
    box-shadow: 0 5px 5px 0 rgba(54, 44, 44, 0.1);
    transform: translateY(-100%);
    transition: all 0.3s ease-in-out;
}

#primary-menu>li .sub-menu.open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}


/* --- BOUTON BURGER --- */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    margin: auto 0;
}

.menu-toggle .bar {
    width: 40px;
    height: 6px;
    border-radius: 999px;
    background-color: var(--dark-blue-color);
    transition: 0.3s;
}

@media screen and (max-width: 1024px) {
    .menu-toggle {
        display: flex;
    }

    .main-navigation {
        display: none;
    }
}

/* --- OVERLAY BURGER DESIGN --- */
.burger-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    z-index: 800;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;

    display: flex;
    flex-direction: column;
    padding: 160px 25px 50px 25px;

    transition: transform 0.4s ease-in-out, opacity 0.3s ease;
    transform: translateX(100%);
}

.burger-menu-overlay.is-open {
    transform: translateX(0);
    visibility: visible;
}

/* --- STYLE DES LIENS DU BURGER --- */
#burger-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

#burger-menu>li {
    border-bottom: 1px solid #eee;
    overflow: hidden;
}

#burger-menu>li>a {
    display: block;
    padding: 15px 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-blue-color);
    text-decoration: none;
    transition: color 0.3s;
}

/* Flèche pour les sous-menus */
#burger-menu .menu-item-has-children>a::after {
    content: '\f107';
    /* Icône FontAwesome */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    float: right;
    transition: transform 0.3s;
}

#burger-menu .menu-item-has-children.active>a::after {
    transform: rotate(180deg);
}

/* --- SOUS-MENUS EN ACCORDÉON --- */
#burger-menu .sub-menu {
    display: none;
    /* Géré par le JS pour l'animation */
    list-style: none;
    padding: 0 0 15px 20px;
}

#burger-menu .sub-menu li a {
    display: block;
    padding: 10px 0;
    font-size: 1.1rem;
    color: #666;
    text-decoration: none;
    position: relative;
}

#burger-menu .sub-menu li a::before {
    content: "";
    position: absolute;
    left: -15px;
    top: 50%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    transform: translateY(-50%);
    background-color: var(--yellow-site);
}

/* Animation des barres du burger en mode blanc (si besoin sur fond bleu) */
.menu-toggle.active .bar:nth-of-type(1) {
    transform: rotate(45deg) translate(8px, 7px);
}

.menu-toggle.active .bar:nth-of-type(2) {
    opacity: 0;
}

.menu-toggle.active .bar:nth-of-type(3) {
    transform: rotate(-45deg) translate(10px, -9px);
}


#burger-menu .menu-item-has-children>a {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    position: relative;
    cursor: pointer;
}

/* La flèche qui tourne */
#burger-menu .menu-item-has-children>a::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    transition: transform 0.3s ease;
}

#burger-menu .menu-item-has-children.active>a::after {
    transform: rotate(180deg);
}

/* On cache le sous-menu par défaut */
#burger-menu .sub-menu {
    display: none;
    overflow: hidden;
}

/* --- SCROLL INTERNE SOUS-MENU BURGER --- */

/* On limite la hauteur pour ne pas pousser tout le menu hors écran */
#burger-menu .sub-menu {
    max-height: 300px;
    /* Ajuste selon tes besoins */
    overflow-y: auto;
    /* Active le scroll vertical */
    padding-right: 10px;
    /* Évite que la barre de scroll colle au texte */

    /* Pour un scroll plus joli sur mobile */
    -webkit-overflow-scrolling: touch;
}

/* Personnalisation de la barre de scroll (optionnel, pour rester discret) */
#burger-menu .sub-menu::-webkit-scrollbar {
    width: 4px;
}

#burger-menu .sub-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#burger-menu .sub-menu::-webkit-scrollbar-thumb {
    background: var(--yellow-site);
    /* Rappel de ta charte */
    border-radius: 10px;
}









#primary-menu #menu-item-200 .sub-menu li:nth-child(1)::before,
.burger-navigation .menu-item-200 .sub-menu li:nth-child(1) a::before  {
    background-color: #00008b !important;
}

#primary-menu #menu-item-200 .sub-menu li:nth-child(2)::before,
.burger-navigation .menu-item-200 .sub-menu li:nth-child(2) a::before  {
    background-color: #ffa500 !important;
}

#primary-menu #menu-item-200 .sub-menu li:nth-child(3)::before,
.burger-navigation .menu-item-200 .sub-menu li:nth-child(3) a::before  {
    background-color: #ff00ff !important;
}

#primary-menu #menu-item-200 .sub-menu li:nth-child(4)::before,
.burger-navigation .menu-item-200 .sub-menu li:nth-child(4) a::before  {
    background-color: #ff0000 !important;
}

#primary-menu #menu-item-200 .sub-menu li:nth-child(5)::before,
.burger-navigation .menu-item-200 .sub-menu li:nth-child(5) a::before  {
    background-color: #32cd32 !important;
}

#primary-menu #menu-item-200 .sub-menu li:nth-child(6)::before,
.burger-navigation .menu-item-200 .sub-menu li:nth-child(6) a::before  {
    background-color: #9400d3 !important;
}

#primary-menu #menu-item-200 .sub-menu li:nth-child(7)::before,
.burger-navigation .menu-item-200 .sub-menu li:nth-child(7) a::before  {
    background-color: #000000 !important;
}

#primary-menu #menu-item-200 .sub-menu li:nth-child(8)::before,
.burger-navigation .menu-item-200 .sub-menu li:nth-child(8) a::before  {
    background-color: #ffff00 !important;
}
