.kart-selector {
	--ks-radius: 1.25rem;
	--ks-gap: 1.25rem;
	--ks-panel-bg: rgba(20, 20, 22, 0.35);
	--ks-panel-border: rgba(255, 255, 255, 0.14);
	/* Ink defaults to light: --ks-panel-bg is a dark, translucent glass panel
	   meant to float over a photo/gradient backdrop (see the mockup), so dark
	   text would be unreadable against it. Override these on a light theme. */
	--ks-ink: #fff;
	--ks-muted: rgba(255, 255, 255, 0.78);
	--ks-accent: #c81e1e;
	--ks-dot: rgba(255, 255, 255, 0.35);
	--ks-dot-active: #c81e1e;
	--ks-progress-track: rgba(255, 255, 255, 0.25);
	/* The info card is absolutely positioned on top of the stage (which spans
	   the full width behind it), so this width IS the overlap - the whole
	   card sits over the image. Wide enough to reach past the centerline. */
	--ks-info-width: clamp(15rem, 42%, 23rem);
	--ks-ease: cubic-bezier(0.22, 1, 0.36, 1);
	box-sizing: border-box;
	color: var(--ks-ink);
	display: grid;
	grid-template-columns: minmax(0, 1fr) 15rem;
	grid-template-areas:
		'main thumbs'
		'dots thumbs';
	gap: var(--ks-gap);
	align-items: start;
	width: 100%;
	max-width: 100%;
}

.kart-selector *,
.kart-selector *::before,
.kart-selector *::after {
	box-sizing: border-box;
}

.kart-selector__main {
	grid-area: main;
	position: relative;
	/* The 2x hero image and the overlapping info card both extend past this
	   box's own edges on purpose - clipping here would cut them off. */
	overflow: visible;
}

.kart-selector__info {
	/* Absolutely positioned over the stage instead of pulled onto it with a
	   negative margin - a negative margin only overlaps if there happens to
	   be enough spare width left in the row, and any ancestor CSS that
	   resets margins/flex-shrink (common in WP themes and page builders)
	   silently kills the overlap, dropping the card back into normal flow
	   next to the image. Absolute positioning doesn't depend on either. */
	position: absolute;
	top: 0;
	left: 0;
	width: var(--ks-info-width);
	z-index: 2;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 1.5rem 1.5rem 1.35rem;
	border-radius: var(--ks-radius);
	background: var(--ks-panel-bg);
	border: 1px solid var(--ks-panel-border);
	backdrop-filter: blur(10px);
	box-shadow: 0 24px 55px rgba(0, 0, 0, 0.4);
}

.kart-selector__progress {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	margin-bottom: 1.1rem;
}

.kart-selector__progress-count {
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: var(--ks-muted);
}

.kart-selector__progress-track {
	position: relative;
	width: 100%;
	height: 2px;
	border-radius: 999px;
	background: var(--ks-progress-track);
	overflow: hidden;
}

.kart-selector__progress-fill {
	position: absolute;
	inset: 0;
	width: 0;
	background: var(--ks-accent);
	border-radius: 999px;
	transition: width 320ms var(--ks-ease);
}

.kart-selector__panel {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	animation: kart-selector-fade 280ms var(--ks-ease);
}

/* Same CSS specificity as the UA `[hidden]` rule, but ours loads later in
   the cascade and would otherwise win, keeping every panel visible at once. */
.kart-selector__panel[hidden] {
	display: none;
}

@keyframes kart-selector-fade {
	from {
		opacity: 0;
		transform: translateY(4px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.kart-selector__title {
	margin: 0;
	font-size: clamp(1.1rem, 1.6vw, 1.4rem);
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: 1.15;
}

.kart-selector__body {
	margin: 0;
	color: var(--ks-muted);
	font-size: 0.95rem;
	line-height: 1.55;
}

.kart-selector__body > :first-child {
	margin-top: 0;
}

.kart-selector__body > :last-child {
	margin-bottom: 0;
}

.kart-selector__stage {
	position: relative;
	width: 100%;
	min-height: 28rem;
	z-index: 1;
	overflow: visible;
}

.kart-selector__hero-image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center;
	opacity: 0;
	/* Base size is 2x: the fitted image, scaled up from its own center. */
	transform: scale(1.94);
	transition: opacity 360ms var(--ks-ease), transform 360ms var(--ks-ease);
	pointer-events: none;
}

.kart-selector__hero-image.is-active {
	opacity: 1;
	transform: scale(2);
}

.kart-selector__dots {
	grid-area: dots;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	margin-top: 0.5rem;
}

.kart-selector__dot {
	width: 0.55rem;
	height: 0.55rem;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: var(--ks-dot);
	cursor: pointer;
	transition: width 260ms var(--ks-ease), background 260ms ease;
}

.kart-selector__dot.is-active {
	width: 1.35rem;
	background: var(--ks-dot-active);
}

.kart-selector__dot:focus-visible {
	outline: 2px solid var(--ks-accent);
	outline-offset: 3px;
}

.kart-selector__thumbs {
	grid-area: thumbs;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.kart-selector__thumb {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	padding: 1rem;
	border: 1px solid var(--ks-panel-border);
	border-radius: var(--ks-radius);
	background: var(--ks-panel-bg);
	backdrop-filter: blur(6px);
	cursor: pointer;
	transition: transform 220ms var(--ks-ease), box-shadow 220ms ease, border-color 220ms ease;
}

.kart-selector__thumb:hover,
.kart-selector__thumb:focus-visible {
	transform: translateY(-2px);
	border-color: var(--ks-accent);
	outline: none;
}

.kart-selector__thumb[hidden] {
	display: none;
}

.kart-selector__thumb img {
	width: 100%;
	max-height: 5.5rem;
	object-fit: contain;
}

.kart-selector__thumb-label {
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--ks-ink);
}

.kart-selector__cta {
	grid-column: 1 / -1;
	justify-self: center;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 0.5rem;
	min-height: 2.5rem;
	padding: 0.6rem 1.5rem;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.9);
	/* Fixed, not var(--ks-ink): the pill is always light regardless of theme,
	   so its text must stay dark even when --ks-ink flips to light. */
	color: #17181b;
	text-decoration: none;
	font-weight: 600;
	font-size: 0.85rem;
	transition: transform 220ms var(--ks-ease), background 220ms ease;
}

.kart-selector__cta:hover,
.kart-selector__cta:focus-visible {
	background: #fff;
	transform: translateY(-1px);
	outline: none;
}

@media (max-width: 767px) {
	.kart-selector {
		grid-template-columns: 1fr;
		grid-template-areas:
			'main'
			'dots'
			'thumbs';
	}

	.kart-selector__info {
		/* The overlap doesn't read as well stacked on a narrow screen - back
		   into normal flow, full width, sitting above the stage instead of
		   on top of it. */
		position: static;
		width: 100%;
		margin-bottom: 1rem;
	}

	.kart-selector__stage {
		min-height: 16rem;
	}

	.kart-selector__hero-image {
		/* 2x would overflow the viewport width on a narrow screen. */
		transform: scale(1.44);
	}

	.kart-selector__hero-image.is-active {
		transform: scale(1.5);
	}

	.kart-selector__thumbs {
		flex-direction: row;
		flex-wrap: wrap;
	}

	.kart-selector__thumb {
		flex: 1 1 8rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.kart-selector__panel,
	.kart-selector__hero-image,
	.kart-selector__dot,
	.kart-selector__thumb,
	.kart-selector__cta {
		animation-duration: 1ms !important;
		transition-duration: 1ms !important;
	}
}
