/* Vlieglessen OA Booking: date and time picker. Override the colours with CSS variables in your (child) theme. */
.vloa-picker {
	/* Accent colour: own --vloa-primary, else the Avada primary colour, else blue. JavaScript copies the colour of the theme's add-to-cart button when available. */
	--vloa-accent: var(--vloa-primary, var(--primary_color, #1a73e8));
	--vloa-accent-contrast: var(--vloa-primary-contrast, #fff);
	--vloa-border: rgba(0, 0, 0, 0.18);
	--vloa-muted: rgba(0, 0, 0, 0.45);
	--vloa-radius: 6px;
	margin: 0 0 1.25em;
	max-width: none;
	width: 100%;
}

.vloa-picker[hidden],
.vloa-picker [hidden] {
	display: none !important;
}

.vloa-picker__title,
.vloa-times__title {
	font-weight: 600;
	margin: 0 0 0.5em;
}

.vloa-calendar {
	font-size: 0.9em;
	max-width: 19em;
}

.vloa-calendar__header {
	align-items: center;
	display: flex;
	justify-content: space-between;
	margin-bottom: 0.5em;
}

.vloa-calendar__title {
	font-weight: 600;
	text-transform: capitalize;
}

.vloa-calendar__nav {
	background: transparent;
	border: 1px solid var(--vloa-border);
	border-radius: var(--vloa-radius);
	cursor: pointer;
	font-size: 1.2em;
	height: 2em;
	line-height: 1;
	padding: 0;
	width: 2em;
}

.vloa-calendar__nav:disabled {
	cursor: not-allowed;
	opacity: 0.35;
}

.vloa-calendar__grid {
	display: grid;
	gap: 0.25em;
	grid-template-columns: repeat(7, minmax(0, 1fr));
}

.vloa-calendar__weekday {
	color: var(--vloa-muted);
	font-size: 0.8em;
	padding: 0.25em 0;
	text-align: center;
	text-transform: capitalize;
}

.vloa-calendar__day,
.vloa-times__slot {
	background: transparent;
	border: 1px solid transparent;
	border-radius: var(--vloa-radius);
	color: inherit;
	cursor: pointer;
	font: inherit;
	line-height: 1;
	padding: 0;
}

.vloa-calendar__day {
	aspect-ratio: 1;
	min-height: 2em;
}

.vloa-calendar__day:disabled {
	color: var(--vloa-muted);
	cursor: not-allowed;
	opacity: 0.45;
	text-decoration: line-through;
}

.vloa-calendar__day.is-available {
	border-color: var(--vloa-border);
	font-weight: 600;
}

.vloa-calendar__day.is-today {
	box-shadow: inset 0 0 0 1px var(--vloa-accent);
}

.vloa-calendar__day.is-available:hover,
.vloa-calendar__day.is-available:focus-visible,
.vloa-times__slot:hover,
.vloa-times__slot:focus-visible {
	border-color: var(--vloa-accent);
	outline: 2px solid transparent;
}

.vloa-calendar__day.is-selected,
.vloa-times__slot.is-selected {
	background: var(--vloa-accent);
	border-color: var(--vloa-accent);
	color: var(--vloa-accent-contrast);
}

.vloa-calendar__empty,
.vloa-times__empty {
	color: var(--vloa-muted);
	font-size: 0.9em;
	margin: 0.5em 0 0;
}

.vloa-times__list {
	display: grid;
	gap: 0.4em;
	grid-template-columns: repeat(auto-fill, minmax(4.5em, 1fr));
}

.vloa-times__slot {
	border-color: var(--vloa-border);
	padding: 0.6em 0.4em;
}

.vloa-picker__status {
	font-size: 0.9em;
	margin: 0.75em 0 0;
}

.vloa-picker__status--error {
	color: #b32d2e;
}

.single_add_to_cart_button.vloa-locked,
.vloa-submit-blocked {
	opacity: 0.55;
}

.vloa-picker__mode {
	border: 0;
	margin: 0 0 1em;
	padding: 0;
}

.vloa-picker__option {
	align-items: flex-start;
	cursor: pointer;
	display: flex;
	gap: 0.5em;
	margin: 0 0 0.4em;
}

.vloa-picker__option input {
	margin-top: 0.3em;
}

.vloa-picker__slots {
	align-items: flex-start;
	display: flex;
	flex-wrap: wrap;
	gap: 1em 1.5em;
	margin-top: 0.5em;
}

/* Calendar and times sit side by side when the form is wide enough, otherwise they stack. */
.vloa-picker__calendar {
	flex: 0 1 19em;
	min-width: 0;
}

.vloa-picker__times {
	flex: 1 1 12em;
	margin-top: 0;
}

/* Info notice: uses the WooCommerce class "woocommerce-info" so the theme (Avada) styles it as an info alert. */
.vloa-picker__disclaimer {
	margin: 0.75em 0 0;
}

.vloa-picker__disclaimer > :last-child {
	margin-bottom: 0;
}

/* Loader shown instead of a calendar full of struck-through days, and while time slots load. */
.vloa-loader {
	align-items: center;
	color: var(--vloa-muted);
	display: flex;
	font-size: 0.9em;
	gap: 0.6em;
	margin: 0.5em 0 0;
}

.vloa-calendar .vloa-loader {
	min-height: 6em;
}

.vloa-spinner {
	animation: vloa-spin 0.8s linear infinite;
	border: 2px solid var(--vloa-border);
	border-radius: 50%;
	border-top-color: var(--vloa-accent);
	flex: none;
	height: 1.1em;
	width: 1.1em;
}

@keyframes vloa-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.vloa-spinner {
		animation-duration: 2.4s;
	}
}

/* Small screens: the calendar fills the width, with larger touch targets. */
@media (max-width: 640px) {
	.vloa-picker__slots {
		display: block;
	}

	.vloa-picker__calendar,
	.vloa-picker__times {
		width: 100%;
	}

	.vloa-picker__times {
		margin-top: 1em;
	}

	.vloa-calendar {
		font-size: 1em;
		max-width: 26em; /* Keeps the squares reasonable on large phones and small tablets. */
	}

	.vloa-calendar__day {
		min-height: 2.75em;
	}

	.vloa-calendar__nav {
		height: 2.75em;
		width: 2.75em;
	}
}

/* Avada form field: setup notice, only rendered for administrators. */
.vloa-intake__notice {
	background: #fff8e5;
	border: 1px solid #dba617;
	border-radius: var(--vloa-radius, 6px);
	color: #3c3000;
	font-size: 0.9em;
	margin: 0.75em 0 0;
	padding: 0.6em 0.8em;
}

.vloa-intake__hint {
	margin: .5em 0 0;
	font-size: .9em;
	opacity: .8;
}

/* Load error with a retry button, in place of the calendar or the times. */
.vloa-error {
	border: 1px solid #f0b8b8;
	border-radius: var(--vloa-radius, 6px);
	background: #fcf0f1;
	color: #8a1f22;
	padding: 0.75em 1em;
}

.vloa-error__text {
	margin: 0 0 0.5em;
}

.vloa-error__retry {
	background: transparent;
	border: 1px solid currentColor;
	border-radius: var(--vloa-radius, 6px);
	color: inherit;
	cursor: pointer;
	font: inherit;
	min-height: 44px;
	padding: 0 1em;
}

/* Touch screens: targets of 44 CSS pixels high. Days keep the width of their column, so seven fit on a narrow phone. */
@media (pointer: coarse) {
	.vloa-calendar__day,
	.vloa-calendar__nav,
	.vloa-times__slot {
		min-height: 44px;
	}

	.vloa-calendar__nav,
	.vloa-times__slot {
		min-width: 44px;
	}
}
