:root {
  --bg: #f4f6fa;
  --card: #fff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e3e8ef;
  --accent: #0b5fff;
  --accent-ink: #fff;
  --accent-soft: #e8efff;
  --great: #08844a;
  --good: #2b9c55;
  --fair: #64748b;
  --high: #c2410c;
  --r: 16px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 24px rgba(15, 23, 42, .06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(26px, 4vw, 44px); font-weight: 800; }
h2 { font-size: 22px; font-weight: 750; }
h3 { font-size: 17px; font-weight: 700; }
.muted { color: var(--muted); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.num { font-variant-numeric: tabular-nums; }

/* шапка */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar__in { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 850; font-size: 20px; letter-spacing: .02em; }
.logo__mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 17px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.nav a:hover { color: var(--ink); background: var(--bg); }
.nav a.on { color: var(--accent); background: var(--accent-soft); }
.count:empty { display: none; }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 2px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 12px; }
.cur { display: flex; background: var(--bg); border-radius: 10px; padding: 3px; }
.cur button { border: 0; background: none; padding: 5px 12px; border-radius: 8px; cursor: pointer; font-weight: 700; color: var(--muted); }
.cur button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

main { min-height: 70vh; padding-bottom: 60px; }

/* кнопки, поля */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: #fff; padding: 10px 16px; border-radius: 12px; cursor: pointer; font-weight: 650; transition: .15s; }
.btn:hover { border-color: #c5cfdd; }
.btn--main { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--main:hover { background: #0047d6; border-color: #0047d6; }
.btn--big { padding: 14px 22px; font-size: 16px; border-radius: 14px; }
.btn--block { width: 100%; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--accent); }
.field { display: grid; gap: 6px; }
.field[hidden] { display: none; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 11px; padding: 10px 12px; outline: none; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: #fff; padding: 7px 13px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 14px; user-select: none; }
.chip.on, .chip:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip input { display: none; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }
.pad { padding: 20px; }
.section { margin-top: 44px; }
.section__head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }

/* главная */
.hero { margin-top: 24px; border-radius: 24px; padding: clamp(24px, 5vw, 56px); color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(1200px 400px at 90% -10%, #4f8bff 0%, transparent 60%), linear-gradient(135deg, #0a2a7a, #0b5fff); }
.hero p { font-size: 18px; opacity: .9; margin: 12px 0 24px; max-width: 620px; }
.hero__car { position: absolute; right: -40px; bottom: -10px; width: 520px; opacity: .95; pointer-events: none; }
.smart { display: flex; gap: 8px; background: #fff; padding: 8px; border-radius: 16px; max-width: 760px; position: relative; z-index: 1; }
.smart input { flex: 1; border: 0; outline: none; padding: 10px 12px; font-size: 17px; color: var(--ink); min-width: 0; }
.smart__hint { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; position: relative; z-index: 1; }
.smart__hint button { border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12); color: #fff; padding: 6px 12px; border-radius: 999px; cursor: pointer; font-size: 14px; }
.smart__hint button:hover { background: rgba(255,255,255,.22); }
.understood { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; position: relative; z-index: 1; font-size: 14px; }
.understood span { background: rgba(255,255,255,.18); padding: 3px 10px; border-radius: 8px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tile { padding: 16px; border-radius: var(--r); background: #fff; box-shadow: var(--shadow); display: grid; gap: 4px; transition: .15s; }
.tile:hover { transform: translateY(-2px); }
.tile b { font-size: 16px; }
.tile__ico { font-size: 26px; }
.trust { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.trust > div { padding: 20px; }
.trust b { display: block; font-size: 16px; margin: 6px 0 4px; }
.promo { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px; background: linear-gradient(120deg, #fff 40%, #eaf0ff); }

/* карточки машин */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 16px; }
.car { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; position: relative; transition: .15s; }
.car:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(15,23,42,.06), 0 14px 34px rgba(15,23,42,.1); }
.car__img { aspect-ratio: 16 / 10; background: linear-gradient(180deg, #eef2f8, #dfe6f1); display: grid; place-items: center; position: relative; }
.car__img svg { width: 92%; }
.car__badges { position: absolute; left: 10px; top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.car__tools { position: absolute; right: 8px; top: 8px; display: flex; gap: 6px; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); cursor: pointer; display: grid; place-items: center; font-size: 17px; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.icon-btn.on { color: #e11d48; }
.icon-btn.cmp.on { color: var(--accent); }
.car__body { padding: 14px 16px 16px; display: grid; gap: 4px; }
.car__title { font-weight: 700; font-size: 16px; }
.car__price { font-size: 21px; font-weight: 800; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.car__old { font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: line-through; }
.car__month { font-size: 13px; color: var(--muted); }
.car__specs { font-size: 13.5px; color: var(--muted); }
.car__foot { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 7px; background: #fff; }
.badge--great { background: var(--great); color: #fff; }
.badge--good { background: #dcf3e4; color: var(--great); }
.badge--fair { background: #eef1f5; color: var(--fair); }
.badge--high { background: #fde9df; color: var(--high); }
.badge--drop { background: #fff3cd; color: #8a5a00; }
.badge--ok { background: var(--accent-soft); color: var(--accent); }
.verified { color: var(--great); font-weight: 600; }

/* каталог */
.catalog { display: grid; grid-template-columns: 290px 1fr; gap: 20px; margin-top: 24px; align-items: start; }
.filters { position: sticky; top: 80px; max-height: calc(100vh - 96px); overflow: auto; padding: 18px; display: grid; gap: 16px; }
.filters h3 { display: flex; justify-content: space-between; align-items: center; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.results__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.results__bar .input { width: auto; }
.active-f { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.active-f button { border: 0; background: var(--accent-soft); color: var(--accent); padding: 5px 10px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px; }
.empty { padding: 48px 20px; text-align: center; }
.filters-toggle { display: none; }

/* страница машины */
.crumbs { margin: 20px 0 12px; font-size: 14px; color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.detail { display: grid; grid-template-columns: 1fr 380px; gap: 20px; align-items: start; }
.gallery__main { aspect-ratio: 16 / 9; border-radius: var(--r); background: linear-gradient(180deg, #eef2f8, #d9e1ee); display: grid; place-items: center; overflow: hidden; }
.gallery__main svg { width: 86%; }
.gallery__thumbs { display: flex; gap: 8px; margin-top: 8px; }
.gallery__thumbs button { flex: 1; max-width: 140px; aspect-ratio: 16/10; border-radius: 12px; border: 2px solid transparent; background: #e6ebf3; cursor: pointer; padding: 4px; }
.gallery__thumbs button.on { border-color: var(--accent); }
.gallery__thumbs svg { width: 100%; height: 100%; }
.side { position: sticky; top: 80px; display: grid; gap: 14px; }
.price-big { font-size: 34px; font-weight: 850; }
.specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1px; background: var(--line); border-radius: 12px; overflow: hidden; }
.specs > div { background: #fff; padding: 12px 14px; }
.specs span { display: block; font-size: 12.5px; color: var(--muted); }
.specs b { font-weight: 650; }
.blocks { display: grid; gap: 16px; margin-top: 16px; }
.report { display: grid; gap: 2px; }
.report > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.report > div:last-child { border: 0; }
.ok { color: var(--great); font-weight: 650; }
.warn { color: var(--high); font-weight: 650; }
.hist { display: grid; gap: 6px; }
.hist > div { display: flex; justify-content: space-between; }
.calc { display: grid; gap: 14px; }
.calc input[type=range] { width: 100%; accent-color: var(--accent); }
.calc__out { display: flex; justify-content: space-between; align-items: baseline; padding: 14px; border-radius: 12px; background: var(--accent-soft); }
.calc__out b { font-size: 24px; color: var(--accent); }
.seller { display: flex; gap: 12px; align-items: center; }
.avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 18px; flex: none; }
.mobile-bar { display: none; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* сравнение */
.cmp-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.cmp-table th, .cmp-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.cmp-table th { width: 180px; color: var(--muted); font-weight: 600; font-size: 14px; }
.cmp-table td.best { background: #e9f8ef; font-weight: 700; color: var(--great); }
.cmp-table .car__img { border-radius: 12px; }
.scroll-x { overflow-x: auto; }

/* листать */
.swipe { max-width: 480px; margin: 24px auto 0; text-align: center; }
.deck { position: relative; height: 520px; margin-top: 16px; }
.deck .car { position: absolute; inset: 0; cursor: grab; touch-action: none; user-select: none; transition: transform .3s, opacity .3s; text-align: left; }
.deck .car:hover { transform: none; }
.deck .car.dragging { transition: none; cursor: grabbing; }
.deck .car__img { aspect-ratio: auto; height: 300px; }
.deck .stamp { position: absolute; top: 24px; padding: 6px 14px; border: 3px solid; border-radius: 10px; font-weight: 900; font-size: 22px; opacity: 0; transform: rotate(-12deg); }
.stamp--yes { left: 20px; color: var(--great); }
.stamp--no { right: 20px; color: #e11d48; transform: rotate(12deg) !important; }
.swipe__btns { display: flex; justify-content: center; gap: 22px; margin-top: 18px; }
.swipe__btns button { width: 66px; height: 66px; border-radius: 50%; border: 0; background: #fff; box-shadow: var(--shadow); font-size: 28px; cursor: pointer; }

/* продать */
.sell { display: grid; grid-template-columns: 1fr 360px; gap: 20px; margin-top: 24px; align-items: start; }
.form { display: grid; gap: 14px; }
.estimate { text-align: center; }
.estimate .price-big { color: var(--accent); }
.bar { height: 10px; border-radius: 6px; background: linear-gradient(90deg, var(--great), #a7d8b8 45%, #e5e7eb 55%, #f6b48f); position: relative; margin: 18px 0 6px; }

/* всплывашки */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; opacity: 0; pointer-events: none; transition: .25s; z-index: 100; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: grid; place-items: center; z-index: 90; padding: 20px; }
.modal[hidden] { display: none; }
.modal__box { background: #fff; border-radius: 20px; padding: 24px; width: min(440px, 100%); display: grid; gap: 14px; }

/* телефон */
@media (max-width: 1150px) { .hero__car { display: none; } }
@media (max-width: 960px) {
  .catalog, .detail, .sell { grid-template-columns: 1fr; }
  .filters { position: fixed; inset: 0; z-index: 80; max-height: none; border-radius: 0; display: none; }
  .filters.open { display: grid; align-content: start; }
  .filters-toggle { display: inline-flex; }
  .side { position: static; }
  .hero__car { display: none; }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .mobile-bar { display: flex; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); z-index: 55; }
  .mobile-bar .btn { flex: 1; }
}

.footer { border-top: 1px solid var(--line); background: #fff; }
.footer__in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 20px; font-size: 14px; }

/* каталог: «Всё / Машины / Мотоциклы» и «Все / Новые / С пробегом» в одну строку */
.tabs-row { display: flex; flex-wrap: wrap; gap: 8px 12px; }
