/**
 * Showroom single — "Boat Listing" section (boats from the inventory API)
 * Markup: single-showroom.php (.showroom-listing). Figma states: 685-4063 (several boats),
 * 685-4558 (one boat), 685-4828 (no boats here → nearest showroom's boats + notice).
 * More than 3 boats → the same cards in a carousel (arrows: assets/js/showroom.js).
 * Loaded after assets/css/showroom.css (inc/theme/assets.php).
 */

.showroom-listing__heading {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 32px;
	margin-bottom: 40px;
}

/* Fallback: notice box under the heading */
.showroom-listing__notice {
	margin: 0 0 40px;
	padding: 40px 24px;
	border-radius: 8px;
	background: #f1fafc;
	color: #001830;
	text-align: center;
}

.showroom-listing__notice-title {
	margin: 0 0 6px;
	padding: 0;
	font-family: "Archivo Narrow", "Arial Narrow", sans-serif;
	font-size: 24px;
	font-weight: 700;
	line-height: 1.2;
}

.showroom-listing__notice-text {
	margin: 0;
	padding: 0;
	font-size: 18px;
	line-height: 1.4;
}

/* Cards: 3 per row; a single boat keeps its 1/3 width, left-aligned */
.showroom-listing__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 32px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.showroom-listing__grid > li::before {
	content: none;
	display: none;
}

.showroom-boat {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
}

.showroom-boat__media {
	position: relative;
	aspect-ratio: 380 / 215;
	margin-bottom: 18px;
	border-radius: 4px;
	overflow: hidden;
	background: #dde4e6;
}

.showroom-boat__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}

.showroom-boat__badge {
	position: absolute;
	top: 14px;
	left: 14px;
	border-radius: 4px !important;
	z-index: 1;
	padding: 4px 14px;
	color: #fff;
	font-size: 14px;
	line-height: 1.4;
}

.showroom-boat__badge--new {
	background: #2db4cb;
}

.showroom-boat__badge--used {
	background: #001e46;
}

a.showroom-boat__vr {
	position: absolute;
	left: 12px;
	bottom: 10px;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: #fff;
	font-size: 14px;
	line-height: 1;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.showroom-boat__vr svg {
	width: 22px;
	height: 22px;
	fill: currentColor;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

a.showroom-boat__vr:hover {
	text-decoration: underline;
}

.showroom-boat__title {
	margin: 0 0 6px;
	color: #001830;
	font-family: "Archivo Narrow", "Arial Narrow", sans-serif;
	font-size: 24px;
	font-weight: 700;
	line-height: 1.2;
}

.showroom-boat__title a:hover {
	text-decoration: underline;
}

.showroom-boat__meta {
	margin: 0;
	padding: 0;
	color: #001830;
	font-size: 18px;
	line-height: 1.4;
}

.showroom-boat__price {
	margin: 12px 0 0;
	padding: 0;
	color: #2db4cb;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.4;
}

/* See All CTA: always under the boat listing, centred */
.showroom-listing__footer {
	display: flex;
	justify-content: center;
	margin-top: 40px;
}

/* Carousel (2+ boats): up to 3 per view on desktop (2 or 3 boats fill one row, arrows hidden),
   2 per view on tablet, 1 on mobile. --listing-per-view-desktop / --listing-gap-desktop are set
   inline in single-showroom.php. Arrows sit on the middle of the photos (photo height = card width x 222/380). */
.showroom-listing__carousel {
	--listing-per-view: var(--listing-per-view-desktop, 3);
	--listing-gap: var(--listing-gap-desktop, 22px);
	container-type: inline-size;
}

.showroom-listing__track {
	touch-action: pan-y;
}

.showroom-listing__grid.showroom-listing__track {
	display: flex;
	gap: var(--listing-gap);
	transition: transform 0.45s ease;
}

.showroom-listing__track > .showroom-boat {
	flex: 0 0 calc((100% - (var(--listing-per-view) - 1) * var(--listing-gap)) / var(--listing-per-view));
	min-width: 0;
}

.showroom-listing__carousel .showroom-carousel__arrow {
	top: calc((100cqw - (var(--listing-per-view) - 1) * var(--listing-gap)) / var(--listing-per-view) * 222 / 380 / 2);
}

/* Paragraph under the heading */
.showroom-listing .showroom-models__text {
	max-width: 520px;
}

/* No boats here: icon above the notice title, CTA centred under the cards */
.showroom-listing__notice-icon {
	display: block;
	width: 32px;
	height: 32px;
	margin: 0 auto 16px;
}

.showroom-listing--fallback .showroom-listing__footer {
	display: flex;
	justify-content: center;
}

/* 2 boats: two cards per row */
.showroom-listing--count-2 .showroom-listing__grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* 1 boat: text + CTA on the left, the card on the right */
.showroom-listing__split {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	align-items: center;
	gap: 48px;
}

.showroom-listing--single .showroom-listing__heading {
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	gap: 28px;
	margin-bottom: 0;
}

.showroom-listing--single .showroom-listing__grid {
	grid-template-columns: 1fr;
}

@media (max-width: 980px) {
	.showroom-listing__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.showroom-listing__carousel {
		--listing-per-view: 2;
		--listing-gap: 22px;
	}
}

@media (max-width: 700px) {
	.showroom-listing__heading {
		flex-direction: column;
		align-items: flex-start;
		gap: 20px;
		margin-bottom: 28px;
	}

	.showroom-listing__grid {
		grid-template-columns: 1fr;
		gap: 36px;
	}

	.showroom-listing__carousel {
		--listing-per-view: 1;
	}

	.showroom-listing__notice {
		padding: 28px 20px;
	}

	.showroom-listing--count-2 .showroom-listing__grid,
	.showroom-listing__split {
		grid-template-columns: 1fr;
		gap: 28px;
	}

	.showroom-listing--single .showroom-listing__heading {
		gap: 20px;
	}
}