/* --- BARRE DE NAVIGATION --- */
nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  color: #222;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  height: 100px; /* hauteur normale */
  transition: height 0.3s ease, padding 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
nav.shrink {
  height: 60px;
  transition: height 0.3s ease;
}

/* --- ZONE GAUCHE : LOGOS --- */
.nav-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}


/* --- MENU PRINCIPAL --- */
.nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 1rem;
}

/* Liens de menu */
.nav-menu li a {
  color: #222;
  text-decoration: none;
  padding: 0.5rem;
  display: block;
  transition: background 0.3s;
  border-radius: 4px;
}

.nav-menu li a:hover {
  background: #eee;
}

/* --- SOUS-MENUS --- */
.nav-menu li {
  position: relative;
}

.nav-menu li ul {
  margin: 0;
  padding: 0;
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  list-style: none;
  min-width: 160px;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
}

.nav-menu li:hover ul {
  display: block;
}

.nav-menu li ul li a {
  padding: 0.5rem 1rem;
}

/* --- BOUTON HAMBURGER --- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  cursor: pointer;
  gap: 5px;
}

.hamburger span {
  display: block;
  height: 3px;
  width: 25px;
  background: #222;
  border-radius: 2px;
  transition: all 0.3s ease;
}
.search-form {
  position: relative;
  display: flex;
  align-items: center;
}

#search-input {
  width: 0;
  opacity: 0;
  transition: width 0.3s ease, opacity 0.3s ease;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 6px 8px;
  margin-left: 8px;
}

#search-input.visible {
  width: 160px;
  opacity: 1;
}

.search-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
}
/* --- RESPONSIVE --- */
@media (max-width: 1100px) {
    .nav {
        height: 140px;
    }

  .nav-menu {
    position: absolute;
    top: 70px;
    right: 0;
    background: #fff;
    flex-direction: column;
    align-items: flex-start;
    width: 220px;
    max-height: 0;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: max-height 0.4s ease-out;
  }

  .nav-menu.show {
    max-height: 500px;
    transition: max-height 0.4s ease-in;
  }

  .nav-menu li {
    width: 100%;
  }

  .nav-menu li ul {
    position: static;
    background: #f9f9f9;
    width: 100%;
    border: none;
    box-shadow: none;
  }

  .hamburger {
    display: flex;
  }
    
.search-box.show {
    width: 120px;
    right: 35px;
}
}
    
/* --- ZONE DE RECHERCHE --- */

.nav-right {
  display: flex;
  align-items: center;
  position: relative;
}

/* Champ masqué par défaut */
.search-box {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  border: 1px solid #ccc;
  border-radius: 20px;
  padding: 0.3rem 0.8rem;
  outline: none;
  transition: width 0.3s ease, opacity 0.3s ease;
}

/* Champ visible */
.search-box.show {
  width: 90px;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Bouton loupe */
.search-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: #222;
  transition: color 0.3s;
}

.search-btn:hover {
  color: #555;
}
@media (max-width: 600px) {
    .nav {
          height: 80px;
    }
    .search-box.show {
        width: 100px;
    }
}
/* --- MODE RÉTRÉCI AU SCROLL --- */
nav.shrink {
  padding: 0 1rem;
  height: 60px; /* hauteur réduite */
  transition: height 0.3s ease, padding 0.3s ease;
}

/* Logos — taille normale → réduite */
nav .nav-left img {
  transition: width 0.3s ease;
}

/* Desktop */
@media (min-width: 1101px) {
  nav .nav-left img { height: 80px; }
  nav.shrink .nav-left img { height: 50px; }
}

/* Tablette */
@media (max-width: 1100px) and (min-width: 601px) {
  nav .nav-left img { height: 80px; }
  nav.shrink .nav-left img { height: 50px; }
}

/* Mobile */
@media (max-width: 600px) {
  nav .nav-left img { height: 80px; }
  nav.shrink .nav-left img { height: 50px; }
}
nav .nav-left img {
  height: 80px;
  width: auto;
  max-width: none;
  transition: height 0.3s ease;
}
