/* ===========================================================
   Sticky top navigation.
   - Default: opaque dark with backdrop blur (used on Services, Shop, Contact)
   - .nav--video-hero modifier: starts transparent, becomes opaque on scroll
     (used on the home page so the hero video can fade up into the nav region)
   =========================================================== */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background: rgba(5, 6, 8, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(59, 130, 246, 0.18);
  transition: background 300ms var(--ease), backdrop-filter 300ms var(--ease),
              border-color 300ms var(--ease), box-shadow 300ms var(--ease);
}
.nav.is-scrolled {
  background: rgba(5, 6, 8, 0.95);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

/* Home-page variant: transparent at rest so the video fades through, opaque on scroll */
.nav--video-hero {
  background: transparent;
  backdrop-filter: none;
  border-bottom-color: transparent;
}
.nav--video-hero.is-scrolled {
  background: rgba(5, 6, 8, 0.92);
  backdrop-filter: blur(8px);
  border-bottom-color: rgba(59, 130, 246, 0.18);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

.nav__inner {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__brand img {
  height: 168px;
  width: auto;
  filter: drop-shadow(0 0 18px rgba(59, 130, 246, 0.45));
}

.nav__list {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  align-items: center;
}

.nav__link {
  position: relative;
  font-family: var(--font-display);
  font-size: 0.875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0.5rem 0;
}
.nav__link:hover { color: var(--text); }
.nav__link.is-active { color: var(--accent-hot); }
.nav__link.is-active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-hot), transparent);
  box-shadow: 0 0 8px var(--accent-hot);
}

/* Cart icon (shop pages) */
.nav__cart {
  display: inline-flex;
  position: relative;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 4px;
  background: transparent;
  color: var(--accent-hot);
  transition: all 200ms var(--ease);
}
.nav__cart:hover {
  border-color: var(--accent-hot);
  box-shadow: var(--shadow-glow);
}
.nav__cart svg { width: 22px; height: 22px; }
.nav__cart-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.6);
}
.nav__cart-badge[data-count="0"] { display: none; }

/* Hamburger — hidden on desktop */
.nav__hamburger { display: none; }

/* Mobile */
@media (max-width: 768px) {
  .nav__brand img { height: 60px; }

  .nav__hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 4px;
    cursor: pointer;
    padding: 0.5rem;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
  }
  .nav__hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--accent-hot);
    border-radius: 2px;
    transition: transform 250ms var(--ease), opacity 200ms var(--ease);
  }
  .nav__hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav__hamburger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
  .nav__hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .nav__list {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0; right: 0;
    background: rgba(5, 6, 8, 0.97);
    backdrop-filter: blur(12px);
    flex-direction: column;
    gap: 0;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(59, 130, 246, 0.18);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 99;
  }
  .nav__list.is-open {
    display: flex;
    animation: condFade 200ms var(--ease) both;
  }
  .nav__list li { display: block; }
  .nav__link {
    display: block;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }
  .nav__cart { margin: 0.5rem 1.5rem; }
}
