/* ЮГИД — бронирование, заказы, тестовая оплата. Токены — tokens.css. */

.yg-page { padding: 32px 0 88px; font-family: var(--yg-font-body); color: var(--yg-ink); }
.yg-page h1 { font-family: var(--yg-font-head); font-weight: 600; font-size: clamp(26px, 3vw, 38px); line-height: 1.15; margin: 8px 0 8px; }
.yg-page .yg-sub { color: var(--yg-ink-soft); margin: 0 0 28px; }
.yg-back { display: inline-flex; align-items: center; gap: 6px; color: var(--yg-sea); font-weight: 700; text-decoration: none; min-height: 44px; }
.yg-back svg { width: 16px; height: 16px; transform: rotate(180deg); }

.yg-book { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.yg-panel { background: #fff; border-radius: var(--yg-radius); box-shadow: var(--yg-shadow); padding: 24px; }
.yg-panel + .yg-panel { margin-top: 20px; }
.yg-panel h2 { font: 800 18px/1.3 var(--yg-font-body); margin: 0 0 16px; }
.yg-sticky { position: sticky; top: 96px; }

.yg-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.yg-slot input { position: absolute; opacity: 0; pointer-events: none; }
.yg-slot > span {
    display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px; cursor: pointer;
    box-shadow: inset 0 0 0 1px var(--yg-border); transition: box-shadow .2s, background-color .2s;
}
.yg-slot b { font-size: 15px; }
.yg-slot em { font-style: normal; font-weight: 800; font-size: 18px; }
.yg-slot small { color: var(--yg-muted); font-size: 13px; }
.yg-slot input:checked + span { background: var(--yg-sky-soft); box-shadow: inset 0 0 0 2px var(--yg-sea); }
.yg-slot input:focus-visible + span { outline: 3px solid var(--yg-sun); outline-offset: 2px; }

.yg-tariff { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--yg-border); }
.yg-tariff:last-child, .yg-tariff:last-of-type { border-bottom: 0; }
.yg-tariff__name { font-weight: 700; }
.yg-tariff__note { color: var(--yg-muted); font-size: 13px; }
.yg-qty { display: inline-flex; align-items: center; gap: 4px; }
.yg-qty button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--yg-sky); color: var(--yg-ink); font-size: 20px; cursor: pointer; }
.yg-qty input {
    width: 48px; height: 44px; text-align: center; border: 0; border-radius: 12px; font: 800 18px var(--yg-font-body);
    color: var(--yg-ink); background: transparent; font-variant-numeric: tabular-nums; appearance: textfield; -moz-appearance: textfield;
}
/* Свои кнопки «−/+» — системные стрелки числового поля не показываем */
.yg-qty input::-webkit-inner-spin-button, .yg-qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.yg-qty input:focus { outline: none; }
.yg-qty input:focus-visible, .yg-qty input:focus { background: #fff; box-shadow: 0 0 0 2px var(--yg-sea); }

.yg-input { display: grid; gap: 6px; margin-bottom: 14px; }
.yg-input label { font-size: 13px; font-weight: 700; color: var(--yg-ink-soft); }
.yg-input input, .yg-input textarea, .yg-input select {
    width: 100%; min-height: 50px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--yg-border);
    background: var(--yg-sky-soft); font: 600 16px var(--yg-font-body); color: var(--yg-ink);
}
.yg-input input:focus, .yg-input textarea:focus, .yg-input select:focus { outline: none; border-color: var(--yg-sea); background: #fff; box-shadow: 0 0 0 4px rgba(3, 105, 161, .15); }

.yg-sum { display: grid; gap: 8px; margin: 16px 0; }
.yg-sum div { display: flex; justify-content: space-between; gap: 12px; }
.yg-sum .yg-sum__total { font-size: 20px; font-weight: 800; padding-top: 8px; border-top: 1px solid var(--yg-border); }
.yg-sum .yg-muted { color: var(--yg-muted); font-size: 14px; }

.yg-alert { padding: 14px 16px; border-radius: 14px; margin-bottom: 16px; font-weight: 600; }
.yg-alert--error { background: #FEF2F2; color: #991B1B; }
.yg-alert--ok { background: #ECFDF5; color: #065F46; }
.yg-alert--info { background: var(--yg-sky-soft); color: var(--yg-ink); }

.yg-terms { display: grid; gap: 12px; font-size: 15px; }
.yg-terms dt { font-size: 13px; font-weight: 700; color: var(--yg-muted); text-transform: uppercase; letter-spacing: .04em; }
.yg-terms dd { margin: 2px 0 0; white-space: pre-line; }

.yg-status { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 999px; font-weight: 800; font-size: 14px; }
.yg-status--success { background: #DCFCE7; color: #166534; }
.yg-status--info { background: var(--yg-sky); color: var(--yg-sea-dark); }
.yg-status--warning { background: #FEF3C7; color: #92400E; }
.yg-status--gray { background: #F1F5F9; color: #475569; }

.yg-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.yg-timeline li { display: grid; grid-template-columns: 120px 1fr; gap: 12px; font-size: 14px; }
.yg-timeline time { color: var(--yg-muted); }

.yg-orders { display: grid; gap: 12px; }
.yg-order-row {
    display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: center; padding: 18px 20px;
    background: #fff; border-radius: var(--yg-radius); box-shadow: var(--yg-shadow); color: var(--yg-ink); text-decoration: none;
}
.yg-order-row:hover { color: var(--yg-ink); box-shadow: var(--yg-shadow-lg); }
.yg-order-row small { color: var(--yg-muted); }

.yg-fakepay { max-width: 480px; margin: 48px auto; text-align: center; }
.yg-fakepay__badge { display: inline-block; padding: 4px 12px; border-radius: 999px; background: #FEF3C7; color: #92400E; font-weight: 800; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.yg-fakepay__amount { font: 700 40px var(--yg-font-head); margin: 16px 0; }
.yg-fakepay form { display: grid; gap: 10px; margin-top: 24px; }

.yg-btn-block { width: 100%; justify-content: center; }
.yg-btn--danger { background: #fff; color: #B91C1C; box-shadow: inset 0 0 0 2px #FCA5A5; }
.yg-btn--danger:hover { background: #FEF2F2; color: #991B1B; }

@media (max-width: 991.98px) {
    .yg-book { grid-template-columns: minmax(0, 1fr); }
    .yg-sticky { position: static; }
}

/* ---------- Публичная страница экскурсии ---------- */
.yg-crumbs { font-size: 14px; color: var(--yg-muted); margin-bottom: 16px; }
.yg-crumbs a { color: var(--yg-sea); text-decoration: none; }
.yg-gallery { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 200px 200px; gap: 8px; border-radius: var(--yg-radius-lg); overflow: hidden; margin-bottom: 28px; }
.yg-gallery img { width: 100%; height: 100%; object-fit: cover; background: var(--yg-sky); }
.yg-gallery img:first-child { grid-row: 1 / 3; }
.yg-gallery--single { grid-template-columns: 1fr; grid-template-rows: 420px; }
.yg-facts { display: flex; flex-wrap: wrap; gap: 12px; list-style: none; padding: 0; margin: 0 0 20px; }
.yg-facts li { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1px var(--yg-border); font-weight: 700; }
.yg-facts svg { width: 20px; height: 20px; color: var(--yg-sea); }
.yg-facts small { display: block; font-size: 12px; font-weight: 600; color: var(--yg-muted); }
.yg-lead-text { font-size: 18px; color: var(--yg-ink-soft); margin: 0 0 20px; }
.yg-prose { line-height: 1.65; color: var(--yg-ink-soft); }
.yg-price-big { font: 700 30px var(--yg-font-head); margin-bottom: 8px; }
.yg-price-big small { font: 600 15px var(--yg-font-body); color: var(--yg-muted); }
.yg-next-dates { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 6px; }
.yg-next-dates li { display: flex; justify-content: space-between; padding: 8px 12px; border-radius: 10px; background: var(--yg-sky-soft); }
@media (max-width: 767.98px) {
    .yg-gallery { grid-template-columns: 1fr 1fr; grid-template-rows: 220px 110px; }
    .yg-gallery img:first-child { grid-column: 1 / 3; grid-row: 1; }
    .yg-gallery img:nth-child(n+4) { display: none; }
}
/* Раскладка галереи под число фото: 2, 3, 4 (5 — базовая) */
.yg-gallery--n2, .yg-gallery--n3 { grid-template-columns: 2fr 1fr; }
.yg-gallery--n2 img:nth-child(2) { grid-row: 1 / 3; }
.yg-gallery--n4 img:nth-child(4) { grid-column: 2 / 4; }
@media (max-width: 767.98px) {
    .yg-gallery--n2 img:nth-child(2) { grid-row: auto; grid-column: 1 / 3; }
    .yg-gallery--n4 img:nth-child(4) { grid-column: auto; }
}

/* ---------- Отзывы ---------- */
.yg-stars { color: var(--yg-sun-dark); letter-spacing: 2px; margin: 0 0 8px; }
.yg-reply { margin: 10px 0 0; padding: 10px 14px; border-left: 3px solid var(--yg-sea); background: var(--yg-sky-soft); border-radius: 0 12px 12px 0; }
.yg-reviews-list { display: grid; gap: 18px; }
.yg-review-item header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.yg-review-item time { color: var(--yg-muted); font-size: 13px; }
.yg-review-item p { margin: 6px 0 0; color: var(--yg-ink-soft); }
.yg-rating-link { color: var(--yg-sea-dark); font-weight: 700; text-decoration: none; }
.yg-rating { border: 0; padding: 0; margin: 0 0 12px; display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.yg-rating legend { float: left; width: 100%; font-size: 13px; font-weight: 700; color: var(--yg-ink-soft); margin-bottom: 4px; }
.yg-rating input { position: absolute; opacity: 0; }
.yg-rating label { font-size: 34px; line-height: 1; color: #CBD5E1; cursor: pointer; transition: color .15s; }
.yg-rating input:checked ~ label, .yg-rating label:hover, .yg-rating label:hover ~ label { color: var(--yg-sun-dark); }
.yg-rating input:focus-visible + label { outline: 3px solid var(--yg-sun); outline-offset: 2px; border-radius: 4px; }

/* Поддержка */
.yg-support { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .yg-support { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; } }
.yg-support .yg-panel + .yg-panel { margin-top: 0; }
.yg-thread { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.yg-msg { max-width: 640px; padding: 12px 16px; border-radius: 16px; background: #F1F5F9; }
.yg-msg--customer { justify-self: end; background: var(--yg-sky); border-bottom-right-radius: 4px; }
.yg-msg--staff { border-bottom-left-radius: 4px; }
.yg-msg--system { justify-self: center; background: none; color: var(--yg-muted); font-size: 14px; text-align: center; }
.yg-msg__meta { display: flex; gap: 10px; align-items: baseline; font-size: 13px; margin-bottom: 4px; }
.yg-msg__meta time { color: var(--yg-muted); }
.yg-msg__body { overflow-wrap: anywhere; }

/* Чат с организатором на странице экскурсии и заказа */
.yg-ask .yg-btn .yg-cab__badge { margin-left: 6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--yg-sun); color: var(--yg-ink); font-size: 12px; font-weight: 800; }
.yg-ask a:not(.yg-btn) { color: var(--yg-sea); font-weight: 700; }

/* ---------- Оформление брони (/book/{экскурсия}) ---------- */
.yg-co__eyebrow { margin: 18px 0 0; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--yg-sea); }
.yg-co h1 { margin-top: 4px; }
.yg-co .yg-panel { padding: 26px; }
.yg-co .yg-panel h2 { display: flex; align-items: center; gap: 12px; font-size: 19px; margin-bottom: 18px; }
.yg-co__num { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--yg-ink); color: var(--yg-sun); font: 700 15px/1 var(--yg-font-head); }
.yg-co__label { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 10px; }
.yg-co__label span { font-size: 14px; font-weight: 800; }
.yg-co__label small { font-size: 13px; color: var(--yg-muted); }
.yg-co__lead { margin: -6px 0 16px; color: var(--yg-ink-soft); font-size: 15px; }
.yg-co__row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.yg-co__opt { font-weight: 600; color: var(--yg-muted); }
.yg-co__error { color: var(--yg-coral); font-size: 13px; font-weight: 700; }
.yg-co__hint { margin: 12px 0 0; padding: 12px 14px; border-radius: 14px; background: rgba(194, 65, 12, .08); color: var(--yg-coral); font-size: 14px; font-weight: 700; }
.yg-co__hint[hidden] { display: none; }
.yg-co__note { margin: 12px 0 0; font-size: 13px; color: var(--yg-muted); }
.yg-co .yg-input input[aria-invalid="true"] { border-color: var(--yg-coral); }
.yg-co-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Лента дат и время выбранного дня */
.yg-co-days { display: flex; gap: 8px; margin: 0 -26px 20px; padding: 2px 26px 8px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding: 0 26px; scrollbar-width: thin; scrollbar-color: var(--yg-border) transparent; }
.yg-co-day, .yg-co-time { position: relative; margin: 0; scroll-snap-align: start; }
.yg-co-day input, .yg-co-time input { position: absolute; opacity: 0; pointer-events: none; }
.yg-co-day span { display: grid; justify-items: center; gap: 2px; width: 64px; padding: 10px 0; border-radius: 16px; cursor: pointer; box-shadow: inset 0 0 0 1px var(--yg-border); transition: background-color .15s, box-shadow .15s; }
.yg-co-day small { font-size: 12px; font-weight: 700; color: var(--yg-muted); text-transform: lowercase; }
.yg-co-day b { font: 600 22px/1.15 var(--yg-font-head); color: var(--yg-ink); }
.yg-co-times { display: flex; flex-wrap: wrap; gap: 10px; }
.yg-co-times[hidden] { display: none; }
.yg-co-time span { display: grid; justify-items: center; gap: 2px; min-width: 96px; padding: 10px 16px; border-radius: 16px; cursor: pointer; box-shadow: inset 0 0 0 1px var(--yg-border); transition: background-color .15s, box-shadow .15s; }
.yg-co-time b { font-size: 18px; font-weight: 800; color: var(--yg-ink); font-variant-numeric: tabular-nums; }
.yg-co-time small { font-size: 12px; font-weight: 700; color: var(--yg-muted); }
.yg-co-day span:hover, .yg-co-time span:hover { box-shadow: inset 0 0 0 1px var(--yg-sea); }
.yg-co-day input:checked + span, .yg-co-time input:checked + span { background: var(--yg-ink); box-shadow: none; }
.yg-co-day input:checked + span b, .yg-co-day input:checked + span small, .yg-co-time input:checked + span b { color: #fff; }
.yg-co-day input:checked + span small:first-child, .yg-co-time input:checked + span small { color: var(--yg-sun); }
.yg-co-day input:focus-visible + span, .yg-co-time input:focus-visible + span { outline: 3px solid var(--yg-sun-dark); outline-offset: 2px; }

.yg-co .yg-qty button { width: 44px; height: 44px; transition: background-color .15s; }
.yg-co .yg-qty button:hover { background: var(--yg-sea); color: #fff; }
.yg-co .yg-qty button:focus-visible { outline: 3px solid var(--yg-sun-dark); outline-offset: 2px; }

/* Карточка брони справа */
.yg-co-card { overflow: hidden; }
.yg-co-card__img { display: block; width: calc(100% + 52px); max-width: none; height: 180px; margin: -26px -26px 18px; object-fit: cover; background: var(--yg-sky); }
.yg-co .yg-co-card__title { display: block; font: 600 20px/1.25 var(--yg-font-head); margin: 0 0 14px; }
.yg-co-card__facts { display: grid; gap: 10px; margin: 0 0 4px; }
.yg-co-card__facts div { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; font-size: 15px; }
.yg-co-card__facts svg { width: 20px; height: 20px; color: var(--yg-sea); margin-top: 1px; }
.yg-co-card__facts dd { margin: 0; font-weight: 600; }
.yg-co-card__facts dd::first-letter { text-transform: uppercase; }
.yg-co .yg-sum { margin: 18px 0; }
.yg-co .yg-sum__total { font-size: 22px; padding-top: 14px; }
.yg-co [data-co-submit]:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.yg-co [data-co-submit].is-loading { cursor: progress; }
.yg-co-trust { list-style: none; margin: 18px 0 0; padding: 16px 0 0; border-top: 1px solid var(--yg-border); display: grid; gap: 12px; }
.yg-co-trust li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; font-size: 14px; color: var(--yg-ink-soft); line-height: 1.45; }
.yg-co-trust svg { width: 20px; height: 20px; color: var(--yg-sea); margin-top: 1px; }
.yg-co-trust b { color: var(--yg-ink); }

.yg-co-terms summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; font-weight: 800; font-size: 17px; cursor: pointer; list-style: none; }
.yg-co-terms summary::-webkit-details-marker { display: none; }
.yg-co-terms summary::after { content: ''; width: 10px; height: 10px; border-right: 2px solid var(--yg-sea); border-bottom: 2px solid var(--yg-sea); transform: rotate(45deg); transition: transform .2s; margin-right: 4px; }
.yg-co-terms[open] summary::after { transform: rotate(-135deg); }
.yg-co-terms[open] summary { margin-bottom: 12px; }

/* Нижняя панель на мобильном */
.yg-co-bar { display: none; }
@media (max-width: 991.98px) {
    .yg-co { padding-bottom: 120px; }
    .yg-co-bar {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 12px;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: #fff; box-shadow: 0 -8px 24px rgba(11, 46, 69, .12);
    }
    .yg-co-bar div { display: grid; min-width: 0; }
    .yg-co-bar small { font-size: 13px; color: var(--yg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .yg-co-bar b { font-size: 20px; font-weight: 800; }
    .yg-co-bar .yg-btn { padding: 0 22px; flex: none; }
    .yg-co__side { order: 2; }
}
@media (max-width: 575.98px) {
    .yg-co .yg-panel { padding: 20px; }
    .yg-co-days { margin: 0 -20px 18px; padding: 2px 20px 8px; scroll-padding: 0 20px; }
    .yg-co-card__img { width: calc(100% + 40px); margin: -20px -20px 16px; }
    .yg-co__row { grid-template-columns: 1fr; }
    .yg-co .yg-tariff { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
    .yg-co-day span, .yg-co-time span, .yg-co-terms summary::after { transition: none; }
}
