/* barre de nav desktop */
.main-nav {
  display: flex;
  align-items: center;
  background: #fff;
  color: #202a44;
  padding: 0.6em 1rem;
  justify-content: center;
  position: sticky;     /* au lieu de relative */
  top: 0;               /* collé en haut */
  border-bottom: 1px solid #eaeaea;
  box-shadow: 0 3px 12px #0001;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-weight: 600;
  z-index: 1000;        /* au-dessus du contenu */
}

/* conteneur items nav */
.nav-center {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.nav-center ul {
  display: flex;
  list-style: none;
  gap: 2.5em;
  margin: 0;
  padding: 0;
}

.nav-center li a {
  color: #202a44;
  background: none;
  font-weight: 700;
  font-size: 1.4em;
  text-decoration: none;
  padding: 0.2em 0.4em;
  border-radius: 6px;
  letter-spacing: .01em;
  box-shadow: none;
  border: none;
  margin: 0 0.13em;
  transition: background 0.22s, color 0.2s;
}

.nav-center li a.active,
.nav-center li a:hover {
  background: #f3f6fa;
  color: #000;
}

/* LANGUE menu déroulant à droite (desktop) */
.lang-dropdown {
  margin-left: auto;
  margin-right: 0.5em;
  position: relative;
  display: inline-block;
  font-weight: 600;
  user-select: none;
}

.dropbtn {
  background-color: transparent;
  border: none;
  color: #202a44;
  font-size: 1.1em;
  cursor: pointer;
  padding: 0.4em 0.8em;
  border-radius: 4px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5em;
  transition: background 0.2s;
}

.dropbtn:hover,
.dropbtn:focus {
  background: #f3f6fa;
  outline: none;
}

.dropdown-content {
  position: absolute;
  right: 0;
  background: #fff;
  min-width: 130px;
  margin-top: 0.4em;
  border-radius: 6px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.14);
  z-index: 1000;
  list-style: none;
  padding: 0;
  border: 1px solid #eaeaea;
}

.lang-dropdown .dropbtn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.lang-flag {
  width: 18px;
  height: 18px;
  object-fit: cover;
  border-radius: 3px;
  display: inline-block;
  vertical-align: middle;
}

/* dans le menu déroulant */
.dropdown-content a .lang-flag {
  margin-right: 0.35rem;
}

.dropdown-content li a {
  color: #202a44;
  font-size: 0.95em;
  padding: 0.7em 1.2em;
  display: flex;
  align-items: center;
  gap: 0.7em;
  text-decoration: none;
  background: none;
  border: none;
  box-shadow: none;
  transition: background 0.2s;
}

.dropdown-content li a:hover,
.dropdown-content li a:focus {
  background: #ffffff;
  color: #000;
}

/* === HAMBURGER pour mobile === */

.hamburger {
  display: none;
  margin-left: 0;
  cursor: pointer;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 4px;
  border: 1px solid #dde1ea;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: 0;
}

.hamburger span {
  display: block;
  width: 1.5rem;
  height: 2px;
  background: #202a44;
  margin: 3px 0;
  transition: transform 0.2s, opacity 0.2s;
}

/* état ouvert (croix) optionnel */
.hamburger.open span:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
}
.hamburger.open span:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

/* en mobile, on masque le menu et on montre le hamburger */
@media (max-width: 800px) {

  .main-nav {
    padding: 0.4em 0.6em;
    justify-content: flex-start;
    gap: 0.6rem;
  }

  .hamburger {
    display: flex;
    margin-right: 0.4rem;
  }

  .nav-center {
    width: 100%;
  }

  .nav-center ul {
    display: none;
    flex-direction: column;
    gap: 0.6em;
    width: 100%;
    margin-top: 0.5rem;
    padding-left: 0;
  }

  .main-nav.open .nav-center ul {
    display: flex;
  }

  .nav-center li a {
    font-size: 1.05em;
    padding: 0.4em 0.2em;
  }

  .lang-dropdown {
    display: none;
    width: 100%;
    margin: 0.3em 0 0;
  }

  .main-nav.open .lang-dropdown {
    display: block;
  }

  .dropbtn {
    width: 100%;
    justify-content: flex-start;
  }

  .dropdown-content {
    width: 100%;
    min-width: unset;
    left: 0;
    border-radius: 0 0 8px 8px;
  }
}

@media (max-width: 500px) {
  .nav-center li a {
    font-size: 1em;
  }
}
