/**
 * Products / Solutions coverflow — matches V5 products.css
 * Tokens from globals.css. Clips coverflow to prevent page X-scroll.
 */

html:has(.se-products),
html:has(.se-products) body {
	overflow-x: clip !important;
}

.se-products.stage--products {
	position: relative;
	padding-block: 5.5rem;
	overflow-x: clip;
	max-width: 100%;
	background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-surface-soft) 100%);
	color: var(--color-ink);
}

.se-products .products-header {
	max-width: 800px;
	margin-bottom: 2.5rem;
}

.se-products .products-header .eyebrow {
	margin-bottom: 0.75rem;
}

.se-products .products-title {
	font-family: var(--font-display);
	font-size: clamp(2.25rem, 5vw, 3.25rem);
	font-weight: 500;
	line-height: 1.1;
	letter-spacing: -0.02em;
	margin: 0 0 1rem;
	color: var(--color-ink);
}

.se-products .products-lede {
	font-size: 1.1rem;
	line-height: 1.6;
	color: var(--color-ink-soft);
	margin: 0;
	font-weight: 500;
}

.se-products .solutions-coverflow-bleed {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	overflow: hidden;
}

.se-products .solutions-coverflow {
	position: relative;
	height: 480px;
	width: 100%;
	margin-block: 2.5rem;
	overflow: visible;
}

.se-products .coverflow-card {
	position: absolute;
	top: 50%;
	left: 50%;
	width: min(840px, calc(100vw - 2 * var(--gutter)));
	max-width: min(840px, calc(100vw - 2 * var(--gutter)));
	height: 430px;
	border-radius: 24px;
	padding: 2rem;
	display: flex;
	flex-direction: column;
	box-shadow: 0 20px 48px -12px rgba(11, 10, 26, 0.15);
	transition:
		transform 0.6s cubic-bezier(0.25, 1, 0.5, 1),
		opacity 0.6s ease,
		background-color 0.6s ease,
		color 0.6s ease;
	cursor: pointer;
	overflow: hidden;
	box-sizing: border-box;
	/* Pre-JS coverflow positions — prevent CLS before products.js runs */
	transform: translate(-50%, -50%) scale(0.72);
	opacity: 1;
	z-index: 1;
}

/* Stable first paint matching products.js activeIndex = 0 (4-card wrap) */
.se-products .coverflow-card.active,
.se-products .coverflow-card[data-index="0"] {
	transform: translate(-50%, -50%) scale(1);
	z-index: 10;
}

.se-products .coverflow-card[data-index="1"] {
	transform: translate(calc(-50% + min(436.8px, 43.68vw)), -50%) scale(0.85);
	z-index: 9;
}

.se-products .coverflow-card[data-index="2"] {
	transform: translate(calc(-50% + min(873.6px, 87.36vw)), -50%) scale(0.72);
	z-index: 8;
}

.se-products .coverflow-card[data-index="3"] {
	transform: translate(calc(-50% - min(436.8px, 43.68vw)), -50%) scale(0.85);
	z-index: 9;
}

@media (max-width: 767px) {
	.se-products .coverflow-card[data-index="1"] {
		transform: translate(calc(-50% + 32.2vw), -50%) scale(0.85);
	}

	.se-products .coverflow-card[data-index="2"] {
		transform: translate(calc(-50% + 64.4vw), -50%) scale(0.72);
	}

	.se-products .coverflow-card[data-index="3"] {
		transform: translate(calc(-50% - 32.2vw), -50%) scale(0.85);
	}
}

.se-products .coverflow-card-grid {
	display: grid;
	grid-template-columns: 1fr 1.15fr;
	gap: 2.2rem;
	width: 100%;
	height: 100%;
	align-items: center;
}

.se-products .coverflow-card-image {
	width: 100%;
	height: 100%;
	border-radius: 14px;
	overflow: hidden;
	position: relative;
	background: var(--color-surface);
	box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.02);
}

.se-products .coverflow-card-image::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.55);
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.5s ease;
	z-index: 5;
}

.se-products .coverflow-card.inactive .coverflow-card-image::after {
	opacity: 1;
}

.se-products .coverflow-card.active .coverflow-card-image::after {
	opacity: 0;
}

.se-products .coverflow-card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s ease;
}

.se-products .coverflow-card:hover .coverflow-card-image img {
	transform: scale(1.04);
}

.se-products .coverflow-card-content {
	display: flex;
	flex-direction: column;
	justify-content: center;
	text-align: left;
	transition: opacity 0.3s ease;
}

.se-products .coverflow-card.inactive {
	background: var(--color-surface-tint) !important;
	color: var(--color-ink) !important;
}

.se-products .coverflow-card.inactive h3 {
	color: var(--color-ink) !important;
}

.se-products .coverflow-card.inactive p {
	color: var(--color-ink-soft) !important;
}

.se-products .coverflow-card.inactive .card-eyebrow {
	color: var(--color-primary) !important;
}

.se-products .coverflow-card.inactive .card-icon-wrapper {
	background: var(--color-primary-soft) !important;
	color: var(--color-primary) !important;
}

.se-products .coverflow-card.inactive .feature-item {
	color: var(--color-ink-soft) !important;
}

.se-products .coverflow-card.inactive .feature-icon {
	color: var(--color-primary);
}

.se-products .coverflow-card.inactive .card-icon-wrapper .icon {
	filter: none;
}

.se-products .coverflow-card.inactive .coverflow-card-content {
	opacity: 0.3 !important;
	transition: opacity 0.4s ease;
	pointer-events: auto;
}

.se-products .coverflow-card.active {
	background: var(--color-secondary);
	color: #ffffff;
	z-index: 10;
}

.se-products .coverflow-card.active .card-eyebrow {
	color: var(--color-primary-bright-on-dark);
}

.se-products .coverflow-card.active .card-icon-wrapper {
	background: rgba(255, 255, 255, 0.12);
	color: #ffffff;
}

.se-products .coverflow-card.active .card-icon-wrapper .icon {
	filter: brightness(0) invert(1);
	opacity: 0.92;
}

.se-products .coverflow-card.active .feature-icon {
	color: #ffffff;
	opacity: 0.92;
	filter: none;
}

.se-products .coverflow-card.active .feature-item {
	color: rgba(255, 255, 255, 0.85);
}

.se-products .coverflow-card.active .coverflow-card-content {
	opacity: 1 !important;
	transition: opacity 0.4s ease;
}

.se-products .card-eyebrow {
	font-size: var(--fs-2xs);
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	margin-bottom: 1.25rem;
	transition: color 0.3s;
}

.se-products .card-icon-wrapper {
	display: inline-flex;
	width: 46px;
	height: 46px;
	border-radius: 13px;
	align-items: center;
	justify-content: center;
	margin-bottom: 1.25rem;
	transition: background-color 0.3s, color 0.3s;
}

.se-products .coverflow-card h3 {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 1.25rem;
	letter-spacing: -0.01em;
	margin: 0 0 0.5rem;
	color: inherit !important;
}

.se-products .card-tagline {
	font-size: 0.875rem;
	line-height: 1.55;
	margin: 0 0 1.5rem;
	opacity: 0.85;
}

.se-products .card-features {
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
	margin-top: auto;
}

.se-products .card-cta {
	margin-top: 1.35rem;
}

.se-products .card-cta [data-magnetic] {
	display: inline-block;
}

.se-products .card-cta__btn {
	width: fit-content;
}

.se-products .coverflow-card.active .card-cta__btn {
	--btn-bg: #ffffff;
	--btn-fg: var(--color-secondary);
	--btn-bg-hover: var(--color-primary-bright-on-dark, #b8aef0);
	--btn-fg-hover: var(--color-secondary);
	--btn-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.se-products .coverflow-card.inactive .card-cta__btn {
	opacity: 0.85;
}

.se-products .feature-row {
	display: flex;
	gap: 0.5rem;
	align-items: flex-start;
}

.se-products .card-icon-wrapper .icon,
.se-products .feature-icon {
	display: block;
	flex: none;
	object-fit: contain;
}

.se-products .feature-icon {
	width: 16px;
	height: 16px;
	margin-top: 3px;
	color: var(--color-primary);
	transition: color 0.3s, opacity 0.3s;
}

.se-products .feature-item {
	font-size: 12.5px;
	line-height: 1.45;
	transition: color 0.3s;
}

.se-products .coverflow-dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 2rem;
}

.se-products .coverflow-dot {
	width: 10px;
	height: 10px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(107, 98, 172, 0.25);
	cursor: pointer;
	transition: background 0.3s, transform 0.3s;
}

.se-products .coverflow-dot.is-active {
	background: var(--color-primary) !important;
	transform: scale(1.3);
}

@media (max-width: 1200px) {
	.se-products.stage--products {
		padding-block: 4.5rem;
	}

	.se-products .coverflow-card {
		width: min(720px, 100%);
	}
}

@media (max-width: 768px) {
	.se-products.stage--products {
		padding-block: 3.5rem;
	}

	.se-products .solutions-coverflow {
		height: auto;
		min-height: 420px;
		margin-top: 0;
		touch-action: pan-y;
	}

	.se-products .coverflow-card {
		height: auto;
		min-height: 420px;
		padding: 1.5rem;
	}

	.se-products .coverflow-card-grid {
		grid-template-columns: 1fr;
		gap: 1rem;
	}

	.se-products .coverflow-card-image {
		display: none;
	}

	.se-products .products-title {
		font-size: clamp(1.75rem, 6vw, 2.25rem);
	}

	.se-products .products-lede {
		font-size: 1rem;
	}
}

@media (max-width: 480px) {
	.se-products.stage--products {
		padding-block: 3rem;
	}

	.se-products .coverflow-card {
		min-height: 380px;
		padding: 1.25rem;
		border-radius: 18px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.se-products .coverflow-card,
	.se-products .coverflow-card-image img,
	.se-products .coverflow-dot {
		transition: none;
	}
}
