/* =========================================================
   AEGLOS EBIKE PLATFORM — SHARED STYLESHEET
   Color palette pulled from the PDF buyer's guide:
     Background:    #191919
     Gold/Amber:    #c9a84c
     Olive green:   #3d4f28  (table headers)
     Body text:     #e0e0e0
     Muted text:    #888
     Card bg:       #242424
     Border:        #333
   ========================================================= */

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

:root {
  --bg:           #191919;
  --bg-card:      #242424;
  --bg-card-alt:  #2a2a2a;
  --bg-input:     #2e2e2e;
  --gold:         #c9a84c;
  --gold-light:   #e0c06a;
  --gold-dim:     #8a6e28;
  --olive:        #3d4f28;
  --olive-light:  #4d6433;
  --text:         #e0e0e0;
  --text-muted:   #888;
  --text-dim:     #aaa;
  --border:       #333;
  --border-light: #3e3e3e;

  --green:        #4caf50;
  --green-dark:   #2e7d32;
  --amber:        #ff9800;
  --amber-dark:   #e65100;
  --red:          #f44336;
  --red-dark:     #b71c1c;
  --blue:         #42a5f5;

  --radius:       6px;
  --radius-sm:    4px;
  --shadow:       0 2px 12px rgba(0,0,0,0.5);
  --shadow-lg:    0 4px 24px rgba(0,0,0,0.7);

  --font-sans:    'IBM Plex Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono:    'IBM Plex Mono', 'Courier New', monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); text-decoration: underline; }

/* =========================================================
   NAV
   ========================================================= */
.site-nav {
  background: #111;
  border-bottom: 2px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 24px;
}
.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 56px;
  gap: 32px;
}
.nav-brand {
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.nav-brand span { color: var(--text-dim); font-weight: 400; font-size: 13px; letter-spacing: 1px; margin-left: 8px; }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--gold);
  background: rgba(201,168,76,0.08);
}
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.nav-badge {
  font-family: var(--font-mono);
  background: var(--gold);
  color: #111;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* =========================================================
   PAGE HERO
   ========================================================= */
.page-hero {
  background: linear-gradient(135deg, #111 0%, #1a1a1a 60%, #1f1a0e 100%);
  border-bottom: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
}
.page-hero h1 {
  font-family: var(--font-sans);
  font-size: 32px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1.2;
}
.page-hero .subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 6px;
  letter-spacing: 0.5px;
}
.page-hero .edition-badge {
  font-family: var(--font-mono);
  display: inline-block;
  border: 1px solid var(--gold-dim);
  color: var(--gold-dim);
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 10px;
  margin-bottom: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* =========================================================
   MAIN LAYOUT (3 columns: filters | cards | ads)
   ========================================================= */
.page-layout {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 260px 1fr 160px;
  grid-template-areas: "filters main ads";
  gap: 0;
  min-height: calc(100vh - 140px);
}

/* Filters sidebar */
.filters-sidebar {
  grid-area: filters;
  padding: 20px 16px;
  border-right: 1px solid var(--border);
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
}

/* Cards area */
.cards-main {
  grid-area: main;
  padding: 20px 20px;
}

/* Ads sidebar */
.ads-sidebar {
  grid-area: ads;
  padding: 20px 12px;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
}

/* =========================================================
   AD SLOTS
   ========================================================= */
.ad-slot {
  background: var(--bg-card);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
  padding: 12px 8px;
  min-height: 250px;
  gap: 8px;
}
.ad-slot .ad-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--border-light);
}
.ad-slot-tall { min-height: 400px; }
.ad-slot-leaderboard {
  width: 100%;
  min-height: 90px;
  flex-direction: row;
  background: var(--bg-card);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius);
  align-items: center;
  justify-content: center;
  padding: 12px;
  margin: 12px 0;
}

/* =========================================================
   FILTER PANEL
   ========================================================= */
.filter-section-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gold);
  margin-bottom: 10px;
  margin-top: 18px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.filter-section-title:first-child { margin-top: 0; }

.filter-group { margin-bottom: 14px; }
.filter-label {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 4px;
  display: block;
}
.filter-value {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--gold);
  float: right;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--gold);
  cursor: pointer;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: 13px; color: var(--text-dim); }

.toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border-light);
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle input:checked + .toggle-slider { background: var(--gold); }
.toggle input:checked + .toggle-slider::before { transform: translateX(16px); }

.multi-select { display: flex; flex-wrap: wrap; gap: 5px; }
.ms-chip {
  font-size: 11px;
  padding: 3px 9px 3px 8px;
  border-radius: 12px;
  border: 1px solid rgba(180,60,60,0.4);
  background: rgba(180,60,60,0.08);
  color: rgba(210,130,130,0.75);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  opacity: 0.7;
}
.ms-chip::before { content: '✕ '; font-size: 9px; }
.ms-chip:hover { opacity: 0.9; border-color: rgba(210,130,130,0.6); color: rgba(210,130,130,0.95); }
.ms-chip.active {
  background: rgba(212,160,23,0.12);
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 600;
  opacity: 1;
}
.ms-chip.active::before { content: '✓ '; font-size: 9px; }

.motor-select { width: 100%; }
.motor-select select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  color: var(--text);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
}
.motor-select select:focus { outline: none; border-color: var(--gold-dim); }

.filter-reset-btn {
  width: 100%;
  margin-top: 16px;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-reset-btn:hover { border-color: var(--gold-dim); color: var(--gold-dim); }

.filter-active-badge {
  background: var(--gold);
  color: #111;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.filter-active-badge.hidden { display: none; }

/* =========================================================
   RESULTS HEADER
   ========================================================= */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.results-count {
  font-size: 13px;
  color: var(--text-muted);
}
.results-count strong { color: var(--gold); }
.show-eliminated-btn {
  font-size: 12px;
  padding: 4px 12px;
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}
.show-eliminated-btn:hover { border-color: var(--red); color: var(--red); }
.show-eliminated-btn.active { border-color: var(--red); color: var(--red); background: rgba(244,67,54,0.08); }

/* =========================================================
   BIKE CARDS
   ========================================================= */
.bikes-list { display: flex; flex-direction: column; gap: 12px; }

.bike-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.bike-card:hover { border-color: var(--border-light); box-shadow: var(--shadow); }
.bike-card.eliminated { opacity: 0.6; border-style: dashed; }
.bike-card.weight-warning { border-left: 3px solid var(--amber); }
.bike-card.weight-danger { border-left: 3px solid var(--red); }

/* Card header */
.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 10px;
  cursor: pointer;
  user-select: none;
}
.card-header:hover .card-title { color: var(--gold-light); }

.rank-badge {
  font-size: 22px;
  font-weight: 900;
  color: var(--gold);
  min-width: 36px;
  line-height: 1;
}

.card-meta { flex: 1; min-width: 0; }
.card-title { font-family: var(--font-sans); font-size: 17px; font-weight: 600; color: var(--text); line-height: 1.2; }
.card-brand { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; }
.card-tagline { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}
.card-price { font-size: 17px; font-weight: 700; color: var(--gold); }
.card-price-sub { font-size: 11px; color: var(--text-muted); text-align: right; }

.card-bike-img {
  display: block;
  max-width: 140px;
  max-height: 90px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin-top: 4px;
  pointer-events: none;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}

/* Verdict badges */
.verdict-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.verdict-green  { background: var(--green-dark); color: #a5d6a7; border: 1px solid var(--green); }
.verdict-amber  { background: rgba(255,152,0,0.15); color: var(--amber); border: 1px solid var(--amber-dark); }
.verdict-red    { background: rgba(244,67,54,0.12); color: #ef9a9a; border: 1px solid var(--red-dark); }

/* Size + category inline badges */
.size-badge, .cat-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  vertical-align: middle;
  margin-left: 4px;
}
.size-pit-bike    { background: rgba(201,168,76,0.12); color: var(--gold-dim); border: 1px solid rgba(201,168,76,0.3); }
.size-intermediate { background: rgba(100,181,246,0.12); color: #90caf9; border: 1px solid rgba(100,181,246,0.3); }
.size-full-size   { background: rgba(76,175,80,0.12); color: #a5d6a7; border: 1px solid rgba(76,175,80,0.3); }
.cat-dirt   { background: rgba(121,85,72,0.2); color: #bcaaa4; border: 1px solid rgba(121,85,72,0.4); }
.cat-street { background: rgba(100,181,246,0.1); color: #90caf9; border: 1px solid rgba(100,181,246,0.3); }
.cat-ebike  { background: rgba(76,175,80,0.1); color: #a5d6a7; border: 1px solid rgba(76,175,80,0.3); }

/* OEM note in spec detail */
.oem-note {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(201,168,76,0.07);
  border-left: 3px solid var(--gold-dim);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.oem-note strong { color: var(--text-dim); }

/* stat-chip dim variant */
.stat-chip.dim { opacity: 0.5; }

/* Motor type badge */
.motor-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.motor-mid-drive { background: rgba(76,175,80,0.15); color: var(--green); border: 1px solid var(--green-dark); }
.motor-hub       { background: rgba(244,67,54,0.1); color: #ef9a9a; border: 1px solid var(--red-dark); }

/* Quick stats strip */
.card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 10px;
}
.stat-chip {
  font-size: 11px;
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  color: var(--text-dim);
  white-space: nowrap;
}
.stat-chip strong { color: var(--text); }
.stat-chip.highlight { border-color: var(--olive-light); color: var(--gold-dim); }
.stat-chip.warn { border-color: var(--amber-dark); color: var(--amber); }
.stat-chip.danger { border-color: var(--red-dark); color: var(--red); }
.stat-chip.good { border-color: var(--green-dark); color: var(--green); }

/* Top pros strip */
.card-pros-strip {
  padding: 6px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.pro-item {
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  gap: 6px;
}
.pro-item::before { content: '✓'; color: var(--green); flex-shrink: 0; }

/* Card footer */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-card-alt);
  cursor: pointer;
  user-select: none;
}
.expand-btn {
  font-size: 12px;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.15s;
}
.expand-btn:hover { color: #81c784; }
.expand-arrow { transition: transform 0.2s; font-size: 10px; }
.expanded .expand-arrow { transform: rotate(180deg); }

.elim-reason {
  font-size: 11px;
  color: var(--red);
  background: rgba(244,67,54,0.08);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

/* =========================================================
   EXPANDED DETAIL PANEL
   ========================================================= */
.card-detail {
  display: none;
  border-top: 1px solid var(--border);
  padding: 20px 16px;
}
.bike-card.expanded .card-detail { display: block; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 860px) { .detail-grid { grid-template-columns: 1fr; } }

/* Spec table */
.spec-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.spec-table th {
  background: var(--olive);
  color: #c8d8a8;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 7px 10px;
  text-align: left;
}
.spec-table td { padding: 6px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.spec-table tr:last-child td { border-bottom: none; }
.spec-table tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
.spec-table .spec-label { color: var(--text-muted); font-size: 12px; width: 140px; }
.spec-table .spec-value { color: var(--text); }
.spec-table .spec-note { color: var(--text-muted); font-size: 11px; }
.spec-check { color: var(--green); }
.spec-cross { color: var(--red); }
.spec-question { color: var(--amber); }

/* Pros / Cons */
.pros-cons-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
@media (max-width: 600px) { .pros-cons-grid { grid-template-columns: 1fr; } }

.pros-block, .cons-block {
  background: var(--bg-card-alt);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.pros-block { border-left: 3px solid var(--green); }
.cons-block { border-left: 3px solid var(--red); }
.pros-cons-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.pros-cons-title.green { color: var(--green); }
.pros-cons-title.red { color: var(--red); }
.pros-list li, .cons-list li {
  font-size: 12px;
  padding: 3px 0;
  padding-left: 16px;
  position: relative;
  line-height: 1.4;
  color: var(--text-dim);
  list-style: none;
}
.pros-list li::before { content: '✓'; position: absolute; left: 0; color: var(--green); }
.cons-list li::before { content: '✗'; position: absolute; left: 0; color: var(--red); }

/* Rider note */
.rider-note {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(201,168,76,0.07);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--gold-dim);
  line-height: 1.6;
}
.rider-note strong { color: var(--gold); }

/* Mod path */
.mod-path {
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(66,165,245,0.06);
  border: 1px solid rgba(66,165,245,0.2);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: #90caf9;
  line-height: 1.6;
}
.mod-path-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--blue);
  margin-bottom: 6px;
}

/* YouTube embed */
.yt-embed {
  margin-top: 14px;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16/9;
  background: #000;
}
.yt-embed iframe { width: 100%; height: 100%; border: none; display: block; }

/* Deal block */
.deal-block {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(76,175,80,0.07);
  border: 1px solid var(--green-dark);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: #a5d6a7;
}
.deal-block strong { color: var(--green); }
.deal-codes { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.deal-code {
  font-family: monospace;
  font-size: 12px;
  background: rgba(76,175,80,0.15);
  border: 1px solid var(--green-dark);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  color: var(--green);
}

/* Buy button */
.buy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 10px 20px;
  background: var(--gold);
  color: #111;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.15s;
}
.buy-btn:hover { background: var(--gold-light); color: #111; text-decoration: none; }

/* =========================================================
   SECTION HEADERS (eliminated group, etc.)
   ========================================================= */
.section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 10px;
}
.section-divider-line { flex: 1; height: 1px; background: var(--border); }
.section-divider-text {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* =========================================================
   SCENARIO TABLE (final recommendations)
   ========================================================= */
.scenario-table-wrap { overflow-x: auto; margin: 16px 0; }
.scenario-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 500px; }
.scenario-table th {
  background: var(--olive);
  color: #c8d8a8;
  padding: 8px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.scenario-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.scenario-table tr:last-child td { border-bottom: none; }
.scenario-table tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
.scenario-pick { color: var(--gold); font-weight: 600; }

/* =========================================================
   FORMS + INPUTS
   ========================================================= */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 5px;
  font-weight: 500;
}
.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  color: var(--text);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: border-color 0.15s;
}
.form-control:focus {
  outline: none;
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 2px rgba(201,168,76,0.1);
}
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 90px; }
select.form-control { cursor: pointer; }

.form-error { font-size: 12px; color: var(--red); margin-top: 4px; }
.form-success { font-size: 12px; color: var(--green); margin-top: 4px; }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
}
.btn-gold { background: var(--gold); color: #111; }
.btn-gold:hover { background: var(--gold-light); color: #111; }
.btn-outline { background: transparent; border: 1px solid var(--border-light); color: var(--text-dim); }
.btn-outline:hover { border-color: var(--gold-dim); color: var(--gold-dim); }
.btn-red { background: rgba(244,67,54,0.15); border: 1px solid var(--red-dark); color: var(--red); }
.btn-red:hover { background: rgba(244,67,54,0.25); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* =========================================================
   MODAL
   ========================================================= */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 20px;
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
.modal-close:hover { color: var(--text); }
.modal-tabs { display: flex; gap: 0; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.modal-tab {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
}
.modal-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.modal-tab-panel { display: none; }
.modal-tab-panel.active { display: block; }

/* =========================================================
   SALES PAGE — LISTINGS
   ========================================================= */
.sales-layout {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 200px;
  grid-template-areas: "main ads";
  gap: 0;
}
.sales-main { grid-area: main; padding: 20px 24px; }
.sales-ads { grid-area: ads; padding: 20px 12px; border-left: 1px solid var(--border); }

.profile-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: color-mix(in srgb, var(--gold) 10%, transparent);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--text-dim);
  flex-wrap: wrap;
}
.profile-banner-icon { font-size: 14px; }
.profile-banner-dismiss {
  margin-left: auto;
  cursor: pointer;
  color: var(--text-muted);
  white-space: nowrap;
}
.profile-banner-dismiss:hover { color: var(--text-dim); }

.listings-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.search-input-wrap { position: relative; flex: 1; min-width: 200px; }
.search-input-wrap .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}
.search-input { padding-left: 32px !important; }

.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.listing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.listing-card:hover { border-color: var(--border-light); box-shadow: var(--shadow); }
.listing-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: var(--bg-card-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 12px;
}
.listing-img img { width: 100%; height: 100%; object-fit: cover; }
.listing-body { padding: 12px; }
.listing-price { font-size: 20px; font-weight: 700; color: var(--gold); }
.listing-title { font-size: 14px; font-weight: 600; color: var(--text); margin: 4px 0; }
.listing-meta { font-size: 11px; color: var(--text-muted); }
.listing-condition {
  display: inline-block;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  margin-top: 6px;
  font-weight: 600;
}
.cond-New, .cond-Like.New { background: rgba(76,175,80,0.15); color: var(--green); }
.cond-Good { background: rgba(201,168,76,0.15); color: var(--gold); }
.cond-Fair { background: rgba(255,152,0,0.15); color: var(--amber); }
.cond-Parts { background: rgba(244,67,54,0.1); color: var(--red); }
.listing-footer {
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}
.listing-owner { color: var(--gold-dim); }
.listing-actions { display: flex; gap: 8px; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state h3 { font-size: 18px; color: var(--text-dim); margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* =========================================================
   USER STATUS BAR
   ========================================================= */
.user-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 24px;
  background: rgba(0,0,0,0.3);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.user-bar-spacer { flex: 1; }
.user-greeting { color: var(--gold-dim); }
.user-greeting strong { color: var(--gold); }

/* =========================================================
   TOAST NOTIFICATIONS
   ========================================================= */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 999;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  min-width: 240px;
  max-width: 360px;
  box-shadow: var(--shadow);
  animation: slideIn 0.2s ease;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(8px); } }
.toast.out { animation: fadeOut 0.3s ease forwards; }

/* =========================================================
   PAGINATION
   ========================================================= */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 20px; }
.page-btn {
  padding: 5px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
}
.page-btn:hover { border-color: var(--gold-dim); color: var(--gold); }
.page-btn.active { background: var(--gold); border-color: var(--gold); color: #111; font-weight: 700; cursor: default; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1100px) {
  .page-layout { grid-template-columns: 230px 1fr 140px; }
}

@media (max-width: 900px) {
  /* Collapse to single column — ads hidden, filters become overlay */
  .page-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "main";
  }
  .ads-sidebar { display: none; }
  .sales-layout { grid-template-columns: 1fr; }
  .sales-ads { display: none; }

  /* Filter sidebar — slide-in overlay from left */
  .filters-sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    width: 280px;
    max-width: 85vw;
    height: calc(100vh - 56px);
    z-index: 90;
    overflow-y: auto;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    box-shadow: 4px 0 32px rgba(0,0,0,0.6);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    display: block;
  }
  .filters-sidebar.open { transform: translateX(0); }

  /* Backdrop */
  .filter-overlay {
    display: none;
    position: fixed;
    inset: 56px 0 0 0;
    background: rgba(0,0,0,0.55);
    z-index: 89;
    cursor: pointer;
  }
  .filter-overlay.active { display: block; }
}

@media (max-width: 600px) {
  /* Nav */
  .site-nav { padding: 0 12px; }
  .nav-inner { gap: 8px; height: 50px; }
  .nav-brand { font-size: 17px; letter-spacing: 1px; }
  .nav-brand span { display: none; }
  .nav-right { display: none; }
  .nav-links a { padding: 5px 8px; font-size: 13px; }

  /* Hero */
  .page-hero { padding: 20px 16px; }
  .page-hero h1 { font-size: 22px; }

  /* Layout */
  .cards-main { padding: 12px 10px; }

  /* Results bar */
  .results-header { flex-direction: column; align-items: flex-start; gap: 8px; }

  /* Cards */
  .card-header { padding: 12px 10px; gap: 8px; }
  .card-title { font-size: 15px; }
  .card-price { font-size: 15px; }
  .card-bike-img { max-width: 90px; max-height: 60px; }

  /* Grids */
  .detail-grid { grid-template-columns: 1fr; }
  .listings-grid { grid-template-columns: 1fr; }
}

/* Mobile filter toggle button */
.mobile-filter-btn {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: rgba(201,168,76,0.08);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.mobile-filter-btn:hover { background: rgba(201,168,76,0.15); }
@media (max-width: 900px) { .mobile-filter-btn { display: inline-flex; } }

/* =========================================================
   MISC UTILITIES
   ========================================================= */
.text-gold { color: var(--gold); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-amber { color: var(--amber); }
.text-muted { color: var(--text-muted); }
.fw-bold { font-weight: 700; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* Loading spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-light);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================
   PHOTO UPLOAD ZONE
   ========================================================= */
.photo-upload-zone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--bg-card-alt);
  position: relative;
}
.photo-upload-zone:hover,
.photo-upload-zone.dragover {
  border-color: var(--gold-dim);
  background: rgba(201,168,76,0.04);
}
.photo-upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.upload-prompt { font-size: 14px; color: var(--text-muted); pointer-events: none; }
.upload-prompt .upload-icon { font-size: 28px; display: block; margin-bottom: 6px; }
.upload-hint { font-size: 11px; color: var(--text-muted); margin-top: 8px; pointer-events: none; }
.upload-count { font-size: 12px; color: var(--gold-dim); margin-top: 4px; pointer-events: none; }

/* Photo preview grid */
.photo-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  justify-content: flex-start;
}
.photo-preview-item {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}
.photo-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-preview-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0,0,0,0.75);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.photo-preview-remove:hover { background: var(--red); }
.photo-preview-primary {
  position: absolute;
  bottom: 2px;
  left: 2px;
  background: rgba(201,168,76,0.85);
  color: #111;
  font-size: 8px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Upload progress bar */
.upload-progress {
  width: 100%;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}
.upload-progress-bar {
  height: 100%;
  background: var(--gold);
  width: 0%;
  transition: width 0.3s ease;
}

/* =========================================================
   LISTING PHOTO CAROUSEL
   ========================================================= */
.listing-gallery {
  position: relative;
  width: 100%;
  height: 200px;
  background: var(--bg-card-alt);
  overflow: hidden;
}
.listing-gallery-slides {
  display: flex;
  height: 100%;
  transition: transform 0.3s ease;
}
.listing-gallery-slide {
  flex-shrink: 0;
  width: 100%;
  height: 100%;
}
.listing-gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-no-photo {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 12px;
  flex-direction: column;
  gap: 6px;
}
.gallery-no-photo span { font-size: 28px; }
.gallery-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  z-index: 2;
}
.gallery-btn:hover { background: rgba(0,0,0,0.8); }
.gallery-prev { left: 6px; }
.gallery-next { right: 6px; }
.gallery-counter {
  position: absolute;
  bottom: 6px;
  right: 8px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 8px;
  z-index: 2;
}
.gallery-dots {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  z-index: 2;
}
.gallery-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  transition: background 0.15s;
}
.gallery-dot.active { background: #fff; }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  background: #111;
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  margin-top: 48px;
}
.site-footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-brand {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.footer-copy {
  font-size: 12px;
  color: var(--text-muted);
}
.footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
}
.footer-links a {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--gold); text-decoration: none; }
.footer-bmc {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 4px 10px;
  transition: border-color 0.15s, color 0.15s;
}
.footer-bmc:hover { border-color: var(--gold); color: var(--gold); text-decoration: none; }
