/* =========================================================
   Рейс 700 — стили сайта
   Цвета: балтийский синий + янтарь (символ Калининграда).
   Шрифты системные — ничего не скачивается, сайт открывается мгновенно.
   Сначала стили для телефона, потом @media для широких экранов.
   ========================================================= */

:root {
  --sea: #12355B;        /* глубокий балтийский синий — шапка, заголовки */
  --sea-soft: #E3ECF5;   /* светлый синий — фон выбранных элементов */
  --amber: #F2A516;      /* янтарь — главные кнопки */
  --amber-hover: #E09405;
  --amber-ink: #2E1E00;  /* текст на янтарной кнопке */
  --bg: #EEF3F7;         /* фон страницы — холодный, «морской» */
  --card: #FFFFFF;
  --ink: #14212E;        /* основной текст */
  --muted: #5E6E7E;      /* второстепенный текст */
  --line: #D9E2EA;       /* рамки */
  --pine: #1F7A5A;       /* «мест много» */
  --brick: #C8432B;      /* ошибки и «мест мало» */

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --shadow: 0 1px 2px rgba(18, 53, 91, .06), 0 6px 20px rgba(18, 53, 91, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Тёмная тема — включается сама, если на телефоне включён тёмный режим */
@media (prefers-color-scheme: dark) {
  :root {
    --sea-soft: #1B3550;
    --bg: #0D1721;
    --card: #15222F;
    --ink: #E7EDF3;
    --muted: #94A5B5;
    --line: #253748;
    --pine: #4CC08E;
    --brick: #F07A62;
    --shadow: none;
  }
}

/* ---------- База ---------- */

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

h1, h2, h3 { line-height: 1.2; margin: 0; }

.wrap {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}

.wrap--narrow { max-width: 560px; }

.muted { color: var(--muted); font-size: 14px; }

/* Видимая рамка при управлении с клавиатуры */
:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}

/* ---------- Шапка ---------- */

.header {
  background: var(--sea);
  color: #fff;
}

.header__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 56px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 17px;
}

/* Номер маршрута как табличка на автобусе */
.logo__num {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  height: 30px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--amber);
  color: var(--amber-ink);
  font-weight: 800;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}

.logo span:last-child { white-space: nowrap; }

/* Ссылки в шапке — только на широком экране (на телефоне они есть в подвале) */
.header__nav { display: none; gap: 20px; }

.header__nav a {
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  opacity: .85;
}

.header__nav a:hover { opacity: 1; }

@media (min-width: 640px) {
  .header__nav { display: flex; margin-left: auto; }
}

/* Переключатель языка RU / EN / PL — виден и на телефоне */
.langs {
  display: flex;
  gap: 2px;
  margin-left: auto;
  padding: 2px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .12);
}

.langs a {
  min-width: 34px;
  padding: 5px 6px;
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  opacity: .75;
}

.langs a:hover { opacity: 1; }
.langs a.is-active { background: #fff; color: var(--sea); opacity: 1; }

@media (min-width: 640px) {
  .langs { margin-left: 16px; }
}

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;          /* удобно попадать пальцем */
  padding: 0 20px;
  border: 0;
  border-radius: var(--r-md);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  background: var(--sea-soft);
  color: var(--sea);
  transition: background-color .15s;
}

.btn--primary {
  background: var(--amber);
  color: var(--amber-ink);
}

.btn--primary:hover { background: var(--amber-hover); }

.btn--ghost {
  background: transparent;
  color: inherit;
  border: 1.5px solid var(--line);
}

.btn--wide { width: 100%; }

.btn--sm {
  min-height: 40px;
  padding: 0 16px;
  font-size: 15px;
}

.btn[disabled] {
  opacity: .6;
  cursor: progress;
}

@media (prefers-color-scheme: dark) {
  .btn { color: #CFE0F2; }
  .btn--primary { color: var(--amber-ink); }
}

/* ---------- Главная: верх страницы ---------- */

.hero {
  background: var(--sea);
  color: #fff;
  padding: 28px 0 72px;
}

.hero h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.01em;
}

.hero p {
  margin: 8px 0 0;
  max-width: 34em;
  opacity: .8;
}

/* ---------- Форма поиска ---------- */

.search {
  position: relative;
  margin-top: -52px;          /* карточка «наезжает» на синий блок */
  padding: 16px;
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}

.search__route {
  position: relative;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
}

.search__point {
  padding: 10px 56px 10px 14px;
}

.search__point--to {
  border-top: 1.5px solid var(--line);
}

.search__point label,
.search__label {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

.search__point select {
  width: 100%;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 18px;
  font-weight: 600;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.search__point select:focus { outline: none; }

/* Кнопка «поменять местами» сидит на границе двух полей */
.swap {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--sea);
  cursor: pointer;
  transition: transform .25s;
}

.swap.is-turned { transform: translateY(-50%) rotate(180deg); }

@media (prefers-color-scheme: dark) {
  .swap { color: #CFE0F2; }
}

.search__date { margin: 14px 0 16px; }

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

.chip {
  min-height: 44px;
  padding: 0 16px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.chip.is-active {
  border-color: var(--sea);
  background: var(--sea);
  color: #fff;
}

/* Поле с календарём выглядит как ещё один «чип» */
.chips input[type="date"] {
  min-height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
}

.chips input[type="date"].is-active {
  border-color: var(--sea);
}

/* ---------- Направления на главной ---------- */

.popular { margin: 32px 0 8px; }

.popular h2 {
  font-size: 20px;
  margin-bottom: 12px;
}

.popular__list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.popular__list li + li { border-top: 1px solid var(--line); }

.popular__list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px;
  text-decoration: none;
}

.popular__list a:hover { background: var(--sea-soft); }

.popular__price {
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------- Страница рейсов: липкая панель сверху ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.topbar__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  padding-bottom: 8px;
}

.topbar__route {
  font-weight: 700;
  font-size: 16px;
}

.topbar__date {
  font-size: 14px;
  color: var(--muted);
}

/* Лента дат — листается пальцем вбок */
.days {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-width: none;
}

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

.day {
  flex: 0 0 auto;
  min-width: 52px;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  text-align: center;
  text-decoration: none;
  color: var(--muted);
  border: 1.5px solid transparent;
}

.day span {
  display: block;
  font-size: 12px;
  text-transform: lowercase;
}

.day b {
  display: block;
  font-size: 18px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.day.is-active {
  background: var(--sea);
  color: #fff;
}

.day.is-active b { color: #fff; }

/* ---------- Карточка рейса ---------- */

.results { padding-top: 16px; padding-bottom: 32px; }

.trip {
  display: block;
  margin-bottom: 12px;
  padding: 16px;
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: border-color .15s;
}

a.trip:hover { border-color: var(--amber); }

.trip--off { opacity: .6; }

/* Главный элемент дизайна: время — линия маршрута — время */
.route {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.route__time {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

.route__line {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 14px;
}

/* сама линия */
.route__line::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: var(--sea);
  opacity: .35;
}

/* точки: крайние — залитые, промежуточные — кольца */
.route__dot {
  position: relative;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--sea);
}

.route__dot--mid {
  width: 10px;
  height: 10px;
  background: var(--card);
  border: 2px solid var(--sea);
}

@media (prefers-color-scheme: dark) {
  .route__line::before { background: #8FB3D9; }
  .route__dot { background: #8FB3D9; }
  .route__dot--mid { background: var(--card); border-color: #8FB3D9; }
}

.route__stops {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  font-size: 14px;
  color: var(--muted);
}

.route__stops span:last-child { text-align: right; }

.trip__meta {
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
}

.trip__foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.price {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.seats {
  font-size: 14px;
  font-weight: 600;
  color: var(--pine);
}

.seats--few { color: var(--brick); }
.seats--none { color: var(--muted); }

.trip__foot .btn { margin-left: auto; }

.back-link {
  display: block;
  margin-top: 8px;
  padding: 16px;
  text-align: center;
  color: var(--sea);
  font-weight: 600;
}

@media (prefers-color-scheme: dark) {
  .back-link { color: #8FB3D9; }
}

/* ---------- Сообщения и пустые состояния ---------- */

.alert {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: rgba(200, 67, 43, .1);
  color: var(--brick);
  font-weight: 600;
}

.empty {
  padding: 32px 16px;
  text-align: center;
  background: var(--card);
  border-radius: var(--r-lg);
}

.empty p { margin: 0 0 16px; }

/* ---------- Бронирование ---------- */

.crumb {
  display: inline-block;
  margin: 16px 0 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
}

.summary {
  padding: 16px;
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}

.summary__date {
  margin-bottom: 10px;
  font-weight: 600;
}

.booking { margin-top: 16px; }

.group {
  min-width: 0;              /* fieldset иначе растягивается под содержимое и вылезает за экран */
  margin: 0 0 12px;
  padding: 16px;
  border: 0;
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}

.group legend {
  float: left;               /* чтобы legend вёл себя как обычный заголовок */
  width: 100%;
  padding: 0;
  font-size: 18px;
  font-weight: 700;
}

.group__hint {
  clear: both;
  margin: 2px 0 4px;
  font-size: 14px;
  color: var(--muted);
}

.field {
  clear: both;
  margin-top: 12px;
}

.field label {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 600;
}

.field input {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 17px;           /* 16px+ — чтобы iPhone не увеличивал страницу при вводе */
}

.field input:focus {
  outline: none;
  border-color: var(--sea);
  box-shadow: 0 0 0 3px var(--sea-soft);
}

.field input::placeholder { color: #A3B1BE; }

.field--error input { border-color: var(--brick); }

.field__error {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--brick);
}

/* Две колонки на широком экране (фамилия + имя) */
.fields-2 { display: grid; gap: 0 12px; }

.consent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 4px 0 0;
  padding: 16px;
  background: var(--card);
  border-radius: var(--r-lg);
  font-size: 15px;
  cursor: pointer;
}

.consent input {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--sea);
}

/* Нижняя панель с ценой и кнопкой — прилипает к низу экрана на телефоне */
.paybar {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 16px -16px 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--card);
  border-top: 1px solid var(--line);
}

.paybar__label {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

.paybar .btn { flex: 1; max-width: 260px; }

/* ---------- Заказ ---------- */

.done {
  padding: 28px 0 16px;
  text-align: center;
}

.done__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--pine);
  color: #fff;
  font-size: 34px;
  font-weight: 800;
  animation: pop .35s ease-out;
}

@keyframes pop {
  from { transform: scale(.4); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.done h1 { font-size: 24px; }

.done p { margin: 6px 0 0; color: var(--muted); }

.ticket {
  position: relative;
  padding: 16px;
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}

.ticket__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 14px;
}

.status {
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
}

.status--new { background: rgba(242, 165, 22, .18); color: #8A5A00; }
.status--paid { background: rgba(31, 122, 90, .15); color: var(--pine); }
.status--cancelled { background: rgba(94, 110, 126, .15); color: var(--muted); }

@media (prefers-color-scheme: dark) {
  .status--new { color: var(--amber); }
}

/* «Отрывная» линия, как у настоящего билета */
.ticket__tear {
  margin: 16px -16px;
  border-top: 2px dashed var(--line);
}

dl.info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0;
}

.info dt {
  font-size: 13px;
  color: var(--muted);
}

.info dd {
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.note {
  margin: 16px 0;
  font-size: 15px;
  color: var(--muted);
}

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

.footer {
  margin-top: 32px;
  padding: 24px 0 40px;
  font-size: 14px;
  color: var(--muted);
}

.footer a { color: inherit; }

.footer__nav {
  display: flex;
  gap: 20px;
  margin-bottom: 12px;
  font-weight: 600;
}

/* ---------- Переключатель «В одну сторону / Туда и обратно» ---------- */

.segmented {
  display: flex;
  padding: 4px;
  margin-bottom: 14px;
  background: var(--bg);
  border-radius: var(--r-md);
}

.segmented__item {
  flex: 1;
  position: relative;
  cursor: pointer;
}

/* Сам кружок радиокнопки прячем, но оставляем доступным для клавиатуры */
.segmented__item input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}

.segmented__item span {
  display: block;
  padding: 10px 8px;
  border-radius: var(--r-sm);
  text-align: center;
  font-weight: 600;
  color: var(--muted);
  transition: background-color .15s, color .15s;
}

.segmented__item input:checked + span {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(18, 53, 91, .15);
}

.segmented__item input:focus-visible + span { outline: 3px solid var(--amber); }

.segmented--small { margin: 0; max-width: 320px; }

.search__back.is-hidden { display: none; }

/* ---------- Меню пассажиров ---------- */

.pax {
  margin: 0 0 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
}

.pax__summary {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
}

.pax__summary::-webkit-details-marker { display: none; }

.pax__summary .search__label { grid-column: 1; }

.pax__value {
  grid-column: 1;
  font-size: 18px;
  font-weight: 600;
}

.pax__chevron {
  grid-column: 2;
  grid-row: 1 / 3;
  color: var(--muted);
  transition: transform .2s;
}

.pax[open] .pax__chevron { transform: rotate(180deg); }

.pax__panel {
  padding: 4px 14px 14px;
  border-top: 1px solid var(--line);
}

.counter {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}

.counter + .counter { border-top: 1px solid var(--line); }

.counter__title { font-weight: 600; }

.counter__hint { font-size: 13px; color: var(--muted); }

.counter__controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.counter__controls input {
  width: 40px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  -moz-appearance: textfield;
}

.counter__controls input::-webkit-outer-spin-button,
.counter__controls input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.counter__btn {
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--sea);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.counter__btn:disabled { opacity: .35; cursor: default; }

@media (prefers-color-scheme: dark) {
  .counter__btn { color: #CFE0F2; }
}

.pax__note {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Ссылки внизу главной ---------- */

.links {
  display: grid;
  gap: 12px;
  margin: 24px 0 8px;
}

.links__item {
  display: block;
  padding: 16px;
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.links__item b { display: block; }

.links__item span { font-size: 14px; color: var(--muted); }

/* ---------- Туда и обратно на странице рейсов ---------- */

.leg-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 12px;
  font-size: 18px;
}

.leg-title + .alert,
.trip + .leg-title,
.empty + .leg-title { margin-top: 24px; }

.leg-title__tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--sea);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

/* Карточка-радиокнопка: выбранная подсвечивается янтарной рамкой */
.trip--pick { cursor: pointer; position: relative; }

.trip__radio {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.trip--pick:has(.trip__radio:checked) { border-color: var(--amber); }

.trip--pick:has(.trip__radio:focus-visible) { outline: 3px solid var(--amber); outline-offset: 2px; }

.trip__check {
  margin-left: auto;
  width: 26px;
  height: 26px;
  border: 2px solid var(--line);
  border-radius: 50%;
}

.trip__radio:checked ~ .trip__foot .trip__check {
  border-color: var(--amber);
  background: var(--amber) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232E1E00' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 16px no-repeat;
}

.center { text-align: center; }

/* ---------- Оформление: несколько пассажиров ---------- */

.summary + .summary { margin-top: 10px; }

.summary__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.summary__head .summary__date { margin: 0; }

.field__label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
}

/* Тип билета — сетка «чипов» */
.type-chips {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.type-chip { position: relative; cursor: pointer; }

.type-chip input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}

.type-chip__body {
  display: block;
  height: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  transition: border-color .15s, background-color .15s;
}

.type-chip__body b { display: block; font-size: 15px; }

.type-chip__body small { color: var(--muted); font-size: 13px; }

.type-chip input:checked + .type-chip__body {
  border-color: var(--sea);
  background: var(--sea-soft);
}

.type-chip input:focus-visible + .type-chip__body { outline: 3px solid var(--amber); }

.type-note {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--pine);
}

.type-note:empty { display: none; }

.type-note--warn { color: var(--brick); }

/* ---------- Заказ ---------- */

.ticket + .ticket { margin-top: 12px; }

.ticket__people {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ticket__people li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.ticket__people li + li { border-top: 1px solid var(--line); }

.ticket__people span { display: block; font-size: 13px; color: var(--muted); }

.ticket__price {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ticket__people .ticket__price { color: var(--ink); font-size: 16px; }

.ticket__where {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.ticket--summary .ticket__head { margin-bottom: 8px; }

.qr {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 8px 0 16px;
}

.qr__img {
  flex: 0 0 132px;
  width: 132px;
  height: 132px;
  padding: 4px;
  background: #fff;
  border-radius: var(--r-sm);
}

.qr__img svg { display: block; width: 100%; height: 100%; }

.qr p { margin: 0; font-size: 14px; color: var(--muted); }

.note-box {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: rgba(242, 165, 22, .14);
  font-size: 15px;
}

.note-box ul { margin: 6px 0 0; padding-left: 20px; }

/* ---------- Простые страницы: «Мой заказ», «Перед поездкой» ---------- */

.page-head { padding: 24px 0 16px; }

.page-head h1 { font-size: 26px; }

.page-head p { margin: 6px 0 0; color: var(--muted); }

.find-btn { margin-top: 16px; }

.info h2 { font-size: 18px; margin-bottom: 8px; }

.info ul { margin: 0; padding-left: 20px; }

.info li + li { margin-top: 6px; }

.info ul.stops { padding: 0; list-style: none; }

.stops li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}

.stops li + li { border-top: 1px solid var(--line); margin: 0; }

.stops span { display: block; font-size: 14px; color: var(--muted); }

.faq { border-top: 1px solid var(--line); }

.faq summary {
  padding: 12px 0;
  font-weight: 600;
  cursor: pointer;
}

.faq p { margin: 0 0 12px; color: var(--muted); }

/* ---------- Оплата ---------- */

.pay-box {
  margin-top: 12px;
  padding: 16px;
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}

.pay-box__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-weight: 600;
}

.test-banner {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1.5px dashed var(--amber);
  font-size: 14px;
}

.cancel-form { margin: 12px 0; }

.link-button {
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
  padding: 8px;
}

.flash {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--sea-soft);
  font-weight: 600;
}

[data-countdown].is-low { color: var(--brick); }


/* Скрыто на экране, но доступно для программ чтения с экрана */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Широкие экраны ---------- */

@media (min-width: 640px) {
  .hero { padding: 48px 0 88px; }
  .hero h1 { font-size: 40px; }

  .search { padding: 20px; }

  /* Откуда | ⇄ | Куда в одну строку */
  .search__route { display: grid; grid-template-columns: 1fr 1fr; }
  .search__point { padding-right: 28px; }
  .search__point--to {
    border-top: 0;
    border-left: 1.5px solid var(--line);
    padding-left: 28px;
  }
  .swap {
    right: auto;
    left: 50%;
    transform: translate(-50%, -50%) rotate(90deg);
  }
  .swap.is-turned { transform: translate(-50%, -50%) rotate(270deg); }

  .route__time { font-size: 34px; }

  .fields-2 { grid-template-columns: 1fr 1fr; }
  .type-chips { grid-template-columns: repeat(3, 1fr); }
  .links { grid-template-columns: 1fr 1fr; }

  .paybar {
    position: static;
    margin: 16px 0 0;
    border-radius: var(--r-lg);
    border: 0;
  }
}

/* Если человек отключил анимации в системе — убираем их */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- Продажа ещё не открыта ---------- */
.sales-closed h1 { margin: 0 0 8px; font-size: 22px; }
.sales-closed p { margin: 0 0 16px; color: var(--muted); }
.actions { display: grid; gap: 10px; }
.sales-closed { margin-top: 12px; }
.actions .btn { text-align: center; justify-content: center; }

/* Узкий телефон: логотип и языки должны помещаться в одну строку */
@media (max-width: 420px) {
  .logo { font-size: 15px; gap: 8px; }
  .logo__num { min-width: 40px; }
  .langs a { min-width: 28px; padding: 5px 4px; font-size: 12px; }
}

/* Плашка «сайт в тестовом режиме» — над всеми страницами */
.test-strip {
  padding: 8px 16px;
  background: #B3261E;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}
