/*
 * ADesign Booking Modal: neutral base styles. The panel takes the system's colours, Canvas and
 * CanvasText, and brings no fonts of its own; a theme restyles it through the custom
 * properties below and the BEM classes. Only transform and opacity animate, and nothing
 * moves with reduced motion.
 */

/* The page doesn't scroll behind an open modal. */
html:has(.adesign-booking-modal[open]) {
	overflow: hidden;
}

.adesign-booking-modal {
	box-sizing: border-box;
	width: min(var(--adesign-booking-modal-width, 27rem), calc(100% - 2rem));
	max-width: none;
	max-height: calc(100% - 2rem);
	margin: auto;
	padding: 0;
	border: 0;
	background: var(--adesign-booking-modal-background, Canvas);
	color: var(--adesign-booking-modal-color, CanvasText);
	overflow: auto;
	overscroll-behavior: contain;
}

.adesign-booking-modal::backdrop {
	background: var(--adesign-booking-modal-backdrop, rgba(0, 0, 0, 0.5));
}

.adesign-booking-modal[open] {
	animation: adesign-booking-modal-in var(--adesign-booking-modal-duration, 0.3s) ease-out;
}

.adesign-booking-modal[open]::backdrop {
	animation: adesign-booking-modal-fade var(--adesign-booking-modal-duration, 0.3s) ease-out;
}

@keyframes adesign-booking-modal-in {

	from {
		opacity: 0;
		transform: translateY(16px);
	}
}

@keyframes adesign-booking-modal-fade {

	from {
		opacity: 0;
	}
}

.adesign-booking-modal__panel {
	position: relative;
	padding: var(--adesign-booking-modal-padding, 2.5rem 2rem);
	text-align: center;
}

.adesign-booking-modal__close {
	position: absolute;
	z-index: 1;
	top: 0.5rem;
	right: 0.5rem;
	display: grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.adesign-booking-modal__close svg {
	width: 1.5rem;
	height: 1.5rem;
}

.adesign-booking-modal__close:focus-visible {
	outline: 1px solid currentColor;
	outline-offset: -0.25rem;
}

.adesign-booking-modal__logo {
	color: var(--adesign-booking-modal-logo-color, currentColor);
}

.adesign-booking-modal__logo svg,
.adesign-booking-modal__logo img {
	display: block;
	width: auto;
	height: var(--adesign-booking-modal-logo-height, 6rem);
	margin: 0 auto;
}

/* A logo's last letter may reach the edge of its viewBox. */
.adesign-booking-modal__logo svg {
	overflow: visible;
	fill: currentColor;
}

.adesign-booking-modal__title {
	margin: 1rem 0 0;
}

.adesign-booking-modal__text {
	margin: 0.75rem 0 0;
}

/*
 * The colours of the title and the buttons, one class stronger than a theme's global heading
 * and link styles (:root :where(a) ties with a single class), so the panel's colours hold
 * and the buttons have no underline.
 */
.adesign-booking-modal .adesign-booking-modal__title {
	color: inherit;
}

.adesign-booking-modal .adesign-booking-modal__button {
	color: inherit;
	text-decoration: none;
}

.adesign-booking-modal .adesign-booking-modal__button--phone {
	border-color: var(--adesign-booking-modal-button-background, var(--adesign-booking-modal-color, CanvasText));
	background: var(--adesign-booking-modal-button-background, var(--adesign-booking-modal-color, CanvasText));
	color: var(--adesign-booking-modal-button-color, var(--adesign-booking-modal-background, Canvas));
}

.adesign-booking-modal .adesign-booking-modal__button--whatsapp:hover,
.adesign-booking-modal .adesign-booking-modal__button--whatsapp:focus-visible {
	background: var(--adesign-booking-modal-outline-hover-background, transparent);
}

.adesign-booking-modal__actions {
	display: grid;
	gap: 0.75rem;
	margin-top: var(--adesign-booking-modal-gap, 2rem);
}

/* A button wraps rather than overflows: on a narrow screen the number drops under the label. */
.adesign-booking-modal__button {
	box-sizing: border-box;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.5em 0.75em;
	min-height: 3rem;
	padding: 0.85em 1.25em;
	border: 1px solid currentColor;
	line-height: 1.2;
}

.adesign-booking-modal__button:focus-visible {
	outline: 1px solid var(--adesign-booking-modal-color, CanvasText);
	outline-offset: 3px;
}

.adesign-booking-modal__icon {
	flex: none;
	width: 1.5em;
	height: 1.5em;
}

.adesign-booking-modal__detail {
	white-space: nowrap;
}

.adesign-booking-modal__sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {

	.adesign-booking-modal[open],
	.adesign-booking-modal[open]::backdrop {
		animation: none;
	}
}
