/**
 * Accommodation — booking modal tab styles.
 * Flexbox native to the WP Travel Engine ecosystem; palette matches the
 * sibling addon plugins (paid activities / inclusive transport).
 */

.wpte-accom-tab {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin: 10px 0;
	-webkit-font-smoothing: antialiased;
}

/* Prices recompute live as travelers/quantities change — tabular figures
   keep the digit width constant so the surrounding layout doesn't jitter.
   Scoped to our own elements (not a bare `.amount-figure` selector) so this
   never touches unrelated markup elsewhere on the page that happens to
   reuse that class name. */
.wpte-accom-tab {
	font-variant-numeric: tabular-nums;
}

.wpte-accom-empty {
	color: #566267;
	font-size: 14px;
}

/* Admin-configurable tab-level title + instructions, shown at the top of the
   tab's own content, above the room cards. */
.wpte-accom-tab-title {
	font-size: 18px;
	font-weight: 700;
	color: #0f1d23;
	margin: 0;
}

.wpte-accom-tab-instructions {
	font-size: 14px;
	color: #566267;
	margin: 0;
	line-height: 1.6;
	width: 100%;
}

/* Room cards sit side-by-side on wider viewports; below 550px there isn't
   enough room for two columns to stay readable, so they stack instead. */
@media ( min-width: 550px ) {
	.wpte-accom-tab {
		flex-direction: row;
		flex-wrap: wrap;
	}

	.wpte-accom-room {
		flex: 1 1 0;
		min-width: 260px;
	}
}

@media ( max-width: 549px ) {
	.wpte-accom-tab {
		flex-direction: column;
	}
}

/* A clip-rect "visually hidden but focusable" pattern was tried here first,
   but a core WTE rule ([type=checkbox],[type=radio]{...}) won the cascade
   over our un-!important width/height, leaving a visible ~1.6x20px sliver
   (confirmed via DevTools). display:none is safe instead: both clickable
   cards already have role="button" tabIndex={0} + onKeyDown handling ALL
   interaction independently, so the native input is purely an internal
   state mirror now — it doesn't need to stay in the a11y tree. */
.wpte-accom-visually-hidden-input {
	display: none !important;
}

/* Plain wrapper — also the flex item WTE-tab lays out in a row/column per
   the breakpoints above. */
.wpte-accom-room {
	display: flex;
	flex-direction: column;
}

.wpte-accom-room__body {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 16px;
	border-radius: 10px;
	cursor: pointer;
	user-select: none;
	/* Shadow-as-border: adapts to any background, unlike a flat border color. */
	box-shadow:
		0px 0px 0px 1px rgba( 0, 0, 0, 0.06 ),
		0px 1px 2px -1px rgba( 0, 0, 0, 0.06 ),
		0px 2px 4px 0px rgba( 0, 0, 0, 0.04 );
	transition-property: box-shadow, background-color, scale;
	transition-duration: 0.2s;
	transition-timing-function: ease-out;
}

.wpte-accom-room__body:hover {
	box-shadow:
		0px 0px 0px 1px rgba( 41, 173, 87, 0.35 ),
		0px 4px 14px rgba( 26, 43, 51, 0.08 );
}

.wpte-accom-room__body:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba( 41, 173, 87, 0.25 );
}

.wpte-accom-room__body:active {
	scale: 0.96;
}

.wpte-accom-room__body.is-selected {
	box-shadow: 0 0 0 2px #29ad57;
	background: rgb( 41 173 87 / .08 );
}

/* Once an upgrade under this room is selected, the upgrade row's own
   `.is-selected` tint is the one active accent — the room body's own tint
   steps back instead of stacking underneath it. */
.wpte-accom-room__body.is-selected.has-selected-upgrade {
	background: none;
}

.wpte-accom-room__title {
	width: 100%;
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	color: #0f1d23;
	text-wrap: balance;
}

.wpte-accom-room.recommended .wpte-accom-room__title {
	padding-top: 30px;
}

.wpte-accom-room__pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

/* "Offered Hotels" — a dedicated row directly below the gallery, distinct
   from the metadata badges further down. Real navigation: each pill swaps
   the gallery grid to that hotel's own photos (public.js). */
.wpte-accom-hotel-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.wpte-accom-hotel-pill {
	display: inline-flex;
	align-items: center;
	padding: 5px 12px;
	font-size: 12px;
	font-weight: 600;
	color: #566267;
	background: #f7f9fa;
	border: 1px solid #e6eaec;
	border-radius: 999px;
	cursor: pointer;
	transition-property: border-color, background-color, color, scale;
	transition-duration: 0.2s;
	transition-timing-function: ease-out;
}

.wpte-accom-hotel-pill:hover {
	border-color: #29ad57;
}

.wpte-accom-hotel-pill:active {
	scale: 0.96;
}

.wpte-accom-hotel-pill.is-active {
	color: #29ad57;
	background: rgba( 41, 173, 87, 0.12 );
	border-color: #29ad57;
}

/* Simple underline reset — clears the active hotel pill back to the room's
   base gallery. Deliberately plain text (no pill/border) so it reads as a
   lightweight "undo" action, distinct from the pills themselves. */
.wpte-accom-gallery-reset-btn {
	display: inline-flex;
	align-items: center;
	padding: 0;
	font-size: 12px;
	font-weight: 600;
	color: #566267;
	background: none;
	border: 0;
	text-decoration: underline;
	cursor: pointer;
}

.wpte-accom-gallery-reset-btn:hover {
	color: #29ad57;
}

/* Room description — clamped to a fixed 3 lines (14px / line-height 1.6 =
   4.8em) with a fade + "Read more" toggle, ported from the Paid Activities
   sibling plugin's own identical mechanism for visual consistency across
   the plugin family. The toggle only renders once public.js confirms real
   overflow via a scrollHeight/clientHeight measurement (`.is-truncatable`),
   so short descriptions that already fit never show a stray fade. */
.wpte-accom-room__desc {
	position: relative;
	font-size: 14px;
	line-height: 1.6;
	color: #566267;
	max-height: 4.8em;
	overflow: hidden;
	transition: max-height 0.35s ease;
	text-wrap: pretty;
}

.wpte-accom-room__desc.is-expanded {
	max-height: 200em;
}

.wpte-accom-room__desc.is-truncatable:not( .is-expanded )::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 2em;
	background: linear-gradient( rgba( 255, 255, 255, 0 ), #fff );
	pointer-events: none;
}

/* A selected room's own background is a light green tint (see
   `.wpte-accom-room__body.is-selected`), not plain white — fade to that
   same tint instead of white so the overlay blends with the card. */
.wpte-accom-room__body.is-selected .wpte-accom-room__desc.is-truncatable:not( .is-expanded )::after {
	background: linear-gradient( rgba( 41, 173, 87, 0 ), rgb( 41 173 87 / 0.08 ) );
}

.wpte-accom-readmore {
	align-self: flex-start;
	padding: 0;
	font-size: 13px;
	font-weight: 600;
	color: #29ad57;
	background: none;
	border: 0;
	cursor: pointer;
}

.wpte-accom-readmore:hover {
	text-decoration: underline;
}

/* Pinned to the card's top-right corner (the card already has
   position:relative), stacked with the selected-state checkmark so the two
   never overlap when a recommended room is also the selected one. */
.wpte-accom-room__corner {
	position: absolute;
	top: 12px;
	z-index: 2;
	display: flex;
	align-items: flex-end;
	gap: 8px;
}

.wpte-accom-room .wpte-accom-room__corner {
	right: 12px;
	flex-direction: column;
}

.wpte-accom-room.recommended .wpte-accom-room__corner {
	right: unset;
	flex-direction: row;
	width: 90%;
	justify-content: space-between;
}

.wpte-accom-recommended {
	display: inline-flex;
	padding: 3px 10px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: #ffffff;
	background: #16a34a;
	border-radius: 999px;
	box-shadow: 0 2px 6px rgba( 22, 101, 52, 0.25 );
}

/* Round checkbox↔checkmark badge, always rendered — an empty outlined circle
   at rest, morphing smoothly into the filled green checkmark (matching the
   selected border color #29ad57) via CSS transition when `.is-checked` is
   toggled, rather than mounting/unmounting the element (which only allowed a
   one-shot pop-in, never a reverse/uncheck animation). */
.wpte-accom-checkmark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 22px;
	height: 22px;
	background: transparent;
	border: 2px solid #c7d0d4;
	border-radius: 50%;
	box-shadow: none;
	transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, scale 0.2s cubic-bezier( 0.2, 0, 0, 1 );
}

.wpte-accom-checkmark.is-checked {
	background: #29ad57;
	border-color: #29ad57;
	box-shadow: 0 2px 6px rgba( 22, 101, 52, 0.25 );
	scale: 1;
}

.wpte-accom-checkmark::after {
	content: '';
	width: 10px;
	height: 10px;
	background-image: url( "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='4 13 9.5 18.5 20 6'/%3E%3C/svg%3E" );
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	opacity: 0;
	scale: 0.5;
	transition: opacity 0.2s ease, scale 0.2s cubic-bezier( 0.2, 0, 0, 1 );
}

.wpte-accom-checkmark.is-checked::after {
	opacity: 1;
	scale: 1;
}

.wpte-accom-upgrade-row .wpte-accom-checkmark {
	position: absolute;
	top: 10px;
	right: 10px;
}

.wpte-accom-included {
	display: inline-flex;
	padding: 5px 12px;
	font-size: 12px;
	font-weight: 600;
	color: #29ad57;
	background: rgba( 41, 173, 87, 0.12 );
	border-radius: 999px;
}

.wpte-accom-badge-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.wpte-accom-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 11px;
	font-size: 12px;
	color: #29ad57;
	background-color: rgba( 41, 173, 87, 0.08 );
	border-radius: 50px;
}

.wpte-accom-badge__glyph {
	display: inline-flex;
	align-items: center;
}

.wpte-accom-badge strong {
	color: #1a2b33;
	font-weight: 700;
}

/* Upgrades panel — its own separate surface (sibling of, not nested inside,
   the room's own card) so its background/boundary never merges visually
   with the base room's selected-state border above it. Stays collapsed
   until its header is clicked, independent of the room's own selection. */
.wpte-accom-upgrades {
	padding: 12px 8px;
	/* Concentric with the 8px upgrade-row radius: 8 (row) + 8 (h-padding) = 16. */
	border-radius: 16px;
	cursor: default;
}

.wpte-accom-upgrades__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 13px;
	font-weight: 600;
	color: #566267;
	cursor: pointer;
	user-select: none;
	/* Minimum 40x40px hit area even though the visible row is shorter. */
	min-height: 40px;
}

.wpte-accom-upgrades__head:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba( 41, 173, 87, 0.25 );
	border-radius: 4px;
}

.wpte-accom-chevron {
	transition: transform 0.2s ease;
	color: #566267;
}

.wpte-accom-chevron.is-open {
	transform: rotate( 180deg );
}

/* `grid-template-rows: 0fr -> 1fr` animates to the content's natural
   height without any JS measurement — an interruptible CSS transition
   (can be reversed mid-animation), unlike the previous mount/unmount which
   had nothing to transition and just snapped open/closed. `visibility` is
   toggled with a transition-delay so the collapsed content leaves the tab
   order and can't be interacted with, same as the old unmount behavior. */
.wpte-accom-upgrades__rows-wrapper {
	display: grid;
	grid-template-rows: 0fr;
	visibility: hidden;
	transition: grid-template-rows 250ms ease, visibility 0s linear 250ms;
}

.wpte-accom-upgrades.is-open .wpte-accom-upgrades__rows-wrapper {
	grid-template-rows: 1fr;
	visibility: visible;
	transition: grid-template-rows 250ms ease, visibility 0s linear 0s;
}

.wpte-accom-upgrades__rows {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 10px;
	overflow: hidden;
	min-height: 0;
}

.wpte-accom-upgrade-row {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 10px 12px;
	/* White so the row reads as its own item against the panel's gray
	   background, rather than blending into it. */
	background: #ffffff;
	border-radius: 8px;
	cursor: pointer;
	user-select: none;
	box-shadow: 0px 0px 0px 1px rgba( 0, 0, 0, 0.06 );
	transition-property: box-shadow, background-color, scale;
	transition-duration: 0.2s;
	transition-timing-function: ease-out;
}

.wpte-accom-upgrade-row:hover {
	box-shadow: 0px 0px 0px 1px rgba( 41, 173, 87, 0.35 );
}

.wpte-accom-upgrade-row:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba( 41, 173, 87, 0.25 );
}

.wpte-accom-upgrade-row:active {
	scale: 0.96;
}

.wpte-accom-upgrade-row.is-selected {
	background: rgba( 41, 173, 87, 0.08 );
	box-shadow: 0 0 0 2px #29ad57;
	margin: 5px;
}

.wpte-accom-upgrade-row label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	margin: 0;
}

.wpte-accom-upgrade-row__title {
	font-weight: 600;
	color: #1a2b33;
}

/* Wraps EITHER the native WP core Gallery block markup (its own
   wp-block-gallery/wp-block-image styles apply — deliberately NOT
   overridden here, so its lightbox/grid layout renders exactly as WP core
   intends) OR, when that markup is unavailable, the plain fallback grid
   below (--fallback variant, styled explicitly, scoped so it never touches
   images nested inside injected core block HTML). */
.wpte-accom-gallery-grid {
	margin-top: 4px;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.wpte-accom-gallery-grid__thumb {
	display: block;
	width: 64px;
	height: 64px;
	cursor: pointer;
}

.wpte-accom-gallery-grid__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 6px;
	display: block;
	/* Subtle consistent depth on photos regardless of what they show. */
	outline: 1px solid rgba( 0, 0, 0, 0.1 );
	outline-offset: -1px;
}

/* Per-category breakdown, shown under a selected 'traveler'-priced
   upgrade row (mirrors Paid Activities' own breakdown panel). */
.wpte-accom-breakdown {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding-top: 8px;
	border-top: 1px dashed #e1e6e8;
	font-size: 13px;
	color: #566267;
}

.wpte-accom-breakdown__line {
	display: flex;
	justify-content: space-between;
	gap: 8px;
}

.wpte-accom-breakdown__line--total {
	font-weight: 700;
	color: #1a2b33;
}

/* Sidebar summary (rendered into #wte-booking-es-summary-content) */
.wpte-accom-summary {
	margin-top: 16px;
}

.wpte-accom-summary ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.wpte-accom-summary__row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 8px;
}

.wpte-accom-summary__row > label {
	flex: 1;
	font-size: 13px;
	line-height: 1.35;
	color: #1a2b33;
}

.wpte-accom-summary__row .amount-figure {
	font-size: 12px;
	color: #1a2b33;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

/* Matches the Transportation tab's sidebar treatment exactly (same
   font-style/weight/color/size) so both "Included in Package" labels look
   identical wherever they appear in the sidebar. */
.wpte-accom-summary__row .amount-figure em {
	font-style: normal;
	font-size: 12px;
	font-weight: 600;
	color: #29ad57;
}

/* Indented per-category breakdown rows, shown under the summary row when
   the selected upgrade is 'traveler'-priced (mirrors Paid Activities'
   wpte-paid-act-summary__line treatment). */
.wpte-accom-summary__line {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 8px;
	padding-left: 12px;
}

.wpte-accom-summary__line > label {
	flex: 1;
	font-size: 12px;
	line-height: 1.35;
	color: #566267;
}

.wpte-accom-summary__line .amount-figure {
	font-size: 12px;
	color: #566267;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

@media ( max-width: 600px ) {
	.wpte-accom-room__body {
		padding: 12px;
	}
}

/**
 * WPTE trip booking modal — step nav polish (finished-step checkmark, muted
 * finished underline, clearer active-step focus). Targets WPTE core's own
 * `.wte-process-nav-item` markup, not this plugin's own — shipped
 * identically in all three addon plugins (redundant but harmless) so it
 * applies regardless of which subset of the three is active, matching the
 * pattern already used for the mobile scroll-to-top fix.
 *
 * `!important` on `border-bottom-color` specifically: confirmed via
 * DevTools that WPTE's own React component sets `border-bottom` as a
 * PER-ITEM INLINE style, which otherwise overrides any plain class-based
 * rule regardless of selector specificity.
 */
.wte-process-nav-list .wte-process-nav-item.finish {
	position: relative;
}

.wte-process-nav-list .wte-process-nav-item.finish::after {
	content: '';
	position: absolute;
	top: 6px;
	right: 10px;
	width: 18px;
	height: 18px;
	background-color: #29ad57;
	background-image: url( "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='4 13 9.5 18.5 20 6'/%3E%3C/svg%3E" );
	background-size: 10px 10px;
	background-repeat: no-repeat;
	background-position: center;
	border-radius: 50%;
	box-shadow: 0 2px 6px rgba( 22, 101, 52, 0.25 );
}

/* Step-number badge: numbers each nav item 1..N in DOM order via a CSS
   counter, so it stays correct regardless of which addon plugins are active.
   A `display:none` legacy template also contains `.wte-process-nav-item`
   markup, but counters never count elements inside a display:none subtree,
   so only the live, visible nav is ever numbered. Shown opposite the
   `.finish` checkmark (top-left vs top-right) so the two never collide;
   `:not(.finish)` means a completed step shows its checkmark instead. */
.wte-process-nav-list {
	counter-reset: wpte-step;
}

.wte-process-nav-list .wte-process-nav-item {
	counter-increment: wpte-step;
}

.wte-process-nav-list .wte-process-nav-item:not(.finish)::before {
	content: counter( wpte-step );
	position: absolute;
	top: 6px;
	left: 10px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #e9edf0;
	color: #6e797e;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	font-weight: 700;
}

/* Muted underline on finished steps — a plain rgba fallback for browsers
   without color-mix() support, overridden by the theme-aware version below
   wherever it's understood, so finished steps read as "done" without
   competing with the current active step. */
.wte-process-nav-list .wte-process-nav-item.finish {
	border-bottom-color: rgba( 41, 173, 87, 0.35 ) !important;
}

.wte-process-nav-list .wte-process-nav-item.finish {
	border-bottom-color: color-mix( in srgb, var( --wpte-primary-color, var( --primary-color ) ) 35%, transparent ) !important;
}

/* Clearer focus on the current step: full-strength underline, a subtle
   tinted background, and a bolder label. */
.wte-process-nav-list .wte-process-nav-item.active {
	border-bottom-color: var( --wpte-primary-color, var( --primary-color ) ) !important;
	background-color: rgba( 41, 173, 87, 0.08 );
	background-color: color-mix( in srgb, var( --wpte-primary-color, var( --primary-color ) ) 8%, transparent );
	border-radius: 8px 8px 0 0;
}

.wte-process-nav-list .wte-process-nav-item.active a {
	font-weight: 700;
}

/* Admin-uploaded custom tab icon: size it exactly like WPTE's own native
   `.wte-icon svg { width:1em; height:1em }` rule so it shares the same
   font-size-relative sizing convention — a fixed-pixel <img> otherwise looks
   inconsistent next to the native icons and gets squeezed toward invisible
   once the flex nav row runs out of room on narrow viewports. */
.wte-icon .wpte-tab-icon-img {
	width: 1em;
	height: 1em;
	object-fit: contain;
	flex-shrink: 0;
	display: block;
}
