.lang {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.lang button {
  min-width: 46px;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--fg-2);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .03em;
  cursor: pointer;
}

.lang button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--fg);
  font-weight: 700;
  text-decoration: none;
}

.pill-btn svg { color: var(--accent); }

.eyebrow {
  align-self: flex-start;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

.search {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 380px;
}

.search label { font-size: 14px; font-weight: 700; color: var(--fg-2); }

.search input {
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: 16px;
}

.search input::placeholder { color: var(--fg-3); }

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

.chip {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}

.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
}

/* Только для мыши: на тач-экране :hover залипает после тапа. */
@media (hover: hover) {
  .card:hover { border-color: var(--line-hover); transform: translateY(-2px); }
}

.card:active { transform: scale(.985); }

.card-photo {
  display: block;
  margin: -20px -20px 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: var(--raised);
}

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

.card-photo.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--fg-3);
}

.card-head { display: flex; flex-direction: column; gap: 2px; }

.card-brand {
  font-size: 13px;
  font-weight: 700;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: .07em;
}

.card-model {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 21px;
  line-height: 1.2;
}

.card-spec { font-size: 14px; color: var(--fg-3); }

.card-price small { display: block; font-size: 13px; color: var(--fg-3); }

.card-price b {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 27px;
  color: var(--accent);
}

.card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line-card);
}

.card-local { font-size: 14px; color: var(--fg-2); }

.card-go {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: var(--r-sm);
  background: var(--raised);
  font-weight: 700;
  font-size: 15px;
}

.tag {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.tag-good { background: var(--accent-soft); color: var(--accent); }
.tag-flat { background: var(--raised); color: var(--fg-2); }
.tag-ev { background: var(--warn-soft); color: var(--warn); }

.empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 36px 24px;
  border-radius: var(--r-lg);
  background: var(--surface);
}

.empty b { font-size: 18px; }
.empty span { color: var(--fg-3); }

.steps ol {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px;
  border-radius: var(--r-lg);
  background: var(--surface);
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 30px;
  color: var(--accent);
}

.steps b { font-size: 17px; }
.steps span { font-size: 15px; color: var(--fg-3); }

/* Липкая кнопка звонка — только на мобильных, на десктопе её нет. */
.callbar { display: none; }

@media (max-width: 719px) {
  /* Квадрат при radius 999px даёт ровный круг — в тон круглой кнопке телефона.
     При разной ширине и высоте активная кнопка выглядела бы овалом. */
  .lang button {
    min-width: 42px;
    min-height: 42px;
    padding: 0 4px;
    font-size: 11px;
  }

  /* Номер в шапке не помещается — кнопка становится акцентным кругом. */
  .pill-btn {
    justify-content: center;
    width: 44px;
    min-height: 44px;
    padding: 0;
    border-color: transparent;
    background: var(--accent);
    color: var(--accent-ink);
  }

  .pill-btn svg { color: currentColor; }
  .pill-phone { display: none; }

  .eyebrow {
    padding: 0;
    border-radius: 0;
    background: none;
    font-size: 12px;
  }

  .search { max-width: none; }
  .search label { display: none; }
  .search input { min-height: 48px; }

  /* Чипы лентой вместо переноса в три строки; лента скроллится в границах
     контента, по бокам те же отступы, что у карточек. */
  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

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

  .chip {
    flex: none;
    scroll-snap-align: start;
    font-size: 14px;
  }

  .chip:active { transform: scale(.97); }

  /* minmax(0, …) обязателен в обоих местах: у `1fr` минимум — min-content,
     и длинные армянские строки растягивали бы карточку шире экрана. */
  .grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }

  /* Карточка горизонтальная: фото слева, текст справа. */
  .card {
    position: relative;
    display: grid;
    /* Доля, а не фиксированные пиксели: на 360px иначе остаётся 126px под текст
       и он переносится в каждой строке. Потолок — чтобы в ландшафте не раздувалось. */
    grid-template-columns: min(47%, 170px) minmax(0, 1fr);
    gap: 6px 12px;
    padding: 12px 28px 12px 12px;
    align-items: start;
  }

  /* Три строки справа: шапка, цена, подвал; фото занимает все, но по центру и
     со своей пропорцией 4:3 — растянутое на высоту карточки, оно обрезало бы
     машину по бокам (object-fit: cover). `-1` тут не годится: явных строк
     у сетки нет, и он схлопнулся бы в одну. */
  .card-photo,
  .card-photo.is-empty {
    grid-row: 1 / span 3;
    align-self: center;
    width: 100%;
    margin: 0;
    border-radius: var(--r-sm);
    font-size: 12px;
    text-align: center;
  }

  .card-brand { font-size: 11px; }
  .card-model { font-size: 17px; }
  .card-spec { font-size: 13px; }
  .card-price b { font-size: 22px; }

  /* «под ключ в Армении» над ценой и «в Армении ≈ …» под ней на узком экране
     дублируют друг друга и занимают четыре строки. Оставляем цену и тег выгоды —
     полное сравнение всё равно открывается в калькуляторе по тапу. */
  .card-price small,
  .card-local { display: none; }

  .card-foot {
    padding-top: 0;
    border-top: 0;
  }

  /* Длинные теги («≈ как в Армении», «льгота до 31.12») в узкую колонку
     одной строкой не влезают и распирали бы страницу. */
  .tag { white-space: normal; }

  /* Вся карточка — кнопка, поэтому вместо текста «Рассчитать» хватает шеврона. */
  .card-go { display: none; }

  .card::after {
    content: '›';
    position: absolute;
    top: 50%;
    right: 12px;
    translate: 0 -50%;
    font-size: 24px;
    line-height: 1;
    color: var(--fg-3);
  }

  .empty { padding: 24px 18px; }
  .empty .btn { width: 100%; }

  .steps li { padding: 18px; }
  .steps li::before { font-size: 24px; }
  .steps b { font-size: 16px; }
  .steps span { font-size: 14px; }

  .footer-top .cta-row { width: 100%; }
  .footer-top .btn { width: 100%; }

  .callbar {
    position: fixed;
    inset: auto 0 0;
    z-index: 15;
    display: grid;
    grid-template-columns: 1fr 56px;
    gap: 10px;
    padding: 10px max(16px, env(safe-area-inset-right, 0px))
             calc(10px + env(safe-area-inset-bottom, 0px))
             max(16px, env(safe-area-inset-left, 0px));
    background: var(--bg-blur);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    translate: 0 110%;
    visibility: hidden;
    transition: translate .2s, visibility .2s;
  }

  .callbar.is-visible {
    translate: 0 0;
    visibility: visible;
  }

  .callbar .btn { padding: 0 14px; }

  .callbar-wa {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    color: var(--fg);
  }

  .callbar-wa:active { transform: scale(.97); }
}

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  .card:hover,
  .card:active,
  .chip:active,
  .callbar-wa:active { transform: none; }
  .callbar { transition: none; }
}
