:root {
  --bg: #0f1115; --surface: #171a21; --surface2: #1f232c; --border: #2a2f3a;
  --text: #e8eaed; --muted: #9aa2b1; --brand: #ff6b35; --brand-dark: #e2551f;
  --ok: #2fbf71; --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, Segoe UI, Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.site-header .wrap { display: flex; align-items: center; gap: 16px; padding: 12px 16px; flex-wrap: wrap; }
.logo { font-weight: 800; font-size: 1.3rem; color: var(--brand); }
.head-search { display: flex; flex: 1; min-width: 220px; max-width: 480px; }
.head-search input { flex: 1; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius) 0 0 var(--radius); background: var(--surface2); color: var(--text); }
.head-search button, .btn-buy, #garage-save, .hero-search button { background: var(--brand); color: #fff; border: none; font-weight: 700; cursor: pointer; }
.head-search button { padding: 9px 16px; border-radius: 0 var(--radius) var(--radius) 0; }
.head-search button:hover, .btn-buy:hover, #garage-save:hover { background: var(--brand-dark); }
.main-nav { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.main-nav a { color: var(--muted); white-space: nowrap; }
.main-nav a:hover { color: var(--text); }
#garage-btn { background: var(--surface2); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; cursor: pointer; font-weight: 600; }
#garage-btn.set { background: var(--ok); color: #06210f; border-color: var(--ok); }
.garage-panel { display: flex; gap: 8px; padding: 10px 16px; background: var(--surface2); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.garage-panel select { padding: 8px; border-radius: var(--radius); background: var(--bg); color: var(--text); border: 1px solid var(--border); }
#garage-clear { background: transparent; color: var(--muted); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; cursor: pointer; }

.hero { background: linear-gradient(180deg, var(--surface), var(--bg)); padding: 56px 0 32px; text-align: center; }
.hero h1 { font-size: 2rem; margin: 0 0 10px; }
.hero p { color: var(--muted); max-width: 620px; margin: 0 auto 20px; }
.hero-search { display: flex; max-width: 520px; margin: 0 auto; }
.hero-search input { flex: 1; padding: 14px 16px; font-size: 1rem; border: 1px solid var(--border); border-radius: var(--radius) 0 0 var(--radius); background: var(--surface2); color: var(--text); }
.hero-search button { padding: 14px 22px; border-radius: 0 var(--radius) var(--radius) 0; font-size: 1rem; }
.hero-stats { margin-top: 40px; color: var(--muted); font-size: .9rem; }

h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; margin-top: 32px; }
.wrap > h1, .wrap > h2 { margin-top: 28px; }
.breadcrumb { color: var(--muted); font-size: .85rem; margin: 16px 0; }
.breadcrumb a:hover { color: var(--text); }

.cat-grid, .make-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin: 16px 0; }
.cat-tile, .make-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; transition: border-color .15s; }
.cat-tile:hover, .make-tile:hover { border-color: var(--brand); }
.cat-tile .icon { font-size: 1.6rem; }
.cat-tile .n, .make-tile .n { color: var(--muted); font-size: .8rem; }
.see-all { display: inline-block; margin-top: 8px; color: var(--brand); font-weight: 600; }

.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin: 16px 0; }
.listing-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 6px; transition: border-color .15s, transform .1s; }
.listing-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.listing-card img, .listing-card .noimg { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 6px; background: var(--surface2); }
.listing-card .noimg { display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.lc-title { font-size: .9rem; font-weight: 600; }
.lc-price { color: var(--brand); font-weight: 700; }
.listing-card.sold .lc-price { color: var(--muted); }
.lc-shop { color: var(--muted); font-size: .78rem; }
.muted-grid .listing-card { opacity: .6; }
.empty { color: var(--muted); padding: 24px 0; }

.sort-bar { display: flex; gap: 12px; margin: 10px 0; }
.sort-bar a { padding: 6px 12px; border-radius: var(--radius); background: var(--surface2); color: var(--muted); font-size: .85rem; }
.sort-bar a.active { background: var(--brand); color: #fff; }

.pager { display: flex; align-items: center; gap: 16px; justify-content: center; margin: 24px 0; color: var(--muted); }
.pager a { color: var(--brand); font-weight: 600; }

.listing-detail { display: grid; grid-template-columns: 320px 1fr; gap: 28px; margin: 20px 0; align-items: start; }
.ld-image img { width: 100%; border-radius: var(--radius); position: sticky; top: 84px; }
.noimg-big { display: flex; align-items: center; justify-content: center; font-size: 4rem; height: 320px; background: var(--surface); border-radius: var(--radius); position: sticky; top: 84px; }
.ld-info h1 { margin-top: 0; }
.ld-info .price { font-size: 1.8rem; font-weight: 800; color: var(--brand); }
.ld-info .condition { color: #e8a33d; }
.sold-badge { display: inline-block; background: var(--surface2); color: var(--muted); padding: 4px 12px; border-radius: 20px; font-weight: 700; }
.btn-buy { display: inline-block; padding: 12px 24px; border-radius: var(--radius); margin: 10px 0; font-size: 1rem; }
.updated { color: var(--muted); font-size: .8rem; }

.ld-details { margin-top: 32px; display: flex; flex-direction: column; gap: 16px; }
.ld-details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ld-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; }
.ld-card h2 { margin: 0 0 12px; font-size: 1.05rem; }
.description { color: var(--muted); line-height: 1.6; margin: 0; }
.code-list, .fitment-list { list-style: none; padding: 0; margin: 0; }
.code-list li, .fitment-list li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.code-list li:last-child, .fitment-list li:last-child { border-bottom: none; }
.code-list .kind { color: var(--muted); font-size: .8rem; }

@media (max-width: 720px) {
  .listing-detail { grid-template-columns: 1fr; }
  .ld-image img, .noimg-big { position: static; }
  .ld-details-grid { grid-template-columns: 1fr; }
}

#fit-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .8rem; font-weight: 700; margin-left: 8px; }
#fit-badge.exact { background: var(--ok); color: #06210f; }
#fit-badge.maybe { background: #e8a33d; color: #241900; }
#fit-badge.no { background: var(--surface2); color: var(--muted); }

.site-footer { border-top: 1px solid var(--border); margin-top: 48px; padding: 28px 0; color: var(--muted); font-size: .85rem; }

@media (prefers-color-scheme: light) {
  :root { --bg:#f7f7f9; --surface:#fff; --surface2:#f0f1f4; --border:#e2e4ea; --text:#1a1c22; --muted:#6b7280; }
}
