/* En-tête commun : mêmes dimensions et centrage stable sur toutes les pages. */
.topbar nav > a,
.nav-dropdown-toggle {
  white-space: nowrap;
}

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

.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}

.nav-dropdown-toggle span {
  color: #329d7d;
  font-size: 12px;
  transition: transform .18s ease;
}

.nav-dropdown.open .nav-dropdown-toggle span {
  transform: rotate(180deg);
}

.nav-dropdown.active > .nav-dropdown-toggle,
.topbar nav > a.active {
  color: #16765f;
  font-weight: 800;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 13px);
  left: 50%;
  z-index: 30;
  display: grid;
  min-width: 245px;
  padding: 10px;
  border: 1px solid rgba(35, 139, 113, .2);
  border-radius: 17px;
  background: #d7f2ea;
  box-shadow: 0 18px 42px rgba(8, 62, 75, .18);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -7px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}

.nav-dropdown.open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.topbar .nav-dropdown-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: 11px;
  color: #123f37;
  font-size: 13px;
  font-weight: 700;
}

.topbar .nav-dropdown-menu a:hover,
.topbar .nav-dropdown-menu a:focus-visible,
.topbar .nav-dropdown-menu a.active {
  background: rgba(255, 255, 255, .8);
  color: #106c57;
  outline: none;
}

@media (min-width: 951px) {
  .topbar {
    display: grid;
    grid-template-columns: minmax(116px, 1fr) auto minmax(245px, 1fr);
    gap: 22px;
  }

  .topbar .brand {
    justify-self: start;
  }

  .topbar nav {
    justify-self: center;
    margin-left: 0;
  }

  .topbar .actions {
    justify-self: end;
  }
}

@media (max-width: 950px) {
  .topbar nav.open {
    align-items: stretch;
    max-height: calc(100vh - 82px);
    overflow-y: auto;
  }

  .topbar nav > a,
  .nav-dropdown {
    width: min(100%, 430px);
  }

  .nav-dropdown {
    display: grid;
  }

  .nav-dropdown-toggle {
    justify-content: space-between;
    width: 100%;
    padding: 8px 0;
    text-align: left;
  }

  .nav-dropdown-menu {
    position: static;
    min-width: 0;
    max-height: 0;
    padding: 0 8px;
    border-width: 0;
    border-radius: 13px;
    box-shadow: none;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    transform: none;
    transition: max-height .2s ease, opacity .16s ease, padding .2s ease;
  }

  .nav-dropdown.open .nav-dropdown-menu {
    max-height: 180px;
    margin-top: 5px;
    padding: 7px 8px;
    border-width: 1px;
    opacity: 1;
    visibility: visible;
    transform: none;
  }
}

@media (max-width: 580px) {
  .topbar nav.open {
    top: 70px;
    max-height: calc(100vh - 70px);
  }
}

@media (min-width: 951px) and (max-width: 1280px) {
  .topbar nav {
    gap: 13px;
  }

  .topbar nav a {
    font-size: 12px;
  }
}
