/**
 * Booking form styles.
 *
 * Deliberately restrained. This renders inside whatever theme the store runs,
 * so it inherits fonts and colours rather than imposing its own, and only
 * styles what the theme cannot reasonably be expected to handle — the calendar
 * grid and the availability states.
 */

.prb-form {
	--prb-available: #ffffff;
	--prb-partial: #f6c344;
	--prb-booked: #d63638;
	--prb-closed: #e8964f;
	--prb-past: #f0f0f1;
	--prb-border: rgba( 0, 0, 0, 0.12 );

	margin: 1.5em 0;
}

/* Calendar ---------------------------------------------------------------- */

.prb-calendar-wrap {
	margin-bottom: 1.5em;
}

.prb-cal-header {
	align-items: center;
	display: flex;
	gap: 0.5em;
	justify-content: center;
	margin-bottom: 0.5em;
}

.prb-cal-title {
	flex: 1;
	font-size: 1.1em;
	font-weight: 600;
	text-align: center;
}

.prb-cal-nav {
	background: transparent;
	border: 1px solid var( --prb-border );
	border-radius: 4px;
	cursor: pointer;
	font-size: 1.2em;
	line-height: 1;
	padding: 0.3em 0.7em;
}

.prb-cal-nav:hover {
	background: rgba( 0, 0, 0, 0.04 );
}

.prb-cal-grid {
	border-collapse: collapse;
	table-layout: fixed;
	width: 100%;
}

.prb-cal-grid th {
	font-size: 0.8em;
	font-weight: 600;
	padding: 0.4em 0;
	text-align: center;
	text-transform: uppercase;
}

.prb-cal-cell {
	border: 1px solid var( --prb-border );
	height: 2.8em;
	padding: 0;
	position: relative;
	text-align: center;
	vertical-align: middle;
}

.prb-cal-cell[data-state="available"] { background: var( --prb-available ); }
.prb-cal-cell[data-state="partial"]   { background: var( --prb-partial ); }
.prb-cal-cell[data-state="booked"]    { background: var( --prb-booked ); }
.prb-cal-cell[data-state="closed"]    { background: var( --prb-closed ); }
.prb-cal-cell[data-state="past"]      { background: var( --prb-past ); }

.prb-cal-outside {
	opacity: 0.45;
}

.prb-cal-day {
	background: none;
	border: 0;
	color: inherit;
	cursor: pointer;
	font: inherit;
	height: 100%;
	padding: 0.6em 0;
	width: 100%;
}

.prb-cal-day--disabled {
	cursor: default;
	display: block;
	opacity: 0.7;
	padding: 0.6em 0;
}

.prb-cal-cell.is-selected {
	box-shadow: inset 0 0 0 2px currentColor;
}

.prb-cal-day:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: -2px;
}

.prb-cal-count {
	bottom: 2px;
	font-size: 0.65em;
	line-height: 1;
	position: absolute;
	right: 3px;
}

.prb-calendar-error,
.prb-calendar-loading {
	padding: 1em 0;
	text-align: center;
}

/* Legend ------------------------------------------------------------------ */

.prb-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 1em;
	list-style: none;
	margin: 0.6em 0 0;
	padding: 0;
}

.prb-legend li {
	align-items: center;
	display: flex;
	font-size: 0.85em;
	gap: 0.4em;
}

.prb-swatch {
	border: 1px solid var( --prb-border );
	display: inline-block;
	height: 0.9em;
	width: 0.9em;
}

.prb-swatch[data-state="available"] { background: var( --prb-available ); }
.prb-swatch[data-state="partial"]   { background: var( --prb-partial ); }
.prb-swatch[data-state="booked"]    { background: var( --prb-booked ); }
.prb-swatch[data-state="closed"]    { background: var( --prb-closed ); }
.prb-swatch[data-state="past"]      { background: var( --prb-past ); }

/* Fields ------------------------------------------------------------------ */

/**
 * Compact fields pair up two per row. The wrapper is emitted by PHP rather
 * than inferred from a grid over all fields, so theme styling on the fields
 * themselves cannot break the pairing.
 */
.prb-form .prb-row {
	display: grid;
	gap: 0 1.2em;
	grid-template-columns: repeat( 3, minmax( 0, 1fr ) );
}

.prb-form .prb-row--1 {
	grid-template-columns: minmax( 0, 1fr );
}

.prb-form .prb-row--2 {
	grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
}

/* Three columns get tight before the mobile breakpoint, so drop to two first. */
@media ( max-width: 780px ) {
	.prb-form .prb-row--3 {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	}
}

.prb-form .prb-row > .prb-field {
	min-width: 0;
}

@media ( max-width: 560px ) {
	.prb-form .prb-row,
	.prb-form .prb-row--2,
	.prb-form .prb-row--3 {
		grid-template-columns: minmax( 0, 1fr );
	}
}

.prb-field {
	margin-bottom: 1em;
	min-width: 0;
}

.prb-field label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.3em;
}

/**
 * Controls.
 *
 * A date input, a select and a number input are three different native widgets
 * and browsers style each one differently by default — different heights,
 * borders and text colours. Left alone they read as three unrelated things
 * sitting in a row, so the shared properties are set explicitly here.
 *
 * The selectors are doubled up (.prb-form .prb-field select) to outweigh theme
 * form styling without resorting to !important.
 */
.prb-form .prb-field select,
.prb-form .prb-field input[type="date"],
.prb-form .prb-field input[type="number"],
.prb-form .prb-field input[type="text"] {
	-webkit-appearance: none;
	appearance: none;
	background-color: #fff;
	border: 1px solid var( --prb-border );
	border-radius: 4px;
	box-shadow: none;
	color: inherit;
	font-family: inherit;
	font-size: 1em;
	line-height: 1.4;
	max-width: 100%;
	min-height: 2.9em;
	padding: 0.55em 0.75em;
	width: 100%;
}

/* Restore the select's own arrow, which appearance:none removes. */
.prb-form .prb-field select {
	background-image: url( "data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%23555' d='M1 1l5 5 5-5'/%3E%3C/svg%3E" );
	background-position: right 0.75em center;
	background-repeat: no-repeat;
	background-size: 0.7em;
	padding-right: 2.2em;
}

.prb-form .prb-field input:focus,
.prb-form .prb-field select:focus {
	border-color: currentColor;
	outline: 2px solid transparent;
	outline-offset: 1px;
}

/**
 * A single-unit product still shows its quantity box, disabled. It must read
 * as a field that happens to be fixed rather than as a stray label, so it
 * keeps the same border and box as its neighbours and only the fill and
 * cursor change.
 */
.prb-form .prb-field--quantity input[disabled] {
	background-color: rgba( 0, 0, 0, 0.04 );
	border: 1px solid var( --prb-border );
	color: inherit;
	cursor: not-allowed;
	opacity: 0.75;
}

.prb-field--extras {
	border: 1px solid var( --prb-border );
	border-radius: 4px;
	padding: 0.8em 1em;
}

.prb-field--extras legend {
	font-weight: 600;
	padding: 0 0.4em;
}

.prb-extras-list {
	display: flex;
	flex-direction: column;
}

.prb-form .prb-extra {
	align-items: center;
	border-top: 1px solid var( --prb-border );
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em 1em;
	justify-content: space-between;
	padding: 0.7em 0;
}

.prb-form .prb-extra:first-child {
	border-top: 0;
}

.prb-form .prb-extra.is-selected {
	background: rgba( 0, 0, 0, 0.02 );
}

/* Selecting -------------------------------------------------------------- */

.prb-form .prb-extra-select {
	align-items: center;
	cursor: pointer;
	display: flex;
	flex: 1 1 11em;
	font-weight: 400;
	gap: 0.6em;
	margin: 0;
	min-width: 0;
	padding: 0;
}

.prb-form .prb-extra-check {
	flex: 0 0 auto;
	height: 1.1em;
	margin: 0;
	width: 1.1em;
}

.prb-extra-text {
	display: flex;
	flex-direction: column;
	gap: 0.1em;
	min-width: 0;
}

.prb-extra-name {
	font-weight: 600;
	line-height: 1.3;
}

.prb-extra-price {
	font-size: 0.9em;
	opacity: 0.75;
	white-space: nowrap;
}

/* Controls --------------------------------------------------------------- */

.prb-extra-controls {
	align-items: center;
	display: flex;
	flex: 0 0 auto;
	gap: 0.75em;
}

/**
 * Stepper. The bordered wrapper matters: a bare number input inherits whatever
 * the theme does to inputs, and in at least one theme that means no border and
 * grey text — which reads as a label rather than something you can type in.
 */
.prb-stepper {
	align-items: stretch;
	border: 1px solid var( --prb-border );
	border-radius: 4px;
	display: inline-flex;
	overflow: hidden;
}

.prb-stepper-btn {
	background: rgba( 0, 0, 0, 0.03 );
	border: 0;
	color: inherit;
	cursor: pointer;
	font-size: 1em;
	line-height: 1;
	min-width: 2.1em;
	padding: 0.45em 0.5em;
}

.prb-stepper-btn:hover {
	background: rgba( 0, 0, 0, 0.08 );
}

.prb-stepper-btn:disabled {
	cursor: not-allowed;
	opacity: 0.4;
}

.prb-form .prb-stepper .prb-extra-qty,
.prb-form .prb-stepper input[type="number"].prb-extra-qty {
	-moz-appearance: textfield;
	appearance: textfield;
	background: transparent;
	border: 0;
	border-left: 1px solid var( --prb-border );
	border-radius: 0;
	border-right: 1px solid var( --prb-border );
	box-shadow: none;
	color: inherit;
	font-size: 1em;
	height: auto;
	margin: 0;
	min-width: 0;
	opacity: 1;
	padding: 0.4em 0.2em;
	text-align: center;
	width: 3.2em;
}

.prb-form .prb-stepper .prb-extra-qty::-webkit-outer-spin-button,
.prb-form .prb-stepper .prb-extra-qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.prb-extra-availability {
	font-size: 0.82em;
	min-width: 7.5em;
	opacity: 0.7;
	text-align: right;
}

.prb-extra-availability.is-error {
	color: var( --prb-booked );
	font-weight: 600;
	opacity: 1;
}

/* The "Tap to add" hint belongs to the mobile card layout only. */
.prb-extra-hint {
	display: none;
}

/**
 * Defensive resets.
 *
 * Themes routinely set `label { display: block }` and stretch form controls to
 * full width inside product summaries, which is what flattened this section
 * into a stack of orphaned labels in earlier builds. These rules re-assert the
 * layout with enough specificity to win, without resorting to !important.
 */
.prb-form .prb-extras-list label,
.prb-form .prb-extras-list span {
	float: none;
	letter-spacing: normal;
	text-transform: none;
	width: auto;
}

.prb-form .prb-extras-list .prb-extra-text {
	display: flex;
}

.prb-form .prb-extras-list input[type="checkbox"] {
	display: inline-block;
	float: none;
	position: static;
	vertical-align: middle;
}

/* Mobile: selectable cards ------------------------------------------------ */

/**
 * Below 600px each extra becomes a card whose whole surface is a tap target —
 * a 16px checkbox is an unkind thing to ask someone to hit on a phone. The
 * stepper only appears once the card is selected, so an unselected card stays
 * a single clean choice rather than a row of controls.
 */
@media ( max-width: 599px ) {
	.prb-form .prb-extras-list {
		display: grid;
		gap: 10px;
		grid-template-columns: minmax( 0, 1fr );
	}

	.prb-form .prb-extra {
		align-items: stretch;
		border: 1px solid var( --prb-border );
		border-radius: 12px;
		border-top: 1px solid var( --prb-border );
		flex-direction: column;
		gap: 0;
		padding: 0.85em 1em;
		position: relative;
	}

	.prb-form .prb-extra.is-selected {
		background: transparent;
		border-color: currentColor;
		box-shadow: inset 0 0 0 1px currentColor;
	}

	.prb-form .prb-extra-select {
		flex: 1 1 auto;
		flex-direction: row-reverse;
		justify-content: space-between;
	}

	/* Stretches the label over the whole card so any tap toggles it. */
	.prb-form .prb-extra-select::after {
		content: "";
		inset: 0;
		position: absolute;
	}

	.prb-form .prb-extra-check {
		height: 1.25em;
		width: 1.25em;
	}

	.prb-extra-controls {
		align-items: center;
		justify-content: space-between;
		margin-top: 0.7em;
		position: relative;
		width: 100%;
		z-index: 1;
	}

	.prb-extra-hint {
		color: inherit;
		display: block;
		font-size: 0.85em;
		opacity: 0.7;
	}

	.prb-form .prb-extra .prb-stepper {
		display: none;
	}

	.prb-form .prb-extra.is-selected .prb-stepper {
		display: inline-flex;
	}

	.prb-form .prb-extra.is-selected .prb-extra-hint {
		display: none;
	}

	.prb-stepper-btn {
		min-width: 2.6em;
		padding: 0.55em 0.6em;
	}

	.prb-extra-availability {
		min-width: 0;
	}
}

/* Summary ----------------------------------------------------------------- */

.prb-summary {
	border-top: 1px solid var( --prb-border );
	margin: 1em 0;
	padding-top: 0.8em;
}

.prb-summary-total {
	align-items: baseline;
	display: flex;
	font-size: 1.1em;
	gap: 0.5em;
	justify-content: space-between;
	margin: 0 0 0.3em;
}

.prb-summary-value {
	font-weight: 700;
}

.prb-summary-availability {
	font-size: 0.9em;
	margin: 0;
	opacity: 0.8;
}

.prb-summary-availability.is-error {
	color: var( --prb-booked );
	font-weight: 600;
	opacity: 1;
}

.prb-notices:empty {
	display: none;
}

.prb-submit[disabled] {
	cursor: not-allowed;
	opacity: 0.5;
}

.prb-extra-flag {
	opacity: 0.7;
}


@media ( prefers-reduced-motion: reduce ) {
	* {
		transition: none !important;
	}
}

.prb-calendar-hint {
	font-size: 0.8em;
	margin: 0.4em 0 0;
	opacity: 0.65;
}

/* Cells carry an explanation of why a date is closed. */
.prb-cal-cell[data-note] {
	cursor: help;
}

.prb-cal-cell[data-state="available"][data-note],
.prb-cal-cell[data-state="partial"][data-note] {
	cursor: pointer;
}

.prb-calendar {
	position: relative;
}

.prb-tooltip {
	background: #1e1e1e;
	border-radius: 4px;
	color: #fff;
	font-size: 0.78em;
	line-height: 1.35;
	max-width: 15em;
	padding: 0.45em 0.7em;
	pointer-events: none;
	position: absolute;
	text-align: center;
	transform: translate( -50%, calc( -100% - 6px ) );
	white-space: normal;
	z-index: 20;
}

.prb-tooltip::after {
	border: 5px solid transparent;
	border-top-color: #1e1e1e;
	content: "";
	left: 50%;
	position: absolute;
	top: 100%;
	transform: translateX( -50% );
}

.prb-tooltip[hidden] {
	display: none;
}

/**
 * Price output.
 *
 * This theme hides .woocommerce-Price-amount and .amount globally, which is why
 * cart and checkout figures were present in the DOM and invisible on screen.
 * Prices are therefore rendered in .prb-price instead. Nothing here sets a font
 * or a colour — inheriting the theme's is the point — but the properties a
 * hiding rule would use are forced, in case a broad selector catches these too.
 */
.prb-price,
.prb-price-amount,
.prb-rate-unit {
	clip: auto !important;
	color: inherit;
	display: inline !important;
	font-family: inherit;
	font-size: inherit;
	height: auto !important;
	opacity: 1 !important;
	overflow: visible !important;
	position: static !important;
	text-indent: 0 !important;
	visibility: visible !important;
	width: auto !important;
}

.prb-price bdi,
.prb-price .woocommerce-Price-currencySymbol {
	display: inline !important;
	visibility: visible !important;
}

/* Date field and its drop-down ------------------------------------------- */

.prb-date-control {
	display: block;
	position: relative;
}

.prb-form .prb-field .prb-date-display {
	cursor: pointer;
	padding-right: 2.4em;
}

.prb-date-icon {
	align-items: center;
	display: flex;
	opacity: 0.55;
	pointer-events: none;
	position: absolute;
	right: 0.75em;
	top: 50%;
	transform: translateY( -50% );
}

/**
 * The drop-down calendar.
 *
 * This exists because the browser's native date picker cannot mark a date as
 * unavailable — a customer could pick a fully booked day from it and only find
 * out after submitting. This one shares its data and its colouring with the
 * month calendar above, so an unavailable date looks and behaves the same in
 * both places.
 */
.prb-datepicker {
	background: #fff;
	border: 1px solid var( --prb-border );
	border-radius: 8px;
	box-shadow: 0 6px 24px rgba( 0, 0, 0, 0.14 );
	left: 0;
	margin-top: 4px;
	max-width: 22em;
	min-width: 18em;
	padding: 0.7em;
	position: absolute;
	top: 100%;
	z-index: 30;
}

.prb-datepicker .prb-cal-header {
	margin-bottom: 0.4em;
}

.prb-datepicker .prb-cal-title {
	font-size: 0.95em;
}

.prb-cal-grid--compact .prb-cal-cell {
	height: 2.2em;
}

.prb-cal-grid--compact th {
	font-size: 0.7em;
	padding: 0.25em 0;
}

.prb-cal-grid--compact .prb-cal-day {
	font-size: 0.9em;
	padding: 0.35em 0;
}

/* Unavailable days keep their state colour and stop responding to the pointer,
   so the reason a date cannot be chosen is visible rather than implied. */
.prb-cal-grid--compact .prb-cal-day--disabled {
	cursor: not-allowed;
	opacity: 0.55;
}

.prb-datepicker-footer {
	align-items: center;
	border-top: 1px solid var( --prb-border );
	display: flex;
	gap: 0.6em;
	justify-content: space-between;
	margin-top: 0.5em;
	padding-top: 0.5em;
}

.prb-datepicker-clear {
	background: transparent;
	border: 1px solid var( --prb-border );
	border-radius: 4px;
	color: inherit;
	cursor: pointer;
	font-size: 0.85em;
	padding: 0.3em 0.8em;
}

.prb-datepicker-clear:hover {
	background: rgba( 0, 0, 0, 0.04 );
}

.prb-datepicker-hint {
	font-size: 0.75em;
	opacity: 0.6;
	text-align: right;
}

.prb-datepicker-loading {
	margin: 0;
	padding: 1em 0;
	text-align: center;
}

/* On narrow screens the pop-up would otherwise overflow the viewport. */
@media ( max-width: 560px ) {
	.prb-datepicker {
		left: 0;
		max-width: none;
		right: 0;
		width: auto;
	}
}
