/* Страница бронирования: календарь, сеансы, счётчики, липкий итог.
   Вынесено отдельным файлом — это единственная страница со своей
   механикой, и держать её вместе с общими стилями значило бы
   грузить сотню строк на каждый адрес сайта. */

.bk {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 40px;
  align-items: start;
}

@media (max-width: 900px) {
  .bk { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}

.bk__main { display: flex; flex-direction: column; gap: 30px; }

/* Шаг: номер и заголовок в одну строку, без рамок-карточек вокруг всего. */
.bk__step { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.bk__num {
  width: 25px; height: 25px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.bk__ttl { font-size: 17px; font-weight: 600; }
.bk__sub { color: var(--muted); font-size: 14px; font-weight: 400; }

/* --- календарь --- */
.cal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}
.cal__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.cal__month { font-weight: 600; }
.cal__nav {
  background: none; border: 1px solid var(--line); color: var(--ink);
  width: 34px; height: 34px; border-radius: 9px; cursor: pointer;
  font-size: 17px; line-height: 1;
}
.cal__nav:disabled { opacity: .35; cursor: default; }
.cal__nav:hover:not(:disabled) { background: var(--panel-2); }

.cal__dow, .cal__grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px;
}
.cal__dow {
  font-size: 12px; color: var(--muted); text-align: center; margin-bottom: 6px;
}

.cal__day {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 50px; border-radius: 9px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--ink);
  font: inherit; padding: 4px 2px;
  transition: background .12s ease, border-color .12s ease;
}
.cal__day:hover:not(:disabled) { border-color: var(--accent); }
.cal__day b { font-size: 15px; font-weight: 600; }
.cal__day span { font-size: 10.5px; opacity: .75; margin-top: 1px; }

.cal__day--out { visibility: hidden; }
.cal__day--shut {
  background: transparent; border-color: transparent; color: var(--muted);
  cursor: default; opacity: .5;
}
.cal__day--on {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
}
.cal__day--on span { opacity: .85; }

.cal__key {
  display: flex; flex-wrap: wrap; gap: 16px;
  margin-top: 14px; font-size: 12.5px; color: var(--muted);
}
.cal__key span { display: flex; align-items: center; gap: 6px; }
/* Образцы легенды повторяют клетки дня: открытый — плашка с рамкой, закрытый — пустой. */
.cal__key i { width: 12px; height: 12px; border-radius: 3px; display: block; flex: none; }
.cal__key .cal__key--free { background: var(--panel-2); border: 1px solid var(--line); }
.cal__key .cal__key--shut { background: transparent; border: 1px dashed var(--line); }

/* --- сеансы --- */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.slot {
  padding: 12px 4px; border-radius: 9px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--ink);
  font: inherit; font-size: 14.5px; text-align: center;
  transition: background .12s ease, border-color .12s ease;
}
.slot:hover { border-color: var(--accent); }
.slot--on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }

/* --- билеты --- */
.rate {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px 18px;
}
.rate + .rate { margin-top: 10px; }
.rate__info { flex: 1 1 auto; min-width: 0; }
.rate__info strong { display: block; font-size: 16px; }
.rate__note { display: block; color: var(--muted); font-size: 14px; }
.rate__proof { display: block; color: var(--warn); font-size: 13.5px; margin-top: 2px; }
.rate__right { display: flex; align-items: center; gap: 16px; flex: none; }
@media (max-width: 640px) {
  .rate { flex-direction: column; align-items: stretch; gap: 14px; }
  .rate__right { justify-content: space-between; }
}
.rate__price { font-size: 17px; font-weight: 600; white-space: nowrap; }

/* Счётчик: попасть пальцем в кнопку проще, чем напечатать цифру. */
.step {
  display: flex; align-items: center;
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
}
.step button {
  width: 44px; height: 44px; border: 0; background: none; cursor: pointer;
  color: var(--ink); font-size: 19px; line-height: 1;
}
.step button:hover:not(:disabled) { background: var(--panel-2); }
.step button:disabled { color: var(--line); cursor: default; }
.step input {
  width: 42px; text-align: center; border: 0; background: none;
  color: var(--ink); font: inherit; font-weight: 700; font-size: 16px;
  -moz-appearance: textfield; padding: 0;
}
.step input::-webkit-outer-spin-button,
.step input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* --- итог --- */
.bk__aside { position: sticky; top: 18px; }
.sum {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 20px;
}
.sum__ttl { font-size: 19px; font-weight: 600; margin: 0 0 2px; }
.sum__when { color: var(--muted); font-size: 14px; margin-bottom: 16px; min-height: 21px; }
.sum__rows { display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.sum__row { display: flex; justify-content: space-between; gap: 12px; }
.sum__row--sub { color: var(--muted); }
.sum__rule { height: 1px; background: var(--line); margin: 15px 0; }
.sum__total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sum__total b { font-size: 26px; font-weight: 600; }
.sum__empty { color: var(--muted); font-size: 14.5px; }

.sum__trust { display: flex; flex-direction: column; gap: 9px; margin-top: 16px;
  font-size: 13px; color: var(--muted); }
.sum__trust div { display: flex; gap: 9px; align-items: flex-start; }
.sum__trust svg { flex: none; margin-top: 2px; }

/* Кнопка внизу итога, а не в конце длинной формы. */
.sum .btn { width: 100%; margin-top: 16px; }

/* --- посетители --- */
.visitor { display: grid; grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px; align-items: center; }
.visitor + .visitor { margin-top: 10px; }
.visitor__n { color: var(--muted); font-size: 13px; }
.visitor input { margin: 0; }
@media (max-width: 560px) {
  .visitor { grid-template-columns: 26px minmax(0, 1fr); }
  .visitor__n { grid-row: span 2; }
}

/* Остаток мест на кнопке сеанса. Подписываем только малые числа —
   «осталось 40» не значит ничего, «осталось 2» значит. */
.slot i { display: block; font-style: normal; opacity: .75; font-size: .78em; margin-top: 2px; }
.slot--on i { opacity: 1; }
.fresh { font-size: .82rem; margin-top: .35rem; opacity: .75; }

/* --- этап 4.2: шаги формы, ошибки, ловушка для ботов --- */
.bk__sec { margin-top: 0; }
.bk--invalid .bk__ttl, .check.bk--invalid span { color: var(--err); }
.booking [aria-invalid="true"] { border-color: var(--err); box-shadow: 0 0 0 1px var(--err); }
.booking label { display: block; margin-top: 12px; font-weight: 500; }
.booking input:not([type=checkbox]):not([type=number]), .booking select { width: 100%; }
.booking small { display: block; margin-top: 4px; }
.visitor input { width: 100%; }
/* Поле-ловушка: человеку не видно и не достаётся с клавиатуры, бот его заполняет. */

/* --- страница заказа --- */
.order__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: -4px 0 14px; }
.order__ref { font-family: var(--mono, monospace); letter-spacing: .04em; }
.order__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin: 18px 0; }
@media (max-width: 760px) { .order__grid { grid-template-columns: minmax(0, 1fr); } }
.order__card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.order__card h2 { margin-top: 0; font-size: 18px; }
.order__props { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0 0 14px; }
.order__props dt { color: var(--muted); }
.order__props dd { margin: 0; }
.order__sums { width: 100%; border-collapse: collapse; font-size: 15px; }
.order__sums td { padding: 6px 0; border-top: 1px solid var(--line); }
.order__sums td:last-child { text-align: right; white-space: nowrap; padding-left: 12px; }
.order__total td { font-weight: 700; font-size: 17px; }
.order__visitors { margin: 0 0 10px; padding-left: 20px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--panel-2); border: 1px solid var(--line); }
.badge--paid, .badge--fulfilling, .badge--fulfilled, .badge--tickets_ready, .badge--delivered { border-color: var(--accent); color: var(--accent); }
.badge--cancelled, .badge--buyout_failed { color: var(--err); border-color: var(--err); }
.notice--warn { border-color: var(--warn); }
.notice--ok { border-color: var(--accent); }
.notice--info { border-color: var(--line); background: var(--panel); color: var(--muted); margin-top: 18px; }
.pay { max-width: 520px; }
.pay .btn { width: 100%; }
.pay__agree { font-size: 14px; }
.pay__card { font-size: 13px; }
.cab__steps { list-style: none; padding: 0; margin: 18px 0; display: flex; flex-direction: column; gap: 8px; }
.cab__steps li { padding-left: 26px; position: relative; color: var(--muted); }
.cab__steps li::before { content: ''; position: absolute; left: 0; top: 4px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); }
.cab__steps li.is-done { color: var(--ink); }
.cab__steps li.is-done::before { background: var(--accent); border-color: var(--accent); }
.cab__steps li.is-done::after { content: ''; position: absolute; left: 5px; top: 7px; width: 4px; height: 7px; border: solid var(--accent-ink, #fff); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.cab__steps li.is-now { color: var(--ink); font-weight: 600; }
.cab__steps li.is-now::before { border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--bg); background: var(--accent); }
.cab__ref { margin: 0 0 14px; }
/* Подпись «Билет N» — строкой над полями: в узкую колонку слева «Билет 2»
   на русском не помещалась и ломалась на две строки. */
.visitor { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 12px; }
.visitor__n { grid-column: 1 / -1; grid-row: auto; font-size: 13px; }
@media (max-width: 560px) {
  .visitor { grid-template-columns: minmax(0, 1fr); }
}
