/* ==========================================================================
   THEEB-CONSULTATION-BOOKING-V1 / THEEB-BOOKING-MODAL-UX-FIX — booking modal. Front page only (see
   inc/assets.php conditional enqueue). Reuses the site's palette/type/spacing tokens only — no new
   colours, no Bootstrap/SaaS modal patterns, no glassmorphism (BRIEF §26).

   ROOT-CAUSE FIX (BRIEF §1/§16): `.bkm__state{display:flex}` is an AUTHOR rule, which always beats
   the browser's own `[hidden]{display:none}` UA rule regardless of selector specificity — so the
   success state was rendering (and being reachable by scroll) even while `hidden`. Fixed by an
   explicit, unambiguous `[hidden]` override below.
   ========================================================================== */

.bkm { position: fixed; inset: 0; z-index: 200; display: none; }
.bkm.is-open { display: block; }
.bkm__overlay { position: absolute; inset: 0; background: rgb(15 9 6 / 0.72); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); opacity: 0; transition: opacity var(--dur-base) var(--ease); }
.bkm.is-open .bkm__overlay { opacity: 1; }

.bkm__dialog {
	position: absolute; inset-block-start: 50%; inset-inline-start: 50%;
	transform: translate(calc(var(--dir) * -50%), -50%) translateY(10px);
	width: min(92vw, 900px);
	max-height: calc(100dvh - 3rem);
	overflow-y: auto;   /* exception, not the design (BRIEF §21): only engages on unusually short viewports */
	display: flex; flex-direction: column;
	background: var(--c-ink); color: var(--c-text-on-dark);
	border: 1px solid rgb(192 138 62 / 0.28);
	box-shadow: 0 30px 70px -20px rgb(0 0 0 / 0.55);
	opacity: 0;
	transition: opacity var(--dur-base) var(--ease), transform var(--dur-base) var(--ease);
}
.bkm.is-open .bkm__dialog { opacity: 1; transform: translate(calc(var(--dir) * -50%), -50%) translateY(0); }
.bkm__dialog:focus { outline: none; }

.bkm__close {
	position: absolute; inset-block-start: 0.85rem; inset-inline-end: 0.85rem; z-index: 1;
	width: 2.25rem; height: 2.25rem; display: grid; place-items: center;
	color: var(--c-text-on-dark-muted); transition: color var(--dur-fast) var(--ease);
}
.bkm__close:hover, .bkm__close:focus-visible { color: var(--c-ivory); }

/* THEEB-BOOKING-HONEYPOT-FIX: this rule was dropped when booking.css was rewritten for the compact
   single-view redesign, leaving the honeypot input (assets/js/booking.js never reads it visually,
   only its .value) rendering as a plain default-styled <input> at the very top of the form. Same
   off-screen technique as the approved Contact form's `.cf__hp` (assets/css/contact.css) — not
   display:none, so the field stays genuinely present/fillable for a bot that doesn't check visibility,
   while taking no layout space and never being visible to a real visitor. */
.bkm__hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Mutually-exclusive states — only ONE participates in layout at a time. */
.bkm__state { display: flex; flex-direction: column; gap: 0.7rem; padding: 1.15rem clamp(1.25rem, 3vw, 2.25rem) 1.25rem; }
.bkm__state[hidden] { display: none !important; }

/* ---- form state ---------------------------------------------------------- */
.bkm__head { padding-inline-end: 2rem; }   /* clears the close button */
.bkm__eyebrow { color: var(--section-eyebrow-color-on-dark); margin-block-end: 0.3rem; font-size: var(--fs-caption); }
.bkm__title { font-family: var(--font-display); font-size: clamp(1.25rem, 1rem + 1vw, 1.5rem); font-weight: 500; color: var(--c-ivory); }

.bkm__row { display: grid; grid-template-columns: 1fr; gap: 0.75rem; }
@media (min-width: 560px) { .bkm__row { grid-template-columns: 1fr 1fr; } }
.bkm__field--full { grid-column: 1 / -1; }
.bkm__field { display: grid; gap: 0.3rem; }
.bkm__field label { font-size: var(--fs-caption); color: var(--c-text-on-dark-muted); }
.bkm__field input, .bkm__field select {
	width: 100%; min-height: 2.5rem; padding: 0.45rem 0.75rem;
	background: rgb(247 242 233 / 0.04); border: 1px solid var(--c-line-on-dark); color: var(--c-ivory);
	font-family: var(--font-body); font-size: 0.9375rem; transition: border-color var(--dur-fast) var(--ease);
}
.bkm__field input::placeholder { color: rgb(247 242 233 / 0.35); }
.bkm__field input:focus-visible, .bkm__field select:focus-visible { outline: none; border-color: var(--c-gold); }
.bkm__field select { appearance: none; background-image: none; }
html:not([dir="rtl"]) .bkm__field select { direction: ltr; }
.bkm__err { display: block; min-height: 1em; font-size: var(--fs-caption); color: #e2a26a; }
.bkm__field.has-error input, .bkm__field.has-error select { border-color: #e2a26a; }
[data-bkm-other][hidden] { display: none; }

/* icons used inline next to a text label — decorative, small, thin, currentColor (BRIEF §9/§10/§27) */
.bkm-icon { flex: none; margin-inline-end: 0.4rem; vertical-align: -0.15em; color: var(--c-gold-soft); }

/* ---- date + time ---------------------------------------------------------- */
.bkm__dt { display: grid; gap: 1.25rem; margin-block-start: 0.25rem; }
@media (min-width: 640px) { .bkm__dt { grid-template-columns: 1fr 1fr; align-items: start; } }
.bkm__cal-head { display: flex; align-items: center; justify-content: space-between; margin-block-end: 0.5rem; }
.bkm__cal-label { font-family: var(--font-label); font-size: var(--fs-caption); letter-spacing: 0.02em; color: var(--c-ivory); }
.bkm__cal-nav { width: 1.875rem; height: 1.875rem; display: grid; place-items: center; color: var(--c-text-on-dark-muted); transition: color var(--dur-fast) var(--ease); }
.bkm__cal-nav .arrow { transform: scaleX(calc(var(--dir) * -1)); }
.bkm__cal-nav--next .arrow { transform: scaleX(var(--dir)); }
.bkm__cal-nav:hover, .bkm__cal-nav:focus-visible { color: var(--c-gold-soft); }
.bkm__cal-nav:disabled { opacity: 0.3; pointer-events: none; }
.bkm__cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.bkm__cal-dow { text-align: center; font-size: 0.625rem; color: rgb(247 242 233 / 0.4); padding-block: 0.2rem; }
.bkm__cal-day {
	height: 1.85rem; display: grid; place-items: center; font-size: 0.8125rem; color: var(--c-text-on-dark-muted);
	background: rgb(247 242 233 / 0.03); border: 1px solid transparent; transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.bkm__cal-day--empty { visibility: hidden; }
.bkm__cal-day--open { color: var(--c-ivory); cursor: pointer; }
.bkm__cal-day--open:hover, .bkm__cal-day--open:focus-visible { border-color: rgb(192 138 62 / 0.5); outline: none; }
.bkm__cal-day--full, .bkm__cal-day--closed { color: rgb(247 242 233 / 0.22); text-decoration: line-through; text-decoration-color: rgb(247 242 233 / 0.15); cursor: default; }
.bkm__cal-day--selected { background: var(--c-gold); color: var(--c-ink); font-weight: 600; }

.bkm__slots-label { display: flex; align-items: center; font-size: var(--fs-caption); color: var(--c-text-on-dark-muted); margin-block-end: 0.5rem; }
.bkm__date-summary { display: flex; align-items: center; font-size: var(--fs-caption); color: var(--c-gold-soft); margin-block-end: 0.6rem; }
.bkm__date-summary[hidden] { display: none; }
.bkm__slots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.25rem, 1fr)); gap: 0.4rem; max-height: 8.5rem; overflow-y: auto; padding-inline-end: 2px; }
.bkm__slot {
	min-height: 2.1rem; display: grid; place-items: center; font-size: 0.8125rem; font-family: var(--font-label);
	border: 1px solid var(--c-line-on-dark); color: var(--c-text-on-dark-muted); background: transparent;
	transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.bkm__slot:hover:not(:disabled), .bkm__slot:focus-visible { border-color: rgb(192 138 62 / 0.6); color: var(--c-ivory); outline: none; }
.bkm__slot[aria-selected="true"] { background: var(--c-gold); border-color: var(--c-gold); color: var(--c-ink); }
.bkm__slot:disabled { opacity: 0.28; text-decoration: line-through; cursor: not-allowed; }
.bkm__slots-empty, .bkm__slots-loading { font-size: var(--fs-caption); color: rgb(247 242 233 / 0.45); grid-column: 1 / -1; padding-block: 0.5rem; }

/* ---- submit ---------------------------------------------------------- */
.bkm__foot { display: flex; flex-direction: column; align-items: stretch; gap: 0.3rem; margin-block-start: 0.25rem; }
.bkm__foot .bkm__err { text-align: center; }
.bkm__submit { justify-content: center; width: 100%; }
@media (min-width: 560px) { .bkm__submit { width: auto; align-self: center; min-width: 14rem; } }
.bkm__submit:disabled { opacity: 0.7; pointer-events: none; }
.bkm__submit .btn-spin { display: inline-block; width: 0.8em; height: 0.8em; margin-inline-end: 0.5em; border: 1.5px solid currentColor; border-inline-start-color: transparent; border-radius: 50%; vertical-align: -0.12em; animation: bkm-spin 700ms linear infinite; }
@keyframes bkm-spin { to { transform: rotate(360deg); } }

/* ---- success state ---------------------------------------------------------- */
.bkm__state--success { align-items: center; text-align: center; padding-block: 2.25rem; }
.bkm__state--success:focus { outline: none; }
.bkm__success-mark { width: 2.75rem; height: 2.75rem; border: 1px solid var(--c-gold); display: grid; place-items: center; color: var(--c-gold-soft); margin-block-end: 0.35rem; }
.bkm__success-title { font-family: var(--font-display); font-size: var(--fs-h3); font-weight: 500; color: var(--c-ivory); max-width: 26ch; }
.bkm__review { display: grid; gap: 0.7rem; width: 100%; max-width: 22rem; margin-block-start: 0.5rem; }
.bkm__review > div { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block-end: 0.7rem; border-bottom: 1px solid var(--c-line-on-dark); }
.bkm__review dt { display: flex; align-items: center; color: var(--c-text-on-dark-muted); font-size: var(--fs-small); }
.bkm__review dd { margin: 0; color: var(--c-ivory); font-weight: 500; }
.bkm__ref { font-family: var(--font-label); letter-spacing: 0.04em; }
/* THEEB-BOOKING-EDITABLE-CONFIRMATION-NOTE-V1 — compact, no card-in-card: a hairline divider + small label, reusing existing success-state tokens. */
.bkm__success-confirmation { width: 100%; max-width: 22rem; margin-block-start: 0.6rem; padding-block-start: 0.6rem; border-block-start: 1px solid var(--c-line-on-dark); }
.bkm__success-confirmation-label { display: block; font-size: var(--fs-caption); color: var(--c-gold-soft); font-weight: 500; margin-block-end: 0.2rem; }
.bkm__success-confirmation-text { margin: 0; font-size: var(--fs-small); line-height: 1.5; color: var(--c-text-on-dark-muted); }
.bkm__success-note { font-size: var(--fs-caption); color: var(--c-text-on-dark-muted); margin-block-start: 0.35rem; }
.bkm__success-actions { display: flex; align-items: center; gap: 1.5rem; margin-block-start: 0.75rem; }

@media (max-width: 767px) {
	.bkm__dialog { inset-block-start: 0; inset-inline-start: 0; transform: none; width: 100%; height: 100%; max-height: none; border: none; }
	.bkm.is-open .bkm__dialog { transform: none; }
	.bkm__state { padding-block-start: 2.75rem; }
}

@media (prefers-reduced-motion: reduce) {
	.bkm__overlay, .bkm__dialog { transition: none; }
	.bkm__submit .btn-spin { animation: none; }
}
