/* H-Lead Card Carousel — a repeater of cards (fleet/transfer/blog/routes/
 * category/destination) rendered as a slidable track. --hl-cards-per-view
 * is set by card-carousel.js (desktop control value, always 1 on mobile). */

.hl-card-carousel {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: var(--hl-space-24);
	--hl-cards-per-view: 1;
}

/* Prev/next arrows — desktop-only, shown automatically (via card-carousel.js)
 * when the carousel actually overflows its view and isn't in grid layout.
 * card-carousel.js docks this group as a real flex child inside the
 * preceding title/subtitle's row (see .hl-carousel-arrows-host below), so
 * alignment is plain CSS box layout — no absolute positioning, no JS
 * measurement, nothing to recompute or jump after fonts/images settle.
 * The fallback (undocked, e.g. no preceding title found) still floats
 * above the track. */
.hl-card-carousel__arrows {
	display: none;
	position: absolute;
	top: -56px;
	right: 0;
	gap: var(--hl-space-12);
}

.hl-card-carousel__arrows--docked {
	position: static;
	top: auto;
	right: auto;
	margin-left: auto;
	flex: 0 0 auto;
}

@media (min-width: 992px) {
	.hl-card-carousel__arrows:not([hidden]) {
		display: inline-flex;
	}
}

/* Host row for docked arrows — a plain Elementor heading's widget
 * container (block by default) becomes a flex row so the arrows land at
 * its right edge, level with the text. hl-section-title is already a flex
 * row, so it only needs the docked-arrows margin-left:auto above. */
.hl-carousel-arrows-host:not(.hl-section-title) {
	display: flex;
	align-items: center;
	gap: var(--hl-space-12);
}

.hl-carousel-arrow {
	box-sizing: border-box;
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	margin: 0;
	border-radius: 50%;
	border: 2px solid var(--hl-color-brand-800);
	background-color: transparent;
	color: var(--hl-color-brand-800);
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.hl-carousel-arrow svg {
	width: var(--hl-space-20);
	height: var(--hl-space-20);
	flex: 0 0 auto;
}

.hl-carousel-arrow:hover {
	background-color: var(--hl-color-brand-800);
	color: var(--hl-color-white);
}

.hl-carousel-arrow:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.hl-card-carousel__viewport {
	overflow: hidden;
	touch-action: pan-y;
	cursor: grab;
}

.hl-card-carousel__viewport--dragging {
	cursor: grabbing;
	-webkit-user-select: none;
	user-select: none;
}

.hl-card-carousel__track {
	display: flex;
	gap: var(--hl-space-20);
	transition: transform 0.35s ease;
}

.hl-card-carousel__slide {
	flex: 0 0 auto;
	min-width: 0;
	width: calc((100% - (var(--hl-cards-per-view) - 1) * var(--hl-space-20)) / var(--hl-cards-per-view));
}

.hl-card-carousel__slide>* {
	height: 100%;
}

.hl-card-carousel__tabs {
	justify-content: center;
	flex-wrap: wrap;
}

/* When card-carousel.js finds the tabs don't fit on one line, it switches
 * to a single row: tabs that fit stay left-aligned, the rest move into the
 * kebab dropdown pinned to the right (--tabs-more-wrap's margin-left:auto). */
.hl-card-carousel__tabs--overflowing,
.hl-card-carousel__tabs--measuring {
	flex-wrap: nowrap;
	justify-content: flex-start;
}

/* Only clip the mid-measurement flash of un-trimmed tabs; the real
 * --overflowing state must stay visible so the kebab dropdown (a
 * descendant of this nav) isn't clipped along with it. */
.hl-card-carousel__tabs--measuring {
	overflow: hidden;
}

.hl-card-carousel__tabs--overflowing .hl-tabs__tab,
.hl-card-carousel__tabs--measuring .hl-tabs__tab {
	flex: 0 0 auto;
	white-space: nowrap;
}

.hl-card-carousel__tabs-more-wrap {
	position: relative;
	flex: 0 0 auto;
	margin-left: auto;
	padding-left: var(--hl-space-16);
}

.hl-card-carousel__tabs-more {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: none;
	border-radius: var(--hl-radius-9999);
	background-color: transparent;
	color: var(--hl-color-text-title);
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.hl-card-carousel__tabs-more:hover,
.hl-card-carousel__tabs-more--active {
	background-color: var(--hl-color-brand-100);
	color: var(--hl-color-brand-500);
}

.hl-card-carousel__tabs-menu {
	position: absolute;
	top: calc(100% + var(--hl-space-8));
	right: 0;
	z-index: 100;
	display: flex;
	flex-direction: column;
	gap: var(--hl-space-4);
	min-width: 180px;
	padding: var(--hl-space-8);
	border-radius: var(--hl-radius-12);
	background-color: var(--hl-color-white);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-6px) scale(0.98);
	transform-origin: top right;
	pointer-events: none;
	transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.16s;
}

.hl-card-carousel__tabs-menu--open {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
	pointer-events: auto;
	transition: opacity 0.16s ease, transform 0.16s ease;
}

.hl-card-carousel__tabs-menu .hl-tabs__tab {
	width: 100%;
	justify-content: flex-start;
	text-align: left;
	white-space: nowrap;
}

/* Same "color change only" treatment on hover — no pill background here either. */
.hl-card-carousel__tabs-menu .hl-tabs__tab:hover,
.hl-card-carousel__tabs-menu .hl-tabs__tab--underline:hover {
	background-color: transparent;
	border-bottom-color: transparent;
	color: var(--hl-color-brand-400);
}

/* In the dropdown, active is just a color change — no pill background
 * (default variant) and no underline bar (underline variant), so there's
 * only one active style instead of two competing ones. */
.hl-card-carousel__tabs-menu .hl-tabs__tab--active,
.hl-card-carousel__tabs-menu .hl-tabs__tab--active:hover,
.hl-card-carousel__tabs-menu .hl-tabs__tab--underline.hl-tabs__tab--active,
.hl-card-carousel__tabs-menu .hl-tabs__tab--underline.hl-tabs__tab--active:hover {
	background-color: transparent;
	border-bottom-color: transparent;
	color: var(--hl-color-brand-400);
}

/* Slides hidden by the filter tabs must not take up track space. */
.hl-card-carousel__slide[hidden] {
	display: none;
}

.hl-card-carousel__nav {
	display: flex;
	justify-content: center;
	margin-bottom: 30px;
}

@media (max-width: 1024px) {
	.hl-card-carousel__nav {
		margin-top: 20px;
	}
}

.hl-card-carousel__nav[hidden] {
	display: none;
}

.hl-card-carousel__no-results {
	width: 100%;
	max-width: 770px;
	margin-left: auto;
	margin-right: auto;
	padding: var(--hl-space-16) var(--hl-space-24);
	border-radius: var(--hl-radius-12);
	background-color: var(--hl-color-yellow-500);
	color: var(--hl-color-brand-500);
	font-family: var(--hl-font-family);
	text-align: center;
}

.hl-card-carousel__no-results[hidden] {
	display: none;
}

/* Grid layout: cards wrap into rows on desktop instead of sliding. Mobile
 * always keeps the swipeable carousel (with dots) regardless of this
 * setting — the grid override only applies at the desktop breakpoint. */
@media (min-width: 992px) {
	.hl-card-carousel--grid .hl-card-carousel__viewport {
		overflow: visible;
		touch-action: auto;
		cursor: auto;
	}

	.hl-card-carousel--grid .hl-card-carousel__track {
		display: grid;
		grid-template-columns: repeat(var(--hl-cards-per-view), 1fr);
		transform: none !important;
	}

	.hl-card-carousel--grid .hl-card-carousel__slide {
		width: auto;
	}

	.hl-card-carousel--grid .hl-card-carousel__nav {
		display: none !important;
	}
}