/* ===========================
   Variables globales
=========================== */
:root {
    --primary-color: #422565;
    --secondary-color: #7f2a8c;
    --highlight-color: #1ae085;
    --hover-color: #ef6fa5;
    --white-color: #FFFFFF;
}

/* ===========================
   Header combiné
=========================== */

/* Header global */
header {
    margin: 0;
    padding: 0;
}
header {
    position: fixed; /* Fixé tout le header */
    top: 0;
    width: 100%;
    z-index: 1100;
    background-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease; /* Animation fluide */
}

/* Header supérieur */
.header-sup {
    position: fixed; /* Fixe en haut */
    top: 0;
    width: 100%;
    background-color: var(--primary-color);
    color: var(--white-color);
    z-index: 1100;
    padding: 10px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease, padding 0.3s ease, box-shadow 0.3s ease;
}

.header-sup .container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
}

.header-sup-column {
    display: flex;
    align-items: center;
    gap: 5px;
}

.header-sup-column i {
    font-size: 1.2em;
    color: var(--highlight-color);
}

.header-sup-column a {
    color: var(--highlight-color);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.header-sup-column a:hover {
    color: var(--hover-color);
}

/* Header principal */
.main-header {
    position: fixed; /* Fixe sous le header supérieur */
    top: 40px; /* Hauteur exacte du header supérieur */
    width: 100%;
    background-color: var(--primary-color);
    z-index: 1000;
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease, padding 0.3s ease, box-shadow 0.3s ease;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

/* Logo */
.main-header .logo a {
    color: var(--white-color);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-size: 1.2em;
}

.main-header .logo img {
    max-width: 50px;
    transition: transform 0.3s ease;
}

.main-header .logo img:hover {
    transform: scale(1.1);
}

/* Menu de navigation */
.main-nav .nav-list {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.main-nav .nav-list li a {
    color: var(--white-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s ease;
}

.main-nav .nav-list li a i {
    color: var(--highlight-color);
}

.main-nav .nav-list li a:hover {
    color: var(--hover-color);
}

.main-nav .nav-list li a:hover i {
    color: var(--hover-color);
}

/* Bouton Hamburger */
.menu-toggle {
    display: none;
    color: var(--white-color);
    font-size: 1.8em;
    cursor: pointer;
}

/* ===========================
   Responsive pour mobile
=========================== */
@media (max-width: 768px) {
    .header-sup .container {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }

    .main-nav {
        position: absolute;
        top: 100%;
        right: 0;
        background-color: var(--primary-color);
        width: 100%;
        display: none;
        flex-direction: column;
        text-align: center;
    }

    .main-nav.active {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }

    .main-nav .nav-list {
        flex-direction: column;
        gap: 10px;
    }
}

/* ===========================
   Effet au Scroll
=========================== */

/* Header supérieur au scroll */
.header-sup.scrolled {
    background-color: var(--secondary-color); /* Changement de couleur */
    padding: 3px 0; /* Réduction de la hauteur */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Légère ombre */
    transition: background-color 0.3s ease, padding 0.3s ease, box-shadow 0.3s ease;
}

/* Header principal au scroll */
.main-header.scrolled {
    background-color: var(--primary-color); /* Couleur plus sombre */
    padding: 10px 0; /* Réduction de la hauteur */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Ombre plus marquée */
    transition: background-color 0.3s ease, padding 0.3s ease, box-shadow 0.3s ease;
}

/* ===========================
   Responsive Header Mobile Fix
=========================== */

@media (max-width: 768px) {
    /* Header combiné */
    header {
        position: relative; /* Plus de position fixe en mobile */
    }

    /* Header supérieur */
    .header-sup {
        position: relative; /* Statique pour éviter qu'il cache */
        top: 0;
        padding: 5px 0;
        font-size: 0.8em; /* Réduction de la taille */
        text-align: center; /* Centrer le contenu */
    }

    /* Header principal */
    .main-header {
        position: relative; /* Fixe seulement en desktop */
        top: 0; /* Aucun décalage */
        padding: 10px 0; /* Hauteur réduite pour mobile */
        background-color: var(--primary-color);
    }

    /* Menu de navigation */
    .main-nav {
        position: absolute;
        top: 100%; /* Placé en dessous du header principal */
        left: 0;
        background-color: var(--primary-color);
        width: 100%;
        display: none; /* Par défaut, menu caché */
        flex-direction: column;
        text-align: center;
        z-index: 999;
    }

    .main-nav.active {
        display: flex; /* Affiche le menu au clic */
    }

    /* Bouton Hamburger */
    .menu-toggle {
        display: block;
        font-size: 1.8em;
        cursor: pointer;
        color: var(--white-color);
    }
}

@media (max-width: 768px) {
    /* Header global */
    header {
        position: fixed;
        top: 0;
    }

    /* Header supérieur */
    .header-sup {
        flex-direction: column;
        text-align: center;
        padding: 5px 0;
        font-size: 0.8em;
    }

    /* Header principal */
    .main-header {
        top: auto; /* Pas de décalage */
        flex-direction: column; /* En colonne */
        align-items: center;
    }

    /* Navigation */
    .main-nav {
        position: absolute;
        top: 100%; /* Sous le header principal */
        right: 0;
        background-color: var(--primary-color);
        width: 100%;
        display: none; /* Par défaut, menu caché */
        flex-direction: column;
        text-align: center;
        z-index: 999;
    }

    .main-nav.active {
        display: flex;
    }

    .menu-toggle {
        display: block;
        font-size: 1.8em;
        cursor: pointer;
        color: var(--white-color);
    }

    .main-nav .nav-list {
        flex-direction: column;
        gap: 10px;
    }
}

/* Effet au scroll */
header.scrolled {
    background-color: var(--secondary-color); /* Couleur subtile */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); /* Ombre légère */
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

header.scrolled .header-sup {
    font-size: 0.85em; /* Taille du texte à peine réduite */
    transition: padding 0.3s ease, font-size 0.3s ease;
}

header.scrolled .main-header {
    padding: 12px 20px; /* Légère réduction du padding */
    transition: padding 0.3s ease;
}
header, .header-sup, .main-header {
    margin: 0;
}
