.search-container {
  position: relative;
  display: flex;
  align-items: center;
}

#searchIcon {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 10px;
  transition: opacity 0.3s ease;
}

#searchBar {
  width: 0;
  padding: 8px;
  border: 2px solid #ccc;
  border-radius: 5px;
  font-size: 16px;
  opacity: 0;
  transition: width 0.3s ease, opacity 0.3s ease;
}

#searchBar.active {
  width: 200px;
  opacity: 1;
}

.search-container.active #searchIcon {
  opacity: 0;
  pointer-events: none;
}


@media (max-width: 480px) {
  #searchBar.active {
    width: 150px;
  }
}


/* ===== STYLE DU BOUTON HAMBURGER ===== */
.hamburger {
  display: none; /* Caché par défaut sur desktop */
  background: none;
  border: none;
  color: #333; /* Couleur de l'icône */
  font-size: 1.8rem;
  cursor: pointer;
  padding: 15px;
  position: relative;
  z-index: 1002; /* Au-dessus du menu */
  transition: transform 0.3s ease;
  
}

.hamburger i {
  pointer-events: none;
}


/* Animation du bouton */
.hamburger:hover {
  transform: scale(1.1);
}

/* ===== MENU PRINCIPAL (NAV) ===== */
#nav {
  transition: all 0.4s ease; /* Animation douce */
}

/* ===== STYLES MOBILE ===== */
@media (max-width: 768px) {
  /* Afficher le bouton */
  .hamburger {
    display: block;
  }

  /* Positionnement du menu */
  #nav {
    position: fixed;
    top: 0;
    left: -100%; /* Caché hors écran */
    width: 80%;
    height: 100vh;
    background: #f8f8f8;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    overflow-y: auto; /* Scroll si menu trop long */
    padding-top: 70px; /* Espace pour le header */
  }

  /* Quand le menu est actif */
  #nav.active {
    left: 0;
  }

  /* Réorganisation des liens */
  .nav-left, .nav-right {
    flex-direction: column;
    width: 100%;
    padding: 0 20px;
  }

  .nav-left li, .nav-right a {
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
  }

  /* Style des dropdowns mobile */
  .has-dropdown .dropdown {
    display: none;
    position: static;
    box-shadow: none;
    border: none;
    padding-left: 15px;
  }

  .has-dropdown.active .dropdown {
    display: block;
  }
}

/* ===== OVERLAY POUR FOND SOMBRE ===== */
.menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}

@media (max-width: 768px) {
  .menu-overlay.active {
    display: block;
  }
}