/* ============================================================
   nav.css — Navigation Component
   Floating pill with full dropdown menus + mobile accordion drawer.
   ============================================================ */

/* ---- Outer wrapper ---- */
.nav {
  position: fixed;
  top: 1rem;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-inline: var(--spacing-sm);
  pointer-events: none;
}

/* ---- Pill ---- */
.nav__pill {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1280px;
  height: 56px;
  overflow: visible;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 100px;
  padding: 0 0.5rem 0 1rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
  transition: background var(--transition-slow), box-shadow var(--transition-slow);
  gap: var(--spacing-sm);
}

.nav--scrolled .nav__pill {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.10);
}

/* ---- Logo ---- */
.nav__logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  line-height: 0;
}

.nav__logo-img {
  display: block;
  height: 88px;
  width: auto;
  object-fit: contain;
}

/* ---- Center links list ---- */
.nav__links {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
  gap: 0.125rem;
  flex: 1;
  justify-content: center;
}

@media (min-width: 1024px) {
  .nav__links {
    display: flex;
  }
}

/* ---- Nav item wrapper (needed for dropdown positioning) ---- */
.nav__item {
  position: relative;
}

/* ---- Top-level link / button ---- */
.nav__link,
.nav__link--parent {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  color: var(--color-text-muted);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 100px;
  white-space: nowrap;
  transition: color var(--transition-fast), background var(--transition-fast);
  line-height: 1;
}

.nav__link:hover,
.nav__link--parent:hover {
  color: var(--color-text-primary);
  background: rgba(0, 0, 0, 0.04);
}

/* Chevron character */
.nav__chevron {
  font-size: 0.75rem;
  line-height: 1;
  display: inline-block;
  transition: transform 200ms ease;
}

.nav__link--parent[aria-expanded="true"] .nav__chevron {
  transform: rotate(180deg);
}

/* ---- Dropdown panel ---- */
.nav__dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 50%;
  transform: translateX(-50%);
  min-width: 200px;
  background: var(--color-white);
  border: 1px solid var(--color-light-gray);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.09);
  padding: 0.5rem;
  list-style: none;
  margin: 0;
  z-index: 200;
  pointer-events: auto;
}

/* Invisible bridge fills the gap between the pill and the dropdown
   so mouseleave never fires while the cursor travels downward. */
.nav__dropdown::before {
  content: '';
  position: absolute;
  top: -0.75rem;
  left: 0;
  right: 0;
  height: 0.75rem;
  background: transparent;
}

/* Wide variant for Industries */
.nav__dropdown--wide {
  min-width: 280px;
  left: 0;
  transform: none;
}

.nav__dropdown.is-open,
.nav__item--open > .nav__dropdown {
  display: block;
}

.nav__dropdown-link {
  display: block;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--color-text-primary);
  text-decoration: none;
  border-radius: 8px;
  white-space: nowrap;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.nav__dropdown-link:hover {
  background: var(--color-surface-alt);
  color: var(--color-text-primary);
}

/* ---- Right side (CTA + hamburger) ---- */
.nav__right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ---- Hamburger button ---- */
.nav__menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-light-gray);
  cursor: pointer;
  transition: background var(--transition-fast);
  flex-shrink: 0;
}

.nav__menu-btn:hover {
  background: var(--color-light-gray);
}

.nav__menu-btn svg {
  width: 1rem;
  height: 1rem;
  stroke: var(--color-text-primary);
}

@media (min-width: 1024px) {
  .nav__menu-btn {
    display: none;
  }
}

/* ============================================================
   MOBILE DRAWER
   Full-height slide-in from right with accordion groups.
   ============================================================ */

.nav__drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--color-white);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  gap: 0;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.nav__drawer.is-open,
.nav__drawer.nav__drawer--open {
  transform: translateX(0);
}

/* Close button */
.nav__drawer-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-light-gray);
  cursor: pointer;
  align-self: flex-end;
  margin-bottom: 1.5rem;
  flex-shrink: 0;
}

.nav__drawer-close svg {
  width: 1rem;
  height: 1rem;
  stroke: var(--color-text-primary);
}

/* Accordion group */
.nav__drawer-group {
  border-bottom: 1px solid var(--color-light-gray);
}

/* Parent button */
.nav__drawer-parent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-primary);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}

.nav__drawer-parent::after {
  content: '+';
  font-size: 1.25rem;
  font-weight: 300;
  color: var(--color-text-muted);
  transition: transform 200ms ease;
}

.nav__drawer-parent[aria-expanded="true"]::after {
  content: '\2212'; /* minus */
}

/* Children list */
.nav__drawer-children {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0 0 0.75rem 0;
  flex-direction: column;
  gap: 0;
}

.nav__drawer-children.is-open {
  display: flex;
}

.nav__drawer-link {
  display: block;
  padding: 0.625rem 0.5rem;
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--color-text-muted);
  text-decoration: none;
  border-radius: 6px;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.nav__drawer-link:hover {
  color: var(--color-text-primary);
  background: var(--color-surface-alt);
}
