/* ═══════════════════════════════════════════════════════════════════════
   NAVBAR — Modern App-Like Design
   Mobile-first, glassmorphism, sticky header
═══════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────
   Tokens
───────────────────────────────────────────────────────────────────── */
.site-header {
  --nav-bg: #f6f7fb;
  --nav-bg-solid: #ffffff;
  --nav-ink: #111827;
  --nav-muted: #6b7280;
  --nav-border: rgba(0, 0, 0, .06);
  --nav-gold: #c9a227;
  --nav-gold-dark: #a88b1f;
  --nav-height: 72px;
  --nav-height-mobile: 64px;
  --nav-transition: .2s cubic-bezier(.4, 0, .2, 1);
}


/* ─────────────────────────────────────────────────────────────────────
   Header Container
───────────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 2001;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--nav-border);
  transition: background var(--nav-transition), box-shadow var(--nav-transition);
}

.site-header.scrolled {
  background: var(--nav-bg-solid);
  box-shadow: 0 4px 20px rgba(0, 0, 0, .06);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: var(--nav-height-mobile);
}

@media (min-width: 768px) {
  .nav-inner {
    height: var(--nav-height);
    padding: 0 32px;
  }
}


/* ─────────────────────────────────────────────────────────────────────
   Logo
───────────────────────────────────────────────────────────────────── */
.nav-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nav-logo img {
  height: 48px;
  width: auto;
  transition: height var(--nav-transition);
}

@media (min-width: 768px) {
  .nav-logo img {
    height: 56px;
  }
}


/* ─────────────────────────────────────────────────────────────────────
   Desktop Navigation Links
───────────────────────────────────────────────────────────────────── */
.nav-links {
  display: none;
  align-items: center;
  gap: 8px;
}

@media (min-width: 900px) {
  .nav-links {
    display: flex;
  }
}

.nav-links a {
  padding: 8px 16px;
  font-size: 18px;
  font-weight: 500;
  color: var(--nav-muted);
  text-decoration: none;
  border-radius: 8px;
  transition: all var(--nav-transition);
}

.nav-links a:hover {
  color: var(--nav-ink);
  background: rgba(0, 0, 0, .04);
}

.nav-links a.active {
  color: var(--nav-gold-dark);
  background: rgba(201, 162, 39, .1);
}


/* ─────────────────────────────────────────────────────────────────────
   Right Actions (icons)
───────────────────────────────────────────────────────────────────── */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
}

.nav-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: var(--nav-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--nav-transition);
  position: relative;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  text-decoration: none;
  box-sizing: border-box;
  line-height: 1;
  font-size: inherit;
  font-family: inherit;
}

/* Normalize button vs anchor differences */
button.nav-action {
  -webkit-appearance: none;
  appearance: none;
}

.nav-action:hover {
  color: var(--nav-ink);
  background: rgba(0, 0, 0, .04);
}

.nav-action svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  display: block;
}

/* Cart badge */
.nav-cart-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  color: #fff;
  background: var(--nav-gold);
  border-radius: 9px;
}

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


/* ─────────────────────────────────────────────────────────────────────
   Mobile Menu Toggle
───────────────────────────────────────────────────────────────────── */
.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--nav-ink);
  border-radius: 12px;
  transition: background var(--nav-transition);
  padding: 0;
  margin: 0;
  line-height: 0;
  align-self: center;
}

.nav-toggle:hover {
  background: rgba(0, 0, 0, .04);
}

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

.nav-toggle svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  display: block;
}

/* Hamburger to X animation */
.nav-toggle .icon-menu { display: block; }
.nav-toggle .icon-close { display: none; }
.site-header.menu-open .nav-toggle .icon-menu { display: none; }
.site-header.menu-open .nav-toggle .icon-close { display: block; }


/* ─────────────────────────────────────────────────────────────────────
   Mobile Menu Overlay
───────────────────────────────────────────────────────────────────── */
.nav-mobile {
  display: none;
  position: fixed;
  inset: var(--nav-height-mobile) 0 auto 0;
  background: var(--nav-bg-solid);
  padding: 24px 20px;
  overflow-y: auto;
  z-index: 2000;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .12);
  max-height: calc(100vh - var(--nav-height-mobile));
}

.site-header.menu-open .nav-mobile {
  display: block;
  animation: slideDown .25s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 900px) {
  .nav-mobile {
    display: none !important;
  }
}


/* ─────────────────────────────────────────────────────────────────────
   Mobile Search
───────────────────────────────────────────────────────────────────── */
.nav-mobile-search {
  margin-bottom: 24px;
}

.nav-mobile-search input {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  font-family: inherit;
  border: 1px solid var(--nav-border);
  border-radius: 12px;
  background: #f8f9fa;
  color: var(--nav-ink);
  outline: none;
  transition: all var(--nav-transition);
}

.nav-mobile-search input:focus {
  border-color: var(--nav-gold);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(201, 162, 39, .1);
}

.nav-mobile-search input::placeholder {
  color: var(--nav-muted);
}


/* ─────────────────────────────────────────────────────────────────────
   Mobile Menu Links
───────────────────────────────────────────────────────────────────── */
.nav-mobile-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-mobile-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 500;
  color: var(--nav-ink);
  text-decoration: none;
  border-radius: 12px;
  transition: all var(--nav-transition);
}

.nav-mobile-links a:hover,
.nav-mobile-links a:active {
  background: rgba(0, 0, 0, .04);
}

.nav-mobile-links a.active {
  color: var(--nav-gold-dark);
  background: rgba(201, 162, 39, .1);
}

.nav-mobile-links svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  flex-shrink: 0;
}


/* ─────────────────────────────────────────────────────────────────────
   Mobile Menu Footer
───────────────────────────────────────────────────────────────────── */
.nav-mobile-footer {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--nav-border);
}

.nav-mobile-footer a {
  display: block;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--nav-muted);
  text-decoration: none;
  border-radius: 8px;
  transition: color var(--nav-transition);
}

.nav-mobile-footer a:hover {
  color: var(--nav-ink);
}


/* ─────────────────────────────────────────────────────────────────────
   Desktop Search (expandable)
───────────────────────────────────────────────────────────────────── */
.nav-search {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  flex-shrink: 0;
  align-self: center;
}

.nav-search .nav-action {
  background: transparent !important;
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 0;
}

.nav-search-input {
  position: absolute;
  right: 48px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  max-width: 0;
  opacity: 0;
  padding: 0;
  font-size: 15px;
  font-family: inherit;
  border: 2px solid var(--nav-border);
  border-radius: 12px;
  background: #fff;
  color: var(--nav-ink);
  outline: none;
  transition: all .3s cubic-bezier(.4, 0, .2, 1);
  pointer-events: none;
  box-sizing: border-box;
  z-index: 1;
}

.nav-search.open .nav-search-input {
  width: 280px;
  max-width: calc(100vw - 200px);
  opacity: 1;
  padding: 12px 16px;
  pointer-events: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

@media (min-width: 1024px) {
  .nav-search.open .nav-search-input {
    width: 360px;
  }
}

@media (min-width: 1200px) {
  .nav-search.open .nav-search-input {
    width: 420px;
  }
}

.nav-search-input:focus {
  border-color: var(--nav-gold);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1), 0 0 0 3px rgba(201, 162, 39, .15);
}

.nav-search-input::placeholder {
  color: var(--nav-muted);
}

/* Hide search on mobile - use mobile menu search instead */
@media (max-width: 899px) {
  .nav-search {
    display: none;
  }
}


/* ─────────────────────────────────────────────────────────────────────
   Body lock when menu open
───────────────────────────────────────────────────────────────────── */
body.nav-menu-open {
  overflow: hidden;
}

@media (min-width: 900px) {
  body.nav-menu-open {
    overflow: auto;
  }
}


/* ─────────────────────────────────────────────────────────────────────
   Reduced Motion
───────────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .site-header,
  .nav-action,
  .nav-links a,
  .nav-toggle,
  .nav-mobile-links a,
  .nav-search-input {
    transition: none;
  }

  .site-header.menu-open .nav-mobile {
    animation: none;
  }
}
