/* Book page only: the booking panel and the Bookly overrides. Loaded by page.php. */

/* Booking */

.booking__grid {
	display: grid;
	gap: clamp(2rem, 4vw, 3.5rem);
	align-items: start;
}

.booking__panel {
	position: relative;
	display: grid;
	gap: 1rem;
	padding: clamp(1.5rem, 4vw, 2.75rem);
	border-radius: var(--radius-plate);
	background: var(--cream);
	box-shadow: var(--shadow-lift);
	min-width: 0;
}

.booking__panel::before {
	content: "";
	position: absolute;
	inset: 10px;
	border: 1px solid rgb(36 67 56 / 0.16);
	border-radius: 8px;
	pointer-events: none;
}

.booking__intro {
	color: var(--ink-soft);
}

.booking__form.entry {
	max-width: none;
}

.booking__form {
	/* Bookly reads its accent from these; set on the wrapper so it beats the plugin's :root value */
	--bookly-main-color: #244338 !important;
	--bookly-color: #244338 !important;
	position: relative;
	min-height: 12rem;
	margin-top: 0.5rem;
}

/* Bookly renders its own markup; keep it on the theme's type and palette */
.booking__form .bookly-form,
.booking__form [class*="bookly-"] {
	font-family: var(--serif-text) !important;
	color: var(--ink);
}

.booking__form .bookly-form .bookly-btn,
.booking__form .bookly-form button.bookly-btn {
	min-height: 3.25rem;
	padding: 0.75rem 1.6rem !important;
	border: 0 !important;
	border-radius: var(--radius) !important;
	background: var(--forest) !important;
	color: var(--cream) !important;
	font-family: var(--serif-display) !important;
	font-size: 0.9375rem !important;
	font-weight: 700 !important;
	line-height: 1.2 !important;
	letter-spacing: 0.08em !important;
	text-transform: uppercase;
	box-shadow: var(--shadow-mount);
}

.booking__form .bookly-form .bookly-btn:hover {
	background: var(--forest-hover) !important;
}

.booking__form .bookly-form input:not([type="checkbox"]):not([type="radio"]),
.booking__form .bookly-form textarea,
.booking__form .bookly-form select {
	min-height: 3rem;
	padding: 0.6rem 0.9rem !important;
	border: 1px solid var(--sage-deep) !important;
	border-radius: 8px !important;
	background-color: var(--cream) !important;
	color: var(--ink) !important;
	font-family: var(--serif-text) !important;
	font-size: 1rem !important;
}

.booking__form .bookly-form select {
	appearance: none;
	padding-right: 2.5rem !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23244338' d='M7.4 8.6 12 13.2l4.6-4.6L18 10l-6 6-6-6z'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right 0.75rem center !important;
	background-size: 1.25rem !important;
}

.booking__form .bookly-form input:focus-visible,
.booking__form .bookly-form textarea:focus-visible,
.booking__form .bookly-form select:focus-visible {
	outline: 3px solid var(--forest);
	outline-offset: 2px;
}

/* step tracker: sage for steps ahead, forest for the current one */
.booking__form .bookly-progress-tracker .step {
	background: var(--sage-soft) !important;
}

.booking__form .bookly-progress-tracker .active .step {
	background: var(--forest) !important;
}

/* Bookly's phone dot stepper counts a step its labeled tracker does not; phones get the labeled tracker instead */
.booking__panel .booking__form .bookly-form ol.bookly-stepper {
	display: none !important;
}

.booking__panel .booking__form .bookly-form .bookly-progress-tracker {
	display: flex !important;
	gap: 4px;
	width: 100%;
}

.booking__panel .booking__form .bookly-form .bookly-progress-tracker > div {
	flex: 1 1 0;
	min-width: 0;
	font-size: 0.8125rem;
	line-height: 1.3;
}

/* The form uses the panel's full measure, so its rule, buttons and the call note share one edge */
.booking__form .bookly-form,
.booking__form .bookly-form .bookly-box,
.booking__form .bookly-form .bookly-nav-steps {
	width: 100% !important;
	max-width: none !important;
}

.booking__form .bookly-form input::placeholder,
.booking__form .bookly-form textarea::placeholder {
	color: var(--sage-deep) !important;
	opacity: 1;
}

.booking__form .bookly-form .bookly-btn .ladda-label,
.booking__form .bookly-form .bookly-btn span {
	font-size: inherit !important;
	letter-spacing: inherit !important;
}

@media (min-width: 60rem) {
	.booking__grid {
		grid-template-columns: minmax(0, 1fr) 20rem;
	}

	.booking__aside {
		position: sticky;
		top: calc(var(--header-h) + 1.5rem);
	}
}

/* Phone fallback under the form, always visible, the obvious route when no times show */
.booking__fallback {
	display: flex;
	gap: 0.75rem;
	align-items: flex-start;
	margin-top: 0.5rem;
	padding: 1rem 1.25rem;
	border-radius: var(--radius);
	background: var(--cream-deep);
	color: var(--ink);
	font-size: var(--step-0);
	line-height: 1.5;
}

.booking__fallback .icon {
	width: 1.25rem;
	height: 1.25rem;
	margin-top: 0.15em;
	fill: var(--forest);
}

.booking__fallback a {
	font-weight: 700;
	white-space: nowrap;
}

/* Field labels and the summary line read in the theme's ink, not the accent */
.booking__form .bookly-form .bookly-form-group > label {
	color: var(--ink) !important;
	font-weight: 600;
}

/* The phone field keeps room for its country flag */
.booking__form .bookly-form .iti input.iti__tel-input {
	padding-left: 3.4rem !important;
}

/* Weekday picks: round forest checks, as Bookly draws them, at a size that is easy to tap */
.booking__form .bookly-form .bookly-week-days input[type="checkbox"] {
	width: 1.6rem !important;
	height: 1.6rem !important;
	min-height: 0 !important;
	margin: 0.4rem auto 0 !important;
	border: 2px solid var(--forest) !important;
	background-color: var(--cream) !important;
}

.booking__form .bookly-form .bookly-week-days input[type="checkbox"]:checked {
	background-color: var(--forest) !important;
}

.booking__form .bookly-form .bookly-week-days > div {
	min-width: 2.75rem;
}

/* Time slots: day plates in forest, slots on cream with a sage edge */
.booking__form .bookly-columnizer .bookly-day {
	border-radius: 6px 6px 0 0;
	font-family: var(--serif-text) !important;
}

.booking__form .bookly-columnizer .bookly-hour {
	height: 2.5rem;
	border: 1px solid var(--sage) !important;
	border-radius: 6px;
	background: var(--cream) !important;
	transition: border-color 0.2s, background-color 0.2s;
}

.booking__form .bookly-columnizer .bookly-hour span {
	color: var(--ink) !important;
}

.booking__form .bookly-columnizer .bookly-hour .bookly-hour-icon {
	outline-color: var(--sage-deep) !important;
}

.booking__form .bookly-form .bookly-columnizer .bookly-hour:hover,
.booking__form .bookly-form .bookly-columnizer .bookly-hour:focus-visible {
	border: 2px solid var(--forest) !important;
	background: var(--cream-deep) !important;
}

.booking__form .bookly-form .bookly-columnizer .bookly-hour:focus-visible {
	outline: 3px solid var(--forest);
	outline-offset: 2px;
}

.booking__form .bookly-time-next,
.booking__form .bookly-time-prev {
	min-width: 3.25rem !important;
	height: 3.25rem !important;
}

/* Errors: a dedicated error color on the field edge and the message, never color alone */
.booking__form .bookly-form input.bookly-error,
.booking__form .bookly-form textarea.bookly-error,
.booking__form .bookly-form select.bookly-error {
	border: 2px solid var(--error) !important;
	background-color: #fff8f5 !important;
}

.booking__form .bookly-form .bookly-label-error {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	margin-top: 0.4rem;
	color: var(--error) !important;
	font-size: 0.9375rem;
	font-weight: 600;
}

.booking__form .bookly-form .bookly-label-error:not(:empty)::before {
	content: "";
	width: 1rem;
	height: 1rem;
	flex: none;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1 5h2v7h-2zm0 9h2v2h-2z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1 5h2v7h-2zm0 9h2v2h-2z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Once the booking is done, the phone fallback has nothing left to rescue */
.booking__panel:has(.bookly-progress-tracker > .active:last-child) .booking__fallback {
	display: none;
}

/* "More times" and "Earlier times": the pager reads as a labeled button, its arrow drawn, not typed */
.booking__form .bookly-form .bookly-time-next,
.booking__form .bookly-form .bookly-time-prev {
	width: auto !important;
	padding-inline: 1.25rem !important;
}

.booking__form .bookly-time-next .ladda-label,
.booking__form .bookly-time-prev .ladda-label {
	display: inline-flex !important;
	align-items: center;
	gap: 0.5rem;
}

.booking__form .bookly-time-next .ladda-label::after,
.booking__form .bookly-time-prev .ladda-label::before {
	content: "";
	width: 1rem;
	height: 1rem;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13.3 5.3a1 1 0 0 1 1.4 0l6 6a1 1 0 0 1 0 1.4l-6 6a1 1 0 0 1-1.4-1.4l4.3-4.3H4a1 1 0 1 1 0-2h13.6l-4.3-4.3a1 1 0 0 1 0-1.4z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13.3 5.3a1 1 0 0 1 1.4 0l6 6a1 1 0 0 1 0 1.4l-6 6a1 1 0 0 1-1.4-1.4l4.3-4.3H4a1 1 0 1 1 0-2h13.6l-4.3-4.3a1 1 0 0 1 0-1.4z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.booking__form .bookly-time-prev .ladda-label::before {
	transform: scaleX(-1);
}

/* Confirmation: the heading says it is booked; starting over is a quiet link, not the main action */
.booking__title-done {
	display: none;
}

.booking__panel:has(.bookly-progress-tracker > .active:last-child) .booking__title-pick,
.booking__panel:has(.bookly-progress-tracker > .active:last-child) .booking__intro {
	display: none;
}

.booking__panel:has(.bookly-progress-tracker > .active:last-child) .booking__title-done {
	display: inline;
}

.booking__panel:has(.bookly-progress-tracker > .active:last-child) .bookly-form .bookly-btn {
	min-height: 0;
	padding: 0.25rem 0 !important;
	background: transparent !important;
	box-shadow: none;
	color: var(--forest) !important;
	font-family: var(--serif-text) !important;
	font-size: 1rem !important;
	font-weight: 600 !important;
	letter-spacing: 0 !important;
	text-transform: none;
	text-decoration: underline;
	text-underline-offset: 0.3em;
}

.booking__panel:has(.bookly-progress-tracker > .active:last-child) .bookly-form .bookly-btn .ladda-label,
.booking__panel:has(.bookly-progress-tracker > .active:last-child) .bookly-form .bookly-btn span {
	color: var(--forest) !important;
}

/* Phones: the step buttons share one row and wrap together, never staggered */
@media (max-width: 45.99rem) {
	.booking__form .bookly-form .bookly-nav-steps {
		display: flex !important;
		flex-wrap: wrap;
		gap: 0.75rem;
	}

	.booking__form .bookly-form .bookly-nav-steps::before,
	.booking__form .bookly-form .bookly-nav-steps::after {
		display: none !important;
	}

	.booking__form .bookly-form .bookly-nav-steps > div {
		display: flex;
		flex: 1 1 auto;
		gap: 0.75rem;
		float: none !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	.booking__form .bookly-form .bookly-nav-steps > .bookly-btn,
	.booking__form .bookly-form .bookly-nav-steps > button,
	.booking__form .bookly-form .bookly-nav-steps > div > .bookly-btn {
		float: none !important;
		flex: 1 1 auto;
		height: auto !important;
		min-height: 3.25rem;
		margin: 0 !important;
	}
}

/* "Start over" after booking reads as the site's text link: underline and drawn arrow */
.booking__panel:has(.bookly-progress-tracker > .active:last-child) .bookly-form .bookly-btn .ladda-label {
	display: inline-flex !important;
	align-items: center;
	gap: 0.4rem;
	text-transform: none !important;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.3em;
}

.booking__panel:has(.bookly-progress-tracker > .active:last-child) .bookly-form .bookly-btn .ladda-label::after {
	content: "";
	width: 1rem;
	height: 1rem;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13.3 5.3a1 1 0 0 1 1.4 0l6 6a1 1 0 0 1 0 1.4l-6 6a1 1 0 0 1-1.4-1.4l4.3-4.3H4a1 1 0 1 1 0-2h13.6l-4.3-4.3a1 1 0 0 1 0-1.4z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13.3 5.3a1 1 0 0 1 1.4 0l6 6a1 1 0 0 1 0 1.4l-6 6a1 1 0 0 1-1.4-1.4l4.3-4.3H4a1 1 0 1 1 0-2h13.6l-4.3-4.3a1 1 0 0 1 0-1.4z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.booking__panel:has(.bookly-progress-tracker > .active:last-child) .bookly-form .bookly-btn:hover .ladda-label {
	text-decoration-thickness: 2px;
}

/* Consent line under the form: quiet, but the link is plain to see */
.booking__consent {
	margin-top: 0.25rem;
	color: var(--ink-soft);
	font-size: var(--step--1);
}

.booking__consent a {
	font-weight: 600;
}
