.cv-reservation-launcher {
	--cv-effective-bottom: max(var(--cv-launcher-bottom, 25px), env(safe-area-inset-bottom));
	position: fixed;
	translate: var(--cv-align-right, 0px) var(--cv-anchor-y, 0px);
	right: calc(max(2.7%, env(safe-area-inset-right)) + var(--cv-viewport-right, 0px));
	bottom: var(--cv-effective-bottom);
	top: calc(var(--cv-visual-bottom, auto) - var(--cv-effective-bottom));
	z-index: 10000;
	display: grid;
	place-items: center;
	width: 54px;
	height: 54px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: var(--cv-launcher-background, #a78f6e);
	color: var(--cv-launcher-foreground, #1b1f1d);
	box-shadow: 0 5px 24px #0005;
	cursor: pointer;
	font: 600 15px/1.2 system-ui, sans-serif;
}

.cv-reservation-launcher:hover { filter: brightness(1.1); }

.cv-reservation-launcher.cv-launcher-left {
	left: calc(max(2.7%, env(safe-area-inset-left)) + var(--cv-viewport-left, 0px));
	right: auto;
}

.cv-reservation-launcher-text { display: none; }

.cv-reservation-launcher.cv-launcher-label {
	display: inline-flex;
	gap: 10px;
	width: auto;
	align-items: center;
	padding-inline: 16px;
}

.cv-launcher-label .cv-reservation-launcher-text { display: inline; white-space: nowrap; }

body:has(#qodef-back-to-top) > .cv-launcher-right:not(.cv-launcher-hide-top) {
	--cv-effective-bottom: max(87px, var(--cv-launcher-bottom, 25px), env(safe-area-inset-bottom));
}

body:has(> .cv-launcher-hide-top:not([hidden])) #qodef-back-to-top {
	visibility: hidden;
	pointer-events: none;
}

.cv-reservation-launcher .cv-reservation-icon {
	width: 24px;
	height: 22px;
	border-top-width: 2px;
	background: linear-gradient(currentColor, currentColor) 0 5px / 100% 2px no-repeat;
}

.cv-reservation-launcher .cv-reservation-icon::before,
.cv-reservation-launcher .cv-reservation-icon::after { top: -5px; }

.cv-reservation-check {
	width: 8px;
	height: 5px;
	margin-top: 5px;
	border: solid currentColor;
	border-width: 0 0 2px 2px;
	transform: rotate(-45deg);
}

.cv-reservation-launcher[hidden],
.cv-reservation-launcher.cv-launcher-label[hidden] {
	display: none;
}

.cv-reservation-icon {
	position: relative;
	display: inline-grid;
	place-items: center;
	width: 26px;
	height: 24px;
	border: 2px solid currentColor;
	border-radius: 4px;
	border-top-width: 6px;
	box-sizing: border-box;
	line-height: 1;
}

.cv-reservation-icon::before,
.cv-reservation-icon::after {
	content: '';
	position: absolute;
	top: -9px;
	width: 3px;
	height: 5px;
	border-radius: 2px;
	background: currentColor;
}

.cv-reservation-icon::before { left: 4px; }
.cv-reservation-icon::after { right: 4px; }

.cv-reservation-dialog,
.cv-reservation-calendar {
	margin: auto;
	max-width: calc(100% - 24px);
	max-height: calc(100dvh - 24px);
	padding: clamp(16px, 4vw, 30px);
	border: 1px solid #788f89;
	border-radius: 12px;
	background: #1c3432;
	color: #f4f7f6;
	overflow: auto;
	box-sizing: border-box;
}

.cv-reservation-dialog { width: 680px; }

.cv-reservation-dialog::backdrop,
.cv-reservation-calendar::backdrop { background: #0009; }

@media (prefers-reduced-motion: no-preference) {
	.cv-reservation-dialog[open] {
		animation: cv-booking-enter 260ms ease-out both;
	}

	.cv-reservation-dialog[open]::backdrop {
		animation: cv-booking-fade-in 260ms ease-out both;
	}

	.cv-reservation-dialog[open].cv-reservation-dialog--closing {
		animation: cv-booking-exit 200ms ease-in both;
	}

	.cv-reservation-dialog[open].cv-reservation-dialog--closing::backdrop {
		animation: cv-booking-fade-out 200ms ease-in both;
	}
}

@keyframes cv-booking-enter {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes cv-booking-exit {
	from { opacity: 1; transform: translateY(0); }
	to { opacity: 0; transform: translateY(8px); }
}

@keyframes cv-booking-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes cv-booking-fade-out { from { opacity: 1; } to { opacity: 0; } }

.cv-reservation-dialog > header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 16px;
}

.cv-reservation-dialog h2 {
	margin: 0;
	color: inherit;
	font-size: clamp(18px, 5vw, 26px);
	line-height: 1.2;
	white-space: nowrap;
}

.cv-reservation-close,
.cv-reservation-calendar button,
.cv-reservation-date-button {
	border: 1px solid transparent;
	background: transparent;
	color: inherit;
	cursor: pointer;
	font: inherit;
}

.cv-reservation-close {
	display: grid;
	place-items: center;
	flex: 0 0 44px;
	width: 44px;
	height: 44px;
	padding: 0;
	font-size: 38px;
	line-height: 1;
}

.cv-reservation-fields .form-row {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 22px;
}

.cv-reservation-fields .column-full { grid-column: 1 / -1; }

.cv-reservation-fields :is(.column-half, .column-full) {
	float: none;
	width: auto;
	min-width: 0;
}

.cv-reservation-date {
	position: relative;
	display: block;
}

.cv-reservation-date input[type="date"] {
	padding-right: 42px;
	cursor: pointer;
}

.cv-reservation-date input::-webkit-calendar-picker-indicator { opacity: 0; pointer-events: none; }

.cv-reservation-date-button {
	position: absolute;
	right: 0;
	top: 0;
	width: 40px;
	height: 40px;
	padding: 6px;
}

.cv-reservation-date-button .cv-reservation-icon { width: 20px; height: 18px; }

.cv-reservation-calendar { width: 355px; padding: 14px; }

.cv-calendar-heading {
	display: grid;
	grid-template-columns: 40px 1fr 40px 40px;
	align-items: center;
	text-align: center;
	margin-bottom: 10px;
}

.cv-calendar-grid {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	text-align: center;
	gap: 3px;
}

.cv-calendar-grid button,
.cv-calendar-heading button {
	min-height: 36px;
	padding: 2px;
	border-radius: 5px;
}

.cv-reservation-calendar button:disabled { opacity: .4; cursor: default; }
.cv-calendar-grid [aria-current="date"] { border-color: #fff; }
.cv-calendar-grid .cv-calendar-selected { background: #a8154d; }
.cv-calendar-grid button:not(:disabled):hover { background: #536963; }

.cv-reservation-launcher:focus-visible {
	outline: 2px solid #a78f6e;
	outline-offset: 3px;
	box-shadow: 0 0 0 3px #1b1f1d, 0 5px 24px #0005;
}

.cv-reservation-dialog button:focus-visible,
.cv-reservation-calendar button:focus-visible {
	outline: 2px solid #ff9ec1;
	outline-offset: 2px;
}

@media (max-width: 540px) {
	.cv-reservation-fields .form-row:not(.cv-reservation-time-date) { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 767px), (hover: none) and (pointer: coarse) {
	.cv-reservation-dialog {
		position: fixed;
		width: calc(var(--cv-dialog-width, 100vw) - 24px);
		max-height: calc(var(--cv-dialog-height, 100dvh) - 24px);
		inset: var(--cv-dialog-top, 50%) auto auto var(--cv-dialog-left, 50%);
		margin: 0;
		translate: -50% -50%;
		padding: 12px 16px;
	}
	.cv-reservation-dialog > header { margin-bottom: 8px; }

	.cv-reservation-dialog .cv-reservation-fields {
		font-size: 14px;
		line-height: 1.3;
	}

	.cv-reservation-dialog .cv-reservation-fields .form-row {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
		margin-bottom: 8px;
	}

	.cv-reservation-dialog .cv-reservation-fields :is(.column-half, .column-full) {
		padding: 0;
	}

	.cv-reservation-dialog .cv-reservation-fields :is(input:not([type="submit"]), select, textarea) {
		box-sizing: border-box;
		width: 100%;
		min-width: 0;
		margin: 0;
		font-size: 16px;
		line-height: 1.25;
	}

	.cv-reservation-dialog .cv-reservation-fields :is(input:not([type="submit"]), select) {
		min-height: 44px;
	}

	.cv-reservation-dialog .cv-reservation-fields textarea {
		display: block;
		height: 64px;
		min-height: 64px;
	}

	.cv-reservation-dialog .cv-reservation-fields select { padding-right: 24px; }
	.cv-reservation-dialog .cv-reservation-date input { padding-right: 30px; }
	.cv-reservation-dialog .cv-reservation-date-button { width: 30px; height: 44px; padding: 0; }
	.cv-reservation-dialog .cv-reservation-fields input[type="submit"] { min-height: 44px; }
}
