/* ==========================================================================
   BOOKING GROUPS
   --------------------------------------------------------------------------
   A bookable bundle of room rates that must be reserved together as one
   unit. Rendered inside the hotel box only when the provider exposes a
   bookingGroupKey on its room rates. Hotels without grouping keep the
   legacy per-criterion layout untouched — every selector here is scoped
   under .booking-groups / .booking-group.

   Visual language mirrors the legacy single-room hotel box: badges on the
   left, price block + radio anchored at the right. The card frame, the
   "OPTION N" pill, and the orange selected-state are the only additions.
   ========================================================================== */

.booking-groups {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 10px 0 6px;
	counter-reset: bookingGroupOption;
}

/* Cards from the third onwards live in this block, hidden until the user
   clicks the "more available rooms" link. The forEach keeps the counter
   incrementing across visible + hidden cards so OPTION numbers stay correct. */
.booking-groups .booking-groups-more {
	margin-top: 8px;
}

.booking-groups .booking-groups-more.hidden {
	display: none;
}

/* slideToggle leaves the wrapper with display:block, which kills the
   parent's flex gap. Use margin between siblings so cards keep spacing
   regardless of how jQuery toggles visibility. */
.booking-groups .booking-groups-more > .booking-group + .booking-group {
	margin-top: 8px;
}

/* ==========================================================================
   "MORE / LESS AVAILABLE ROOMS" TOGGLE
   --------------------------------------------------------------------------
   Unified pill-style link applied to BOTH the per-criterion list (legacy
   single-room view) and the booking-groups list. Anchored to the left,
   PNG chevron on the right edge, hover/open swaps to the brand orange.
   ========================================================================== */

.hotel-result .extrascont {
	text-align: right;
	margin: 6px 0 4px;
}

/* Tighten the hotel box: keep 9px top padding (legacy) but trim the bottom
   so the toggle/book button cluster sits closer to the rooms. .book uses
   margin-top to anchor itself; both pulled to 5px. */
.hotel-result .content {
	padding-bottom: 5px;
}

.hotel-result .book {
	margin-top: 5px;
}

.hotel-result a.morerooms,
.hotel-result a.morerooms-bookingGroups {
	display: inline-block;
	float: none;       /* defeat legacy .hotel-result .content .rooms .morerooms { float:right } */
	width: auto;       /* defeat legacy width:160px */
	line-height: 1;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	color: #002a5c;
	text-decoration: none;
	padding: 8px 30px 8px 14px;
	border: 1px solid #d8dde5;
	border-radius: 16px;
	background: #ffffff url(../../images/more_arrow_down.png) no-repeat right 10px center;
	transition: border-color 160ms ease, color 160ms ease, background-color 160ms ease;
}

.hotel-result a.morerooms:hover,
.hotel-result a.morerooms.open,
.hotel-result a.morerooms-bookingGroups:hover,
.hotel-result a.morerooms-bookingGroups.open {
	border-color: #EC681F;
	color: #EC681F;
	background-color: #fffaf6;
}

.hotel-result a.morerooms.open,
.hotel-result a.morerooms-bookingGroups.open {
	background-image: url(../../images/more_arrow_up.png);
}

/* Legacy per-criterion toggle. Higher specificity needed throughout to win
   over the pre-existing rules in hotels-en.css that paint border-bottom and
   the background-image at center-right. Without these overrides the pill
   ends up with a gray bottom edge and a chevron at a different position than
   the booking-groups toggle. */
.hotel-result .content .rooms .morerooms {
	width: 163px;
	border: 1px solid #d8dde5;
	background: #ffffff url(../../images/more_arrow_down.png) no-repeat right 10px center;
}

.hotel-result .content .rooms .morerooms:hover,
.hotel-result .content .rooms .morerooms.open {
	border: 1px solid #EC681F;
	color: #EC681F;
	background-color: #fffaf6;
}

.hotel-result .content .rooms .morerooms.open {
	background-image: url(../../images/more_arrow_up.png);
	background-position: right 10px center;
	background-repeat: no-repeat;
}

/* The legacy hotels-en.css commented out the `.hotel-result .hidden`
   display:none rule, leaving the alternative-rates wrapper visible by
   default. Restore the collapsed-by-default behaviour to match the
   booking-groups view; the legacy click handler slideToggles this on the
   first interaction. */
.hotel-result .room-result.hidden {
	display: none;
}

/* --- Card -------------------------------------------------------------- */

.booking-group {
	counter-increment: bookingGroupOption;
	position: relative;
	background: #ffffff;
	border: 1px solid #d8dde5;
	border-radius: 4px;
	box-shadow: 0 1px 2px rgba(15, 28, 62, 0.04);
	transition:
		border-color 160ms ease,
		box-shadow 200ms ease,
		transform 200ms ease;
}

.booking-group:hover {
	border-color: #b6c0d2;
	box-shadow: 0 4px 12px rgba(15, 28, 62, 0.08);
	transform: translateY(-1px);
}

.booking-group.selected,
.booking-group:has(input[type="radio"]:checked) {
	border-color: #EC681F;
	box-shadow: 0 6px 18px rgba(236, 104, 31, 0.18);
}

.booking-group.selected::before,
.booking-group:has(input[type="radio"]:checked)::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	width: 4px;
	background: #EC681F;
	border-radius: 4px 0 0 4px;
}

/* --- Header strip ------------------------------------------------------ */

.booking-group .group-summary {
	display: flex;
	align-items: stretch;
	height: 48px; /* tighter than legacy 55px to keep the hotel box compact */
	border-bottom: 1px dashed #cdcdcc;
	background: linear-gradient(180deg, #fbfcfd 0%, #ffffff 100%);
	padding-left: 4px; /* keeps text off the orange rail */
}

/* "OPTION N" pill — counter-driven, no extra markup */
.booking-group .group-summary::before {
	content: "OPTION " counter(bookingGroupOption);
	align-self: center;
	margin: 0 12px 0 14px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 1px;
	color: #6b7280;
	background: #f1f3f7;
	border-radius: 10px;
	padding: 4px 9px;
	white-space: nowrap;
	transition: background 160ms ease, color 160ms ease;
}

.booking-group.selected .group-summary::before,
.booking-group:has(input[type="radio"]:checked) .group-summary::before {
	background: #EC681F;
	color: #ffffff;
}

/* Right side: badges + price + radio, anchored right (mirrors legacy single-room).
   Badges sit just before the price so they read together with it, not with the
   "OPTION N" pill on the left. */
.booking-group .group-summary-right {
	display: flex;
	align-items: stretch;
	flex: 0 0 auto;
	margin-left: auto; /* push the whole right block to the far right */
}

/* Reserve a uniform-width slot for the badges so that price + radio align
   across every card, regardless of how many badges this group has. */
.booking-group .group-badges {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 6px;
	height: 100%;
	min-width: 124px; /* fits 2 × 50px badges + 6px gap + side padding */
	padding: 0 8px;
	box-sizing: border-box;
}

/* Refundable / non-refundable / special-offer badges are 50x55 PNGs.
   Scaled proportionally to fit the 48px header strip. */
.booking-group .group-badges img {
	width: auto;
	height: 48px;
	display: block;
	flex: 0 0 auto;
}

/* Price block — beveled gray panel, dimensions tuned to match the legacy
   .hotel-result .room .price (89px wide, 18px left-padding for the corner
   PNG). The accent color stays brand orange so the price reads as the
   loudest element on the strip. */
.booking-group .group-price {
	background: url(../../images/price_corner.png) no-repeat scroll left center #F3F3F3;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	height: 100%;
	width: 89px;
	padding-left: 18px;
	box-sizing: content-box;
	text-align: center;
	flex: 0 0 auto;

	/* defeat the legacy .hotel-result .price absolute positioning */
	position: static;
	top: auto;
	right: auto;
}

.booking-group .group-price em {
	display: block;
	font-style: normal;
	font-size: 11px;
	font-weight: 600;
	color: #6b7280;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	line-height: 1.1;
	margin: 0 0 2px;
}

.booking-group .group-price p {
	margin: 0;
	font-size: 17px;
	font-weight: 700;
	color: #002a5c; /* matches legacy .hotel-result .room .price p */
	line-height: 1;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	transition: color 160ms ease;
}

/* Only the selected card's price wears the brand orange. */
.booking-group.selected .group-price p,
.booking-group:has(input[type="radio"]:checked) .group-price p {
	color: #EC681F;
}

/* Radio block — beveled gray panel, mirrors .hotel-result .room .radio.
   The native input is hidden by the legacy `.hotel-result input[type=radio]
   { display: none }` rule — we make the adjacent <label> the visible target. */
.booking-group .group-summary-right .radio {
	background: url(../../images/select_corner.png) no-repeat scroll left center #E1E1E1;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	width: 38px;
	padding-left: 24px;
	padding-bottom: 8px; /* nudge the label visually up to optical center */
	box-sizing: border-box;
	flex: 0 0 auto;
}

/* Override the legacy global `+label` PNG-radio styling within our scope so
   we get a clean CSS-drawn target that matches the brand orange palette. */
.booking-group .group-summary-right .radio input[type="radio"] {
	display: none;
}

.booking-group .group-summary-right .radio input[type="radio"] + label {
	background: #ffffff;
	border: 2px solid #c8ced9;
	border-radius: 50%;
	height: 20px;
	width: 20px;
	display: block;
	cursor: pointer;
	float: none;
	margin: 0;
	padding: 0;
	position: relative;
	transition: border-color 160ms ease, box-shadow 160ms ease;
	box-sizing: border-box;
}

.booking-group .group-summary-right .radio input[type="radio"] + label:hover {
	border-color: #EC681F;
}

.booking-group .group-summary-right .radio input[type="radio"]:checked + label {
	background: #ffffff;
	border-color: #EC681F;
	box-shadow: 0 0 0 3px rgba(236, 104, 31, 0.18);
}

.booking-group .group-summary-right .radio input[type="radio"]:checked + label::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #EC681F;
}

.booking-group .group-summary-right .radio input[type="radio"]:focus-visible + label {
	outline: 2px solid #EC681F;
	outline-offset: 3px;
}

/* --- Body: rooms grid -------------------------------------------------- */

.booking-group .group-rooms {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0;
}

.booking-group .group-rooms .group-room {
	padding: 8px 16px 10px;
	border-right: 1px dashed #e6e8ec;
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.booking-group .group-rooms .group-room:last-child {
	border-right: none;
}

.booking-group .group-rooms .group-room .criterion-label {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: #8a92a3;
	margin-bottom: 2px;
}

.booking-group .group-rooms .group-room .room-name {
	font-size: 13px;
	font-weight: 600;
	color: #0f1c3e;
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.booking-group .group-rooms .group-room .meal-plan {
	font-size: 12px;
	color: #4b5563;
	margin-top: 2px;
}

/* --- Responsive -------------------------------------------------------- */

@media (max-width: 720px) {
	.booking-group .group-rooms {
		grid-template-columns: 1fr;
	}
	.booking-group .group-rooms .group-room {
		border-right: none;
		border-bottom: 1px dashed #e6e8ec;
	}
	.booking-group .group-rooms .group-room:last-child {
		border-bottom: none;
	}
	.booking-group .group-summary {
		flex-wrap: wrap;
	}
	.booking-group .group-summary-right {
		width: 100%;
		justify-content: flex-end;
		margin-left: 0;
	}
	.booking-group .group-price {
		min-width: 100px;
	}
}
