/* ═══════════════════════════════════════
   NAVBAR
═══════════════════════════════════════ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  /* Above Leaflet's map controls (z-index 1000), which otherwise paint over
     the bar when the map scrolls up under it. Modals/lightboxes stay at
     2000, above the nav, which is intended. */
  z-index: 1100;
  padding: 18px 0;
  transition: padding var(--transition);
}

/* The blur/background lives on a pseudo-element, not .navbar itself —
   backdrop-filter on the real element would make .navbar a containing
   block for its position:fixed descendants (the mobile menu overlay),
   collapsing that overlay down to the navbar's own height instead of
   the full viewport once scrolled. */
.navbar::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  transition: opacity var(--transition), box-shadow var(--transition);
}

.navbar.scrolled::before {
  background: rgba(11,31,58,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06), 0 4px 32px rgba(0,0,0,0.3);
  opacity: 1;
}

.navbar.scrolled {
  padding: 12px 0;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
}

/* Push the logo to the left so the links and language toggle sit together,
   right-aligned toward the edge of the bar. */
.nav-inner > .nav-logo { margin-right: auto; }

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-logo {
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.logo-mark {
  height: 36px;
  width: auto;
  flex-shrink: 0;
  display: block;
}

/* Top navbar: larger wordmark-only logo (no "Pharma" text) */
.navbar .logo-mark { height: 48px; }

.nav-tagline {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
}

@media (max-width: 900px) {
  .nav-tagline { display: none; }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-links a {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.8);
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}

.nav-links a:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

/* Match the dropdown buttons' flex box model so plain links and group
   buttons share the same pill height and vertical centering. Without this
   the inline anchors sit ~5px shorter and their text baseline drifts,
   making the row look wobbly. */
.nav-links > li > a {
  display: inline-flex;
  align-items: center;
}

/* ── Grouped dropdowns ── */
.nav-group { position: relative; }

.nav-group-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.8);
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}

.nav-group-btn:hover,
.nav-group:hover .nav-group-btn,
.nav-group:focus-within .nav-group-btn {
  background: rgba(255,255,255,0.1);
  color: white;
}

.nav-caret { transition: transform var(--transition); opacity: 0.7; }
.nav-group:hover .nav-caret,
.nav-group:focus-within .nav-caret { transform: rotate(180deg); }

.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 200px;
  margin-top: 10px;
  padding: 8px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(11,31,58,0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition), transform var(--transition);
  z-index: 1001;
}

/* Invisible bridge so the pointer can travel from the button to the dropdown
   across the 10px gap without the hover state dropping. */
.nav-group::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 14px;
}

.nav-group:hover .nav-dropdown,
.nav-group:focus-within .nav-dropdown,
.nav-group.open .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown a {
  display: block;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.8);
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}

.nav-dropdown a:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

/* Language toggle — kept hidden (.hidden) until every section has real
   "id" translations; styled now so it's ready to reveal later. */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 100px;
  padding: 3px;
}

.lang-toggle button {
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
  transition: background var(--transition), color var(--transition);
}

.lang-toggle button.active {
  background: var(--teal2);
  color: var(--navy);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: white;
  border-radius: 2px;
  transition: var(--transition);
}

@media (max-width: 900px) {
  .nav-links {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(8,22,40,0.97);
    backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 999;
  }

  .nav-links.open { display: flex; }

  .nav-links > li > a {
    font-size: 20px;
    padding: 14px 32px;
    color: white;
  }

  .nav-toggle { display: flex; z-index: 1000; }

  /* Groups become inline accordions inside the full-screen menu. */
  .nav-group { width: 100%; }

  .nav-group-btn {
    justify-content: center;
    width: 100%;
    font-size: 20px;
    padding: 14px 32px;
    color: white;
  }

  .nav-group::after { content: none; }

  .nav-dropdown {
    position: static;
    transform: none;
    min-width: 0;
    margin: 0 0 6px;
    padding: 4px 0 10px;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    display: none;
    align-items: center;
    gap: 0;
  }

  .nav-group.open .nav-dropdown { display: flex; }
  .nav-group.open .nav-caret { transform: rotate(180deg); }

  /* Neutralize desktop hover reveal on touch. */
  .nav-group:hover .nav-dropdown,
  .nav-group:focus-within .nav-dropdown { visibility: hidden; opacity: 0; }
  .nav-group.open:hover .nav-dropdown,
  .nav-group.open .nav-dropdown { visibility: visible; opacity: 1; }

  .nav-dropdown a {
    font-size: 17px;
    padding: 10px 32px;
    color: rgba(255,255,255,0.85);
  }
}
