/* Public booking page - built on the --wb-* tokens from app.css */
.booking-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--wb-bg-subtle); }
.brand-logo { height: 26px; }
.bk-main { flex: 1; padding: calc(var(--topbar-h) + 2.5rem) 1rem 4rem; }
.bk-wrap { max-width: 1080px; margin: 0 auto; }
.bk-wrap--narrow { max-width: 640px; }

.bk-intro { max-width: 620px; margin-bottom: 2rem; }
.bk-title { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 .6rem; }
.bk-lead { color: var(--wb-text-muted); margin: 0; line-height: 1.6; }

/* Calendar list */
.cal-list { margin-top: 1.5rem; border-top: 1px solid var(--wb-border); }
.cal-list-item { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 1rem; padding: 1.1rem .25rem; border-bottom: 1px solid var(--wb-border); color: var(--wb-text); }
.cal-list-item:hover { color: var(--wb-text); background: var(--wb-bg); }
.cal-list-name { font-weight: 700; font-size: 1.05rem; }
.cal-list-meta { grid-row: 2; font-size: .85rem; color: var(--wb-text-muted); }
.cal-list-item i { grid-row: 1 / span 2; grid-column: 2; align-self: center; color: var(--wb-text-subtle); transition: transform .15s; }
.cal-list-item:hover i { transform: translateX(3px); color: var(--wb-text); }

/* Layout: calendar + sticky slot panel */
.bk-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.5rem; align-items: start; }

/* Calendar */
.bk-cal { background: var(--wb-bg); border: 1px solid var(--wb-border); padding: 1.25rem 1.25rem 1.5rem; }
.bk-cal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.bk-month { font-size: 1.15rem; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.bk-cal-nav { display: flex; align-items: center; gap: .25rem; }
.bk-icon-btn, .bk-today-btn { height: 34px; border: 1px solid var(--wb-border); background: var(--wb-bg); color: var(--wb-text-label); font-size: .85rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; transition: background .15s, border-color .15s, color .15s; }
.bk-icon-btn { width: 34px; padding: 0; }
.bk-today-btn { padding: 0 .75rem; }
.bk-icon-btn:hover:not(:disabled), .bk-today-btn:hover:not(:disabled) { background: var(--wb-disabled-bg); color: var(--wb-text); border-color: var(--wb-border-strong); }
.bk-icon-btn:disabled, .bk-today-btn:disabled { color: var(--wb-text-subtle); opacity: .5; cursor: default; }
.bk-icon-btn:focus-visible, .bk-today-btn:focus-visible { outline: 0; box-shadow: var(--wb-shadow-focus); }

.bk-weekdays, .bk-grid { display: grid; grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)); gap: 6px; }
.bk-weekdays { margin-bottom: 6px; }
.bk-weekdays span { text-align: center; font-size: .78rem; font-weight: 600; color: var(--wb-text-muted); padding: .25rem 0; }

/* Day tiles: explicit resets so buttons carry no browser border/background */
.bk-day { appearance: none; -webkit-appearance: none; margin: 0; font: inherit; position: relative; height: 64px; padding: 0; border: 1px solid transparent; background: transparent; color: var(--wb-text-subtle); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-variant-numeric: tabular-nums; }
.bk-day .num { font-size: .95rem; font-weight: 500; line-height: 1; padding-bottom: 3px; border-bottom: 2px solid transparent; }
.bk-day .mark { width: 16px; height: 3px; background: transparent; }
.bk-day.is-blank { visibility: hidden; }
.bk-day.is-past .num { color: var(--wb-border-strong); }

.bk-day.is-open { cursor: pointer; color: var(--wb-text); background: var(--wb-bg); border-color: var(--wb-border); transition: border-color .15s, background .15s; }
.bk-day.is-open .num { font-weight: 700; }
.bk-day.is-open .mark { background: #16a34a; }
.bk-day.is-open:hover { border-color: var(--wb-primary); }
.bk-day.is-open:focus-visible { outline: 0; border-color: var(--wb-primary); box-shadow: var(--wb-shadow-focus); }
.bk-day.is-full .mark { background: var(--wb-border-strong); }

.bk-day.is-today .num { border-bottom-color: var(--wb-red); }
.bk-day.is-selected, .bk-day.is-selected:hover { background: var(--wb-primary); border-color: var(--wb-primary); color: #fff; }
.bk-day.is-selected .mark { background: rgba(255, 255, 255, .7); }
.bk-day.is-selected.is-today .num { border-bottom-color: #fff; }

.bk-grid-note { grid-column: 1 / -1; padding: 2.5rem 1rem; text-align: center; color: var(--wb-text-muted); font-size: .9rem; }

/* Slot panel */
.bk-panel { background: var(--wb-bg); border: 1px solid var(--wb-border); position: sticky; top: calc(var(--topbar-h) + 1.25rem); }
.bk-panel-head { padding: 1.25rem 1.25rem 1rem; border-bottom: 1px solid var(--wb-border); }
.bk-panel-date { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; }
.bk-panel-meta { font-size: .85rem; color: var(--wb-text-muted); margin-top: .2rem; }
.bk-panel-body { padding: 1rem 1.25rem 1.25rem; }
.bk-panel-body:empty { display: none; }
.bk-panel-note { color: var(--wb-text-muted); font-size: .9rem; margin: 0; }

.slot-group + .slot-group { margin-top: 1.25rem; }
.slot-group-label { font-size: .8rem; font-weight: 600; color: var(--wb-text-muted); margin-bottom: .5rem; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.slot-chip { appearance: none; -webkit-appearance: none; margin: 0; font: inherit; border: 1px solid var(--wb-border-strong); background: var(--wb-bg); color: var(--wb-text); padding: .6rem .25rem; font-weight: 700; font-size: .92rem; font-variant-numeric: tabular-nums; line-height: 1.15; text-align: center; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.slot-chip small { display: block; font-weight: 500; font-size: .72rem; color: var(--wb-text-muted); margin-top: 2px; }
.slot-chip:hover:not(:disabled) { background: var(--wb-primary); border-color: var(--wb-primary); color: #fff; }
.slot-chip:hover:not(:disabled) small { color: rgba(255, 255, 255, .75); }
.slot-chip:focus-visible { outline: 0; box-shadow: var(--wb-shadow-focus); border-color: var(--wb-primary); }
.slot-chip .slot-time { display: block; }
.slot-chip:disabled { cursor: default; background: var(--wb-bg-subtle); border-color: var(--wb-border); color: var(--wb-text-subtle); }
.slot-chip:disabled .slot-time { text-decoration: line-through; }
.slot-chip:disabled small { color: var(--wb-text-subtle); }

/* Modal */
.modal, .modal-body { overscroll-behavior: contain; }   /* swipes inside the form do not scroll the page behind */
/* The <form> sits between .modal-content and .modal-body; it must pass the flex layout on,
   otherwise Bootstrap's scrollable dialog cannot shrink the body and the buttons are cut off. */
#bookForm { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; }
#bookForm .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
#bookForm .modal-footer { flex-shrink: 0; }
.modal-content { border: 1px solid var(--wb-border); border-radius: 0; }
.modal-header { border-bottom: 1px solid var(--wb-border); }
.modal-title { font-weight: 700; font-size: 1.1rem; }
.slot-summary { border-left: 3px solid var(--wb-primary); background: var(--wb-bg-subtle); padding: .8rem 1rem; margin-bottom: 1.25rem; }
.slot-summary-name { font-weight: 700; }
.slot-summary-when { color: var(--wb-text-label); margin-top: .2rem; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.success-box { text-align: center; padding: 1rem .5rem 0; }
.success-box i { font-size: 2.5rem; color: var(--wb-success-text); }
.success-box h5 { font-weight: 700; margin: .5rem 0; }

@media (max-width: 991.98px) {
    .bk-layout { grid-template-columns: 1fr; }
    .bk-panel { position: static; }
}
@media (max-width: 575.98px) {
    /* iOS zooms into fields with text smaller than 16px, which makes the whole view draggable. */
    .booking-page .form-control, .booking-page .form-select { font-size: 16px; }
    .bk-main { padding: calc(var(--topbar-h) + 1.5rem) .75rem 3rem; }
    .bk-cal { padding: 1rem .75rem 1.25rem; }
    .bk-weekdays, .bk-grid { gap: 4px; }
    .bk-day { height: 52px; gap: 5px; }
    .bk-today-btn { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .bk-day, .slot-chip, .cal-list-item i, .bk-icon-btn, .bk-today-btn { transition: none; }
}
