/* ============================================================
   NAV.CSS — Fixed top navigation: [hamburger | logo | store]
   ============================================================ */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 900;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  transition:
    background 350ms var(--ease-out),
    backdrop-filter 350ms var(--ease-out),
    border-bottom-color 350ms ease;
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  background: rgba(8, 8, 8, 0.88);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom-color: var(--border);
}

/* ── 3-column grid: [hamburger] [logo] [action] ── */
.nav__inner {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

/* ── Logo — always perfectly centered ── */
.nav__logo {
  grid-column: 2;
  display: flex;
  align-items: center;
  opacity: 0.95;
  transition: opacity 200ms ease;
  -webkit-tap-highlight-color: transparent;
}

.nav__logo:hover { opacity: 1; }

.nav__logo img {
  height: 54px;
  width: auto;
  display: block;
  filter: drop-shadow(0 0 18px rgba(255,255,255,0.2));
}

/* ── Desktop links — all links live in the overlay ── */
.nav__links {
  display: none;
}

/* ── Hamburger — left, always visible ── */
.nav__hamburger {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--r-sm);
  justify-self: start;
  -webkit-tap-highlight-color: transparent;
  transition: background 180ms ease;
}

.nav__hamburger:hover { background: rgba(255,255,255,0.06); }

.nav__hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  border-radius: 1px;
  transition:
    transform 280ms var(--ease-spring),
    opacity   200ms ease,
    width     280ms var(--ease-spring);
  transform-origin: center;
}

.nav__hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.nav__hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav__hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* ── Store CTA — right side ── */
.nav__store-cta {
  grid-column: 3;
  justify-self: end;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 0.5em 1.1em;
  border: 1px solid rgba(76,201,240,0.3);
  border-radius: var(--r-sm);
  text-decoration: none;
  transition: background 180ms ease, border-color 180ms ease;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  .nav__store-cta:hover {
    background: var(--accent-dim);
    border-color: var(--accent);
  }
}

/* ── Cart button (store / checkout pages) ── */
.nav__cart-btn {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  height: 44px;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  border-radius: var(--r-sm);
  -webkit-tap-highlight-color: transparent;
  transition: background 180ms ease;
  position: relative;
}

.nav__cart-btn:hover { background: rgba(255,255,255,0.06); }

.nav__cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #080808;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.nav__cart-count:empty,
.nav__cart-count[data-me-cart-count="0"] { display: none; }

/* ── Full-screen overlay menu ── */
.nav__mobile {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 850;
  background: rgba(8,8,8,0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 300ms var(--ease-out), visibility 300ms;
  padding: 2rem;
}

.nav__mobile.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.nav__mobile-link {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 10vw, 4.2rem);
  color: var(--text-2);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1.25;
  opacity: 0;
  transform: translateY(16px);
  transition: color 180ms ease, transform 180ms var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) and (pointer: fine) {
  .nav__mobile-link:hover {
    color: var(--text);
    transform: translateX(10px);
  }
}

.nav__mobile-link.active { color: var(--text); }

/* Store link in overlay gets accent treatment */
.nav__mobile-link--store { color: var(--accent); }
.nav__mobile-link--store.active { color: var(--accent); }

.nav__mobile-social {
  display: flex;
  gap: 1.25rem;
  margin-top: 2.5rem;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 220ms ease, transform 220ms var(--ease-out);
}

.nav__mobile-social a {
  color: var(--text-3);
  transition: color 180ms ease;
  -webkit-tap-highlight-color: transparent;
}

.nav__mobile-social a:hover { color: var(--text); }
.nav__mobile-social svg { width: 20px; height: 20px; display: block; }

/* Staggered entry when menu opens */
.nav__mobile.open .nav__mobile-link {
  animation: navLinkIn 380ms var(--ease-out) forwards;
}
.nav__mobile.open .nav__mobile-link:nth-child(1) { animation-delay: 60ms; }
.nav__mobile.open .nav__mobile-link:nth-child(2) { animation-delay: 110ms; }
.nav__mobile.open .nav__mobile-link:nth-child(3) { animation-delay: 160ms; }
.nav__mobile.open .nav__mobile-link:nth-child(4) { animation-delay: 210ms; }

.nav__mobile.open .nav__mobile-social {
  animation: navLinkIn 380ms var(--ease-out) 270ms forwards;
}

@keyframes navLinkIn {
  to { opacity: 1; transform: none; }
}

/* ── Small phone ── */
@media (max-width: 380px) {
  .nav__logo img { height: 46px; }
  .nav__store-cta {
    font-size: 0.62rem;
    padding: 0.4em 0.75em;
    letter-spacing: 0.1em;
  }
}
