:root {
  --bg: #000;
  --text: #fff;
  --text-muted: #b3b3b3;
  --text-dim: #888;
  --line: #222;
  --red: #bf0d2a;
  --gold: #e3b341;
  --header-h: 88px;
  --panel-w: 560px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Полоса прокрутки: тонкая, тёмная, светлеет при наведении */

@supports not selector(::-webkit-scrollbar) {
  html {
    scrollbar-width: thin;
    scrollbar-color: #3a3a3a var(--bg);
  }
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

/* Прозрачная рамка оставляет от ползунка полоску в 4px */
::-webkit-scrollbar-thumb {
  background: #3a3a3a;
  background-clip: content-box;
  border: 3px solid transparent;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #777;
}

::-webkit-scrollbar-thumb:active {
  background-color: var(--red);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Шапка */

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  display: flex;
  align-items: center;
  gap: 28px;
  height: var(--header-h);
  padding: 0 40px;
  border-bottom: 1px solid var(--line);
}

/* Логотип слева, всё остальное прижато вправо */
.header__logo {
  display: block;
  margin-right: auto;
}

.header__logo .logo {
  display: block;
  overflow: visible;
}

.header__phone {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}

.header__phone:hover {
  color: var(--gold);
}

/* Под номером — Telegram менеджера, выровнен по тексту номера (иконка 32 + отступ 12) */
.header__contacts {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.header__tg {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 44px;
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}

.header__tg svg {
  fill: currentColor;
}

.header__tg:hover {
  color: var(--gold);
}

/* Соцсети: круглые кнопки, при наведении — фирменный красный.
   Сама ссылка неподвижна и стоит вплотную к соседним: поднимаются только кружок и значок.
   Иначе кнопка уезжает из-под курсора, наведение пропадает и фон мерцает */

.socials {
  display: flex;
}

.socials a {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
}

.socials a::before {
  content: "";
  position: absolute;
  inset: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  transition: background 0.25s, transform 0.25s var(--ease);
}

.socials svg {
  position: relative;
  width: 22px;
  height: 22px;
  fill: currentColor;
  transition: transform 0.25s var(--ease);
}

.socials a:hover::before {
  background: var(--red);
}

.socials a:hover::before,
.socials a:hover svg {
  transform: translateY(-2px);
}

.socials a:focus-visible {
  outline: none;
}

.socials a:focus-visible::before {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Вымпел: красный щит с драконом висит от верхнего края окна и чуть заходит на карту.
   Верх картинки спрятан над окном, чтобы при покачивании не открывался зазор */

.header__pennant {
  --pennant-w: 61px;
  position: relative;
  flex: none;
  align-self: flex-start;
  width: var(--pennant-w);
  height: var(--header-h);
  transform-origin: 50% 0;
}

.header__pennant img {
  position: absolute;
  top: calc(var(--pennant-w) * -0.16);
  left: 0;
  display: block;
  width: 100%;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.55));
}

/* Раскладка: список слева, карта справа */

.layout {
  display: grid;
  grid-template-columns: var(--panel-w) minmax(0, 1fr);
  align-items: start;
}

.panel {
  position: relative;
  z-index: 0;
  min-width: 0;
  padding: 44px 40px 0;
}

/* Дракон ROKO: неподвижный фон панели, едва светлее чёрного. Крупнее экрана и сдвинут так, чтобы была видна морда */
.panel::before {
  content: "";
  position: fixed;
  top: var(--header-h);
  left: 0;
  z-index: -1;
  width: var(--panel-w);
  height: calc(100vh - var(--header-h));
  background: url("../img/dragon.svg") no-repeat -100px -70px / auto 135vh;
  opacity: 0.07;
  pointer-events: none;
}

.panel h1 {
  margin: 0;
  font-family: "Proxima Nova", Inter, Arial, sans-serif;
  font-size: 56px;
  font-weight: 400;
  line-height: 60px;
}

.panel__summary {
  margin: 12px 0 28px;
  color: var(--text-muted);
}

.panel__summary b {
  color: var(--text);
  font-weight: 500;
}

/* Поиск */

.search {
  position: relative;
  display: flex;
  align-items: center;
  height: 52px;
  padding: 0 6px 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50px;
  transition: border-color 0.2s;
}

.search:focus-within {
  border-color: #fff;
}

.search > svg {
  flex: none;
  color: var(--text-dim);
}

.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 12px;
  background: none;
  border: 0;
  outline: 0;
}

.search input::placeholder {
  color: var(--text-dim);
  font-weight: 300;
}

.search input::-webkit-search-cancel-button {
  filter: invert(1);
  cursor: pointer;
}

.search__near {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  font-size: 14px;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.search__near:hover {
  background: rgba(255, 255, 255, 0.18);
}

.search__near.is-active {
  background: var(--red);
}

.search__near.is-loading svg {
  animation: spin 1s linear infinite;
}

/* Города */

.cities {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 20px;
}

.cities button {
  flex: none;
  padding: 8px 16px;
  border-radius: 50px;
  color: var(--text-muted);
  white-space: nowrap;
  transition: background 0.25s, color 0.25s;
}

.cities button sup {
  margin-left: 3px;
  color: var(--text-dim);
  font-size: 11px;
}

/* Наведение — как у «Рядом со мной»: светлеет подложка */
.cities button[data-city]:hover {
  background: rgba(255, 255, 255, 0.18);
  color: var(--text);
}

.cities .cities__toggle:hover {
  color: var(--text);
}

.cities .cities__toggle {
  color: var(--text);
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 5px;
}

.cities button[aria-selected="true"] {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

/* Карточка дилера */

.dealer-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 28px;
}

.dealer {
  position: relative;
  padding: 22px 24px;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s, transform 0.25s var(--ease);
  animation: card-in 0.45s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 40ms);
}

.dealer:hover,
.dealer.is-active {
  background: #0d0d0d;
  border-color: #555;
}

.dealer.is-active {
  transform: translateX(6px);
}

.dealer--exclusive {
  border-color: rgba(227, 179, 65, 0.4);
  background: linear-gradient(120deg, rgba(227, 179, 65, 0.09), transparent 55%);
}

.dealer--exclusive:hover,
.dealer--exclusive.is-active {
  border-color: var(--gold);
  background: linear-gradient(120deg, rgba(227, 179, 65, 0.16), #0d0d0d 60%);
}

.dealer__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.dealer__name {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  line-height: 26px;
  overflow-wrap: anywhere;
}

.dealer__tag {
  padding: 3px 10px;
  background: var(--line);
  border-radius: 50px;
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}

.dealer--exclusive .dealer__tag {
  background: linear-gradient(110deg, #b8821c, #fbe38a 45%, #e3b341 60%, #b8821c);
  background-size: 220% 100%;
  color: #000;
  font-weight: 600;
  animation: shimmer 4s ease-in-out infinite;
}

.dealer__distance {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 14px;
  white-space: nowrap;
}

.dealer__address {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  color: var(--text-muted);
}

.dealer__address img {
  flex: none;
  margin-top: -2px;
}

.dealer__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  margin-top: 14px;
  font-size: 15px;
}

.dealer__label {
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 300;
  line-height: 16px;
}

.dealer__hours {
  white-space: pre-line;
}

.dealer__meta a {
  display: block;
  text-decoration: none;
}

.dealer__meta a:hover {
  text-decoration: underline;
}

.dealer__meta:empty,
.dealer__actions:empty,
.popup__actions:empty {
  display: none;
}

.dealer__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50px;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.btn:hover {
  background: #fff;
  border-color: #fff;
  color: #000;
}

.btn--primary {
  background: var(--red);
  border-color: var(--red);
}

.dealers__empty {
  padding: 32px 0;
  color: var(--text-muted);
}

.dealers__empty button {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.more {
  display: block;
  width: 100%;
  height: 48px;
  margin-top: 16px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50px;
  transition: background 0.2s, color 0.2s;
}

.more:hover {
  background: #fff;
  color: #000;
}

/* display: block выше перебивает атрибут hidden — прячем явно */
.more[hidden] {
  display: none;
}

.footer {
  margin-top: 48px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 14px;
}

.footer .socials {
  margin: 0 0 16px -4px;
  color: var(--text);
}

.footer p {
  margin: 0;
}

.footer .footer__note {
  max-width: 60ch;
  margin-top: 8px;
  font-size: 12px;
  line-height: 18px;
}

/* Карта */

/* Шапка закреплена, карта занимает ровно остаток экрана под ней */
.map-section {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  height: calc(100dvh - var(--header-h));
  border-left: 1px solid var(--line);
}

.map {
  height: 100%;
  background: #e9e9e9;
}

/* Кнопка Яндекса «Открыть Яндекс Карты» наследует наш белый цвет текста и пропадает на белом фоне */
.map [class*="ymaps3--control"] {
  color: #1a1a1a;
}

.map--failed::after {
  content: "Карта временно недоступна";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #666;
}

.map-legend {
  position: absolute;
  right: 16px;
  top: 26px;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 6px 16px;
  list-style: none;
  background: rgba(0, 0, 0, 0.82);
  border-radius: 50px;
  font-size: 13px;
  pointer-events: none;
}

.map-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Кнопки масштаба */

.map-zoom {
  position: absolute;
  right: 16px;
  bottom: 44px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.map-zoom button {
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.82);
  border-radius: 50%;
  color: #fff;
  font-size: 22px;
  line-height: 40px;
  transition: background 0.2s;
}

.map-zoom button:hover {
  background: var(--red);
}

.map-to-list {
  display: none;
}

/* Метки. YMapMarker ставит левый верхний угол в координату — сдвигаем остриё капли в точку */

.pin {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -100%);
  cursor: pointer;
}

.pin__body {
  position: relative;
  transform-origin: 50% 100%;
  transition: transform 0.3s var(--ease);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4));
}

.pin__body img,
.pin__body svg {
  display: block;
}

.pin:hover .pin__body,
.pin.is-active .pin__body {
  transform: scale(1.22);
}

.pin--intro .pin__body {
  animation: pin-drop 0.6s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}

/* Подпись проявляется вместе со своей каплей, а не раньше неё.
   backwards, а не both: после анимации прозрачностью снова управляет .is-hidden */
.pin--intro .pin__city {
  animation: label-in 0.3s var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 45ms + 0.3s);
}

.pin__count {
  position: absolute;
  top: 10px;
  left: 0;
  width: 100%;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
}

/* Эксклюзивный: золотая капля, пульсирующее кольцо в точке и подпись города */

.pin--exclusive::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  animation: ring 2.4s ease-out infinite;
}

.pin__city {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 4px;
  padding: 1px 9px;
  background: #000;
  border: 1px solid var(--gold);
  border-radius: 50px;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  text-align: center;
  white-space: nowrap;
  transition: opacity 0.2s;
}

/* Обычный дилер: такая же плашка, только светлая и с серой рамкой — скромнее эксклюзивной */
.pin__city--regular {
  background: #fff;
  border-color: #9a9a9a;
  color: #000;
}

/* Название дилера — второй строкой, когда карта приближена (класс ставит app.js) */
.pin__dealer {
  display: none;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--gold);
  font-size: 11px;
  font-weight: 600;
  line-height: 15px;
}

.pin__city--regular .pin__dealer {
  color: var(--red);
}

.map--names .pin__city {
  padding: 2px 10px 3px;
  border-radius: 10px;
}

.map--names .pin__dealer {
  display: block;
}

.pin__city.is-hidden {
  opacity: 0;
}

.pin:hover .pin__city.is-hidden,
.pin.is-active .pin__city.is-hidden {
  opacity: 1;
}

.pin--me {
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  background: #2f7cf6;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(47, 124, 246, 0.25);
  cursor: default;
}

/* Попап на карте */

.popup {
  position: absolute;
  left: 0;
  top: 0;
  width: 280px;
  transform: translate(-50%, calc(-100% - var(--offset, 48px)));
  cursor: default;
}

.popup__inner {
  position: relative;
  padding: 16px 18px;
  background: #111;
  border: 1px solid #333;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 14px;
  line-height: 20px;
  transform-origin: 50% 100%;
  animation: popup-in 0.28s var(--ease) both;
}

.popup--exclusive .popup__inner {
  border-color: var(--gold);
}

.popup__inner::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  background: #111;
  border: solid #333;
  border-width: 0 1px 1px 0;
  transform: rotate(45deg);
}

.popup--exclusive .popup__inner::after {
  border-color: var(--gold);
}

.popup__tag {
  color: var(--gold);
  font-size: 12px;
  font-weight: 500;
}

.popup__name {
  padding-right: 20px;
  font-size: 16px;
  font-weight: 500;
  line-height: 22px;
}

.popup__address {
  margin-top: 4px;
  color: var(--text-muted);
}

.popup__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.popup .btn {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.popup__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  color: var(--text-dim);
  font-size: 20px;
  line-height: 28px;
}

.popup__close:hover {
  color: #fff;
}

/* Кнопка «Стать дилером» (шапка, подвал списка, форма) */

.btn-red {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 28px;
  background: var(--red);
  border-radius: 50px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.2s, transform 0.2s var(--ease);
}

.btn-red:hover {
  background: #d8193a;
}

.btn-red:active {
  transform: scale(0.97);
}

.btn-red:disabled {
  opacity: 0.6;
  cursor: progress;
}

.header__become {
  height: 40px;
  padding: 0 22px;
  font-size: 15px;
}

.footer__become {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-bottom: 28px;
  color: var(--text-muted);
  font-size: 16px;
}

/* Окно заявки. Фон — карта России, красное свечение и флаги ROKO из макета;
   слой фона прижат к низу окна, координаты внутри — как в Figma */

.become {
  width: min(856px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: auto;
  background: #292929;
  border: 0;
  color: var(--text);
  box-shadow: 0 20px 10px rgba(0, 0, 0, 0.25);
}

.become[open] {
  animation: become-in 0.4s var(--ease);
}

.become::backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  animation: become-fade 0.4s var(--ease);
}

/* Закрытие: app.js ставит класс, ждёт конца анимации и только потом закрывает окно */
.become.is-closing {
  animation: become-out 0.25s ease-in forwards;
}

.become.is-closing::backdrop {
  animation: become-fade 0.25s ease-in reverse forwards;
}

@keyframes become-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
}

@keyframes become-out {
  to {
    opacity: 0;
    transform: translateY(16px);
  }
}

@keyframes become-fade {
  from {
    opacity: 0;
  }
}

.become__bg {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 358px;
  overflow: hidden;
  pointer-events: none;
}

.become__map {
  position: absolute;
  left: 40px;
  top: -39.75px;
  width: 1023px;
  height: 604px;
  opacity: 0.1;
}

.become__map img {
  position: absolute;
  display: block;
}

.become__glow {
  position: absolute;
  left: 301px;
  top: 13px;
  display: block;
}

.become__flags {
  position: absolute;
  left: 564px;
  top: 164px;
  width: 273px;
  height: 194px;
  overflow: hidden;
}

.become__flags img {
  display: block;
  width: 100.27%;
  height: auto;
  margin-left: -0.13%;
}

/* Состояние «Спасибо»: окно ниже, фон занимает его целиком */
.become--done .become__bg {
  height: 315px;
}

.become--done .become__map {
  top: -143px;
}

.become--done .become__glow {
  top: -90.25px;
}

.become--done .become__flags {
  top: 60.75px;
  height: 254.25px;
}

.become__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: #292929;
  border-radius: 50%;
  transition: background 0.2s;
}

.become__close:hover {
  background: #3a3a3a;
}

.become__form,
.become__done {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 55px 38px 60px;
}

.become__done {
  min-height: 315px;
  padding-bottom: 55px;
}

.become__title {
  margin: 0;
  font-size: 30px;
  font-weight: 600;
  line-height: 36px;
}

.become__done .become__title {
  font-size: 36px;
  line-height: 44px;
}

.become__lead {
  max-width: 780px;
  margin: 30px 0 0;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 28px;
}

.become__done .become__lead {
  max-width: 507px;
}

.become__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  width: 100%;
  margin-top: 30px;
}

/* Поле с плавающей подписью: пустое — подсказка внутри, при вводе — подпись сверху */
.field {
  position: relative;
  display: block;
  height: 60px;
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid #888;
  border-radius: 5px;
  transition: border-color 0.2s;
}

.field--wide {
  grid-column: 1 / -1;
}

.field:focus-within {
  border-color: #ccc;
}

.field.is-invalid {
  border-color: #e0475f;
}

.field input {
  position: absolute;
  inset: 0;
  width: 100%;
  padding: 24px 13px 6px;
  background: none;
  border: 0;
  outline: none;
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
}

.field span {
  position: absolute;
  left: 13px;
  right: 13px;
  top: 17px;
  overflow: hidden;
  color: #888;
  font-size: 16px;
  font-weight: 300;
  line-height: 24px;
  white-space: nowrap;
  text-overflow: ellipsis;
  pointer-events: none;
  transition: top 0.2s var(--ease), font-size 0.2s var(--ease), color 0.2s;
}

.field input:focus + span,
.field input:not(:placeholder-shown) + span {
  top: 9px;
  color: #fff;
  font-size: 12px;
  line-height: 16px;
}

.become__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.check {
  display: flex;
  gap: 8px;
  max-width: 470px;
  margin-top: 30px;
  color: #888;
  font-size: 12px;
  line-height: 16px;
  cursor: pointer;
}

.check input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 0;
  appearance: none;
  border: 1px solid #888;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.check input:checked {
  background: var(--red) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M6 11.5l3.2 3.2L16 8' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
  border-color: var(--red);
}

.check.is-invalid input {
  border-color: #e0475f;
}

.check span {
  padding-top: 3px;
}

.become__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 30px;
}

.become__submit {
  width: 224px;
}

.become__error {
  max-width: 340px;
  margin: 0;
  color: #ff8a9b;
  font-size: 14px;
  line-height: 20px;
}

.become__error[hidden],
.become__form[hidden],
.become__done[hidden] {
  display: none;
}

/* В узкой шапке кнопке нет места — на телефоне она остаётся в подвале списка */
@media (max-width: 640px) {
  .header__become {
    display: none;
  }
}

@media (max-width: 760px) {
  .become__form,
  .become__done {
    padding: 48px 20px 40px;
  }

  .become__fields {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .become__lead br,
  .become__done .become__title br {
    display: none;
  }

  /* Флаги на узком экране наезжают на поля — оставляем карту и свечение */
  .become__flags {
    display: none;
  }

  .become__actions {
    align-self: stretch;
  }

  .become__submit {
    width: 100%;
  }
}

/* Анимации */

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@keyframes label-in {
  from {
    opacity: 0;
  }
}

@keyframes pin-drop {
  0% {
    opacity: 0;
    transform: translateY(-28px) scale(0.6);
  }
  60% {
    opacity: 1;
    transform: translateY(0) scale(1.12);
  }
  100% {
    transform: none;
  }
}

@keyframes ring {
  from {
    opacity: 0.9;
    transform: scale(0.6);
  }
  to {
    opacity: 0;
    transform: scale(3.2);
  }
}

@keyframes shimmer {
  0%,
  100% {
    background-position: 100% 0;
  }
  50% {
    background-position: 0 0;
  }
}

@keyframes popup-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.92);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Планшет и телефон: карта сверху, список под ней */

@media (max-width: 1100px) {
  :root {
    --header-h: 64px;
  }

  .header {
    gap: 12px;
    padding: 0 16px;
  }

  /* В узкой шапке соцсети не помещаются — они остаются в подвале списка */
  .header__socials {
    display: none;
  }

  .header__pennant {
    --pennant-w: 43px;
  }

  .header__logo .logo {
    width: 115px;
    height: 28px;
  }

  .header__phone {
    gap: 8px;
    font-size: 16px;
  }

  .header__phone img {
    width: 24px;
    height: 24px;
  }

  .header__tg {
    margin-left: 32px;
    font-size: 12px;
  }

  .layout {
    display: flex;
    flex-direction: column-reverse;
  }

  .header {
    position: relative;
  }

  .map-section {
    position: relative;
    top: 0;
    width: 100%;
    height: 58vh;
    min-height: 340px;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }

  .map-legend {
    right: 8px;
    top: 16px;
    gap: 12px;
    padding: 4px 12px;
    font-size: 12px;
  }

  /* На сенсорных экранах масштаб меняют щипком */
  .map-zoom {
    display: none;
  }

  .map-to-list {
    position: absolute;
    right: 8px;
    bottom: 36px;
    display: block;
    height: 32px;
    padding: 0 14px;
    background: var(--red);
    border-radius: 50px;
    font-size: 13px;
  }

  .panel {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 28px 16px 0;
  }

  .panel::before {
    top: 0;
    width: 100%;
    height: 100vh;
    background-position: -120px -40px;
    background-size: auto 120vh;
  }

  .panel h1 {
    font-size: 40px;
    line-height: 44px;
  }

  .panel__summary {
    margin-bottom: 20px;
  }

  .dealer {
    padding: 18px 16px;
  }

  .dealer.is-active {
    transform: none;
  }
}

@media (max-width: 480px) {
  .header__phone img {
    display: none;
  }

  .header__tg {
    margin-left: 0;
  }

  .search__near span {
    display: none;
  }

  .search__near {
    width: 40px;
    padding: 0;
    justify-content: center;
  }

  .popup {
    width: 240px;
  }
}
