.custom-navbar {
  background-color: var(--border-color);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-collapse {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-menu {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}

.nav-right {
  margin-left: auto;
}

.nav-link {
  color: var(--text-color);
  text-decoration: none;
  padding: 0.5rem 0.85rem;
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: 0.375rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary-color);
  background-color: #eff6ff;
}

/* Dropdowns Navbar */
.dropdown {
  position: relative;
}

.dropdown-toggle .arrow {
  font-size: 0.7rem;
  transition: var(--transition);
}

.dropdown.active .arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-white);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  list-style: none;
  min-width: 220px;
  padding: 0.5rem 0;
  margin-top: 0.5rem;
  display: none;
  z-index: 1050;
}

.dropdown.active .dropdown-menu {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

.dropdown-item {
  display: block;
  padding: 0.55rem 1.2rem;
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition);
}

.dropdown-item:hover {
  background-color: #f8fafc;
  color: var(--primary-color);
  padding-left: 1.4rem;
}

.dropdown-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 0.35rem 0;
  border: none;
}

.btn-login {
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  display: flex;
  justify-content: end;
}

.btn-user {
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  border-radius: 2rem;
  padding: 0.4rem 1rem;
}

.btn-user:hover {
  background-color: #dcfce7;
  color: #15803d;
}

.nav-toggler {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 5px;
}

.nav-toggler span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--text-color);
  border-radius: 3px;
  transition: var(--transition);
}

/* --- AJOUTER À LA FIN DE navbar.css --- */

@media (max-width: 992px) {
  /* Afficher le bouton burger sur mobile */
  .nav-toggler {
    display: flex;
  }

  /* Masquer le menu par défaut sur mobile et le transformer en liste verticale */
  .nav-collapse {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--bg-white);
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    border-bottom: 1px solid var(--border-color);
  }

  /* Afficher le menu quand la classe .show est ajoutée par le JS */
  .nav-collapse.show {
    display: flex;
  }

  /* Adapter les listes de liens en colonne sur mobile */
  .nav-menu {
    flex-direction: column;
    width: 100%;
    gap: 0.25rem;
  }

  .nav-right {
    margin-left: 0;
    width: 100%;
    border-top: 1px solid var(--border-color);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
  }

  .nav-item {
    width: 100%;
  }    

  .nav-link {
    width: 100%;
    box-sizing: border-box;
  }



  /* Gestion des sous-menus (dropdowns) sur mobile au clic */
  .dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    background-color: transparent;
    padding-left: 1rem;
    margin-top: 0;
  }
  
}