/**
 * SimplyWhen booking form. Every selector is prefixed with .sw- ; the font
 * comes from the theme. --sw-primary / --sw-on-primary are set inline from
 * the settings (text colour chosen for contrast).
 *
 * @package SimplyWhen
 * @license GPL-2.0-or-later
 */

.sw-booking {
	--sw-primary: #1d4ed8;
	--sw-on-primary: #ffffff;
	--sw-text: #1f2328;
	--sw-muted: #57606a;
	--sw-border: #d0d7de;
	--sw-soft: #f6f8fa;
	--sw-danger: #b42318;
	--sw-success: #1a7f37;
	--sw-radius: 10px;
	--sw-focus: 0 0 0 3px #ffffff, 0 0 0 6px #1f2328;
	box-sizing: border-box;
	display: grid;
	gap: 0;
	max-width: 1040px;
	margin: 1.5em auto;
	color: var(--sw-text);
	background: #ffffff;
	border: 1px solid var(--sw-border);
	border-radius: var(--sw-radius);
	overflow: hidden;
	font: inherit;
	line-height: 1.5;
	text-align: left;
}

/* Themes often cap direct children of the content area (e.g. Astra:
   .entry-content[data-ast-blocks-layout] > *); this selector is one step
   more specific so the widget keeps its own maximum width. */
div.sw-booking.sw-booking {
	max-width: 1040px;
	margin-left: auto;
	margin-right: auto;
}

.sw-booking *,
.sw-booking *::before,
.sw-booking *::after {
	box-sizing: inherit;
}

.sw-booking :focus-visible {
	outline: none;
	box-shadow: var(--sw-focus);
}

.sw-sr-only,
.sw-hp {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* ------------------------------------------------------------ Info column */

.sw-info {
	padding: 1.25em 1.25em 1em;
	background: var(--sw-soft);
	border-bottom: 1px solid var(--sw-border);
}

.sw-info__person {
	display: flex;
	align-items: center;
	gap: 0.75em;
	margin: 0 0 0.75em;
}

.sw-info__photo img {
	display: block;
	width: 72px;
	height: 72px;
	padding: 6px;
	border-radius: 50%;
	object-fit: contain;
	background: #ffffff;
	border: 1px solid var(--sw-border);
}

.sw-info__name {
	margin: 0;
	font-weight: 600;
}

.sw-info__intro {
	margin: 0 0 0.75em;
	color: var(--sw-muted);
	font-size: 0.95em;
}

.sw-booking .sw-info__title {
	margin: 0.1em 0 0.4em;
	font-size: 1.35em;
	line-height: 1.25;
	color: var(--sw-text);
}

.sw-info__facts {
	list-style: none;
	margin: 0;
	padding: 0;
	color: var(--sw-muted);
}

.sw-info__fact {
	margin: 0.2em 0;
	padding-left: 1.6em;
	position: relative;
}

.sw-info__fact::before {
	position: absolute;
	left: 0;
	top: 0.35em;
	width: 1em;
	height: 1em;
	content: "";
	border: 2px solid currentColor;
	border-radius: 50%;
}

.sw-info__fact--place::before {
	border-radius: 50% 50% 50% 0;
	transform: rotate(-45deg);
}

.sw-info__summary {
	margin: 0.8em 0 0;
	padding-top: 0.8em;
	border-top: 1px solid var(--sw-border);
	font-weight: 600;
}

/* ------------------------------------------------------------ Flow / steps */

.sw-flow {
	padding: 1.25em;
	min-height: 18em;
}

.sw-step__count {
	margin: 0;
	color: var(--sw-muted);
	font-size: 0.85em;
}

.sw-booking .sw-step__title {
	margin: 0.1em 0 0.8em;
	font-size: 1.25em;
	line-height: 1.3;
	color: var(--sw-text);
}

.sw-step__title:focus {
	outline: none;
}

.sw-step__sub {
	margin: 0 0 0.8em;
	font-weight: 600;
}

.sw-loading {
	color: var(--sw-muted);
}

/* ------------------------------------------------------------------ Forms */

.sw-form {
	margin: 0;
}

.sw-row {
	display: grid;
	gap: 0 1em;
}

.sw-field {
	margin: 0 0 1em;
}

.sw-field__label {
	display: block;
	margin: 0 0 0.3em;
	font-weight: 600;
}

.sw-field__optional {
	font-weight: 400;
	color: var(--sw-muted);
}

.sw-booking .sw-input {
	display: block;
	width: 100%;
	min-height: 44px;
	margin: 0;
	padding: 0.55em 0.75em;
	font: inherit;
	color: var(--sw-text);
	background: #ffffff;
	border: 1px solid #8c959f;
	border-radius: 8px;
	box-shadow: none;
}

.sw-booking .sw-input:focus-visible {
	border-color: var(--sw-text);
	box-shadow: var(--sw-focus);
}

.sw-booking .sw-input--zip {
	max-width: 10em;
	font-size: 1.2em;
	letter-spacing: 0.1em;
}

.sw-booking .sw-input--readonly {
	background: var(--sw-soft);
	color: var(--sw-muted);
}

.sw-field__help {
	margin: 0.3em 0 0;
	font-size: 0.9em;
	color: var(--sw-muted);
}

.sw-field__error {
	margin: 0.3em 0 0;
	color: var(--sw-danger);
	font-weight: 600;
	font-size: 0.95em;
}

.sw-field--invalid .sw-input {
	border-color: var(--sw-danger);
	border-width: 2px;
}

.sw-check {
	display: flex;
	gap: 0.6em;
	align-items: flex-start;
}

.sw-check input {
	width: 1.25em;
	height: 1.25em;
	margin: 0.15em 0 0;
	flex: none;
	accent-color: var(--sw-primary);
}

.sw-errors {
	margin: 0 0 1em;
	padding: 0.75em 1em;
	border: 2px solid var(--sw-danger);
	border-radius: 8px;
	color: var(--sw-danger);
	font-weight: 600;
}

.sw-errors p {
	margin: 0;
}

/* ---------------------------------------------------------------- Buttons */

.sw-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75em;
	margin: 1.25em 0 0;
}

.sw-actions--split {
	justify-content: space-between;
}

.sw-booking .sw-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	margin: 0;
	padding: 0.6em 1.4em;
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	color: var(--sw-on-primary);
	background: var(--sw-primary);
	border: 2px solid var(--sw-primary);
	border-radius: 8px;
	cursor: pointer;
	text-decoration: none;
	box-shadow: none;
}

.sw-booking .sw-button:hover {
	filter: brightness(0.92);
}

.sw-booking .sw-button[disabled] {
	opacity: 0.6;
	cursor: wait;
}

.sw-booking .sw-button--secondary {
	color: var(--sw-text);
	background: #ffffff;
	border-color: #8c959f;
}

.sw-booking .sw-link {
	margin: 0;
	padding: 0.25em 0;
	font: inherit;
	color: var(--sw-text);
	background: none;
	border: 0;
	text-decoration: underline;
	text-underline-offset: 0.2em;
	cursor: pointer;
}

.sw-nomatch {
	margin: 1.25em 0 0;
	padding-top: 1em;
	border-top: 1px solid var(--sw-border);
}

/* --------------------------------------------------------------- Notices */

.sw-notice {
	margin: 0 0 1em;
	padding: 0.85em 1em;
	background: var(--sw-soft);
	border-left: 4px solid var(--sw-muted);
	border-radius: 6px;
}

.sw-notice--warning,
.sw-notice--area {
	border-left-color: #9a6700;
	background: #fff8e5;
}

.sw-notice--success {
	border-left-color: var(--sw-success);
	background: #eefbf1;
}

.sw-phone {
	font-weight: 700;
	white-space: nowrap;
	color: inherit;
}

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

.sw-cal__nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 0 0 0.5em;
}

.sw-booking .sw-cal__month {
	margin: 0;
	font-size: 1.1em;
	color: var(--sw-text);
}

.sw-booking .sw-cal__prev,
.sw-booking .sw-cal__next {
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	font-size: 1.6em;
	line-height: 1;
	color: var(--sw-text);
	background: #ffffff;
	border: 1px solid var(--sw-border);
	border-radius: 50%;
	cursor: pointer;
}

.sw-booking .sw-cal__prev[disabled],
.sw-booking .sw-cal__next[disabled] {
	opacity: 0.35;
	cursor: default;
}

.sw-booking .sw-cal__grid {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: separate;
	border-spacing: 4px;
	table-layout: fixed;
}

.sw-booking .sw-cal__grid th {
	padding: 0.2em 0;
	font-size: 0.8em;
	font-weight: 600;
	text-align: center;
	color: var(--sw-muted);
	background: none;
	border: 0;
}

.sw-booking .sw-cal__grid td {
	padding: 0;
	text-align: center;
	background: none;
	border: 0;
}

.sw-booking .sw-cal__day {
	display: block;
	width: 100%;
	min-height: 44px;
	aspect-ratio: 1 / 1;
	max-height: 56px;
	margin: 0;
	padding: 0;
	font: inherit;
	color: #6e7781;
	background: transparent;
	border: 1px solid transparent;
	border-radius: 8px;
	cursor: default;
	text-decoration: line-through;
	text-decoration-color: rgba(110, 119, 129, 0.5);
}

.sw-booking .sw-cal__day.is-available {
	color: var(--sw-text);
	font-weight: 700;
	background: #ffffff;
	border-color: var(--sw-primary);
	text-decoration: none;
	cursor: pointer;
}

.sw-booking .sw-cal__day.is-available:hover {
	background: var(--sw-soft);
}

.sw-booking .sw-cal__day.is-selected {
	color: var(--sw-on-primary);
	background: var(--sw-primary);
}

/* ------------------------------------------------------------------ Slots */

.sw-booking .sw-slots {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(6.5em, 1fr));
	gap: 0.5em;
	margin: 0 0 0.5em;
	padding: 0;
	list-style: none;
}

.sw-booking .sw-slots li {
	margin: 0;
	padding: 0;
}

.sw-booking .sw-slot {
	width: 100%;
	min-height: 44px;
	margin: 0;
	padding: 0.5em;
	font: inherit;
	font-weight: 700;
	color: var(--sw-text);
	background: #ffffff;
	border: 1px solid var(--sw-primary);
	border-radius: 8px;
	cursor: pointer;
}

.sw-booking .sw-slot:hover {
	color: var(--sw-on-primary);
	background: var(--sw-primary);
}

/* ------------------------------------------------------------------- Done */

.sw-done__icon {
	width: 3em;
	height: 3em;
	margin: 0 0 0.75em;
	border-radius: 50%;
	background: var(--sw-success);
	color: #ffffff;
	font-size: 1.2em;
	line-height: 3em;
	text-align: center;
}

.sw-done__list {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 0.3em 1em;
	margin: 0 0 1em;
}

.sw-done__list dt {
	font-weight: 600;
	color: var(--sw-muted);
}

.sw-done__list dd {
	margin: 0;
	font-weight: 600;
}

/* ------------------------------------------------------------ Wider screens */

@media (min-width: 600px) {
	.sw-row {
		grid-template-columns: 1fr 1fr;
	}

	.sw-row--street {
		grid-template-columns: 3fr 1fr;
	}

	.sw-row--city {
		grid-template-columns: 1fr 2fr;
	}
}

/* Wide widget (class set by the script at >= 860 px): info | calendar | times. */
.sw-booking--wide {
	grid-template-columns: 250px 1fr;
}

.sw-booking--wide .sw-info {
	padding: 1.5em 1.25em;
	border-right: 1px solid var(--sw-border);
	border-bottom: 0;
}

.sw-booking--wide .sw-flow {
	padding: 1.5em 1.75em;
}

.sw-picker {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 210px;
	gap: 1.75em;
	align-items: start;
}

.sw-booking--wide .sw-cal__day {
	min-height: 40px;
	max-height: 42px;
	aspect-ratio: auto;
	height: 40px;
}

.sw-booking--wide .sw-cal__grid {
	border-spacing: 3px;
}

.sw-times {
	padding-left: 1.5em;
	border-left: 1px solid var(--sw-border);
	min-height: 18em;
}

.sw-booking .sw-times__title {
	margin: 0 0 0.25em;
	font-size: 1em;
	line-height: 1.35;
	color: var(--sw-text);
}

.sw-times__title:focus {
	outline: none;
}

.sw-times__hint {
	margin: 2.5em 0 0;
	color: var(--sw-muted);
}

.sw-booking .sw-times .sw-slots {
	grid-template-columns: 1fr;
	max-height: 21em;
	overflow-y: auto;
	padding: 3px;
}

.sw-turnstile {
	margin: 0 0 1em;
	min-height: 65px;
}

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

/* Time window sentence ("We will arrive between …") and optional cancel reason. */
.sw-booking .sw-done__window {
	margin: 0.75em 0 0;
	font-weight: 600;
}

.sw-booking .sw-cancel-reason {
	margin: 1em 0 0;
}
