/* ==========================================================================
   Перрон — страница тура. Подключается после styles.css.
   ========================================================================== */

/* ---------- Хлебные крошки ---------- */
.crumbs { padding-block: var(--space-3); font-size: 14px; }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.crumbs li { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-muted); }
.crumbs li + li::before { content: "/"; color: var(--line-strong); }
.crumbs a { color: var(--ink-muted); display: inline-flex; align-items: center; min-height: 32px; }
.crumbs a:hover { color: var(--brand); }
@media (max-width: 639px) {
  /* На мобильных оставляем только ссылку на родителя */
  .crumbs li:not(:nth-last-child(2)) { display: none; }
  .crumbs li:nth-last-child(2)::before { content: "‹"; font-size: 18px; color: var(--brand); }
  .crumbs li:nth-last-child(2) a { color: var(--brand); font-weight: 600; }
}

/* ---------- Заголовок тура ---------- */
.tour-head { display: grid; gap: var(--space-3); padding-bottom: var(--space-4); }
.tour-head__title { font: 700 26px/32px var(--font-display); letter-spacing: -.01em; max-width: 22em; }
@media (min-width: 640px) { .tour-head__title { font-size: 34px; line-height: 40px; } }
@media (min-width: 1024px) { .tour-head__title { font-size: 40px; line-height: 46px; } .tour-head { padding-bottom: var(--space-6); } }
.tour-head__route { font-size: 16px; line-height: 24px; color: var(--ink-muted); }
.tour-head__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.tour-head__badges { display: flex; flex-wrap: wrap; gap: 6px; }
.tour-head__actions { display: flex; gap: var(--space-1); }
.tour-head__actions .icon-btn { box-shadow: inset 0 0 0 1px var(--line); }
.tour-head__actions .icon-btn[aria-pressed="true"] svg { fill: var(--accent); stroke: var(--accent); }

/* ---------- Галерея ---------- */
.gallery { display: flex; gap: var(--space-2); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); }
.gallery::-webkit-scrollbar { display: none; }
.gallery__item { position: relative; flex: 0 0 88%; scroll-snap-align: start; margin: 0; border-radius: var(--radius-lg); overflow: hidden; background: var(--brand-tint); }
.gallery__item img { width: 100%; height: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.gallery__cap { position: absolute; left: var(--space-3); bottom: var(--space-3); max-width: calc(100% - 24px);
  padding: 4px 10px; border-radius: var(--radius-sm); background: rgba(18,35,43,.82); color: #FFFFFF; font-size: 13px; line-height: 18px; }
@media (min-width: 640px) { .gallery__item { flex-basis: 60%; } }
@media (min-width: 1024px) {
  .gallery { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 200px 200px; gap: var(--space-2); overflow: visible; margin: 0; padding: 0; }
  .gallery__item:first-child { grid-row: span 2; }
  .gallery__item:nth-child(n+6) { display: none; }
  .gallery__item img { aspect-ratio: auto; }
}

/* ---------- Раскладка: контент + бронирование ---------- */
.tour-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-8); padding-block: var(--space-8) var(--space-12); }
.tour-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-12); min-width: 0; }
@media (min-width: 1024px) {
  .tour-layout { grid-template-columns: minmax(0, 1fr) 380px; gap: var(--space-12); padding-block: var(--space-12) var(--space-16); align-items: start; }
  .tour-main { gap: var(--space-16); }
  .tour-aside { position: sticky; top: calc(var(--header-h) + var(--space-6)); }
}
.tour-section { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); scroll-margin-top: calc(var(--header-h) + 72px); }
.tour-section > .h2 + p { color: var(--ink-muted); margin-top: calc(var(--space-2) * -1); }

/* ---------- Навигация по разделам ---------- */
.subnav { position: sticky; top: var(--header-h); z-index: 40; background: var(--surface); border-bottom: 1px solid var(--line); }
.subnav ul { display: flex; gap: var(--space-6); overflow-x: auto; scrollbar-width: none; }
.subnav ul::-webkit-scrollbar { display: none; }
.subnav a { display: inline-flex; align-items: center; min-height: 48px; color: var(--ink-muted); font-weight: 600; font-size: 15px; white-space: nowrap; border-bottom: 2px solid transparent; }
.subnav a:hover { color: var(--ink); text-decoration: none; }
.subnav a[aria-current="true"] { color: var(--brand); border-bottom-color: var(--brand); }

/* ---------- Коротко о туре ---------- */
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.facts > div { background: var(--surface); padding: var(--space-4); display: grid; gap: 2px; align-content: start; }
.facts dt { font-size: 13px; color: var(--ink-muted); }
.facts dd { font-weight: 600; }
.facts .mono { font-weight: 500; }
@media (min-width: 640px) { .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tour-intro { display: grid; gap: var(--space-3); font-size: 16px; line-height: 26px; max-width: 42em; }
@media (min-width: 1024px) { .tour-intro { font-size: 17px; line-height: 28px; } }

/* ---------- Схема маршрута (ж/д линия) ---------- */
.line { overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding: var(--space-2) var(--gutter) var(--space-4); }
.line::-webkit-scrollbar { display: none; }
.line ol { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(112px, 1fr); min-width: max-content; }
.line ol::before { content: ""; position: absolute; left: 56px; right: 56px; top: 13px; height: 6px; border-radius: 3px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 14px, var(--surface) 14px 22px); box-shadow: 0 0 0 1px var(--ink); }
.line li { position: relative; display: grid; justify-items: center; gap: 4px; text-align: center; padding-inline: 4px; }
.line__dot { width: 32px; height: 32px; border-radius: 50%; background: var(--surface); border: 3px solid var(--brand); z-index: 1; }
.line li.is-end .line__dot { background: var(--brand); }
.line li.is-key .line__dot { background: var(--accent); border-color: var(--ink); }
.line__name { font-weight: 600; font-size: 14px; line-height: 18px; margin-top: 4px; }
.line__day { font: 500 12px/16px var(--font-mono); color: var(--ink-muted); }
@media (min-width: 1024px) { .line { margin: 0; padding-inline: 0; } .line ol { min-width: 0; } }

/* ---------- Программа по дням (вокзальное табло) ---------- */
.days { display: grid; gap: var(--space-3); }
.day { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.day summary { list-style: none; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-3);
  padding: var(--space-4); cursor: pointer; min-height: 64px; }
.day summary::-webkit-details-marker { display: none; }
.day__num { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-md); background: var(--night); color: var(--on-night); font: 500 13px/1 var(--font-mono); text-align: center; }
.day[open] .day__num { background: var(--brand); color: var(--on-brand); }
.day__title { display: grid; gap: 2px; }
.day__title h3 { font: 600 17px/23px var(--font-display); }
.day__title span { font-size: 14px; color: var(--ink-muted); }
.day__chev { color: var(--ink-muted); transition: transform .2s; }
.day[open] .day__chev { transform: rotate(180deg); }
.board { margin: 0 var(--space-4) var(--space-4); border-top: 1px solid var(--line); }
.board li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: var(--space-3); padding-block: var(--space-3); border-bottom: 1px dashed var(--line); }
.board li:last-child { border-bottom: 0; padding-bottom: 0; }
.board time, .board .board__t { font: 500 14px/22px var(--font-mono); color: var(--brand); }
.board li.is-train time { display: inline-block; align-self: start; background: var(--night); color: var(--accent); border-radius: 4px; padding: 0 6px; justify-self: start; }
.board p { line-height: 22px; }
.board small { display: block; color: var(--ink-muted); font-size: 14px; }
@media (min-width: 1024px) { .board li { grid-template-columns: 80px minmax(0, 1fr); } }
.days__note { font-size: 14px; color: var(--ink-muted); }

/* ---------- Включено / не включено ---------- */
.incl { display: grid; gap: var(--space-4); }
@media (min-width: 640px) { .incl { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.incl__col { padding: 20px; border-radius: var(--radius-lg); display: grid; gap: var(--space-3); align-content: start; }
.incl__col--yes { background: var(--brand-tint); }
.incl__col--no { background: var(--surface-alt); }
.incl__col h3 { font-weight: 600; font-size: 17px; }
.incl__col ul { display: grid; gap: 10px; }
.incl__col li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; line-height: 22px; }
.incl__col li svg { margin-top: 1px; }
.incl__col--yes svg { color: var(--brand); }
.incl__col--no svg { color: var(--ink-muted); }

/* ---------- Цены по датам ---------- */
.prices { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.prices table { width: 100%; border-collapse: collapse; min-width: 560px; font-variant-numeric: tabular-nums; }
.prices caption { text-align: left; padding: var(--space-4); font-size: 14px; color: var(--ink-muted); caption-side: bottom; border-top: 1px solid var(--line); }
.prices th, .prices td { padding: 14px var(--space-4); text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.prices thead th { font-size: 13px; font-weight: 500; color: var(--ink-muted); background: var(--surface-alt); vertical-align: bottom; }
.prices th[scope="row"] { text-align: left; font-weight: 600; }
.prices th[scope="row"] .mono { display: block; font-size: 15px; }
.prices th[scope="row"] small { display: block; font-weight: 400; font-size: 13px; color: var(--ink-muted); }
.prices tbody tr:last-child > * { border-bottom: 0; }
.prices td.is-min { color: var(--success); font-weight: 700; }
.prices tr.is-selected > * { background: var(--brand-tint); }
.prices .pick { min-height: 36px; padding: 0 12px; border-radius: var(--radius-md); border: 1px solid var(--brand); background: transparent; color: var(--brand); font-weight: 600; font-size: 14px; }
.prices .pick:hover { background: var(--brand); color: var(--on-brand); }
.prices-notes { display: grid; gap: var(--space-2); font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.prices-notes li { padding-left: 16px; position: relative; }
.prices-notes li::before { content: ""; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }

/* ---------- Где купить (сравнение операторов) ---------- */
.offers { display: grid; gap: var(--space-2); }
.offer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-3) var(--space-4); align-items: center;
  padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.offer--best { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.offer__name { font-weight: 600; font-size: 17px; }
.offer__meta { font-size: 13px; color: var(--ink-muted); }
.offer__price { font-size: 22px; text-align: right; }
.offer .btn { grid-column: 1 / -1; }
@media (min-width: 640px) { .offer { grid-template-columns: minmax(0, 1fr) auto auto; } .offer .btn { grid-column: auto; } }
.offers__empty { padding: var(--space-4); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); font-size: 14px; color: var(--ink-muted); line-height: 20px; }

/* ---------- Важно знать ---------- */
.notes { display: grid; gap: var(--space-3); }
@media (min-width: 640px) { .notes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.note { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius-lg); background: var(--surface-alt); }
.note__icon { width: 40px; height: 40px; border-radius: var(--radius-md); background: var(--surface); display: grid; place-items: center; color: var(--brand); }
.note h3 { font-weight: 600; font-size: 16px; margin-bottom: 4px; }
.note p { font-size: 14px; line-height: 20px; color: var(--ink-muted); }

/* ---------- Бронирование ---------- */
.book { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-raised); overflow: hidden; scroll-margin-top: calc(var(--header-h) + 64px); }
.book__head { padding: 20px 20px var(--space-4); display: grid; gap: 2px; border-bottom: 1px solid var(--line); }
.book__from { font-size: 14px; color: var(--ink-muted); }
.book__price { font-size: 30px; line-height: 36px; }
.book__price small { font-size: 15px; font-weight: 400; color: var(--ink-muted); }
.book__body { padding: var(--space-4) 20px 20px; display: grid; gap: 20px; }
.book fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: var(--space-2); }
.book legend { font-weight: 600; font-size: 15px; padding: 0; margin-bottom: var(--space-2); }
.dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.opt { position: relative; display: block; cursor: pointer; }
.opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opt__box { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface); transition: border-color .15s, background-color .15s; }
.opt:hover .opt__box { border-color: var(--brand); }
.opt input:checked + .opt__box { border-color: var(--brand); background: var(--brand-tint); box-shadow: inset 0 0 0 1px var(--brand); }
.opt input:focus-visible + .opt__box { outline: 3px solid var(--brand); outline-offset: 2px; }
.opt__main { font: 500 15px/20px var(--font-mono); }
.opt__sub { font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.classes .opt__box { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.classes .opt__main { font: 600 15px/20px var(--font-sans); }
.classes .opt__price { grid-row: span 2; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

.counter { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); min-height: 48px; }
.counter__label { display: grid; }
.counter__label small { font-size: 12px; color: var(--ink-muted); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--radius-md); }
.stepper button { width: 44px; height: 44px; border: 0; background: transparent; color: var(--brand); font-size: 20px; line-height: 1; }
.stepper button:disabled { color: var(--line-strong); cursor: not-allowed; }
.stepper input { width: 36px; height: 44px; border: 0; background: transparent; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.book__hint { font-size: 12px; line-height: 16px; color: var(--ink-muted); }

.total { display: grid; gap: 4px; padding-top: var(--space-4); border-top: 1px solid var(--line); }
.total__row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); }
.total__label { font-weight: 600; }
.total__sum { font-size: 24px; }
.total__detail { font-size: 13px; color: var(--ink-muted); }
.book__checked { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ink-muted); }
.book__checked svg { color: var(--success); flex-shrink: 0; }
.book__alt { font-size: 14px; text-align: center; }
.book__pay { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Мобильная нижняя панель ---------- */
.buybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: 0 -4px 20px rgba(18,35,43,.08); padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); transition: transform .2s; }
.buybar.is-hidden { transform: translateY(110%); }
.buybar__price { display: grid; }
.buybar__price small { font-size: 12px; color: var(--ink-muted); }
.buybar__price .price { font-size: 20px; line-height: 24px; }
.has-buybar { padding-bottom: 76px; }
@media (min-width: 1024px) { .buybar { display: none; } .has-buybar { padding-bottom: 0; } }

/* ---------- Отзывы ---------- */
.tour-reviews { display: grid; gap: var(--space-3); }
.tour-reviews__empty { display: grid; gap: var(--space-3); justify-items: start; padding: 20px; border-radius: var(--radius-lg); background: var(--surface-alt); }
.tour-reviews__empty p { color: var(--ink-muted); }

/* Похожие туры — используем .cards из styles.css */
.similar .cards--scroll { padding-top: 2px; }
@media (min-width: 1024px) { .similar .cards--scroll { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Списки без класса внутри компонентов */
.crumbs ol, .subnav ul, .line ol, .incl__col ul { list-style: none; margin: 0; padding: 0; }
.gallery { margin-bottom: var(--space-4); }
@media (min-width: 1024px) { .gallery { margin-bottom: var(--space-6); } }
