/* ==========================================================================
   header.css — Site header, primary nav, language toggle, wishlist, drawer
   Design A "Editorial Trust"
   ==========================================================================
   Two header layouts share the .site-header shell:
     • Full header (default) — logo, nav, lang toggle, wishlist, login, burger
     • Auth header (body.page-auth) — logo + back-to-explore link only
   Both styles are defined here; HTML differs per page section.
   ========================================================================== */

/* ── Site header shell ────────────────────────────────────────────────────── */
.site-header {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  height: var(--header-h);
  background: var(--bg-white);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  z-index: var(--z-header);
}
.header-inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: var(--sp-4);
}
.header-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.header-logo img { height: 40px; width: auto; }

/* ── Primary nav ──────────────────────────────────────────────────────────── */
.header-nav {
  display: none;
  align-items: center;
  gap: var(--sp-1);
  margin-inline-start: var(--sp-4);
}
@media (min-width: 1024px) { .header-nav { display: flex; } }
.nav-link {
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--gray-700);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: color var(--transition-fast), background var(--transition-fast);
}
.nav-link:hover {
  color: var(--primary);
  background: var(--primary-light);
  text-decoration: none;
}
.nav-link.active { color: var(--primary); font-weight: var(--weight-semibold); }

.header-spacer { flex: 1; }

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* ── Language toggle ──────────────────────────────────────────────────────── */
.lang-btn {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-2) var(--sp-3);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-full);
  background: var(--bg-white);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--gray-700);
  cursor: pointer;
  text-decoration: none;
  transition: border-color var(--transition-fast), color var(--transition-fast);
  min-height: 36px;
}
.lang-btn:hover {
  border-color: var(--secondary);
  color: var(--secondary);
  text-decoration: none;
}
.lang-btn svg { width: 14px; height: 14px; }

/* ── Wishlist button ──────────────────────────────────────────────────────── */
.wishlist-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--gray-200);
  background: var(--bg-white);
  color: var(--gray-700);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}
.wishlist-btn:hover {
  border-color: var(--error);
  color: var(--error);
  text-decoration: none;
}
.wishlist-btn svg { width: 20px; height: 20px; }
.wishlist-count {
  position: absolute;
  inset-block-start: -4px;
  inset-inline-end: -4px;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: var(--on-primary-lg);
  font-size: 10px;
  font-weight: var(--weight-bold);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-white);
}

/* ── Login CTA (desktop only) ─────────────────────────────────────────────── */
.header-login { display: none; }
@media (min-width: 768px) { .header-login { display: flex; } }

/* ── Burger (mobile/tablet) ───────────────────────────────────────────────── */
.burger-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--gray-200);
  background: var(--bg-white);
  color: var(--gray-700);
  cursor: pointer;
  flex-shrink: 0;
}
.burger-btn:hover { border-color: var(--navy); color: var(--navy); }
.burger-btn svg { width: 22px; height: 22px; }
@media (min-width: 1024px) { .burger-btn { display: none; } }

/* ── Auth header variant ──────────────────────────────────────────────────── */
.page-auth .site-header { /* identical to default; back-link replaces nav */ }
.header-back-link {
  /* small-button compact gap for auth header back-to-explore */
  gap: var(--sp-1);
}

/* ══════════════════════════════════════════════════════════════════════════
   MOBILE NAV DRAWER
   ══════════════════════════════════════════════════════════════════════════ */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: calc(var(--z-header) - 1);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  inset-block: 0;
  inset-inline-end: 0;
  width: min(280px, 85vw);
  background: var(--bg-white);
  z-index: var(--z-header);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  overflow-y: auto;
}
.drawer.open { transform: translateX(0); }

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-block-end: 1px solid var(--gray-200);
}
.drawer-close {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--gray-50);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--gray-700);
}
.drawer-nav {
  flex: 1;
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.drawer-nav-link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-md);
  color: var(--gray-700);
  font-weight: var(--weight-medium);
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.drawer-nav-link:hover {
  background: var(--primary-light);
  color: var(--primary);
  text-decoration: none;
}
.drawer-nav-link svg { width: 20px; height: 20px; }
.drawer-footer {
  padding: var(--sp-5);
  border-block-start: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
