/* =============================================
   BOUGH BUILT — Etsy-Style Navigation
   Mobile-first, category burger menu + search
   ============================================= */

/* ─── Header Top Bar ─────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(17, 17, 24, 0.96);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border-color);
  height: 56px;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 12px;
  gap: 8px;
}

/* ─── Left: Menu button + Logo ───────────── */
.nav-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Burger menu button */
.nav-burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 6px;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  transition: background 0.2s;
  flex-shrink: 0;
}
.nav-burger:hover {
  background: rgba(255,255,255,0.06);
}
.nav-burger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}
.nav-burger--active span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-burger--active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-burger--active span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent-gold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  white-space: nowrap;
}
.nav-logo-img {
  height: 20px;
  width: 20px;
  display: block;
  flex-shrink: 0;
}
.nav-logo:hover {
  opacity: 0.9;
}

/* ─── Center: Search Bar ────────────────── */
.nav-search {
  flex: 1;
  max-width: 480px;
  position: relative;
  display: none; /* hidden on mobile, shown when toggled or on wider */
}
.nav-search--visible {
  display: block;
}
.nav-search input {
  width: 100%;
  padding: 8px 36px 8px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-family: var(--font-sans);
  outline: none;
  transition: all 0.2s;
}
.nav-search input::placeholder {
  color: var(--text-muted);
}
.nav-search input:focus {
  border-color: var(--accent-gold);
  background: rgba(255,255,255,0.08);
}
.nav-search-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}

/* Search toggle button (mobile) */
.nav-search-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
  border-radius: 6px;
  flex-shrink: 0;
}
.nav-search-toggle:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
}

/* ─── Right: Cart ────────────────────────── */
.nav-right {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.nav-cart-btn {
  position: relative;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 999px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.nav-cart-btn:hover {
  color: var(--accent-gold);
  background: rgba(245, 166, 35, 0.06);
}
.cart-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--accent-gold);
  color: #111118;
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Mobile Search Bar (below header) ──── */
.nav-search-mobile {
  display: none;
  padding: 8px 12px 12px;
  background: rgba(17, 17, 24, 0.96);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 56px;
  z-index: 999;
}
.nav-search-mobile--open {
  display: block;
}
.nav-search-mobile input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: var(--font-sans);
  outline: none;
}
.nav-search-mobile input:focus {
  border-color: var(--accent-gold);
}
.nav-search-mobile input::placeholder {
  color: var(--text-muted);
}

/* ─── Category Burger Menu (slide-in) ───── */
.nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.nav-drawer--open {
  visibility: visible;
  opacity: 1;
}

/* Overlay */
.nav-drawer-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}

/* Drawer panel */
.nav-drawer-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 320px;
  max-width: 85vw;
  height: 100%;
  background: var(--bg-primary);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-drawer--open .nav-drawer-panel {
  transform: translateX(0);
}

/* Drawer header */
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}
.drawer-header .drawer-logo {
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent-gold);
}
.drawer-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.drawer-close:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
}

/* Drawer sections */
.drawer-section-title {
  padding: 12px 16px 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.drawer-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}
.drawer-link:hover,
.drawer-link:active {
  color: var(--text-primary);
  background: rgba(255,255,255,0.03);
  border-left-color: var(--accent-gold);
}
.drawer-link--active {
  color: var(--accent-gold);
  background: rgba(245, 166, 35, 0.04);
  border-left-color: var(--accent-gold);
}
.drawer-link .drawer-emoji {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.drawer-divider {
  height: 1px;
  background: var(--border-color);
  margin: 6px 16px;
}

.drawer-free-link {
  color: #4ade80;
}
.drawer-free-link:hover {
  background: rgba(74, 222, 128, 0.06);
}

/* Drawer footer */
.drawer-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}
.drawer-footer a {
  display: block;
  padding: 8px 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  text-decoration: none;
}
.drawer-footer a:hover {
  color: var(--text-secondary);
}

/* ─── Desktop: wide search visible ───────── */
@media (min-width: 768px) {
  .site-nav {
    height: 64px;
  }
  .nav-inner {
    padding: 0 24px;
    gap: 16px;
  }
  .nav-search {
    display: block;
  }
  .nav-search-toggle,
  .nav-search-mobile {
    display: none !important;
  }
  .nav-logo {
    font-size: 1.3rem;
  }
  .nav-logo-img {
    height: 24px;
    width: 24px;
  }
  .nav-drawer-panel {
    width: 340px;
    max-width: 340px;
  }
}

@media (min-width: 1024px) {
  .nav-inner {
    gap: 24px;
  }
  .nav-search {
    max-width: 600px;
  }
}
