:root {
  --brand-primary: #0057b8;
  --brand-secondary: #003d82;
  --brand-accent: #f59e0b;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow: 0 4px 16px rgba(0,0,0,.1);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.14);
  --transition: 200ms ease;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--brand-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ── Layout ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section { padding: 64px 0; }

/* ── Nav ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 0 24px;
  height: 64px;
  max-width: 1200px;
  margin: 0 auto;
}

.nav-logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--brand-primary);
  letter-spacing: -0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-logo span { color: var(--brand-accent); }

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  flex: 1;
}

.nav-links a {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--surface-2);
  color: var(--brand-primary);
  text-decoration: none;
}

/* User select — injected by nav.js */
.nav-user-select {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nav-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  background: var(--surface);
}

.nav-user-btn--signin {
  color: var(--brand-primary);
  border: 1.5px solid var(--brand-primary);
}

.nav-user-btn--signin:hover {
  background: var(--brand-primary);
  color: white;
}

.nav-user-btn--signedin {
  color: var(--tier-color, var(--text));
  border: 1.5px solid var(--tier-color, var(--border));
}

.nav-user-btn--signedin:hover {
  background: color-mix(in srgb, var(--tier-color) 8%, transparent);
}

.nav-user-caret {
  font-size: .7rem;
  opacity: .7;
}

.tier-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.nav-user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-user-menu-header {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-light);
  padding: 8px 12px 4px;
}

.nav-user-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: .88rem;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.nav-user-option:hover {
  background: var(--surface-2);
}

.nav-user-option--active {
  background: var(--surface-2);
}

.nav-user-option--active::after {
  content: '✓';
  margin-left: auto;
  color: var(--brand-primary);
  font-weight: 700;
}

.nav-user-option-name {
  flex: 1;
}

.nav-user-option-tier {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--text-light);
}

.nav-user-option--active .nav-user-option-tier {
  display: none;
}

.nav-user-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.nav-user-option--signout {
  color: var(--error);
  font-weight: 600;
}

.nav-user-option--signout:hover {
  background: color-mix(in srgb, var(--error) 8%, transparent);
}

/* Vendor badge — injected by nav.js on vendor branches */
.nav-vendor-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1.5px solid var(--vendor-color, var(--border));
  color: var(--vendor-color, var(--text-muted));
  background: var(--vendor-bg, transparent);
  letter-spacing: .2px;
  text-transform: uppercase;
}

.nav-vendor-badge img {
  height: 18px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

/* ── Hero ── */
.hero {
  position: relative;
  min-height: 580px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, var(--brand-secondary) 0%, var(--brand-primary) 60%, #0ea5e9 100%);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('https://images.unsplash.com/photo-1488085061387-422e29b40080?w=1600&q=70');
  background-size: cover;
  background-position: center;
  opacity: .18;
}

.hero-content {
  position: relative;
  z-index: 1;
  color: white;
  padding: 80px 24px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -1px;
  margin-bottom: 20px;
}

.hero h1 em { font-style: normal; color: var(--brand-accent); }

.hero p {
  font-size: 1.15rem;
  opacity: .85;
  max-width: 560px;
  margin-bottom: 40px;
}

/* ── Search Box ── */
.search-box {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  max-width: 820px;
  box-shadow: var(--shadow-lg);
}

.search-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 160px;
}

.search-field label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.search-field input,
.search-field select {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: .95rem;
  color: var(--text);
  background: white;
  outline: none;
  transition: border-color var(--transition);
  width: 100%;
}

.search-field input:focus,
.search-field select:focus {
  border-color: var(--brand-primary);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--brand-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--brand-secondary);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,87,184,.3);
}

.btn-outline {
  background: transparent;
  color: var(--brand-primary);
  border: 1.5px solid var(--brand-primary);
}

.btn-outline:hover {
  background: var(--brand-primary);
  color: white;
  text-decoration: none;
}

.btn-lg { padding: 14px 28px; font-size: 1.05rem; }
.btn-sm { padding: 7px 14px; font-size: .85rem; }

/* ── Cards ── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.card-body { padding: 20px; }

.card-region {
  display: inline-block;
  font-size: .73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--brand-primary);
  background: rgba(0,87,184,.08);
  padding: 2px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.card-tagline {
  font-size: .88rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.card-price {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--brand-primary);
}

.card-price span {
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.card-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* ── Grid ── */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 24px; }

/* ── Section headers ── */
.section-header { margin-bottom: 40px; }
.section-header h2 { font-size: 2rem; font-weight: 800; letter-spacing: -.5px; margin-bottom: 8px; }
.section-header p { color: var(--text-muted); font-size: 1.05rem; }
.section-header .eyebrow {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--brand-primary);
  margin-bottom: 8px;
}

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
}

.badge-blue { background: rgba(0,87,184,.1); color: var(--brand-primary); }
.badge-green { background: rgba(16,185,129,.1); color: var(--success); }
.badge-amber { background: rgba(245,158,11,.1); color: var(--warning); }
.badge-red { background: rgba(239,68,68,.1); color: var(--error); }

/* ── Form ── */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-input, .form-select, .form-textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: .95rem;
  color: var(--text);
  background: white;
  outline: none;
  transition: border-color var(--transition);
  font-family: inherit;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(0,87,184,.1);
}

.form-textarea { resize: vertical; min-height: 100px; }
.form-error { font-size: .82rem; color: var(--error); margin-top: 4px; }
.form-hint { font-size: .82rem; color: var(--text-muted); margin-top: 4px; }

/* ── Page header ── */
.page-header {
  background: linear-gradient(135deg, var(--brand-secondary), var(--brand-primary));
  color: white;
  padding: 56px 24px;
}

.page-header h1 { font-size: 2.4rem; font-weight: 900; letter-spacing: -1px; margin-bottom: 8px; }
.page-header p { opacity: .8; font-size: 1.05rem; }

/* ── Alert ── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
}

.alert-success { background: rgba(16,185,129,.08); border: 1px solid rgba(16,185,129,.2); color: #065f46; }
.alert-error { background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.2); color: #7f1d1d; }
.alert-info { background: rgba(0,87,184,.08); border: 1px solid rgba(0,87,184,.2); color: var(--brand-secondary); }

/* ── Loading ── */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(0,87,184,.2);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 0;
  color: var(--text-muted);
  font-size: .95rem;
}

/* ── Skeleton ── */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Trace ID banner ── */
.trace-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(0,0,0,.85);
  color: #7dd3fc;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: .73rem;
  position: fixed;
  bottom: 16px;
  right: 16px;
  border-radius: var(--radius-sm);
  z-index: 999;
  opacity: 0;
  transition: opacity .3s;
  max-width: 400px;
  word-break: break-all;
}

.trace-banner.visible { opacity: 1; }

/* ── Footer ── */
.footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 72px 24px 48px;
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: space-between;
}

.footer-brand .nav-logo { color: white; margin-bottom: 10px; }
.footer-brand p { font-size: .85rem; max-width: 280px; line-height: 1.7; }

.footer-links h4 { color: white; font-size: .88rem; font-weight: 700; margin-bottom: 14px; }
.footer-links ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: #94a3b8; font-size: .85rem; transition: color var(--transition); }
.footer-links a:hover { color: white; text-decoration: none; }

.footer-bottom {
  max-width: 1200px;
  margin: 32px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: .8rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Responsive ── */

/* ── Hamburger button ── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  margin-left: auto;
}
.nav-hamburger:hover { background: var(--surface-2); }
.nav-hamburger span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 200ms ease, opacity 200ms ease;
  transform-origin: center;
}
.nav-hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.is-open span:nth-child(2) { opacity: 0; }
.nav-hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile drawer ── */
.nav-mobile-menu {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99;
  background: rgba(15,23,42,.4);
  backdrop-filter: blur(2px);
}
.nav-mobile-menu.is-open { display: block; }
.nav-mobile-drawer {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 8px 0 16px;
}
.nav-mobile-drawer a {
  display: flex;
  align-items: center;
  padding: 13px 24px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.nav-mobile-drawer a:hover,
.nav-mobile-drawer a.active {
  background: var(--surface-2);
  color: var(--brand-primary);
}
.nav-mobile-drawer .mobile-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 24px;
}

@media (max-width: 1080px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
}

@media (max-width: 768px) {
  .search-box { flex-direction: column; }
  .search-field { min-width: 100%; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
  .section { padding: 40px 0; }
}
