/* =========================================================
   🌿 HEADER PRINCIPAL
   ========================================================= */

/* Le header survole la balise main */
header {
  position: relative;
  z-index: 1;
}

/* =========================================================
   🌿 MENU DESKTOP
   ========================================================= */

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

/* Icônes sociales */
.social-icons {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

/* Liens du menu */
.nav-desktop a {
  text-decoration: none;
  color: black;
  font-weight: 500;
  font-size: 1rem;
}

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

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

/* Élément parent de chaque lien */
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* =========================================================
   🌿 SOUS-MENU (DESKTOP)
   ========================================================= */

/* Sous-menu caché 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;

  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;
}

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

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

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

/* Positionnement des liens */
.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 du sous-menu */
.submenu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  transition: transform 0.3s ease;
}

.has-submenu:hover .submenu-toggle {
  transform: rotate(180deg);
  color: #dbdbdb;
  animation: bounceArrow 0.5s ease;
}

/* État ouvert du toggle */
.nav-item.open .submenu-toggle {
  transform: rotate(180deg);
}

/* Afficher le sous-menu au survol */
.nav-item.has-submenu:hover .submenu {
  display: grid;
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

/* =========================================================
   🌿 MENU BURGER (MOBILE)
   ========================================================= */

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

/* Bouton burger */
.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 du menu mobile */
.mobile-menu.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

/* =========================================================
   🌿 HEADER DU MENU MOBILE
   ========================================================= */

.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);
}

/* Bouton fermer */
.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 DU MENU MOBILE
   ========================================================= */

.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);
}

/* Liens du sous-menu mobile */
.submenu-mobile a {
  font-size: 1.5rem;
  text-align: center;
  margin: 0.5rem 0;
  color: #555;
}

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

/* =========================================================
   🌿 RESPONSIVE (≤ 991px)
   ========================================================= */

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

  .burger-container {
    display: block;
  }

  header {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10000 !important;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  }

  /* Évite que le header ne cache le contenu */
  main {
    margin-top: 100px; /* adapte selon la hauteur de ton header */
  }
}

/* =========================================================
   🌿 BLOQUER LE SCROLL QUAND LE MENU EST OUVERT
   ========================================================= */

body.menu-open,
html.menu-open {
  overflow: hidden !important;
  height: 100% !important;
}
