/* pour que le header survol la balise main */
header {
    position: relative;
    z-index: 1;
}

/* Centrage du menu */
.nav-desktop {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    position: absolute;
    left: 50%;
    transform: translateX(-35%);
}

.social-icons {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-desktop a {
    text-decoration: none;
    color: black;
    font-weight: 500;
    font-size: 1.1rem;
}

.nav-desktop a.active {
    color: #4FA862;
}

.nav-desktop a:not(.active):hover {
    color: #c3c3c3;
    text-decoration: underline;
}

/* ----desktop--- */
.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Sous-menu caché par défaut */
/* Cache tout par défaut */
.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    width: 550px;

    /* Layout des éléments internes */
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 0.3rem 2rem;
    visibility: hidden;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Quand ouvert */
.nav-item.open .submenu {
    display: grid;
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

/* Liens */
.submenu a {
    color: #333;
    text-decoration: none;
    padding: 0.3rem 0;
    transition: color 0.3s ease;
}

.submenu a:hover {
    color: #4FA862;
}

/* Positionnement */
.submenu a:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
}

.submenu a:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
}

.submenu a:nth-child(3) {
    grid-column: 1;
    grid-row: 3;
}

.submenu a:nth-child(4) {
    grid-column: 2;
    grid-row: 1;
}

.submenu a:nth-child(5) {
    grid-column: 2;
    grid-row: 2;
}

/* Bouton flèche */
.submenu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.nav-item.open .submenu-toggle {
    transform: rotate(180deg);
}

.nav-item.has-submenu:hover .submenu {
    display: grid;
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

/* --- Menu burger --- */
.burger-container {
    display: none;
    position: relative;
    z-index: 200;
}

.burger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    font-size: 2.5rem;
    cursor: pointer;
    background: none;
    border: none;
    transition: transform 0.3s ease;
}

.burger-btn:hover {
    transform: scale(1.2);
}

/* --- Menu mobile fullscreen --- */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(to bottom, rgba(255,255,255,0.98), rgba(250,250,250,0.98));
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
    transition: opacity 0.5s ease, transform 0.5s ease;
    overflow-y: auto;
    padding: 2rem;
}

/* --- Ouverture --- */
.mobile-menu.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

/* --- Header logo + bouton fermer --- */
.mobile-menu-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.mobile-logo {
    height: 107px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.mobile-logo:hover {
    transform: scale(1.05);
}

.close-btn {
    font-size: 2.5rem;
    color: #4FA862; 
    cursor: pointer;
    background: none;
    border: none;
    transition: transform 0.3s ease, color 0.3s ease;
}

.close-btn:hover {
    transform: rotate(90deg);
    color: #FFD700;
}

/* --- Liens principaux --- */
.mobile-menu-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.mobile-menu-links a {
    text-decoration: none;
    color: #333;
    font-weight: 600;
    font-size: 2rem;
    margin: 1rem 0;
    text-align: center;
    transition: color 0.3s ease, transform 0.3s ease;
}

.mobile-menu-links a.active {
    color: #4FA862;
    text-decoration: underline;
}

.mobile-menu-links a:hover {
    color: #FFD700;
    transform: scale(1.05);
}

/* --- Sous-menu mobile --- */
.has-submenu-mobile {
    width: 100%;
    position: relative;
}

.has-submenu-mobile > a {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.arrow {
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
    font-size: 1.2rem;
    color: #333;
}

.has-submenu-mobile .submenu-mobile {
    display: none;
    flex-direction: column;
    margin-top: 0.5rem;
    transition: all 0.3s ease;
}

.has-submenu-mobile.open .submenu-mobile {
    display: flex;
}

.has-submenu-mobile.open .arrow {
    transform: rotate(180deg);
}

/* Sous-menu texte plus petit et centré */
.submenu-mobile a {
    font-size: 1.5rem;
    text-align: center;
    margin: 0.5rem 0;
    color: #555;
}

.submenu-mobile a:hover {
    color: #4FA862;
}

/* --- Media Query --- */
@media (max-width: 991px) {
    .nav-desktop, .social-icons {
        display: none;
    }

    .burger-container {
        display: block;
    }
}

/* --- Bloquer scroll quand menu ouvert --- */
body.menu-open,
html.menu-open {
    overflow: hidden !important;
    height: 100% !important;
}
