/*
 * Book a Call page. The step layout (progress bar, step titles, Continue and Back) comes from the
 * theme's quote-form styles, and inputs, labels and buttons from its form styles (.form-row, .btn);
 * this file only adds what the booking form needs: the calendar and the times.
 * Colours match the theme: slate-900/50 fields, white/30 borders, indigo-600 selection.
 *
 * The calendar and the times panel have fixed heights, so the page does not shift when slots load.
 */

.booking [hidden] {
	display: none;
}

/*
 * The step titles ("Pick a Date and Time", "Your Details") are not shown: the form explains itself.
 * They stay in the page for screen readers, because booking.js announces "Step 2 of 2: Your Details"
 * and moves focus to the title when the step changes. (.quote-form is repeated so this wins over
 * the theme's title style, which has the same weight.)
 */
.booking.quote-form .quote-step-title {
	border: 0;
	clip: rect(0, 0, 0, 0);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

.booking .booking-note {
	color: rgba(255, 255, 255, 0.7);
	font-size: 0.875rem;
	margin-bottom: 1.25rem;
	text-align: center;
}

/* Native select, used until the theme's selectWoo takes over. Same look as the text inputs. */
.booking select {
	-webkit-appearance: none;
	appearance: none;
	background: rgba(15, 23, 42, 0.5) url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="9" viewBox="0 0 14 9"><path fill="none" stroke="%23FFF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="m1 1.5 6 6 6-6"/></svg>') no-repeat right 1.25rem center;
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 0.75rem;
	color: #fff;
	cursor: pointer;
	font-size: 1rem;
	height: 52px;
	padding: 0.75rem 3rem 0.75rem 1.5rem;
	width: 100%;
}

.booking select:focus {
	border-color: rgba(255, 255, 255, 0.5);
	outline: none;
}

.booking select option {
	background: #082f49;
	color: #fff;
}

/* Picker: calendar on the left, times on the right (stacked on phones), each in its own box. */
.booking .booking-picker-grid {
	align-items: stretch;
	display: grid;
	gap: 1.5rem;
	grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 768px) {
	.booking .booking-picker-grid {
		grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
	}
}

/* The same box as the quote form's option panels (bg-slate-900/30, border-white/10, p-6, rounded-xl). */
.booking .booking-calendar,
.booking .booking-slots {
	background: rgba(15, 23, 42, 0.3);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 0.75rem;
	padding: 1.5rem;
}

.booking .booking-cal-head {
	align-items: center;
	display: flex;
	height: 2.5rem;
	justify-content: space-between;
	margin-bottom: 0.5rem;
}

.booking .booking-cal-month {
	color: #fff;
	font-size: 1.125rem;
	font-weight: 700;
	margin: 0;
}

.booking .booking-cal-nav {
	align-items: center;
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 0.5rem;
	color: #fff;
	cursor: pointer;
	display: inline-flex;
	height: 2.25rem;
	justify-content: center;
	padding: 0;
	width: 2.25rem;
}

.booking .booking-cal-nav:hover:not(:disabled) {
	border-color: #c7d2fe;
}

.booking .booking-cal-nav:disabled {
	cursor: default;
	opacity: 0.3;
}

.booking .booking-cal-nav:focus-visible,
.booking .booking-cal-day:focus-visible {
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7);
	outline: none;
}

.booking .booking-cal-weekdays,
.booking .booking-cal-days {
	display: grid;
	gap: 0.25rem;
	grid-template-columns: repeat(7, minmax(0, 1fr));
}

.booking .booking-cal-weekdays {
	color: rgba(255, 255, 255, 0.5);
	font-size: 0.75rem;
	height: 1.5rem;
	text-align: center;
}

/* 6 rows of 2.5rem plus 5 gaps of 0.25rem = 16.25rem: the same for every month, and reserved before the cells render. */
.booking .booking-cal-days {
	grid-auto-rows: 2.5rem;
	min-height: 16.25rem;
}

.booking .booking-cal-day {
	background: transparent;
	border: 1px solid transparent;
	border-radius: 0.5rem;
	color: rgba(255, 255, 255, 0.3);
	font-size: 0.9375rem;
	padding: 0;
}

.booking .booking-cal-day.is-open {
	background: rgba(79, 70, 229, 0.2);
	color: #fff;
	cursor: pointer;
	font-weight: 700;
}

.booking .booking-cal-day.is-open:hover {
	border-color: #c7d2fe;
}

.booking .booking-cal-day.is-selected {
	background: #4f46e5;
	border-color: #c7d2fe;
}

/* Loading placeholder: dimmed, softly pulsing days until the slots arrive. */
.booking .booking-cal-days.is-loading .booking-cal-day {
	animation: wpbybk-pulse 1.2s ease-in-out infinite;
	background: rgba(255, 255, 255, 0.08);
}

@keyframes wpbybk-pulse {
	50% {
		opacity: 0.4;
	}
}

@media (prefers-reduced-motion: reduce) {
	.booking .booking-cal-days.is-loading .booking-cal-day {
		animation: none;
	}
}

/*
 * Times box: at most 9 slots a day (09:00-18:00, hourly), so 2 columns by 5 rows. The height is
 * fixed for the fullest day, so picking another day never moves the page: box padding (3rem) +
 * title (3rem) + the nine-slot list (15.5rem). On desktop the box also stretches to the calendar's height.
 */
.booking .booking-slots {
	min-height: 21.5rem;
}

.booking .booking-slots-title {
	color: rgba(255, 255, 255, 0.9);
	font-size: 1rem;
	font-weight: 700;
	height: 2.5rem;
	line-height: 1.25rem;
	margin: 0 0 0.5rem;
}

.booking .booking-times {
	align-content: start;
	display: grid;
	gap: 0.5rem;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	min-height: 15.5rem;
}

/* Time slots: the radio stays focusable but visually hidden; the label becomes the button. */
.booking .booking-time {
	cursor: pointer;
	margin-bottom: 0;
	position: relative;
}

.booking .booking-time input {
	cursor: pointer;
	height: 100%;
	left: 0;
	opacity: 0;
	position: absolute;
	top: 0;
	width: 100%;
}

.booking .booking-time span {
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 0.5rem;
	color: rgba(255, 255, 255, 0.9);
	cursor: pointer;
	display: block;
	font-size: 0.875rem;
	padding: 0.5rem 0;
	text-align: center;
	transition: border-color 0.15s, background-color 0.15s;
	-webkit-user-select: none;
	user-select: none;
}

/* Hover: the border goes fully opaque. On the label, not the span: the radio covers the span. */
.booking .booking-time:hover span {
	border-color: #fff;
}

.booking .booking-time input:checked + span {
	background: #4f46e5;
	border-color: #c7d2fe;
	color: #fff;
}

.booking .booking-time input:focus-visible + span {
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7);
}

/* Terms and Privacy note under the Book button. */
.booking .booking-legal {
	color: rgba(255, 255, 255, 0.7);
	font-size: 0.875rem;
	margin: 0;
	text-align: center;
}

/* Honeypot: off-screen, not display:none, so simple bots still fill it. */
.booking .booking-hp {
	height: 1px;
	left: -9999px;
	overflow: hidden;
	position: absolute;
	width: 1px;
}

.booking .booking-error {
	color: #fca5a5;
	margin-bottom: 1.25rem;
	text-align: center;
}

.booking .booking-done {
	padding: 2.5rem 0;
	text-align: center;
}

.booking .booking-done:focus {
	outline: none;
}
