/* EVEREST AUTO — стили витрины */

:root {
  --bg: #f2f4f7;
  --surface: #ffffff;
  --ink: #0d1726;
  --ink-2: #4b5567;
  --ink-3: #7a8494;
  --line: #e1e5eb;
  --navy: #0d1726;
  --navy-2: #1a2638;
  --ice: #8cc4ff;
  --blue: #1d4ed8;
  --wa: #15803d;
  --wa-hover: #116b33;
  --ok-bg: #e7f6ec;
  --ok-ink: #14632f;
  --way-bg: #fdf1d8;
  --way-ink: #8a4b06;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(13, 23, 38, .04), 0 8px 24px rgba(13, 23, 38, .06);
  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

svg { width: 18px; height: 18px; flex: 0 0 auto; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- шапка ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(13, 23, 38, .96);
  color: #fff;
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--navy-2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
  color: var(--ice);
}

.brand-mark svg { width: 26px; height: 26px; }

.brand-copy { display: grid; min-width: 0; line-height: 1.1; }

.brand-copy strong {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .04em;
  white-space: nowrap;
}

.brand-copy span {
  margin-top: 3px;
  color: rgba(255, 255, 255, .6);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.top-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
  color: #fff;
  transition: background .2s;
}

.icon-btn:hover { background: rgba(255, 255, 255, .08); }

/* ---------- кнопка WhatsApp ---------- */

.wa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  background: var(--wa);
  color: #fff;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
  transition: background .2s, transform .2s;
}

.wa-btn:hover { background: var(--wa-hover); }
.wa-btn:active { transform: scale(.98); }

.wa-btn--pill {
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 14px;
}

.wa-btn--big {
  min-height: 52px;
  padding: 0 22px;
  font-size: 16px;
}

/* ---------- контент ---------- */

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  padding-bottom: max(40px, env(safe-area-inset-bottom));
}

.intro { display: grid; gap: 10px; }

.kicker {
  color: var(--blue);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.intro h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.05;
  letter-spacing: -.03em;
}

.lead {
  max-width: 56ch;
  margin: 0;
  color: var(--ink-2);
  font-size: 15px;
}

body.from-ad .lead { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.chip svg { width: 15px; height: 15px; color: var(--ink-3); }
a.chip:hover { color: var(--ink); }

/* ---------- гарантия и подарки ---------- */

.perks {
  display: grid;
  margin-top: 18px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.perks[hidden] { display: none; }

.perk {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
}

.perk + .perk { box-shadow: inset 0 1px 0 var(--line); }

.perk-ic {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--ok-bg);
  color: var(--ok-ink);
}

.perk-ic svg { width: 20px; height: 20px; }

.perk-txt { display: grid; min-width: 0; line-height: 1.3; }
.perk-txt strong { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.perk-txt span { font-size: 15px; font-weight: 650; color: var(--ink); }

/* ---------- фильтр по марке ---------- */

.filters {
  display: flex;
  gap: 8px;
  margin: 22px -16px 0;
  padding: 0 16px 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar { display: none; }
.filters:empty { display: none; }

.filter {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}

.filter small { margin-left: 4px; color: var(--ink-3); font-size: 12px; }
.filter[aria-selected="true"] { background: var(--navy); box-shadow: none; color: #fff; }
.filter[aria-selected="true"] small { color: rgba(255, 255, 255, .6); }

/* ---------- сетка и карточки ---------- */

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 16px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  container-type: inline-size;
}

.card[hidden] { display: none; }

.card.is-ad {
  box-shadow: 0 0 0 2px var(--blue), 0 12px 32px rgba(29, 78, 216, .18);
}

.photo {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #1a1d24;
}

.track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.track::-webkit-scrollbar { display: none; }

.slide {
  flex: 0 0 100%;
  height: 100%;
  scroll-snap-align: start;
}

.slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge {
  position: absolute;
  top: 10px;
  z-index: 2;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.badge--status { left: 10px; background: var(--ok-bg); color: var(--ok-ink); }
.badge--status.is-way { background: var(--way-bg); color: var(--way-ink); }
.badge--ad { right: 10px; background: var(--blue); color: #fff; }

.arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: none;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(13, 23, 38, .55);
  color: #fff;
  cursor: pointer;
  transform: translateY(-50%);
}

.arrow:hover { background: rgba(13, 23, 38, .8); }
.arrow:disabled { opacity: .3; pointer-events: none; }
.arrow--prev { left: 8px; }
.arrow--next { right: 8px; }

@media (hover: hover) and (pointer: fine) {
  .photo:hover .arrow { display: grid; }
}

.dots {
  position: absolute;
  bottom: 9px;
  left: 50%;
  z-index: 2;
  display: flex;
  gap: 5px;
  padding: 5px 7px;
  border-radius: 999px;
  background: rgba(13, 23, 38, .38);
  transform: translateX(-50%);
}

.dot {
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .5);
  cursor: pointer;
  transition: background .2s, transform .2s;
}

.dot.is-on { background: #fff; transform: scale(1.35); }

.body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 14px 16px 16px;
}

.car-brand {
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.car-model {
  margin: 2px 0 0;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -.02em;
}

.car-engine { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }

.car-perk {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 0;
  color: var(--ok-ink);
  font-size: 13px;
  font-weight: 650;
}

.car-perk svg { width: 16px; height: 16px; }

.photo-note {
  margin: 14px 0 0;
  color: var(--ink-3);
  font-size: 12px;
  text-align: center;
}

.price { margin-top: auto; padding-top: 14px; }

.price small { display: block; color: var(--ink-3); font-size: 12px; font-weight: 600; }

.price strong {
  display: block;
  margin-top: 1px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

.price strong.is-ask { font-size: 18px; }

.actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 8px;
  margin-top: 12px;
}

.actions .wa-btn { min-width: 0; min-height: 48px; padding: 0 14px; overflow: hidden; font-size: 15px; }
.wa-short { display: none; }

@container (max-width: 340px) {
  .wa-full { display: none; }
  .wa-short { display: inline; }
}

.call {
  display: grid;
  place-items: center;
  min-height: 48px;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  transition: background .2s;
}

.call:hover { background: var(--bg); }

.empty, .noscript {
  grid-column: 1 / -1;
  margin: 0;
  padding: 28px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-2);
  text-align: center;
}

/* ---------- блок «не нашли» ---------- */

.contact {
  display: grid;
  gap: 16px;
  margin-top: 28px;
  padding: 22px 20px;
  border-radius: var(--radius);
  background: var(--navy);
  color: #fff;
}

.contact h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.contact p { margin: 6px 0 0; color: rgba(255, 255, 255, .72); }
.contact .contact-who { color: rgba(255, 255, 255, .9); font-weight: 600; }
.contact .contact-who a { text-decoration: none; white-space: nowrap; }

/* ---------- трейд-ин ---------- */

.tradein {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px 14px;
  align-items: start;
  margin-top: 28px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.tradein[hidden] { display: none; }
.tradein-ic {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--ok-bg);
  color: var(--ok-ink);
}
.tradein-ic svg { width: 22px; height: 22px; }
.tradein h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.tradein p { margin: 6px 0 0; color: var(--ink-2); }
.tradein .wa-btn { grid-column: 1 / -1; }

/* ---------- подвал ---------- */

.foot { margin-top: 24px; padding: 0 4px; }

.foot p { margin: 0 0 8px; color: var(--ink-3); font-size: 12px; line-height: 1.5; }
.foot p:first-child { color: var(--ink-2); font-size: 13px; }

/* ---------- ширина ---------- */

@media (max-width: 360px) {
  .wa-btn--pill span { display: none; }
  .wa-btn--pill { width: 40px; padding: 0; }
}

@media (min-width: 640px) {
  .top { padding: 12px 24px; }
  .wrap { padding: 32px 24px 56px; }
  .intro h1 { font-size: 42px; }
  .filters { margin: 26px 0 0; padding: 0; }
  .perks { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 22px; }
  .perk { padding: 16px 18px; }
  .perk + .perk { box-shadow: inset 1px 0 0 var(--line); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .contact { grid-template-columns: 1fr auto; align-items: center; padding: 28px; }
  .tradein { grid-template-columns: auto 1fr auto; align-items: center; padding: 24px 28px; }
  .tradein .wa-btn { grid-column: auto; }
}

@media (min-width: 980px) {
  .top { padding: 14px 32px; }
  .intro h1 { font-size: 52px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
