.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--nav-height);
  z-index: 1000;
  isolation: isolate;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.brand-icon {
  color: var(--text-primary);
}

/* Full wordmark SVG — matches assets/svg/logo.svg viewBox 940×240 */
.logo .brand-logo-img--header,
.footer-brand .logo .brand-logo-img--footer {
  width: auto;
  height: 44px;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 40px;
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--text-primary);
}

/* Product dropdown (desktop) */
.nav-product {
  position: relative;
  align-self: center;
}

.nav-product__summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 0;
  font: inherit;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: inherit;
  color: var(--text-secondary);
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.nav-product__chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.24s cubic-bezier(0.32, 0.72, 0, 1), color 0.15s ease;
}

.nav-product--open .nav-product__chevron {
  transform: rotate(180deg);
  color: var(--text-secondary);
}

.nav-product--open .nav-product__summary,
.nav-product__summary:hover {
  color: var(--text-primary);
}

.nav-product__panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 1001;
  min-width: 220px;
  padding: 6px 0;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  transform-origin: top right;
  opacity: 0;
  transform: translateY(-12px) scale(0.97);
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.24s cubic-bezier(0.32, 0.72, 0, 1),
    transform 0.28s cubic-bezier(0.32, 0.72, 0, 1),
    box-shadow 0.28s ease,
    visibility 0s linear 0.28s;
}

.nav-product--open .nav-product__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
  pointer-events: auto;
  transition:
    opacity 0.26s cubic-bezier(0.32, 0.72, 0, 1),
    transform 0.3s cubic-bezier(0.32, 0.72, 0, 1),
    box-shadow 0.3s ease,
    visibility 0s;
}

.nav-product__link {
  display: block;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

.nav-product--open .nav-product__link {
  animation: nav-product-link-in 0.3s cubic-bezier(0.32, 0.72, 0, 1) backwards;
}

.nav-product--open .nav-product__link:nth-child(1) {
  animation-delay: 0.04s;
}

.nav-product--open .nav-product__link:nth-child(2) {
  animation-delay: 0.07s;
}

.nav-product--open .nav-product__link:nth-child(3) {
  animation-delay: 0.1s;
}

.nav-product--open .nav-product__link:nth-child(4) {
  animation-delay: 0.13s;
}

.nav-product--open .nav-product__link:nth-child(5) {
  animation-delay: 0.16s;
}

.nav-product--open .nav-product__link:nth-child(6) {
  animation-delay: 0.19s;
}

.nav-product__link:hover {
  background: var(--bg-alt);
  color: var(--accent-color);
}

@media (prefers-reduced-motion: reduce) {
  .nav-product__chevron {
    transition: color 0.12s ease;
  }

  .nav-product--open .nav-product__chevron {
    transform: rotate(180deg);
  }

  .nav-product__panel {
    transform: none;
    transition: opacity 0.12s ease, visibility 0.12s ease;
  }

  .nav-product--open .nav-product__panel {
    transform: none;
    transition: opacity 0.12s ease, visibility 0s;
  }

  .nav-product--open .nav-product__link {
    animation: none;
  }
}

@keyframes nav-product-link-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Product subgroup (mobile panel) */
.mobile-nav-product-group {
  margin-bottom: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.mobile-nav-sublabel {
  margin: 0 0 6px 12px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.mobile-nav-sublabel--row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mobile-nav-sublabel-chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  opacity: 0.9;
}

.mobile-nav-product-link {
  font-weight: 500 !important;
  color: var(--text-secondary) !important;
  padding-left: 20px !important;
  font-size: 0.95rem !important;
}

.mobile-nav-product-link:hover {
  color: var(--accent-color) !important;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-link-secondary {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

.nav-link-secondary:hover {
  color: var(--text-primary);
}

/* Checkbox drives menu (no JS required to open — works with touch + stacking quirks) */
.mobile-nav-checkbox {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.mobile-menu-btn {
  display: none;
  position: relative;
  z-index: 2;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: var(--transition);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.mobile-menu-btn:hover {
  background: var(--bg-alt);
}

.mobile-menu-btn svg {
  pointer-events: none;
  flex-shrink: 0;
}

.mobile-menu-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mobile-menu-icon--close {
  display: none;
}

.mobile-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--nav-height);
  background: rgba(17, 17, 17, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  cursor: pointer;
}

.mobile-nav-panel {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  z-index: 999;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  max-height: min(70vh, 480px);
  overflow-y: auto;
  transform: translateY(-12px);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.32s cubic-bezier(0.32, 0.72, 0, 1),
    transform 0.34s cubic-bezier(0.32, 0.72, 0, 1);
}

/* Open state: checkbox hack (siblings after input#mobile-nav-toggle) */
@media (max-width: 1024px) {
  #mobile-nav-toggle:checked ~ .mobile-nav-backdrop {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  #mobile-nav-toggle:checked ~ .mobile-nav-panel {
    display: block;
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  #mobile-nav-toggle:checked ~ nav .mobile-menu-icon--open {
    display: none;
  }

  #mobile-nav-toggle:checked ~ nav .mobile-menu-icon--close {
    display: inline-flex;
  }

  html:has(#mobile-nav-toggle:checked),
  body:has(#mobile-nav-toggle:checked) {
    overflow: hidden;
  }
}

@media (max-width: 1024px) and (prefers-reduced-motion: reduce) {
  .mobile-nav-panel {
    transform: none;
    transition: opacity 0.16s ease;
  }

  #mobile-nav-toggle:checked ~ .mobile-nav-panel {
    transform: none;
  }
}

@media (min-width: 1025px) {
  #mobile-nav-toggle {
    display: none;
  }

  .mobile-nav-backdrop,
  .mobile-nav-panel {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden;
  }
}

.mobile-nav-inner {
  padding: 20px max(16px, env(safe-area-inset-right)) 28px max(16px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-nav-links a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.mobile-nav-links a:hover {
  background: var(--bg-alt);
  color: var(--accent-color);
}

.mobile-nav-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.mobile-nav-actions .btn {
  width: 100%;
  min-height: 48px;
}

.mobile-nav-actions .nav-link-secondary {
  text-align: center;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
