/* Карточка бронирования в правой колонке тура (templates/includes/tour_booking_card.html). */

/* Прилипание: колонка тянется на всю высоту описания, иначе липкому блоку
   некуда двигаться (сетка выравнивает ячейки по верху). */
@media (min-width: 1200px) {
    /* overflow: hidden у html/body/main (main.css) делает их контейнером
       прокрутки, и sticky не срабатывает. clip так же прячет вылезающее по
       горизонтали, но контейнером прокрутки не становится. Без !important:
       блокировка прокрутки модалкой (inline style) и .no-scroll сильнее. */
    html:has(.booking-sidebar), body:has(.booking-sidebar) { overflow-x: clip; }
    main:has(.booking-sidebar) { overflow: clip; }
    .tour-content-layout > .booking-sidebar { align-self: stretch; }

    /* Прилипает вся колонка, без прокрутки внутри; лишнее убирает
       tour-booking-card.js (режимы описаны там). */
    .booking-sticky { position: sticky; top: 12px; z-index: 3; }
    .booking-sidebar .booking-card { position: relative; top: auto; padding: 24px 26px; }
    .booking-sticky.bk-compact .booking-help .about-tour { display: none; }
    .booking-sticky.bk-card-only .booking-help { display: none; }
    .booking-sticky.bk-no-stick { position: static; }
    /* «О туре» в основной колонке, когда справа ему нет места. */
    body.bk-about-main .tour-main-info .about-tour.mobile-only { display: block !important; }
}

.booking-help {
    background: #fff; border: 1px solid #f0f0f0; border-radius: 20px; padding: 20px 26px;
    margin-top: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.bk-card { font-size: 14px; color: #1f2937; }
.bk-price-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.bk-price { font-size: 30px; font-weight: 800; line-height: 1.1; color: #111827; }
.bk-price-unit { font-size: 14px; color: #6b7280; }

.bk-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #6b7280; margin: 0 0 6px; }
.bk-input {
    display: block; width: 100%; background: #f8fafc; border: 1.5px solid #e5e7eb; border-radius: 10px;
    padding: 11px 12px; font-size: 15px; color: #111827; outline: none; transition: border-color .15s;
}
.bk-input:focus, .bk-input:hover { border-color: #2563eb; }
.bk-input.is-err { border-color: #dc2626; }
.bk-select {
    appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23111827' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
    text-overflow: ellipsis; white-space: nowrap;
}
.bk-prog-badge { display: inline-block; background: #eff6ff; color: #1d4ed8; border-radius: 8px; padding: 6px 12px; font-size: 14px; font-weight: 600; }
.bk-divider { height: 1px; background: #e5e7eb; margin: 12px 0; }
.bk-field { margin-bottom: 10px; }

.bk-toggle { display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer; }
.bk-toggle span { flex: 1; }
.bk-chevron { flex-shrink: 0; transition: transform .2s; }
.bk-toggle[aria-expanded="true"] { border-color: #2563eb; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.bk-toggle[aria-expanded="true"] .bk-chevron { transform: rotate(180deg); }
.bk-party-panel { background: #f8fafc; border: 1.5px solid #2563eb; border-top: 0; border-radius: 0 0 10px 10px; padding: 10px 12px 12px; }
.bk-party-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; }
.bk-party-row + .bk-party-row { border-top: 1px solid #e5e7eb; }
.bk-party-name { font-weight: 600; }
.bk-party-note { font-size: 12px; color: #6b7280; }
.bk-counter { display: flex; align-items: center; gap: 10px; }
.bk-cnt {
    width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid #e5e7eb; background: #fff; color: #2563eb;
    font-size: 18px; font-weight: 700; line-height: 1; padding: 0; cursor: pointer;
}
.bk-cnt:hover { border-color: #2563eb; background: #eff6ff; }
.bk-cnt-val { min-width: 22px; text-align: center; font-weight: 700; font-size: 16px; }
.bk-party-done { width: 100%; margin-top: 10px; background: #2563eb; color: #fff; border: 0; border-radius: 8px; padding: 9px; font-weight: 600; }

.bk-hotel-wrap { position: relative; }
.bk-hotel-list {
    position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; background: #fff;
    border: 1.5px solid #e5e7eb; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.08); max-height: 260px; overflow-y: auto;
}
.bk-hotel-opt { padding: 10px 12px; cursor: pointer; border-bottom: 1px solid #f1f5f9; }
.bk-hotel-opt:last-child { border-bottom: 0; }
.bk-hotel-opt:hover { background: #eff6ff; }
.bk-hotel-opt span { color: #6b7280; font-size: 12px; }

.bk-total { background: #f8fafc; border: 1.5px solid #e5e7eb; border-radius: 10px; padding: 10px 14px; margin: 12px 0; }
.bk-total-row { display: flex; justify-content: space-between; gap: 10px; color: #374151; padding: 3px 0; }
.bk-total-line { display: flex; justify-content: space-between; gap: 10px; font-weight: 800; font-size: 16px; border-top: 1px solid #e5e7eb; margin-top: 8px; padding-top: 10px; }

.bk-err { color: #dc2626; font-size: 13px; margin: 8px 0; }
.bk-cta {
    width: 100%; background: #2563eb; color: #fff; border: 0; border-radius: 10px; padding: 14px;
    font-size: 16px; font-weight: 700; cursor: pointer; transition: background .15s; margin-top: 4px;
}
.bk-cta:hover { background: #1d4ed8; }
.bk-cta:disabled { opacity: .7; cursor: wait; }
.bk-back { width: 100%; background: none; border: 0; color: #6b7280; padding: 10px; font-size: 14px; }

.bk-contact { margin-top: 4px; }
.bk-contact-title { font-weight: 700; margin-bottom: 8px; }
.bk-contact .bk-input { margin-bottom: 8px; }
.bk-contact textarea { resize: vertical; min-height: 44px; }
.bk-contact .iti { display: block; width: 100%; margin-bottom: 8px; }
.bk-contact .iti .bk-input { margin-bottom: 0; padding-left: 52px; }
.bk-captcha { display: flex; align-items: center; gap: 10px; }
.bk-captcha label { white-space: nowrap; font-size: 14px; }
.bk-captcha .bk-input { width: 80px; }
.bk-legal { font-size: 12px; color: #6b7280; margin: 4px 0 8px; }
.bk-legal a { text-decoration: underline; }

.bk-success { text-align: center; padding: 8px 0; }
.bk-success-icon { width: 48px; height: 48px; border-radius: 50%; background: #dcfce7; color: #15803d; font-size: 24px; font-weight: 800; line-height: 48px; margin: 0 auto 10px; }
.bk-success-title { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.bk-success p { color: #6b7280; margin: 0; }

/* Подсветка всей формы после «Заказ» у программы. */
@keyframes bk-flash {
    0%   { box-shadow: 0 0 0 0 rgba(37, 99, 235, .55), 0 10px 30px rgba(0,0,0,.05); border-color: #2563eb; }
    60%  { box-shadow: 0 0 0 8px rgba(37, 99, 235, .18), 0 10px 30px rgba(0,0,0,.05); border-color: #2563eb; }
    100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0), 0 10px 30px rgba(0,0,0,.05); }
}
.booking-card.bk-flash { animation: bk-flash 1.6s ease-out; border-color: #2563eb; }
@media (prefers-reduced-motion: reduce) { .booking-card.bk-flash { animation: none; outline: 2px solid #2563eb; } }
.booking-help > :last-child, .booking-help p:last-of-type { margin-bottom: 0; }
