/* ============================================================
   HostDeck Store — Header / Navigation
   ============================================================ */

.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color .3s ease, border-color .3s ease, backdrop-filter .3s ease, height .3s ease;
}
.site-header.scrolled {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--border-soft);
  height: 64px;
}
.header-inner {
  width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}

/* ---------- Logo ---------- */
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--grad-brand);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px var(--glow);
  flex-shrink: 0;
}
.brand-mark svg { width: 22px; height: 22px; color: #06202a; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.brand-sub { font-size: 10.5px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-faint); }

/* ---------- Nav ---------- */
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 9px 14px; border-radius: 9px; font-size: 14.5px; font-weight: 500;
  color: var(--text-2); transition: color .18s ease, background-color .18s ease;
  position: relative;
}
.nav a:hover { color: var(--text); background: var(--glow-soft); }
.nav a.active { color: var(--accent); }
.nav a.active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px;
  background: var(--grad-brand); border-radius: 2px;
}

/* ---------- Header actions ---------- */
.header-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.theme-toggle {
  width: 40px; height: 40px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); color: var(--text-2);
  transition: color .18s ease, border-color .18s ease, background-color .18s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--border-2); background: var(--glow-soft); }
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .icon-sun { display: none; }
html.light .theme-toggle .icon-sun { display: block; }
html.light .theme-toggle .icon-moon { display: none; }

/* ---------- Mobile menu ---------- */
.nav-toggle {
  display: none; width: 42px; height: 42px; border-radius: 10px;
  border: 1px solid var(--border); color: var(--text);
  align-items: center; justify-content: center;
}
.nav-toggle svg { width: 22px; height: 22px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle.open .icon-menu { display: none; }
.nav-toggle.open .icon-close { display: block; }

.mobile-menu {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 99;
  width: min(340px, 86vw);
  background: var(--bg-elev);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform .32s cubic-bezier(.2,.7,.2,1);
  display: flex; flex-direction: column;
  padding: 24px;
  overflow-y: auto;
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.mobile-menu a {
  display: block; padding: 14px 16px; border-radius: 10px;
  font-size: 16px; font-weight: 500; color: var(--text-2);
  border: 1px solid transparent;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease;
}
.mobile-menu a:hover { color: var(--text); background: var(--glow-soft); }
.mobile-menu a.active { color: var(--accent); background: var(--glow-soft); border-color: var(--border); }
.mobile-menu .btn { margin-top: 18px; }
.mobile-overlay {
  position: fixed; inset: 0; z-index: 98; background: rgba(0,0,0,0.55);
  opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s ease;
  backdrop-filter: blur(2px);
}
.mobile-overlay.open { opacity: 1; visibility: visible; }

@media (max-width: 1024px) {
  .nav { display: none; }
  .nav-toggle { display: inline-flex; }
  .header-actions .btn { display: none; }
}
@media (max-width: 560px) {
  .brand-sub { display: none; }
  .brand-name { font-size: 16px; }
  .brand-mark { width: 36px; height: 36px; }
}
