:root {
  --bg: #F8F6F2;
  --bg-alt: #EFE9E0;
  --card: #F6E6DA;
  --ink: #1F1D1B;
  --muted: #6B645D;
  --line: #DDD3C5;
  --accent: #C2410C;
  --accent-ink: #FFFFFF;
  --green: #1E5A4F;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 "Onest", system-ui, sans-serif;
}
h1, h2 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 16px; }
h1 { font-size: clamp(32px, 4.6vw, 52px); font-weight: 800; }
h2 { font-size: clamp(26px, 3vw, 36px); font-weight: 700; }
p { margin: 0 0 12px; }
a { color: inherit; }
.muted { color: var(--muted); }
.container { max-width: 1160px; margin: 0 auto; padding: 0 16px; }

.proto {
  background: var(--ink);
  color: #EDE6DC;
  font-size: 13px;
  text-align: center;
  padding: 6px 16px;
}

/* Шапка */
.header { position: sticky; top: 0; z-index: 10; background: rgba(248, 246, 242, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header__inner { display: flex; align-items: center; gap: 32px; height: 64px; }
.logo { font-weight: 800; font-size: 24px; text-decoration: none; letter-spacing: -0.03em; }
.logo span { color: var(--accent); }
.logo_sm { font-size: 18px; }
.nav { display: flex; gap: 24px; margin-right: auto; }
.nav a { text-decoration: none; color: var(--muted); font-weight: 500; }
.nav a:hover { color: var(--ink); }

.langs { position: relative; }
.langs summary { list-style: none; cursor: pointer; font-weight: 600; padding: 8px 10px; border-radius: 8px; }
.langs summary::-webkit-details-marker { display: none; }
.langs summary::after { content: "▾"; margin-left: 4px; font-size: 12px; }
.langs summary:hover { background: var(--bg-alt); }
.langs ul {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 160px;
  list-style: none; margin: 0; padding: 6px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(31, 29, 27, .08);
}
.langs a { display: block; padding: 8px 10px; border-radius: 6px; text-decoration: none; }
.langs a:hover { background: var(--bg-alt); }
.langs a[aria-current] { font-weight: 600; color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 10px; padding: 14px 22px;
  font-family: inherit; font-weight: 600; font-size: 16px; line-height: 1; text-decoration: none; cursor: pointer;
}
.btn_primary { background: var(--accent); color: var(--accent-ink); }
.btn_primary:hover { background: #A8380A; }
.btn_ghost { border: 1.5px solid var(--ink); background: transparent; }
.btn_sm { padding: 10px 16px; font-size: 15px; }

/* Первый экран */
.hero { padding: 56px 0 72px; }
.hero__grid { display: grid; grid-template-columns: 1fr 440px; gap: 48px; align-items: start; }
.lead { font-size: 19px; color: var(--muted); max-width: 520px; }
.hero__art { position: relative; width: 100%; max-width: 520px; margin: 32px 0 0; }
.hero__art img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); }
.hero__art #carArt { aspect-ratio: auto; }
.hero__art img[hidden], .hero__art figcaption[hidden] { display: none; }
.hero__art figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between; align-items: flex-end; gap: 12px;
  padding: 40px 16px 12px; border-radius: 0 0 var(--radius) var(--radius);
  background: linear-gradient(transparent, rgba(20, 18, 16, .75)); color: #fff;
}
.hero__art figcaption b { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.hero__art figcaption a { font-size: 11px; opacity: .75; text-decoration: none; text-align: right; }
.hero__art figcaption a:hover { opacity: 1; text-decoration: underline; }

/* Калькулятор */
.calc { background: var(--card); border-radius: var(--radius); padding: 24px; display: grid; gap: 16px; }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--bg); border-radius: 10px; padding: 4px; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; text-align: center; padding: 10px 4px; border-radius: 8px; font-weight: 600; font-size: 15px; cursor: pointer; color: var(--muted); }
.seg input:checked + span { background: var(--ink); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }

.row { display: flex; flex-wrap: wrap; gap: 12px; }
.row > .field { flex: 1 1 110px; }
.field_grow { flex: 2 1 150px !important; }
.field { display: grid; gap: 6px; font-size: 14px; font-weight: 500; color: var(--muted); min-width: 0; }
.field input, .field select {
  width: 100%; font-family: inherit; font-weight: 500; font-size: 16px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px;
}
.field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.field[hidden] { display: none; }

.result { border-top: 1px solid rgba(31, 29, 27, .12); padding-top: 16px; }
.result__total { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.result__local { color: var(--muted); font-weight: 500; margin-top: 4px; }
.bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; margin: 16px 0 12px; gap: 2px; }
.bar i { display: block; min-width: 3px; }
.parts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 15px; }
.parts li { display: flex; align-items: center; gap: 8px; }
.parts b { margin-left: auto; font-weight: 600; }
.dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.result__note { font-size: 13px; color: var(--muted); margin: 12px 0 0; }

/* Секции */
.section { padding: 72px 0; }
.section_alt { background: var(--bg-alt); }
.section__head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 8px 14px; font-family: inherit; font-weight: 500; font-size: 14px; cursor: pointer; color: var(--ink); }
.chip.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }

.table-wrap { overflow-x: auto; margin-top: 16px; border-radius: var(--radius); background: var(--bg); }
.models { width: 100%; border-collapse: collapse; min-width: 880px; }
.models th, .models td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.models th { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.models tbody tr { cursor: pointer; }
.models tbody tr:hover { background: var(--card); }
.models tbody tr:last-child td { border-bottom: 0; }
.models .num { text-align: right; font-variant-numeric: tabular-nums; }
.models small { display: block; color: var(--muted); font-size: 13px; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: #DCEBE6; color: var(--green); }

.lead-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.lead-form { display: grid; gap: 14px; background: var(--card); padding: 24px; border-radius: var(--radius); }
.lead-form__done { margin: 0; font-weight: 600; color: var(--green); }

.importers { max-width: 720px; }
.faq { max-width: 760px; }
.faq details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq summary { font-weight: 600; font-size: 18px; cursor: pointer; }
.faq details p { margin: 10px 0 0; color: var(--muted); }

.footer { border-top: 1px solid var(--line); padding: 28px 0; }
.footer__inner { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; font-size: 14px; }

@media (max-width: 900px) {
  .hero__grid, .lead-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero { padding-top: 32px; }
  /* На телефоне калькулятор сразу под заголовком, иллюстрация после него */
  .hero__grid { gap: 0; }
  .hero__text { display: contents; }
  .calc { order: 1; margin-top: 12px; }
  .hero__art { order: 2; margin-top: 24px; }
  .hero__art.is-photo { order: 0; margin-top: 12px; }
  .nav { display: none; }
  .header__inner { gap: 8px; }
  .langs { margin-left: auto; }
}
/* Четыре страны в узкой колонке не помещаются в строку: две на две */
@media (max-width: 1100px) and (min-width: 901px), (max-width: 520px) {
  .seg { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 340px) {
  .row { flex-direction: column; }
  .calc, .lead-form { padding: 18px; }
}
