/* «Подойдёт ли автомобиль» (Part CCCLVIII) — /drivers/cars.
 *
 * Built on mv.css tokens (--fg, --grey, --line, --green, …), so light and dark
 * follow the site switch with no extra blocks. One loud element: the year ruler.
 * Everything else stays in the site's black-and-grey register.
 */

.page-drivers_cars {
  --cf-track: var(--line);
  --cf-lvl-1: #8fd3ae;
  --cf-lvl-2: #3fbc78;
  --cf-lvl-3: var(--green);
  --cf-lvl-1: color-mix(in srgb, var(--green) 38%, var(--line));
  --cf-lvl-2: color-mix(in srgb, var(--green) 70%, var(--line));
}

/* ── Hero: intro left, finder right ─────────────────────────────────────── */
@media (min-width: 900px) {
  .page-drivers_cars .page-hero--split .page-hero__grid { grid-template-columns: 5fr 6fr; align-items: start; gap: 56px; }
  .page-drivers_cars .page-hero__main { padding-top: 24px; }
}
.page-drivers_cars .page-hero__aside { min-width: 0; }

.cf-card {
  position: relative;
  display: flex; flex-direction: column; gap: 18px;
  padding: 20px; border-radius: 20px;
  background: var(--grey);
}
@media (min-width: 640px) { .cf-card { padding: 28px; } }

/* City switch: a segmented control, the site's only use of one */
.cf-cities { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--grey-2); overflow-x: auto; scrollbar-width: none; }
.cf-cities::-webkit-scrollbar { display: none; }
.cf-city {
  flex: 1 0 auto; min-height: 40px; padding: 0 16px; border: 0; border-radius: 9px;
  background: transparent; color: var(--text-2); font: inherit; font-weight: 500; cursor: pointer;
  transition: background-color .15s, color .15s;
}
.cf-city:hover { color: var(--fg); }
.cf-city[aria-checked="true"] { background: var(--card); color: var(--fg); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.cf-city:focus-visible { outline: 2px solid var(--fg); outline-offset: 1px; }

/* Inputs */
/* Car and year always share one row; bottom-aligned so a label that wraps
   («Թողարկման տարի» on a phone) never pushes its box below the other. */
.cf-inputs { display: grid; grid-template-columns: minmax(0, 1fr) 112px; gap: 10px; align-items: end; }
@media (min-width: 520px) { .cf-inputs { grid-template-columns: minmax(0, 1fr) 148px; gap: 12px; } }
.cf-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cf-label { font-size: .9rem; font-weight: 500; }
.cf-input {
  width: 100%; min-height: 52px; padding: 12px 14px;
  border: 1px solid var(--input-border); border-radius: 10px;
  background: var(--input-bg); color: var(--fg); font: inherit; font-size: 1.05rem;
  transition: border-color .15s;
}
.cf-input:hover { border-color: var(--input-border-hover); }
.cf-input:focus { outline: none; border-color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
.cf-input::placeholder { color: var(--text-3); }
.cf-input:disabled { opacity: .55; }
.cf-select { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 19px) 52%, calc(100% - 14px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }

.cf-combo { position: relative; }
.cf-combo .cf-input { padding-left: 44px; padding-right: 44px; }
.cf-combo__icon { position: absolute; left: 15px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%);
  fill: none; stroke: var(--text-3); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.cf-combo__clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-2); cursor: pointer; }
.cf-combo__clear:hover { background: var(--grey); color: var(--fg); }
.cf-combo__clear svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.cf-combo__clear[hidden] { display: none; }

.cf-options {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px);
  max-height: min(360px, 60vh); overflow-y: auto; margin: 0; padding: 6px; list-style: none;
  border-radius: 12px; background: var(--card); box-shadow: 0 0 0 1px var(--line), var(--shadow);
}
.cf-option { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.cf-option[aria-selected="true"], .cf-option:hover { background: var(--grey); }
.cf-option__name { font-weight: 600; }
.cf-option__brand { font-weight: 400; color: var(--text-2); }
.cf-option__meta { font-size: .86rem; color: var(--text-2); }
.cf-nomatch { margin: 4px 0 0; color: var(--text-2); font-size: .95rem; }
.cf-nomatch a { color: var(--fg); font-weight: 500; }
.cf-nomatch[hidden] { display: none; }

/* Before a car is chosen: the city's tariffs, quietly */
.cf-preview { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.cf-preview li { padding: 6px 12px; border-radius: 999px; background: var(--card); color: var(--text-2); font-size: .9rem; }
.cf-preview[hidden] { display: none; }
.cf-card:not(.is-ready) .cf-preview { opacity: .7; }

.cf-unavailable { margin: 0; color: var(--text-2); }

/* ── Result ─────────────────────────────────────────────────────────────── */
.cf-result { display: flex; flex-direction: column; gap: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.cf-result[hidden] { display: none; }
.cf-result__car { margin: 0; font-size: clamp(1.35rem, 2.6vw, 1.7rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.cf-result__year { color: var(--text-2); font-weight: 500; }
.cf-result__verdict { margin: 6px 0 0; color: var(--text-2); }

.cf-tariffs { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; border-radius: 12px; overflow: hidden; }
.cf-tariff { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 12px; min-height: 48px; padding: 10px 14px; background: var(--card); }
.cf-tariff__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.cf-tariff__name { font-weight: 600; }
.cf-tariff__status { font-size: .95rem; color: var(--text-2); text-align: right; }
.cf-tariff--ok .cf-tariff__dot { background: var(--green); }
.cf-tariff--ok .cf-tariff__status { color: var(--ok-fg); font-weight: 600; }
.cf-tariff--later .cf-tariff__dot { background: transparent; box-shadow: inset 0 0 0 2px var(--green); }
.cf-tariff--later .cf-tariff__status { color: var(--fg); }
.cf-tariff--no .cf-tariff__name, .cf-tariff--no .cf-tariff__status { color: var(--text-3); }

/* The year ruler — the page's one loud element */
.cf-ruler { --thumb: 30px; display: flex; flex-direction: column; gap: 6px; }
.cf-ruler__marks { position: relative; height: 70px; margin: 0 calc(var(--thumb) / 2); }
.cf-mark {
  position: absolute; bottom: 0; left: var(--p); transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding-bottom: 12px; white-space: nowrap; font-size: .8rem; line-height: 1.2; color: var(--text-3);
  transition: color .2s;
}
.cf-mark::after { content: ""; position: absolute; bottom: 0; left: 50%; width: 2px; height: 10px; margin-left: -1px; border-radius: 1px; background: currentColor; }
.cf-mark--low { bottom: auto; top: 0; transform: translate(-50%, 0); }
.cf-mark--low::after { height: 40px; bottom: auto; top: 30px; opacity: .5; }
.cf-mark__name { font-weight: 600; font-size: .86rem; }
.cf-mark.is-on { color: var(--fg); }
.cf-mark.is-on::after { background: var(--green); }
/* Edge labels stay inside the card: anchored by their tick, text grows inward */
.cf-mark--start { transform: translateX(-12px); align-items: flex-start; }
.cf-mark--start::after { left: 12px; }
.cf-mark--end { transform: translateX(calc(-100% + 12px)); align-items: flex-end; }
.cf-mark--end::after { left: auto; right: 11px; }

.cf-ruler__rail { position: relative; height: var(--thumb); }
.cf-ruler__track { position: absolute; left: calc(var(--thumb) / 2); right: calc(var(--thumb) / 2); top: 50%; height: 10px; margin-top: -5px; border-radius: 5px; }
.cf-ruler__range {
  position: absolute; inset: 0; width: 100%; height: var(--thumb); margin: 0;
  background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer;
}
.cf-ruler__range::-webkit-slider-runnable-track { height: var(--thumb); background: transparent; }
.cf-ruler__range::-moz-range-track { height: var(--thumb); background: transparent; }
.cf-ruler__range::-webkit-slider-thumb {
  -webkit-appearance: none; width: var(--thumb); height: var(--thumb); border-radius: 50%;
  background: var(--fg); border: 4px solid var(--grey); box-shadow: 0 0 0 1px var(--line-strong), 0 2px 8px rgba(0, 0, 0, .25);
  transition: transform .15s;
}
.cf-ruler__range::-moz-range-thumb {
  width: var(--thumb); height: var(--thumb); box-sizing: border-box; border-radius: 50%;
  background: var(--fg); border: 4px solid var(--grey); box-shadow: 0 0 0 1px var(--line-strong), 0 2px 8px rgba(0, 0, 0, .25);
}
.cf-ruler__range:active::-webkit-slider-thumb { transform: scale(1.1); }
.cf-ruler__range:focus { outline: none; }
.cf-ruler__range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--fg); }
.cf-ruler__range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--fg); }
.cf-ruler.is-idle .cf-ruler__range::-webkit-slider-thumb { background: var(--card); border-color: var(--fg); }
.cf-ruler.is-idle .cf-ruler__range::-moz-range-thumb { background: var(--card); border-color: var(--fg); }
.cf-ruler__ends { display: flex; justify-content: space-between; padding: 0 calc(var(--thumb) / 2 - 12px); font-size: .8rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.cf-ruler__hint { margin: 2px 0 0; font-size: .86rem; color: var(--text-2); }

.cf-result__actions { display: flex; flex-wrap: wrap; gap: 10px; }

@media (prefers-reduced-motion: reduce) {
  .cf-mark, .cf-city, .cf-ruler__range::-webkit-slider-thumb { transition: none; }
}

/* ── Rules: the site's .points, nothing new ─────────────────────────────── */

/* ── Full list ──────────────────────────────────────────────────────────── */
.cf-list__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 32px; margin-bottom: 24px; }
.cf-list__head .section-title { margin-bottom: 12px; }
.cf-list__title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; max-width: none; }
.cf-list__city { font-size: 1rem; font-weight: 500; letter-spacing: 0; padding: 4px 12px; border-radius: 999px; background: var(--grey); color: var(--text-2); }
.cf-list__head .section-lead { margin: 0; }
.cf-any-note { margin: 10px 0 0; color: var(--text-2); }
.cf-any-note[hidden] { display: none; }
.cf-updated { margin: 0; font-size: .9rem; color: var(--text-3); }

.cf-list__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 14px; }
.cf-search { flex: 1 1 320px; max-width: 520px; }
.cf-search .cf-input { padding-right: 14px; }
.cf-count { margin: 0; color: var(--text-2); font-variant-numeric: tabular-nums; }

.cf-letters {
  position: sticky; top: calc(var(--header-h) + 1px); z-index: 3;
  display: flex; gap: 2px; margin: 0; padding: 8px 0;
  overflow-x: auto; scrollbar-width: none; background: var(--bg); border-bottom: 1px solid var(--line);
}
.cf-letters::-webkit-scrollbar { display: none; }
.cf-letters a {
  flex: 0 0 auto; display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 6px;
  border-radius: 8px; color: var(--fg); font-weight: 600; font-size: .92rem; text-decoration: none;
}
.cf-letters a:hover { background: var(--grey); }
.cf-letters a.is-off { color: var(--text-3); opacity: .45; pointer-events: none; }
.cf-letters a:focus-visible { outline: 2px solid var(--fg); outline-offset: -2px; }

/* clip, not auto: an overflow:auto wrapper becomes the sticky header's scroll box
   and shoves the header down by its own top offset. */
.cf-table-wrap { overflow-x: clip; }
.cf-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.cf-table thead th {
  position: sticky; top: calc(var(--header-h) + 52px); z-index: 2;
  padding: 12px 12px; background: var(--bg); text-align: left; font-size: .88rem; font-weight: 600; color: var(--text-2);
  border-bottom: 1px solid var(--line);
}
.cf-table thead th:not(:first-child), .cf-table td { text-align: right; }
.cf-table td, .cf-table tbody th { padding: 0 12px; height: 48px; border-bottom: 1px solid var(--line); }
.cf-table td { white-space: nowrap; }
.cf-table td.is-no { color: var(--text-3); }
.cf-table tbody th { text-align: left; font-weight: 400; }
.cf-table tr[hidden] { display: none; }
.cf-brand th {
  height: auto !important; padding: 28px 12px 8px !important; text-align: left;
  font-size: 1.15rem; font-weight: 700 !important; letter-spacing: -.01em; border-bottom: 1px solid var(--line-strong) !important;
  scroll-margin-top: calc(var(--header-h) + 100px);
}
/* Letter anchors sit on the row: land below the header, letter bar and column heads */
.cf-brand { scroll-margin-top: calc(var(--header-h) + 100px); }
.cf-row {
  padding: 0; border: 0; background: none; color: var(--fg); font: inherit; text-align: left; cursor: pointer;
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: text-decoration-color .15s;
}
.cf-row:hover, .cf-row:focus-visible { text-decoration-color: currentColor; }
.cf-row:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 4px; }
.cf-table tbody tr:not(.cf-brand):hover { background: var(--grey); }
.cf-empty { padding: 32px 0; color: var(--text-2); }
.cf-empty[hidden] { display: none; }
.cf-empty a { color: var(--fg); font-weight: 500; }

/* Phones: the wrapper clips (it must, for the sticky heads), so the table has
   to fit — fixed layout, model names wrap, year cells stay compact. */
@media (max-width: 639px) {
  .cf-table { table-layout: fixed; }
  .cf-table thead th { top: calc(var(--header-h) + 52px); padding: 10px 6px; font-size: .78rem; overflow-wrap: anywhere; }
  .cf-table thead th:first-child { width: 34%; }
  .cf-table td, .cf-table tbody th { padding: 6px; height: auto; min-height: 44px; font-size: .88rem; }
  .cf-table td { white-space: normal; }
  .cf-table tbody th { overflow-wrap: anywhere; }
  .cf-row { min-height: 32px; }
}

/* ── CTA band ───────────────────────────────────────────────────────────── */
.cf-cta__inner { display: grid; gap: 24px; align-items: end; }
.cf-cta .section-title { margin-bottom: 12px; }
.cf-cta .section-lead { margin: 0; }
@media (min-width: 900px) { .cf-cta__inner { grid-template-columns: 1fr auto; gap: 48px; } }

/* The site's grey button vanishes on the grey card */
.cf-card .btn--grey { background: var(--card); }
.cf-card .btn--grey:hover { background: var(--grey-2); }
