/**
 * Phase 2E — homepage sections after catalog (conditions, steps, driver, contact, clients, reviews, FAQ).
 * Most layout/spacing comes from `leocar-ls-main` (LiteSpeed utility export). This file adds
 * scoped fallbacks for ported static + placeholder blocks. Phase 2E CSS debt if bundle is trimmed.
 */

/* FAQ: donor toggles `.open` on `.faq-list > div` (see `leocar-phase2e.js`). */
body.home .faq-list > div.open .bg-car {
	display: block;
}

body.home .faq-list > div.open h3 svg {
	transform: rotate(180deg);
}

body.home .faq-list h3 svg {
	transition: transform 0.2s ease;
}

body.home .leo-faq-map {
	position: relative;
	overflow: hidden;
	border-radius: 12px;
	aspect-ratio: 16 / 9;
	max-height: 320px;
	background: rgb(0 0 0 / 0.35);
}

body.home .leo-faq-map iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	filter: grayscale(0.35) contrast(1.05);
}

/* Clients logos — horizontal carousel */
body.home .leocar-clients-carousel {
	--leocar-clients-gap: 2rem;
	--leocar-clients-spv: 2;
	position: relative;
}

@media (min-width: 768px) {
	body.home .leocar-clients-carousel {
		--leocar-clients-spv: 3;
	}
}

@media (min-width: 1024px) {
	body.home .leocar-clients-carousel {
		--leocar-clients-spv: 4;
	}
}

body.home .leocar-clients-carousel__viewport {
	overflow: hidden;
}

body.home .leocar-clients-carousel__track {
	display: flex;
	gap: var(--leocar-clients-gap);
	transition: transform 0.45s ease;
	will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
	body.home .leocar-clients-carousel__track {
		transition: none;
	}
}

body.home .leocar-clients-carousel__slide {
	box-sizing: border-box;
	display: flex;
	flex: 0 0
		calc(
			(100% - (var(--leocar-clients-spv) - 1) * var(--leocar-clients-gap)) / var(--leocar-clients-spv)
		);
	align-items: center;
	justify-content: center;
	min-width: 0;
}

body.home .leocar-clients-carousel__logo {
	display: block;
	width: 280px;
	max-width: none;
	height: 144px;
	object-fit: contain;
}

/* Infinite marquee — duplicated track in `leocar-phase2e.js` */
body.home .leocar-clients-carousel--infinite .leocar-clients-carousel__viewport {
	overflow: hidden;
	mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}

body.home .leocar-clients-carousel--infinite .leocar-clients-carousel__track {
	width: max-content;
	flex-wrap: nowrap;
	animation: leocar-clients-marquee 36s linear infinite;
}

body.home .leocar-clients-carousel--infinite .leocar-clients-carousel__slide {
	flex: 0 0 auto;
	width: auto;
}

body.home .leocar-clients-carousel--infinite:hover .leocar-clients-carousel__track,
body.home .leocar-clients-carousel--infinite:focus-within .leocar-clients-carousel__track {
	animation-play-state: paused;
}

body.home .leocar-clients-carousel--infinite .leocar-clients-carousel__controls {
	display: none !important;
}

@keyframes leocar-clients-marquee {
	from {
		transform: translate3d(0, 0, 0);
	}

	to {
		transform: translate3d(-50%, 0, 0);
	}
}

@media (prefers-reduced-motion: reduce) {
	body.home .leocar-clients-carousel--infinite .leocar-clients-carousel__track {
		animation: none;
		flex-wrap: wrap;
		justify-content: center;
		width: 100%;
	}

	body.home .leocar-clients-carousel--infinite .leocar-clients-carousel__viewport {
		mask-image: none;
		overflow: visible;
	}
}

body.home .leocar-clients-carousel__controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	margin-top: 1.5rem;
}

body.home .leocar-clients-carousel--static .leocar-clients-carousel__controls {
	display: none;
}

body.home .leocar-clients-carousel__nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	padding: 0;
	border: 1px solid rgb(250 250 250 / 0.18);
	border-radius: 999px;
	background: rgb(250 250 250 / 0.04);
	color: #fafafa;
	cursor: pointer;
	flex-shrink: 0;
	transition:
		background-color 0.18s ease,
		border-color 0.18s ease,
		color 0.18s ease;
}

body.home .leocar-clients-carousel__nav:hover,
body.home .leocar-clients-carousel__nav:focus-visible {
	background: rgb(39 172 91 / 0.15);
	border-color: #27ac5b;
	color: #27ac5b;
}

body.home .leocar-clients-carousel__nav:focus-visible {
	outline: 2px solid #27ac5b;
	outline-offset: 2px;
}

body.home .leocar-clients-carousel__nav:disabled {
	opacity: 0.35;
	cursor: default;
	pointer-events: none;
}

body.home .leocar-clients-carousel__pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-height: 0.5rem;
}

body.home .leocar-clients-carousel__dot {
	width: 0.5rem;
	height: 0.5rem;
	padding: 0;
	border: none;
	border-radius: 999px;
	background: rgb(250 250 250 / 0.25);
	cursor: pointer;
	transition: background-color 0.18s ease, transform 0.18s ease;
}

body.home .leocar-clients-carousel__dot.is-active {
	background: #27ac5b;
	transform: scale(1.15);
}

body.home .leocar-clients-carousel__dot:focus-visible {
	outline: 2px solid #27ac5b;
	outline-offset: 2px;
}

/* Reviews: Trustindex replaced with static placeholder */
body.home .leocar-phase2e-reviews-placeholder {
	min-height: 220px;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 1.5rem;
	border-radius: 1rem;
	background: rgb(64 64 64 / 0.25);
	border: 1px solid rgb(250 250 250 / 0.08);
}

body.home .leocar-phase2e-reviews-placeholder__text {
	max-width: 36rem;
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.5;
	color: rgb(250 250 250 / 0.75);
}

/* Questions section: full-width photo + green tint overlay (was 7/12 right column only). */
body.home #leo-questions {
	overflow: hidden;
}

body.home #leo-questions .leocar-phase2e-questions-bg {
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 0;
}

body.home #leo-questions .leocar-phase2e-questions-bg img {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 100%;
	object-fit: cover;
}

body.home #leo-questions::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background:
		radial-gradient(ellipse 80% 50% at 75% 15%, rgba(39, 172, 91, 0.22) 0%, transparent 55%),
		linear-gradient(115deg, rgba(15, 15, 15, 0.72) 0%, rgba(25, 25, 25, 0.55) 45%, rgba(15, 15, 15, 0.35) 100%);
}

/* Questions / contact — balanced vertical padding on desktop (replaces legacy pt-44/pb-0 split). */
@media (min-width: 820px) {
	body.home #leo-questions.leo-questions {
		padding-top: 3rem;
		padding-bottom: 3rem;
	}

	body.home #leo-questions .leocar-questions-contact-list {
		margin-top: 1.75rem;
	}
}

@media (min-width: 1100px) {
	body.home #leo-questions.leo-questions {
		padding-top: 3.5rem;
		padding-bottom: 3.5rem;
	}
}

/* Questions consultation form — match hero `#leo-hero-form` glass card + contact chips (LiteSpeed scopes hero rules under `.leo-intro-main` only). */
body.home .leo-questions .form-slide {
	-webkit-backdrop-filter: blur(24px) saturate(1.3);
	backdrop-filter: blur(24px) saturate(1.3);
	background: hsl(0 0% 6% / 0.5);
	border: 1px solid hsl(0 0% 98% / 0.2);
	border-radius: 1.5rem;
	box-shadow: none;
	padding: 2rem 1.5rem;
}

@media (prefers-reduced-transparency: reduce) {
	body.home .leo-questions .form-slide {
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
		background: hsl(0 0% 6% / 0.92);
	}
}

body.home .leo-questions .contact-method-group .contact-chip:has(input:checked) {
	background-color: rgb(39 172 91 / 0.15);
	border-color: #27ac5b;
	box-shadow: inset 0 0 0 1px #27ac5b;
	color: rgb(250 250 250);
}

body.home .leo-questions .contact-method-group .contact-chip:has(input:focus-visible) {
	outline: 2px solid #27ac5b;
	outline-offset: 2px;
}

body.home .leo-questions .contact-method-group .contact-chip:active {
	transform: scale(0.98);
}

@media (prefers-reduced-motion: reduce) {
	body.home .leo-questions .contact-method-group .contact-chip,
	body.home .leo-questions .contact-method-group .contact-chip:active {
		transform: none;
		transition: none;
	}
}

body.home .leo-questions form.priceForm .leocar-phone-field .iti input[type='tel'] {
	padding-bottom: 10px !important;
	padding-top: 4px !important;
}

body.home .leo-questions form.priceForm {
	display: block;
}

body.home .leo-questions form.priceForm input[type='button'],
body.home .leo-questions form.priceForm input[type='submit'] {
	cursor: pointer;
}

/* Catalog → conditions CTA: zero `mt-24` / `1100:mt-32` when section follows catalog (direct or lazy wrapper). */
body.home #catalog_54.leo-catalog-home + #leo-conditions-cta-1,
body.home #catalog_54.leo-catalog-home + #leocar-lazy-conditions-primary #leo-conditions-cta-1 {
	margin-top: 0 !important;
}

/* Catalog block — standard mobile section padding (matches .leo-subscription-steps). */
@media (max-width: 1023px) {
	body.home #catalog_54.leo-catalog-home:has(+ #leo-conditions-cta-1),
	body.home #catalog_54.leo-catalog-home:has(+ #leocar-lazy-conditions-primary) {
		padding-bottom: var(--leocar-catalog-home-cta-gap, calc(2rem * 1.1)) !important;
		padding-top: 4rem !important;
	}
}

@media (min-width: 1100px) {
	body.home #catalog_54.leo-catalog-home:has(+ #leo-conditions-cta-1),
	body.home #catalog_54.leo-catalog-home:has(+ #leocar-lazy-conditions-primary) {
		padding-bottom: var(--leocar-catalog-home-cta-gap, calc(2rem * 1.1)) !important;
		padding-top: 3rem !important;
	}
}

/* Personal driver — section gradient (charcoal base + brand green glow). */
body.home #leo-personal-driver {
	position: relative;
	isolation: isolate;
	background-color: #0f0f0f;
	background-image:
		radial-gradient(ellipse 75% 55% at 12% 8%, rgb(39 172 91 / 0.2) 0%, transparent 52%),
		radial-gradient(ellipse 65% 50% at 88% 92%, rgb(39 172 91 / 0.14) 0%, transparent 54%),
		linear-gradient(165deg, rgb(8 8 8) 0%, rgb(17 17 17) 42%, rgb(10 10 10) 100%);
}

/* Personal driver — card row + intro background (UCSS keys off `../images/…`, not `__TA__` URLs). */
body.home #leo-personal-driver .leocar-pd-intro-card {
	position: relative;
	isolation: isolate;
	background-image: url('../images/theme/car-with-driver2.png');
	background-repeat: no-repeat;
	background-size: cover;
	background-position: center;
}

body.home #leo-personal-driver .leocar-pd-intro-card::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 0;
	border-radius: inherit;
	background: linear-gradient(
		180deg,
		rgb(15 15 15 / 0.25) 0%,
		rgb(15 15 15 / 0.55) 45%,
		rgb(15 15 15 / 0.82) 100%
	);
	pointer-events: none;
}

body.home #leo-personal-driver .leocar-pd-intro-card > * {
	position: relative;
	z-index: 1;
}

body.home #leo-personal-driver .leocar-pd-cards-row {
	align-items: stretch;
}

/* Mobile / tablet — photo bg kept; ~2× pd-item height (not full 111vw / 48vh). */
@media (max-width: 1099px) {
	body.home #leo-personal-driver .leocar-pd-intro-card {
		display: flex;
		flex-direction: column;
		justify-content: flex-end;
		height: auto !important;
		min-height: clamp(17.5rem, 52vw, 21rem) !important;
		max-height: none !important;
		padding: 1.75rem 1.5rem 1.5rem !important;
		background-image: url('../images/theme/car-with-driver2.png');
		background-repeat: no-repeat;
		background-size: cover;
		background-position: center;
	}

	body.home #leo-personal-driver .leocar-pd-intro-card::before {
		background: linear-gradient(
			180deg,
			rgb(15 15 15 / 0.2) 0%,
			rgb(15 15 15 / 0.5) 42%,
			rgb(15 15 15 / 0.88) 100%
		);
	}

	body.home #leo-personal-driver .leocar-pd-intro-card h2 {
		font-size: clamp(1.35rem, 4.5vw, 1.75rem) !important;
		line-height: 1.25;
	}

	body.home #leo-personal-driver .leocar-pd-intro-card .mt-4 {
		margin-top: 0.75rem !important;
	}

	body.home #leo-personal-driver .leocar-pd-intro-card .mt-4 p {
		font-size: 0.875rem;
		line-height: 1.45;
		margin: 0;
	}
}

@media (min-width: 820px) {
	body.home #leo-personal-driver .leocar-pd-cards-row {
		display: flex;
		flex-direction: row;
		flex-wrap: wrap;
		gap: 1.25rem;
	}

	body.home #leo-personal-driver .leocar-pd-intro-card {
		flex: 0 1 355px;
		max-width: 355px;
		min-height: 100%;
		background-position: center bottom;
	}

	body.home #leo-personal-driver .leocar-pd-cards-row > .pd-item {
		flex: 1 1 calc(33.333% - 0.85rem);
		min-width: 0;
	}
}

@media (min-width: 1100px) {
	body.home #leo-personal-driver .leocar-pd-cards-row {
		flex-wrap: nowrap;
		gap: 1.25rem;
	}

	body.home #leo-personal-driver .leocar-pd-cards-row > .pd-item {
		flex: 1 1 0;
	}
}

@media (min-width: 1024px) and (max-width: 1099px) {
	body.home #leo-personal-driver {
		padding-bottom: 5rem !important;
	}
}

/* Personal driver — “Ціни на трансфери” CTA: centered below row, clear of cards. */
body.home #leo-personal-driver a.leocar-pd-cta.leocar-phase2e-pdf-placeholder.button {
	display: flex !important;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: fit-content !important;
	max-width: min(338px, 100%) !important;
	margin-top: 1.5rem !important;
	margin-left: auto !important;
	margin-right: auto !important;
	text-align: center;
	--tw-bg-opacity: 1;
	background-color: rgb(39 172 91 / var(--tw-bg-opacity, 1));
	border: 0;
	border-radius: 1rem;
	color: #fafafa;
	font-family: Evolventa-Bold, sans-serif;
	font-weight: 700;
	height: 3rem;
	line-height: 1;
}

@media (min-width: 820px) {
	body.home #leo-personal-driver a.leocar-pd-cta.leocar-phase2e-pdf-placeholder.button {
		margin-top: 2rem !important;
	}
}

@media (min-width: 1100px) {
	body.home #leo-personal-driver a.leocar-pd-cta.leocar-phase2e-pdf-placeholder.button {
		margin-top: 2.25rem !important;
	}
}

@media (hover: hover) {
	body.home #leo-personal-driver a.leocar-pd-cta.leocar-phase2e-pdf-placeholder.button:hover {
		background-color: rgb(37 211 102);
		color: #fafafa;
	}
}

/* Personal driver → financing CTA: remove stacked Tailwind pb + mt gap (black band). */
body.home #leo-personal-driver + #leo-conditions-cta-2 {
	margin-top: 0 !important;
}

@media (max-width: 1023px) {
	body.home #leo-personal-driver:has(+ #leo-conditions-cta-2) {
		padding-bottom: 4rem !important;
	}
}

@media (min-width: 1024px) {
	body.home #leo-personal-driver:has(+ #leo-conditions-cta-2) {
		padding-bottom: 2rem !important;
	}
}

@media (min-width: 1100px) {
	body.home #leo-personal-driver:has(+ #leo-conditions-cta-2) {
		padding-bottom: 2.5rem !important;
	}

	body.home #leo-personal-driver + #leo-conditions-cta-2 {
		margin-top: 0 !important;
	}
}
