/* ═══════════════════════════════════
   NAVBAR — fixed, plain values
   ═══════════════════════════════════ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 9000;
  /* No backdrop-filter here — it would create a stacking context
     trapping mobile-open nav-list (position:fixed) inside header.
     Simple solid background works fine. */
  background: rgba(255,255,255,.98);
  border-bottom: 1px solid #e2e2ec;
}
[data-theme=dark] .site-header {
  background: rgba(13,13,26,.98);
  border-bottom-color: #1c1c30;
}

.navbar {
  display: flex;
  align-items: center;
  height: 64px;               /* --nav-h */
  padding: 0 2rem;
  max-width: 100%;
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 1.25rem;
  color: #673DE6;
  letter-spacing: -.04em;
  flex-shrink: 0;
  margin-right: 1.5rem;
  text-decoration: none;
  transition: opacity .2s;
}
.nav-logo:hover { opacity: .82; }
.nav-logo svg   { flex-shrink: 0; }

/* Nav list */
.nav-list {
  display: flex;
  align-items: stretch;
  /* height:100% removed - breaks mobile drawer */
  flex: 1;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-item { display: flex; align-items: center; }

.nav-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color:var(--gray-700);
  font-family: inherit;
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0 .85rem;
  height: 100%;
  white-space: nowrap;
  text-decoration: none;
  transition: color .18s, border-color .18s;
}
.nav-trigger:hover,
.nav-item.open .nav-trigger  { color: #673DE6; border-bottom-color: #673DE6; }

.nav-link                    { border-bottom: 2px solid transparent; }
.nav-link.active,
.nav-link:hover              { color: #673DE6; border-bottom-color: #673DE6; }

.nav-chevron {
  width: 14px; height: 14px;
  flex-shrink: 0;
  color:var(--text-muted);
  transition: transform .2s, color .2s;
}
.nav-item.open .nav-chevron  { transform: rotate(180deg); color: #673DE6; }

/* Right actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-left: auto;
  flex-shrink: 0;
}

/* Cart icon button */
.nav-cart {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 12px;
  color:var(--gray-700);
  border:1.5px solid var(--border);
  background:var(--surface);
  cursor: pointer;
  text-decoration: none;
  transition: color .18s, border-color .18s, background .18s;
}
.nav-cart:hover { color: #673DE6; border-color: #673DE6; background: #f4f0ff; }
.nav-cart svg   { width: 17px; height: 17px; }

.cart-count {
  position: absolute;
  top: -7px; right: -7px;
  min-width: 18px; height: 18px;
  background: #673DE6;
  color: white;
  font-size: .63rem;
  font-weight: 800;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid white;
  opacity: 0;
  transform: scale(0);
  transition: opacity .2s, transform .2s;
}
.cart-count.visible { opacity: 1; transform: scale(1); }
.cart-count.bump    { animation: cartBump .32s ease; }
@keyframes cartBump {
  0%  { transform: scale(1); }
  40% { transform: scale(1.4); }
  100%{ transform: scale(1); }
}

/* User button */
.nav-user {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .85rem;
  border-radius: 12px;
  color:var(--gray-700);
  font-size: .85rem;
  font-weight: 500;
  background: none;
  border:1.5px solid var(--border);
  cursor: pointer;
  transition: color .18s, border-color .18s, background .18s;
}
.nav-user:hover { color: #673DE6; border-color: #673DE6; background: #f4f0ff; }
.nav-user-avatar {
  width: 24px; height: 24px;
  background: #673DE6;
  color: white;
  border-radius: 50%;
  font-size: .66rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* CTA button */
.btn-nav-cta {
  background: #673DE6;
  color: white;
  padding: .48rem 1.1rem;
  border-radius: 12px;
  font-size: .875rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(103,61,230,.22);
  transition: background .18s, transform .12s, box-shadow .18s;
}
.btn-nav-cta:hover {
  background: #4e26d4;
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(103,61,230,.3);
  color: white;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 22px; height: 16px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: .5rem;
}
.hamburger span {
  display: block;
  height: 2px;
  background:var(--gray-700);
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile overlay — must sit BELOW the sticky header (z-index:9000)
   so the navbar/header remains visible and clickable on top.
   Drawer itself uses z-index:9500 and renders above both. */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 8900;          /* header=9000 > overlay=8900, drawer=9500 */
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}
.mobile-overlay.visible {
  display: block;
  opacity: 1;
  pointer-events: auto;
}


/* ── WTS Logo ── */
.nav-logo { gap: 10px; }
.nav-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
  gap: 1px;
}
.nav-logo-short {
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: -.02em;
  background: linear-gradient(90deg, #b146f8, #5ccbf9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-logo-full {
  font-size: .58rem;
  font-weight: 600;
  color:var(--text-muted);
  letter-spacing: .02em;
  white-space: nowrap;
  -webkit-text-fill-color:var(--text-muted);
}
/* Keep logo color on dark backgrounds */
.hero .nav-logo-full { color: rgba(255,255,255,.5); }

/* ── New color logo (wide format, transparent bg) ── */
.nav-logo-img {
  height: 32px;
  width: auto;
  max-width: 180px;
  display: block;
  flex-shrink: 0;
}
/* Remove old text styles that conflict */
.nav-logo-text,
.nav-logo-short,
.nav-logo-full { display: none; }

/* ── Notification bell ── */
.nav-notif { display:flex; align-items:center; justify-content:center; }
.nav-notif-btn {
  position:relative; background:none; border:none; cursor:pointer;
  color:var(--nav-color,rgba(255,255,255,.7)); padding:.4rem; border-radius:8px;
  transition:color .15s, background .15s; display:flex; align-items:center;
  justify-content:center; line-height:1;
}
.nav-notif-btn:hover { color:white; background:rgba(255,255,255,.08); }
.notif-badge {
  position:absolute; top:1px; right:1px; min-width:16px; height:16px;
  background:linear-gradient(90deg,#b146f8,#5ccbf9); color:white;
  border-radius:9999px; font-size:.6rem; font-weight:800; line-height:16px;
  text-align:center; padding:0 4px; border:2px solid var(--nav-bg,#001d30);
}
.notif-panel {
  position:absolute; top:calc(100% + 10px); right:0; width:320px;
  background:var(--surface); border:1.5px solid var(--border); border-radius:16px;
  box-shadow:0 12px 40px rgba(0,0,0,.15); z-index:9999; overflow:hidden;
  animation:notifIn .2s ease;
}
@keyframes notifIn { from{opacity:0;transform:translateY(-8px)} to{opacity:1;transform:none} }
.notif-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:.875rem 1rem; border-bottom:1px solid var(--border-soft);
  font-size:.85rem; font-weight:700;
}
.notif-mark-all {
  background:none; border:none; cursor:pointer;
  font-size:.75rem; color:#b146f8; font-weight:600; font-family:inherit;
}
.notif-mark-all:hover { text-decoration:underline; }
.notif-list { max-height:320px; overflow-y:auto; }
.notif-item {
  display:flex; gap:.75rem; padding:.875rem 1rem;
  border-bottom:1px solid #f0f0f5; transition:background .12s; cursor:pointer;
}
.notif-item:last-child { border-bottom:none; }
.notif-item:hover { background:var(--brand-light); }
.notif-item.unread { background:var(--brand-light); }
.notif-item.unread::before { content:''; width:6px; height:6px; border-radius:50%; background:#b146f8; flex-shrink:0; margin-top:6px; }
.notif-item-icon { font-size:1.25rem; flex-shrink:0; }
.notif-item-body { flex:1; min-width:0; }
.notif-item-title { font-size:.84rem; font-weight:600; margin-bottom:.15rem; color:var(--text); }
.notif-item-sub   { font-size:.75rem; color:var(--text-muted); }
.notif-empty { padding:2rem; text-align:center; color:var(--text-muted); font-size:.85rem; }

/* ── Notification panel extras ── */
.notif-avatar {
  width: 34px; height: 34px; border-radius: 9px;
  color: white; display: flex; align-items: center; justify-content: center;
  font-size: .68rem; font-weight: 800; flex-shrink: 0;
}
.notif-unread-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #b146f8; flex-shrink: 0; align-self: center;
}
.notif-view-all {
  display: block; text-align: center; padding: .75rem 1rem;
  font-size: .78rem; font-weight: 600; color: #b146f8;
  text-decoration: none; border-top:1px solid var(--border-soft);
  transition: background .12s;
}
.notif-view-all:hover { background:var(--brand-light); }
.notif-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem; border-bottom: 1px solid #f0f0f5;
  transition: background .12s; cursor: pointer;
}
.notif-item:last-of-type { border-bottom: none; }
.notif-item:hover { background:var(--brand-light); }
.notif-item.unread { background:var(--brand-light); }
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title { font-size: .82rem; font-weight: 600; color:var(--text); margin-bottom: .15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-item-sub   { font-size: .73rem; color:var(--text-muted); }
.notif-panel { width: 340px; }

/* ── Mobile drawer header pseudo-element contents ── */
.nav-list.mobile-open {
  position: relative;
}
/* Drawer top bar with logo */
.nav-list.mobile-open::before {
  content: 'WTS';
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 1.25rem;
  height: 56px;
  min-height: 56px;
  background: linear-gradient(135deg, #001d30, #0a0f1e);
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: -.02em;
  color: transparent;
  background-clip: text;
  -webkit-background-clip: text;
  background-image: linear-gradient(90deg, #b146f8, #5ccbf9);
  -webkit-text-fill-color: transparent;
  flex-shrink: 0;
}

/* Section label in mobile nav */
.mobile-nav-section {
  font-size: .67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color:var(--text-muted);
  padding: .75rem 1.25rem .25rem;
}

/* ── Dark Mode Theme Toggle Button ── */
.nav-theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-md, 10px);
  border:1.5px solid var(--border);
  background: transparent;
  color:var(--text-muted);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  flex-shrink: 0;
}
.nav-theme-btn:hover {
  background:var(--gray-100);
  border-color: #673DE6;
  color: #673DE6;
}
[data-theme="dark"] .nav-theme-btn {
  border-color: #2a2a3d;
  color: #9999b8;
}
[data-theme="dark"] .nav-theme-btn:hover {
  background: #1c1c30;
  border-color: #c084fc;
  color: #c084fc;
}

/* ── Nav User Dropdown ─────────────────────────────────────────── */
.nav-user-dropdown {
  position: absolute;
  top: calc(100% + .5rem);
  right: 0;
  min-width: 220px;
  background: var(--surface, #fff);
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.06);
  z-index: 9999;
  overflow: hidden;
  animation: navDropIn .15s ease;
}
@keyframes navDropIn {
  from { opacity:0; transform:translateY(-6px); }
  to   { opacity:1; transform:translateY(0); }
}
.nav-user-dropdown-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .875rem 1rem;
  background: var(--bg, #f9fafb);
}
.nav-user-dropdown-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #673DE6;
  color: #fff;
  font-size: .8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.nav-user-dropdown-sep {
  height: 1px;
  background: var(--border, #e5e7eb);
  margin: .25rem 0;
}
.nav-user-dropdown-item {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .525rem 1rem;
  font-size: .845rem;
  font-weight: 500;
  color: var(--text, #111);
  text-decoration: none;
  background: none;
  border: none;
  width: 100%;
  cursor: pointer;
  transition: background .12s;
  text-align: left;
}
.nav-user-dropdown-item:hover { background: var(--bg, #f9fafb); }
.nav-user-dropdown-item--danger { color: #dc2626; }
.nav-user-dropdown-item--danger:hover { background: #fef2f2; }
