/* =========================================================================
   CDL Availability: split stay, free-date chips, waiting list.
   Uses the theme tokens (--cdl-*) from cdl-blocks general.css.
   ========================================================================= */

/* Everything that is not a card spans the whole results grid. */
.accommodation > .cdl-split,
.accommodation > .cdl-waitlist {
	grid-column: 1 / -1;
}

/* --- Split stay --------------------------------------------------------- */

.cdl-split {
	background: var(--cdl-white, #fff);
	border: 1px solid var(--cdl-line, #ddd);
	border-radius: var(--cdl-radius, 20px);
	padding: var(--cdl-card-pad, 24px);
}

.cdl-split-title {
	margin: 0 0 20px;
	font-family: var(--cdl-font-title, inherit);
	font-size: 20px;
	font-weight: 400;
	line-height: 1.3;
}

.cdl-split-legs {
	display: flex;
	align-items: stretch;
	gap: 16px;
}

.cdl-split-leg {
	flex: 1 1 0;
	min-width: 0;
	border: 1px solid var(--cdl-line, #ddd);
	border-radius: var(--cdl-radius, 20px);
	overflow: hidden;
	background: var(--cdl-white, #fff);
}

.cdl-split-image img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: var(--cdl-img-ratio, 4 / 3);
	object-fit: cover;
}

.cdl-split-name,
.cdl-split-nights,
.cdl-split-dates {
	margin: 0;
	padding-inline: 16px;
}

.cdl-split-name {
	padding-top: 14px;
	font-size: var(--cdl-fs-card-title, 18px);
	font-weight: 700;
	line-height: 1.2;
}

.cdl-split-nights {
	padding-top: 6px;
	font-size: var(--cdl-fs-meta, 14px);
}

.cdl-split-dates {
	padding-bottom: 16px;
	font-size: var(--cdl-fs-meta, 14px);
	opacity: .75;
}

.cdl-split-arrow {
	flex: none;
	align-self: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--cdl-brand, #663264);
	position: relative;
}

.cdl-split-arrow::before {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 12px;
	height: 12px;
	border-top: 2px solid #fff;
	border-right: 2px solid #fff;
	transform: translateX(-2px) rotate(45deg);
}

.cdl-split-note {
	margin: 20px 0 0;
	font-weight: 700;
	line-height: 1.5;
}

.cdl-split-footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid var(--cdl-line, #ddd);
}

.cdl-split-total {
	margin: 0;
	font-size: 18px;
}

.cdl-split form {
	margin: 0;
}

.cdl-split .cdl-split-book {
	display: inline-block;
	min-width: 200px;
	padding: 16px 28px 15px;
	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-family: var(--cdl-font-ui, inherit);
	font-size: 16px;
	font-weight: 500;
	line-height: 1;
	cursor: pointer;
	transition: background-color .2s ease, border-color .2s ease;
}

.cdl-split .cdl-split-book:hover {
	background: var(--cdl-brand-dark, #4d254b);
	border-color: var(--cdl-brand-dark, #4d254b);
}

.cdl-split .cdl-split-attributes {
	display: flex;
	flex-wrap: wrap;
	row-gap: 5px;
	margin: 0;
	padding: 10px 16px 0;
	list-style: none;
}

.cdl-split-rates {
	margin: 20px 0 0;
}

.cdl-split-total {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.cdl-split-price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 6px 10px;
}

.cdl-split-price .cdl-club-badge {
	flex: 0 0 auto;
	margin: 0;
}

.cdl-split-price .cdl-price-note {
	flex: 0 0 100%;
	margin-top: 2px;
}

.cdl-split-amount .mphb-price {
	font-weight: 700;
}

@media (max-width: 767px) {
	.cdl-split-legs {
		flex-direction: column;
	}

	/* A zero basis in a column collapses the card in Safari. */
	.cdl-split-leg {
		flex: 0 0 auto;
	}

	.cdl-split-arrow {
		transform: rotate(90deg);
	}

	.cdl-split-book {
		width: 100%;
	}
}

/* --- Free-date chips inside an unavailable card ------------------------- */

/* The card greys itself out; the suggestions inside must not. */
.accommodation > .mphb-room-type.unavailable:has(.cdl-flex) {
	filter: none;
	opacity: 1;
}

.accommodation > .mphb-room-type.unavailable:has(.cdl-flex) > :not(.cdl-flex) {
	filter: grayscale(1);
	opacity: .65;
}

.mphb-room-type > .cdl-flex {
	grid-column: 1 / -1;
	order: 99;
	align-self: end;
	margin: 0 var(--cdl-card-pad, 24px) var(--cdl-card-pad, 24px);
}

.cdl-flex-title {
	margin: 0 0 10px;
	font-size: var(--cdl-fs-meta, 14px);
}

.cdl-flex-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cdl-flex-item {
	margin: 0;
}

.cdl-flex-chip {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	box-sizing: border-box;
	padding: 10px 8px;
	border: 1px solid var(--cdl-brand, #663264);
	border-radius: calc(var(--cdl-radius, 20px) / 2);
	background: var(--cdl-soft, #f6f6f6);
	color: var(--cdl-text, #000);
	text-align: center;
	text-decoration: none;
	transition: background-color .2s ease, color .2s ease;
}

.cdl-flex-chip:hover,
.cdl-flex-chip:focus-visible {
	background: var(--cdl-brand, #663264);
	color: var(--cdl-white, #fff);
}

/* "3 days earlier": the first line, plain text. */
.cdl-flex-shift {
	font-size: 12px;
	font-weight: 400;
}

/* "Best price": a diagonal ribbon in the bottom right corner. */
.cdl-flex-chip {
	position: relative;
	overflow: hidden;
}

.cdl-flex-ribbon {
	position: absolute;
	right: -24px;
	bottom: 18px;
	width: 96px;
	padding: 2px 0;
	background: var(--cdl-brand, #663264);
	color: var(--cdl-white, #fff);
	font-size: 9px;
	font-weight: 700;
	line-height: 1.3;
	text-align: center;
	text-transform: uppercase;
	transform: rotate(-45deg);
	pointer-events: none;
}

.cdl-flex-chip:hover .cdl-flex-ribbon,
.cdl-flex-chip:focus-visible .cdl-flex-ribbon {
	background: var(--cdl-white, #fff);
	color: var(--cdl-brand, #663264);
}

.cdl-flex-dates {
	font-weight: 700;
	color: inherit;
}

.cdl-flex-nights,
.cdl-flex-price {
	font-size: 13px;
}

/* --- Flexible options (nothing free) ------------------------------------ */

.accommodation > .cdl-flexible-title {
	grid-column: 1 / -1;
	margin: 8px 0 0;
	font-family: var(--cdl-font-title, inherit);
	font-size: 20px;
	font-weight: 400;
}

/* Only the size, view and bed type stay on these cards. */
.accommodation > .mphb-room-type.cdl-flexible-card .mphb-loop-room-type-attributes > .mphb-room-type-facilities,
.accommodation > .mphb-room-type.cdl-flexible-card .mphb-loop-room-type-attributes > .mphb-room-type-total-capacity,
.accommodation > .mphb-room-type.cdl-flexible-card .mphb-loop-room-type-attributes > .mphb-room-type-adults-capacity,
.accommodation > .mphb-room-type.cdl-flexible-card .mphb-loop-room-type-attributes > .mphb-room-type-children-capacity {
	display: none;
}

/* Nearby dates (split view): in colour, without size and bed type. */
.accommodation > .mphb-room-type.unavailable.cdl-flexible-card,
.accommodation > .mphb-room-type.unavailable.cdl-flexible-card > * {
	filter: none !important;
	opacity: 1 !important;
}

.accommodation > .mphb-room-type.cdl-flexible-card .mphb-loop-room-type-attributes > .mphb-room-type-size,
.accommodation > .mphb-room-type.cdl-flexible-card .mphb-loop-room-type-attributes > .mphb-room-type-bed-type {
	display: none;
}

/* "Not available 18-21 Oct." on its own line above the name. */
.cdl-not-available {
	font-size: .7em;
	font-weight: 400;
	opacity: .75;
}


.accommodation > .cdl-flexible-more-wrap {
	grid-column: 1 / -1;
	margin: 0;
	text-align: center;
}

/* Same pill as every button of the design (see .cdl-split-book). */
.accommodation > .cdl-flexible-more-wrap .cdl-flexible-more {
	display: inline-block;
	min-width: 200px;
	padding: 16px 28px 15px;
	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-family: var(--cdl-font-ui, inherit);
	font-size: 16px;
	font-weight: 500;
	line-height: 1;
	cursor: pointer;
	transition: background-color .2s ease, border-color .2s ease;
}

.accommodation > .cdl-flexible-more-wrap .cdl-flexible-more:hover,
.accommodation > .cdl-flexible-more-wrap .cdl-flexible-more:focus-visible {
	background: var(--cdl-brand-dark, #4d254b);
	border-color: var(--cdl-brand-dark, #4d254b);
}

.accommodation > .cdl-flexible-more-wrap[hidden] {
	display: none;
}

/* "Join the waitlist" jump above the nearby dates. */
.accommodation > .cdl-waitlist-jump {
	grid-column: 1 / -1;
	margin: 8px 0 0;
	font-weight: 700;
}

.cdl-waitlist-jump a {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--cdl-brand, #663264);
	text-decoration: none;
}

.cdl-waitlist-jump a:hover,
.cdl-waitlist-jump a:focus-visible {
	text-decoration: underline;
}

.cdl-waitlist-jump-arrow {
	width: 8px;
	height: 8px;
	margin-top: -4px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
}

.cdl-waitlist {
	scroll-margin-top: 120px;
}

/* --- Unavailable card with free dates (normal search) ------------------- */

/* Only the photos, name, details and the free dates stay. */
.accommodation > .mphb-room-type.unavailable:has(.cdl-flex) > p:not([class]),
.accommodation > .mphb-room-type.unavailable:has(.cdl-flex) > .cdl-rates,
.accommodation > .mphb-room-type.unavailable:has(.cdl-flex) > .mphb-regular-price,
.accommodation > .mphb-room-type.unavailable:has(.cdl-flex) > .mphb-reserve-room-section {
	display: none;
}

.accommodation > .mphb-room-type.unavailable:has(.cdl-flex)::after {
	content: none;
}

/* The free dates sit at the bottom of the card, whatever is above them.
   The card is a grid whose rows share the spare height, so here it becomes
   a column and the auto margin takes all of it. */
.accommodation > .mphb-room-type.unavailable:has(.cdl-flex) {
	display: flex;
	flex-direction: column;
}

.accommodation > .mphb-room-type.unavailable > .cdl-flex {
	align-self: stretch; /* the grid rule's "end" would push it right */
	margin-top: auto;
}

/* --- Waiting list ------------------------------------------------------- */

.cdl-waitlist {
	background: var(--cdl-white, #fff);
	border: 1px solid var(--cdl-line, #ddd);
	border-radius: var(--cdl-radius, 20px);
	padding: var(--cdl-card-pad, 24px);
}

.cdl-waitlist-title {
	margin: 0 0 8px;
	font-size: 20px;
}

.cdl-waitlist-lead,
.cdl-waitlist-done,
.cdl-waitlist-error {
	margin: 0 0 16px;
}

.cdl-waitlist-error {
	color: #b42318;
}

.cdl-waitlist-form {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
	max-width: 760px;
}

.cdl-waitlist-form p {
	margin: 0;
}

.cdl-waitlist-consent,
.cdl-waitlist-submit {
	grid-column: 1 / -1;
}

.cdl-waitlist-field label {
	display: block;
	margin-bottom: 6px;
	font-size: 12px;
	font-weight: 500;
}

.cdl-waitlist-field input {
	width: 100%;
	box-sizing: border-box;
	padding: 12px 14px;
	border: 1px solid var(--cdl-line, #ddd);
	border-radius: var(--cdl-radius, 20px);
	font: inherit;
}

.cdl-waitlist-field input:focus {
	outline: none;
	border-color: var(--cdl-brand, #663264);
}

.cdl-waitlist-consent label {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	font-size: 14px;
}

.cdl-waitlist-consent input {
	accent-color: var(--cdl-brand, #663264);
	margin-top: 3px;
}

.cdl-waitlist-submit .button {
	min-width: 200px;
	padding: 14px 24px 13px;
	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-size: 16px;
	cursor: pointer;
}

.cdl-waitlist-submit .button:hover {
	background: var(--cdl-brand-dark, #4d254b);
}

@media (max-width: 767px) {
	.cdl-waitlist-form {
		grid-template-columns: minmax(0, 1fr);
	}

	.cdl-waitlist-submit .button {
		width: 100%;
	}
}

/* Cards after the first few wait behind "More": after, and as specific as,
   the flex layout of a card with free dates, which would show them again. */
.accommodation > .mphb-room-type.unavailable.cdl-flexible-hidden,
.accommodation > .mphb-room-type.cdl-flexible-card.cdl-flexible-hidden {
	display: none;
}
