.wc-bookings-modal {
	--wc-bookings--modal--block-spacing: 1.4rem;
}
:where(.wc-bookings-modal-overlay) {
	background-color: rgba(95,95,95,.35);
	bottom: 0;
	box-sizing: border-box;
	left: 0;
	opacity: 1;
	position: fixed;
	right: 0;
	top: 0;
	transition: opacity .3s;
	z-index: 9999;
}
:where(.wc-bookings-modal-overlay[hidden]) {
	display: block;
	left: -10000px;
	opacity: 0;
	overflow: hidden;
	pointer-events: none;
	transition: opacity .3s, display 0s .3s;
}
:where(.wc-bookings-modal) {
	background-color: var(--wc-bookings--calendar--background-color);
	border: 0;
	bottom: 0;
	box-sizing: border-box;
	color: var(--wc-bookings--calendar--color);
	display: flex;
	flex-direction: column;
	left: 0;
	max-height: 100vh;
	max-height: 100svh;
	max-height: 100dvh;
	opacity: 0;
	padding: 0px 25px 25px 25px; // Top spacing comes from the heading block.
	pointer-events: none;
	position: fixed;
	right: 0;
	transform: translateY(50px);
	width: 100%;
	z-index: 10000;
}
:where(.wc-bookings-modal[open]) {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0);
	transition: all .3s;
}
.wc-bookings-modal:focus {
	outline-width: 0;
}
:where(.wc-bookings-modal-container) {
	min-height: 0;
	overflow-y: auto;
	overflow-x: hidden;

	// Work-around so if a focused element inside the container shows an outline,
	// is fully visible.
	margin: 0 -2px;
	padding: 0 2px;

	// Hide the scrollbar.
	&::-webkit-scrollbar {
		display: none;
	}
}
@media (min-width: 782px) {
	:where(.wc-bookings-modal) {
		bottom: auto;
		height: auto;
		max-height: calc(100vh - 2rem);
		max-height: calc(100svh - 2rem);
		max-height: calc(100dvh - 2rem);
		max-width: 750px;
		left: 50%;
		right: auto;
		top: 50%;
		transform: translate(-50%, calc(-50% + 50px));
		width: 100%;
	}
	:where(.wc-bookings-modal[open]) {
		transform: translate(-50%, -50%);
	}
}
:where(.wc-bookings-modal-header) {
	display: flex;
	flex-direction: row;
	justify-content: space-between;
	align-items: center;
}
:where(.wc-bookings-modal-close) {
	background: none;
	border: none;
	cursor: pointer;
	padding: 5px;

	svg {
		fill: var(--wc-bookings--calendar--color);
	}
}
:where(.wc-bookings-modal-buttons.is-disabled) {
	pointer-events: none;
	opacity: 0.5;
}

.wc-bookings-modal-container > * {
	margin-bottom: var(--wc-bookings--modal--block-spacing);
}
.wc-bookings-modal-container > *:last-child {
	margin-bottom: 0;
}
.wc-bookings-modal-buttons {
	margin-top: var(--wc-bookings--modal--block-spacing);
}
// Cancel default margins.
// We need control over spacing and height within the modal.
.wc-bookings-modal-buttons .wp-block-buttons {
	margin-top: 0;
	gap: 10px; // Override default gap of 8px.
}
@media (min-width: 782px) {
	.wc-bookings-modal-buttons .wp-block-buttons {
		flex-direction: row;
		flex-wrap: nowrap;

		& > .wp-block-button {
			width: 50%;
			flex-basis: 50%;
			font-size: var(--wp--preset--font-size--small, 1.2rem);
		}
	}
}

