/* Booking page UX layer (book.php), 2026-10-08.
   Pairs with assets/js/tour-picker.js and assets/js/booking-ux.js. Classes only: the site CSP
   blocks inline style="" attributes. */

/* ── Fields: big enough to tap, 16px text so phones do not zoom on focus ───── */
.booking-form input:not([type="checkbox"]):not([type="radio"]):not(.form-honeypot),
.booking-form select,
.booking-form textarea {
    font-size: 16px;
    min-height: 50px;
    border-radius: 12px;
}
.booking-form label { font-weight: 700; color: var(--ink); }
.booking-form .field-help,
.booking-form .field-help--block { font-weight: 400; }

/* ── Date card ─────────────────────────────────────────────────────────────── */
.bk-date-field {
    display: block;
    grid-column: 1 / -1;
    padding: 16px;
    border: 2px solid var(--line);
    border-radius: 16px;
    background: #fff;
    transition: border-color .15s, background-color .15s;
}
.bk-date-label { display: block; font-size: 1.05rem; margin: 0 0 10px; }
.bk-date-field input[type="date"] { width: 100%; min-height: 56px; font-size: 18px; font-weight: 700; }
.bk-date-pick { display: block; margin: 10px 0 0; font-size: .95rem; font-weight: 700; line-height: 1.4; }
.bk-date-field.is-empty { border-color: #f59e0b; background: #fffbeb; box-shadow: 0 0 0 4px rgba(245, 158, 11, .14); }
.bk-date-field.is-empty .bk-date-pick { color: #b45309; }
.bk-date-field.is-set { border-color: #16a34a; background: #f0fdf4; }
.bk-date-field.is-set .bk-date-pick { color: #166534; }
.bk-date-field.is-error { border-color: #dc2626; background: #fef2f2; box-shadow: 0 0 0 4px rgba(220, 38, 38, .14); animation: bk-shake .35s; }
.bk-date-field.is-error .bk-date-pick { color: #b91c1c; }
.bk-date-error { display: block; margin: 8px 0 0; color: #b91c1c; font-weight: 700; font-size: .9rem; }
.bk-date-error:empty { display: none; }
@keyframes bk-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .bk-date-field.is-error { animation: none; } }

/* ── Tour picker ───────────────────────────────────────────────────────────── */
.tp-wrap { position: relative; margin-top: 6px; }
.tp-native {
    position: absolute !important;
    width: 1px; height: 1px; min-height: 0 !important;
    opacity: 0; pointer-events: none; overflow: hidden; clip: rect(0 0 0 0);
}
.tp-trigger {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "title chev" "meta chev";
    align-items: center;
    column-gap: 12px;
    width: 100%;
    min-height: 58px;
    padding: 12px 14px;
    text-align: left;
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
}
.tp-trigger:hover { border-color: var(--teal-text); }
.tp-trigger:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.tp-trigger-title { grid-area: title; font-weight: 800; font-size: 1rem; line-height: 1.3; }
.tp-trigger-meta { grid-area: meta; font-size: .84rem; font-weight: 500; color: #52636a; }
.tp-trigger-meta:empty { display: none; }
.tp-trigger-chev { grid-area: chev; font-size: 1.4rem; line-height: 1; color: var(--teal-text); }

.tp-sheet { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-end; justify-content: center; }
.tp-sheet[hidden] { display: none; }
.tp-backdrop { position: absolute; inset: 0; background: rgba(15, 63, 75, .55); }
.tp-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 640px;
    max-height: 88vh;
    max-height: 88dvh;
    background: #fff;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, .25);
}
.tp-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 6px; }
.tp-head h2 { margin: 0; font-size: 1.2rem; }
.tp-close { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--wash); color: var(--ink); font-size: 1.7rem; line-height: 1; cursor: pointer; }
.tp-search { padding: 8px 18px 4px; }
.tp-search-input { width: 100%; min-height: 50px; padding: 12px 14px; font-size: 16px; border: 1.5px solid var(--line); border-radius: 12px; }
.tp-chips { display: flex; gap: 8px; padding: 8px 18px 10px; overflow-x: auto; scrollbar-width: none; }
.tp-chips::-webkit-scrollbar { display: none; }
.tp-chip { flex: 0 0 auto; min-height: 40px; padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 99px; background: #fff; color: var(--ink); font: inherit; font-size: .88rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.tp-chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.tp-list { flex: 1 1 auto; overflow-y: auto; padding: 0 12px 18px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.tp-group { margin: 14px 6px 6px; font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--gold-text, #8a6d1f); }
.tp-item {
    position: relative;
    display: block;
    width: 100%;
    min-height: 56px;
    margin: 0 0 6px;
    padding: 12px 44px 12px 14px;
    text-align: left;
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    font: inherit;
    cursor: pointer;
}
.tp-item:hover { border-color: var(--teal-text); background: #f0fafb; }
.tp-item.is-selected { border-color: var(--teal-text); background: #e8f6f8; }
.tp-item-title { display: block; font-weight: 800; font-size: 1rem; line-height: 1.3; }
.tp-item-meta { display: block; margin-top: 2px; font-size: .84rem; color: #52636a; }
.tp-item-check { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 1.2rem; color: var(--teal-text); font-weight: 800; }
.tp-empty { margin: 24px 8px; text-align: center; color: #52636a; }
html.tp-lock, html.tp-lock body { overflow: hidden; }
@media (min-width: 821px) {
    .tp-sheet { align-items: center; }
    .tp-panel { border-radius: 20px; max-height: 80vh; }
}

/* ── Review card (step 4) ──────────────────────────────────────────────────── */
.bk-review { grid-column: 1 / -1; margin: 0 0 4px; padding: 16px; background: #fff; border: 1.5px solid var(--line); border-radius: 16px; }
.bk-review h3 { margin: 0 0 10px; font-size: 1.05rem; }
.bk-review dl { margin: 0; display: grid; gap: 10px; }
.bk-review dl > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.bk-review dl > div:last-child { border-bottom: 0; padding-bottom: 0; }
.bk-review dt { font-size: .86rem; color: #52636a; font-weight: 600; }
.bk-review dd { margin: 0; font-weight: 800; color: var(--ink); text-align: right; }
.bk-review dd.is-missing { color: #b45309; }

/* ── Sticky summary bar (phones) ───────────────────────────────────────────── */
.bk-sticky { display: none; }
@media (max-width: 820px) {
    .bk-sticky {
        position: fixed;
        left: 0; right: 0; bottom: 0;
        z-index: 90;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
        background: #fff;
        border-top: 1px solid var(--line);
        box-shadow: 0 -6px 24px rgba(15, 63, 75, .14);
    }
    .bk-sticky.is-hidden,
    .bk-sticky.is-typing { display: none; }
    .bk-sticky-sum { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
    .bk-sticky-tour { font-size: .9rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
    .bk-sticky-meta { font-size: .8rem; line-height: 1.3; color: #52636a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .bk-sticky.needs-date .bk-sticky-meta { color: #b45309; font-weight: 700; }
    .bk-sticky-btn { flex: 0 0 auto; min-height: 48px; padding: 10px 16px; white-space: nowrap; }
    .bk-sticky.needs-date .bk-sticky-btn { background: #d97706; border-color: #d97706; color: #fff; }
    body.has-bk-sticky { padding-bottom: 88px; }
}

/* ── Mobile layout for the whole booking page ──────────────────────────────── */
@media (max-width: 820px) {
    .booking-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .booking-form { padding: 12px; border-radius: 16px; }
    .bk-step { padding: 16px 14px; border-radius: 16px; margin-bottom: 14px; }
    .bk-step-head h2 { font-size: 1.15rem; }
    .form-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .form-grid > label { grid-column: 1 / -1; }
    .booking-form label { font-size: 1rem; }

    .bk-guest-stepper { gap: 10px; }
    .bk-guest-stepper button { width: 56px; height: 56px; font-size: 1.5rem; border-radius: 12px; }
    .bk-guest-stepper input { flex: 1 1 auto; max-width: 140px; min-height: 56px; font-size: 20px; font-weight: 800; }

    .bk-type-toggle { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .bk-type-btn { min-height: 64px; text-align: left; }
    .bk-checkbox-field { display: flex; align-items: flex-start; gap: 12px; font-weight: 600; line-height: 1.4; }
    .bk-checkbox-field input[type="checkbox"] { flex: 0 0 26px; width: 26px; height: 26px; min-height: 0; margin-top: 2px; }

    /* Add-ons: compact cards, easy to tick */
    .addons-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .addon-check { padding: 14px; min-height: 56px; }
    .addon-check input[type="checkbox"] { width: 26px; height: 26px; flex: 0 0 26px; }

    /* Quick-request panel at the top: it overflowed the screen on phones */
    .booking-message-start { padding: 16px 14px; }
    .booking-message-quick-fields,
    .booking-message-controls { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .booking-message-quick-fields label,
    .booking-message-controls label { display: block; min-width: 0; font-size: 1rem; }
    .booking-message-quick-fields input,
    .booking-message-quick-fields select,
    .booking-message-controls select { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; font-size: 16px; min-height: 52px; }
    .booking-message-actions { flex-direction: column; align-items: stretch; }
    .booking-message-actions .button { width: 100%; white-space: normal; text-align: center; justify-content: center; }
    .booking-message-proof { display: flex; flex-wrap: wrap; gap: 8px 14px; }

    /* Step nav: tidy chips instead of a cramped row */
    .booking-steps ol { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
    .booking-steps li small { display: none; }
    .booking-mobile-progress { font-weight: 800; }

    /* Price panel reads at a glance */
    .price-calc { padding: 14px; border-radius: 14px; }
    .price-calc-row { font-size: 1rem; }
    .price-calc-row.highlight { font-size: 1.1rem; }
    .booking-form button[type="submit"] { width: 100%; min-height: 56px; font-size: 1.05rem; }
}
