/* Search bar: dates and guests, panels under the bar on desktop and from
   the bottom of the screen on mobile. */

.cdl-sb {
	position: sticky;
	top: 0;
	z-index: 50;
	margin: 0 0 24px;
	font-family: var(--cdl-font-ui, inherit);
}

/* The bar is a stacking context of its own, so its panels can never rise
   above anything outside it (the multi-room footer, at 60). While a panel is
   open the whole bar goes on top. */
.cdl-sb.is-open {
	z-index: 1000;
}

/* Holds the bar's place while it is pinned (mobile). */
.cdl-sb-spacer {
	display: block;
	margin: 0 !important;
}

.cdl-sb-bar {
	display: flex;
	align-items: stretch;
	gap: 12px;
	margin: 0;
	padding: 8px;
	border: 1px solid var(--cdl-line, #ddd);
	border-radius: var(--cdl-radius, 20px);
	background: var(--cdl-white, #fff);
	box-shadow: 0 2px 10px rgba(0, 0, 0, .04);
}

.cdl-sb-field {
	display: flex;
	flex: 1 1 0;
	align-items: center;
	gap: 12px;
	min-width: 0;
	padding: 8px 18px;
	border: 0;
	border-radius: calc(var(--cdl-radius, 20px) - 6px);
	background: transparent;
	color: var(--cdl-text, #000);
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.cdl-sb-field:hover,
.cdl-sb-field[aria-expanded="true"] {
	background: var(--cdl-soft, #f6f6f6);
}

/* The dates field and the inputs that cover its text while the calendar is
   open. */
.cdl-sb-dates-wrap {
	position: relative;
	display: flex;
	flex: 1 1 0;
	min-width: 0;
}

.cdl-sb-dates-wrap > .cdl-sb-field {
	flex: 1 1 auto;
}

.cdl-sb-date-inputs {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 46px;
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px 6px 0;
}

.cdl-sb-date-inputs[hidden] {
	display: none;
}

.cdl-sb-date-input {
	flex: 1 1 0;
	min-width: 0;
	height: 40px;
	margin: 0;
	padding: 4px 8px;
	border: 1px solid var(--cdl-line, #ddd);
	border-radius: 8px;
	background: var(--cdl-white, #fff);
	color: var(--cdl-text, #000);
	font: inherit;
	font-size: 15px;
}

.cdl-sb-date-input:focus {
	border-color: var(--cdl-brand, #663264);
	outline: 1px solid var(--cdl-brand, #663264);
	outline-offset: 0;
}

.cdl-sb-date-input.is-invalid {
	border-color: #b32d2e;
	outline-color: #b32d2e;
}

/* Desktop: the calendar below is the picker, the native one only takes room. */
@media (min-width: 768px) {
	.cdl-sb-date-input::-webkit-calendar-picker-indicator {
		display: none;
	}
}

.cdl-sb-date-sep {
	flex: none;
}

.cdl-sb-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.cdl-sb-label {
	font-size: 13px;
	opacity: .7;
}

.cdl-sb-value {
	overflow: hidden;
	font-size: 17px;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.cdl-sb-icon {
	flex: none;
	width: 22px;
	height: 22px;
	background: currentColor;
	-webkit-mask: var(--cdl-sb-icon) center / contain no-repeat;
	mask: var(--cdl-sb-icon) center / contain no-repeat;
}

.cdl-sb-icon-calendar {
	--cdl-sb-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E");
}

.cdl-sb-icon-guests {
	--cdl-sb-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2.5 20c.6-3.6 3.2-5.5 6.5-5.5s5.9 1.9 6.5 5.5'/%3E%3Cpath d='M15.5 4.8a3.5 3.5 0 0 1 0 6.4M18 14.8c1.9.7 3.2 2.4 3.5 5.2'/%3E%3C/svg%3E");
}

.cdl-sb-submit,
.cdl-sb-go,
.cdl-sb-add {
	flex: none;
	padding: 14px 28px;
	border: 1px solid var(--cdl-brand, #663264);
	border-radius: var(--cdl-radius-pill, 999px);
	background: var(--cdl-brand, #663264);
	color: var(--cdl-white, #fff);
	font: inherit;
	font-size: 16px;
	font-weight: 500;
	line-height: 1;
	cursor: pointer;
	transition: background-color .2s ease, border-color .2s ease;
}

.cdl-sb .cdl-sb-submit:hover,
.cdl-sb .cdl-sb-submit:focus-visible,
.cdl-sb .cdl-sb-go:hover,
.cdl-sb .cdl-sb-add:hover {
	background: var(--cdl-brand-dark, #4d254b);
	border-color: var(--cdl-brand-dark, #4d254b);
	color: var(--cdl-white, #fff);
}

.cdl-sb-go {
	background: var(--cdl-soft, #eee);
	border-color: var(--cdl-soft, #eee);
	color: var(--cdl-text, #000);
}

/* --- Panels ---------------------------------------------------------- */

.cdl-sb-panel {
	position: absolute;
	top: calc(100% + 8px);
	z-index: 60;
	max-height: calc(100vh - 140px);
	overflow: auto;
	border: 1px solid var(--cdl-line, #ddd);
	border-radius: var(--cdl-radius, 20px);
	background: var(--cdl-white, #fff);
	box-shadow: 0 12px 32px rgba(0, 0, 0, .12);
}

.cdl-sb-panel[hidden],
.cdl-sb-backdrop[hidden] {
	display: none;
}

.cdl-sb-panel-dates {
	left: 0;
	width: min(720px, 100%);
	padding: 20px 24px 24px;
}

.cdl-sb-panel-who {
	left: 33%;
	width: 380px;
}

.cdl-sb-panel-head {
	display: none;
	align-items: center;
	justify-content: space-between;
	padding-bottom: 12px;
}

.cdl-sb-panel-dates .cdl-sb-panel-head {
	display: flex;
}

.cdl-sb-panel-title {
	font-weight: 600;
}

.cdl-sb-close {
	position: relative;
	width: 32px;
	height: 32px;
	border: 0;
	background: transparent;
	cursor: pointer;
}

.cdl-sb-close::before,
.cdl-sb-close::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 8px;
	width: 16px;
	height: 2px;
	background: currentColor;
	transform: rotate(45deg);
}

.cdl-sb-close::after {
	transform: rotate(-45deg);
}

.cdl-sb-panel-dates .cdl-sb-close {
	display: none;
}

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

.cdl-sb-calendar {
	position: relative;
}

.cdl-cal-nav {
	position: absolute;
	top: -2px;
	right: 0;
	left: 0;
	display: flex;
	justify-content: space-between;
	pointer-events: none;
}

.cdl-cal-prev,
.cdl-cal-next {
	position: relative;
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
	pointer-events: auto;
}

.cdl-cal-prev::before,
.cdl-cal-next::before {
	content: "";
	position: absolute;
	top: 11px;
	left: 12px;
	width: 8px;
	height: 8px;
	border-top: 2px solid currentColor;
	border-left: 2px solid currentColor;
	transform: rotate(-45deg);
}

.cdl-cal-next::before {
	left: 9px;
	transform: rotate(135deg);
}

.cdl-cal-prev:disabled {
	opacity: .25;
	cursor: default;
}

.cdl-cal-months {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 32px;
}

.cdl-cal-title {
	margin-bottom: 12px;
	font-weight: 600;
	text-align: center;
	text-transform: capitalize;
}

.cdl-cal-grid {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	row-gap: 2px;
}

.cdl-cal-wd {
	padding-bottom: 6px;
	font-size: 12px;
	text-align: center;
	opacity: .6;
}

.cdl-cal-day {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: 52px;
	aspect-ratio: 1;
	margin: 0 auto;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--cdl-text, #000);
	font: inherit;
	cursor: pointer;
}

.cdl-cal-day:hover:not(:disabled),
.cdl-cal-day.is-hover-end {
	box-shadow: inset 0 0 0 1px var(--cdl-brand, #663264);
}

.cdl-cal-day:disabled {
	opacity: .3;
	cursor: default;
}

.cdl-cal-num {
	font-size: 15px;
	line-height: 1.2;
}

.cdl-cal-price {
	min-height: 14px;
	font-size: 11px;
	line-height: 1.2;
	opacity: .7;
}

.cdl-cal-day.is-between {
	max-width: none;
	border-radius: 0;
	background: rgba(var(--cdl-brand-rgb, 102, 50, 100), .15);
	background: color-mix(in srgb, var(--cdl-brand, #663264) 15%, transparent);
}

.cdl-cal-day.is-start,
.cdl-cal-day.is-end {
	background: var(--cdl-brand, #663264);
	color: var(--cdl-white, #fff);
}

/* A whole range reads as one band: rounded only on its outer ends. */
.cdl-cal-day.is-start.has-end,
.cdl-cal-day.is-end,
.cdl-cal-day.is-hover-end {
	max-width: none;
	aspect-ratio: auto;
	height: 100%;
}

.cdl-sb .cdl-cal-day.is-start.has-end {
	border-radius: 999px 0 0 999px;
}

.cdl-sb .cdl-cal-day.is-end,
.cdl-sb .cdl-cal-day.is-hover-end {
	border-radius: 0 999px 999px 0;
}

.cdl-cal-day.is-start .cdl-cal-price,
.cdl-cal-day.is-end .cdl-cal-price {
	opacity: .9;
}

/* --- Guests ---------------------------------------------------------- */

.cdl-sb-room {
	border-bottom: 1px solid var(--cdl-line, #ddd);
}

.cdl-sb-room-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 24px 8px;
}

.cdl-sb-room-title {
	font-size: 18px;
	font-weight: 700;
}

.cdl-sb-remove {
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 14px;
	text-decoration: underline;
	cursor: pointer;
}

.cdl-sb-step {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 24px;
}

.cdl-sb-step-text {
	display: flex;
	flex-direction: column;
}

.cdl-sb-step-label {
	font-size: 17px;
}

.cdl-sb-step-hint {
	font-size: 13px;
	opacity: .65;
}

.cdl-sb-step-ctrl {
	display: flex;
	align-items: center;
	gap: 14px;
}

.cdl-sb-step-value {
	min-width: 20px;
	font-size: 17px;
	text-align: center;
}

.cdl-sb-minus,
.cdl-sb-plus {
	position: relative;
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--cdl-brand, #663264);
	cursor: pointer;
}

.cdl-sb-minus::before,
.cdl-sb-plus::before,
.cdl-sb-plus::after {
	content: "";
	position: absolute;
	top: 16px;
	left: 9px;
	width: 16px;
	height: 2px;
	background: currentColor;
}

.cdl-sb-plus::after {
	transform: rotate(90deg);
}

.cdl-sb-minus:disabled,
.cdl-sb-plus:disabled {
	opacity: .25;
	cursor: default;
}

.cdl-sb-ages {
	padding: 16px 24px;
	background: var(--cdl-soft, #f6f6f6);
}

.cdl-sb-ages-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

.cdl-sb-age {
	width: 100%;
	padding: 12px 16px;
	border: 1px solid var(--cdl-line, #ddd);
	border-radius: var(--cdl-radius-pill, 999px);
	background: var(--cdl-white, #fff);
	font: inherit;
}

.cdl-sb-age.is-invalid {
	border-color: #c62828;
	box-shadow: 0 0 0 2px rgba(198, 40, 40, .15);
}

.cdl-sb-ages-note {
	margin: 12px 0 0;
	font-size: 13px;
	opacity: .7;
}

.cdl-sb-panel-foot {
	position: sticky;
	bottom: 0;
	display: flex;
	gap: 12px;
	padding: 16px 24px;
	background: var(--cdl-white, #fff);
}

.cdl-sb-panel-foot .cdl-sb-add {
	flex: 1 1 auto;
}

.cdl-sb-add[hidden] {
	display: none;
}

/* --- Mobile: compact bar, bottom sheets ------------------------------ */

@media (max-width: 767px) {
	/* Edge to edge, whatever padding the page has. */
	/* Edge to edge: wider than its column and moved left by the column's
	   offset, which needs no margins (the block layout forces those). Once
	   scrolled out of view the script pins it to the top of the screen. */
	.cdl-sb {
		position: relative;
		left: calc(50% - 50vw);
		width: 100vw;
		max-width: none !important;
	}

	.cdl-sb.is-pinned {
		position: fixed;
		top: 0;
		right: 0;
		left: 0;
		width: auto;
		margin: 0 !important;
	}

	.cdl-sb-bar {
		padding: 6px;
		border-width: 0 0 1px;
		border-radius: 0;
	}

	.cdl-sb-field {
		gap: 8px;
		padding: 6px 10px;
	}

	/* The field is too narrow for two dates: the inputs cover the whole bar,
	   above the backdrop. */
	.cdl-sb-bar {
		position: relative;
	}

	.cdl-sb-dates-wrap {
		position: static;
	}

	.cdl-sb-date-inputs {
		left: 0;
		z-index: 1001;
		padding: 6px;
		background: var(--cdl-white, #fff);
	}

	.cdl-sb-icon {
		display: none;
	}

	.cdl-sb-label {
		font-size: 11px;
	}

	.cdl-sb-value {
		font-size: 14px;
	}

	.cdl-sb-submit {
		padding: 12px 16px;
		font-size: 14px;
	}

	.cdl-sb-backdrop {
		position: fixed;
		inset: 0;
		z-index: 1000;
		background: rgba(0, 0, 0, .4);
	}

	.cdl-sb-panel,
	.cdl-sb-panel-dates,
	.cdl-sb-panel-who {
		position: fixed;
		top: auto;
		right: 0;
		bottom: 0;
		left: 0;
		z-index: 1001;
		width: auto;
		max-height: 88vh;
		border-width: 1px 0 0;
		border-radius: var(--cdl-radius, 20px) var(--cdl-radius, 20px) 0 0;
		animation: cdl-sb-up .25s ease-out;
	}

	.cdl-sb-panel-head,
	.cdl-sb-panel-dates .cdl-sb-close {
		display: flex;
	}

	.cdl-sb-panel-who .cdl-sb-panel-head {
		padding: 16px 24px 0;
	}

	.cdl-sb-panel-dates {
		padding: 16px;
	}

	.cdl-cal-months {
		grid-template-columns: 1fr;
		gap: 20px;
	}

	.cdl-cal-nav {
		top: 0;
	}

	html.cdl-sb-locked,
	html.cdl-sb-locked body {
		overflow: hidden;
	}
}

@keyframes cdl-sb-up {
	from {
		transform: translateY(100%);
	}

	to {
		transform: translateY(0);
	}
}
