/* ============================================================
   PARENDI - Services Carousel (autoplay)
   3 karty naraz na desktop, auto-przewijanie co 5s.
   Strzalki + dots pod spodem.
   Mobile: karty w kolumnie.
   ============================================================ */

:root {
	--sc-side-pad: clamp(24px, 4vw, 64px);
	--sc-gap: clamp(16px, 1.5vw, 24px);
}

.services-carousel {
	position: relative;
	z-index: 2;
	background: var(--c-bg, #F8F5F0);
	padding: clamp(80px, 12vh, 160px) 0 clamp(64px, 8vh, 100px);
	min-height: 0;
}

.services-carousel__inner {
	position: relative;
}

/* Rozowa poswiata z lewej */
.services-carousel__inner::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	width: 65%;
	background: radial-gradient(
		ellipse 70% 80% at 0% 55%,
		rgba(201, 169, 110, 0.28) 0%,
		rgba(201, 169, 110, 0.14) 30%,
		rgba(245, 236, 216, 0.06) 60%,
		transparent 85%
	);
	pointer-events: none;
	z-index: 0;
}

/* ─── Header ────────────────────────────────────────────── */

.services-carousel__header {
	position: relative;
	z-index: 1;
	text-align: center;
	padding: 0 var(--sc-side-pad);
	margin-bottom: clamp(48px, 7vh, 80px);
}

.services-carousel__title {
	font-family: var(--font-serif, 'Fraunces', serif);
	font-style: italic;
	font-weight: 300;
	font-size: clamp(36px, 5vw, 64px);
	line-height: 1.1;
	letter-spacing: -0.01em;
	color: var(--c-text-on-light, #1A1714);
	margin: 0 0 16px;
}

.services-carousel__lead {
	font-family: var(--font-sans, 'Inter', sans-serif);
	font-weight: 400;
	font-size: clamp(14px, 1.1vw, 16px);
	line-height: 1.5;
	color: var(--c-text-muted, #6B6B6B);
	max-width: 540px;
	margin: 0 auto;
}

/* ─── Viewport + Track ──────────────────────────────────── */

.services-carousel__viewport {
	position: relative;
	z-index: 1;
	overflow-x: clip;
	overflow-y: visible;
}

.services-carousel__track {
	display: flex;
	gap: var(--sc-gap);
	padding: 24px var(--sc-side-pad) 48px;
	transition: transform 0.72s cubic-bezier(0.22, 1, 0.36, 1);
	will-change: transform;
	cursor: grab;
	user-select: none;
	-webkit-user-select: none;
}

.services-carousel__track.is-dragging {
	cursor: grabbing;
	transition: none;
}

/* ─── Card (desktop: 1/3 widocznego obszaru) ────────────── */

.service-card {
	flex: 0 0 calc((100vw - 2 * var(--sc-side-pad) - 2 * var(--sc-gap)) / 3);
	aspect-ratio: 16 / 10;
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: 12px;
	background: #0e0a08;
	text-decoration: none;
	color: var(--c-text-on-dark, #F8F5F0);
	transition: transform 600ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 600ms ease;
	box-shadow: 0 14px 40px -20px rgba(26, 23, 20, 0.18);
	-webkit-tap-highlight-color: transparent;
}

.service-card:hover,
.service-card:focus-visible {
	transform: translateY(-6px);
	box-shadow: 0 28px 60px -22px rgba(26, 23, 20, 0.35);
}

.service-card__image {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	opacity: 0.88;
	mix-blend-mode: normal;
	transition: transform 1200ms cubic-bezier(0.22, 1, 0.36, 1), opacity 400ms ease;
	will-change: transform;
}

.service-card:hover .service-card__image {
	transform: scale(1.06);
	opacity: 0.65;
}

.service-card__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to top,
		rgba(18, 12, 8, 0.88) 0%,
		rgba(18, 12, 8, 0.35) 55%,
		rgba(18, 12, 8, 0.05) 100%
	);
	transition: background 400ms ease;
}

.service-card:hover .service-card__overlay {
	background: linear-gradient(
		to top,
		rgba(18, 12, 8, 0.92) 0%,
		rgba(18, 12, 8, 0.42) 55%,
		rgba(18, 12, 8, 0.08) 100%
	);
}

.service-card--no-image .service-card__overlay {
	background: linear-gradient(135deg, #F5ECD8 0%, #C9A96E 100%);
}

.service-card--no-image .service-card__title,
.service-card--no-image .service-card__desc,
.service-card--no-image .service-card__cta {
	color: var(--c-text-on-light, #1A1714);
}

.service-card__content {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: clamp(20px, 2.5vw, 40px);
	z-index: 2;
}

.service-card__title {
	font-family: var(--font-serif, 'Fraunces', serif);
	font-weight: 400;
	font-size: clamp(22px, 2.2vw, 38px);
	line-height: 1.1;
	letter-spacing: -0.01em;
	color: #FFFFFF;
	margin: 0;
	text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
	max-width: 80%;
	transition: margin-bottom 0.48s ease;
}

.service-card:hover .service-card__title {
	margin-bottom: 10px;
}

.service-card__desc {
	font-family: var(--font-sans, 'Inter', sans-serif);
	font-weight: 400;
	font-size: clamp(13px, 1vw, 15px);
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.9);
	max-width: 82%;
	text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
	max-height: 0;
	overflow: hidden;
	opacity: 0;
	margin-bottom: 0;
	transition:
		max-height 0.48s cubic-bezier(0.22, 1, 0.36, 1),
		opacity 0.35s ease,
		margin-bottom 0.48s ease;
}

.service-card:hover .service-card__desc {
	max-height: 180px;
	opacity: 1;
	margin-bottom: 16px;
}

.service-card__cta {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: var(--font-sans, 'Inter', sans-serif);
	font-weight: 500;
	font-size: 11px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: #FFFFFF;
	padding-bottom: 5px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.4);
	width: fit-content;
	-moz-fit-content: fit-content;
	max-height: 0;
	overflow: hidden;
	opacity: 0;
	transition:
		max-height 0.48s cubic-bezier(0.22, 1, 0.36, 1) 0.05s,
		opacity 0.35s ease 0.08s,
		border-color 300ms ease,
		gap 300ms ease;
}

.service-card:hover .service-card__cta {
	max-height: 40px;
	opacity: 1;
	border-color: #FFFFFF;
	gap: 14px;
}

.service-card__arrow {
	font-size: 13px;
	transition: transform 300ms ease;
}

.service-card:hover .service-card__arrow {
	transform: translateX(4px);
}

/* ─── Controls: strzalki + dots ────────────────────────── */

.services-carousel__controls {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 20px;
	margin-top: clamp(32px, 5vh, 52px);
	padding: 0 var(--sc-side-pad);
}

.services-carousel__nav-btn {
	flex-shrink: 0;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 1.5px solid rgba(26, 23, 20, 0.18);
	background: rgba(255, 255, 255, 0.85);
	color: var(--c-text-on-light, #1A1714);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
	box-shadow: 0 4px 16px -6px rgba(26, 23, 20, 0.14);
	-webkit-tap-highlight-color: transparent;
}

.services-carousel__nav-btn:hover {
	background: #fff;
	border-color: rgba(26, 23, 20, 0.32);
	box-shadow: 0 8px 24px -8px rgba(26, 23, 20, 0.22);
	transform: scale(1.1);
}

.services-carousel__nav-btn:active {
	transform: scale(0.95);
}

.services-carousel__nav-btn:disabled {
	opacity: 0.3;
	cursor: default;
	pointer-events: none;
}

.services-carousel__dots {
	display: flex;
	align-items: center;
	gap: 8px;
}

.services-carousel__dot {
	width: 8px;
	height: 8px;
	border-radius: 4px;
	border: none;
	padding: 0;
	background: rgba(26, 23, 20, 0.18);
	cursor: pointer;
	transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1), background 0.35s ease;
	-webkit-tap-highlight-color: transparent;
}

.services-carousel__dot.is-active {
	width: 28px;
	background: var(--c-accent, #C9A96E);
}

/* ─── Mobile — karty w kolumnie, bez karuzeli ─────────── */

@media (max-width: 767px) {
	.services-carousel {
		padding: clamp(60px, 8vh, 100px) 0 clamp(40px, 5vh, 60px);
	}

	.services-carousel__header {
		padding: 0 20px;
		margin-bottom: clamp(28px, 5vh, 40px);
	}

	.services-carousel__viewport {
		overflow: visible;
	}

	.services-carousel__track {
		flex-direction: column;
		transform: none !important;
		transition: none;
		padding: 0 20px;
		gap: 16px;
		cursor: auto;
		user-select: auto;
		-webkit-user-select: auto;
		will-change: auto;
	}

	.service-card {
		flex: none;
		width: 100%;
		aspect-ratio: 16 / 9;
		border-radius: 10px;
		isolation: isolate;
	}

	/* iOS Safari: mix-blend-mode: luminosity + will-change: transform moze
	   promowac obraz na osobna GPU layer i "zjadac" overlay gradient.
	   Na mobile reset blend-mode na normal + isolation: isolate na cardzie. */
	.service-card__image {
		mix-blend-mode: normal;
		opacity: 0.40;
	}

	.service-card__overlay {
		background: linear-gradient(
			to top,
			rgba(18, 12, 8, 0.88) 0%,
			rgba(18, 12, 8, 0.35) 55%,
			rgba(18, 12, 8, 0.05) 100%
		);
	}

	.service-card__title {
		font-size: clamp(20px, 5.5vw, 28px);
		max-width: 90%;
	}

	.service-card__desc {
		display: none;
	}

	.services-carousel__controls {
		display: none;
	}
}

/* ─── Eyebrow (licznik zabiegów) — widoczny zawsze nad tytułem ─── */

.service-card__eyebrow {
	display: block;
	font-family: var(--font-sans, 'Inter', sans-serif);
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.7);
	margin-bottom: 6px;
}

/* ─── Zabiegi archive grid — override flex sizing kart ─── */

.zabiegi-cats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: clamp(12px, 1.4vw, 20px);
}

.zabiegi-cats-grid .service-card {
	flex: none;
	width: 100%;
	aspect-ratio: 4 / 3;
}

@media (min-width: 640px) {
	.zabiegi-cats-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 1100px) {
	.zabiegi-cats-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 639px) {
	.zabiegi-cats-grid .service-card {
		aspect-ratio: 16 / 9;
	}

	.zabiegi-cats-grid .service-card__eyebrow {
		display: block;
	}
}
