/*------------------------------------------------------------------
[ AB Showcase — слайдър с карти (Swiper + GSAP) ]

Променливите (--ab-sc-*) идват inline от шорткода. Структурата е тук,
project-specific override-и отиват в css/ab_custom.css.
------------------------------------------------------------------*/

.ab-sc {
	position: relative;
	width: 100%;
	color: var(--ab-sc-text-color, #fff);
	/* Ширина на слайда: макс. card-w, но трите видими карти + два gap-а се събират в контейнера.
	   Слайдът е „кутията“ на картата; gap-ът е между кутиите (Swiper spaceBetween). */
	--ab-sc-slide-w: min(var(--ab-sc-card-w, 450px), calc((100% - 2 * var(--ab-sc-gap, 30px)) / 3));
}
/* Фиксирана ширина: gap-ът раздалечава картите, без да ги смалява */
.ab-sc--fixed-w {
	--ab-sc-slide-w: var(--ab-sc-card-w, 450px);
}
.ab-sc--bleed {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}

/* Сцена — full-width, избледняване към ръбовете, без хоризонтален скрол */
.ab-sc__stage {
	position: relative;
	overflow: hidden;
	padding: calc(var(--ab-sc-frame-off, 22px) + 16px) 0;
	transform: translateZ(0); /* Safari: маскираният контейнер трябва да е композитен слой */
	-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--ab-sc-edge-fade, 220px), #000 calc(100% - var(--ab-sc-edge-fade, 220px)), transparent 100%);
	mask-image: linear-gradient(90deg, transparent 0, #000 var(--ab-sc-edge-fade, 220px), #000 calc(100% - var(--ab-sc-edge-fade, 220px)), transparent 100%);
}

/* .container на темата, ограничен до --ab-sc-container */
.ab-sc .ab-sc__viewport {
	width: 100%;
	max-width: var(--ab-sc-container, 1400px);
	margin: 0 auto;
	padding-left: 15px;
	padding-right: 15px;
}

.ab-sc__swiper {
	overflow: visible;
	--swiper-wrapper-transition-timing-function: cubic-bezier(0.45, 0, 0.2, 1);
}

/* ── Слайд и карта ─────────────────────────────────────────────── */

.ab-sc__slide {
	position: relative;
	width: var(--ab-sc-slide-w);
	aspect-ratio: var(--ab-sc-ratio, 450 / 840);
	display: flex;
	align-items: center;
	justify-content: center;
	height: auto;
	margin-left: -10px;
	right: -5px;
}
.swiper-slide-active{
	z-index: 30;
}

.ab-sc__card {
	position: relative;
	width: calc(100% * var(--ab-sc-inactive-w, 0.95));
	height: calc(100% * var(--ab-sc-inactive-h, 0.82));
	will-change: width, height;
}

/* Златна рамка около активната карта */
.ab-sc__frame {
	position: absolute;
	inset: calc(-1 * var(--ab-sc-frame-off, 22px));
	border: 1px solid var(--ab-sc-accent, #B58753);
	border-radius: calc(var(--ab-sc-radius, 18px) + var(--ab-sc-frame-off, 22px) * 0.6);
	opacity: 0;
	pointer-events: none;
	z-index: 3;
}

.ab-sc__inner {
	position: absolute;
	inset: 0;
	border-radius: var(--ab-sc-radius, 18px);
	overflow: hidden;
	background: var(--ab-sc-bg, #241D1D);
	transform: translateZ(0);
	/* Safari: (1) border-radius не изрязва деца с transform без собствена маска;
	   (2) mix-blend-mode елементи (пушек, сияние) трябва да са изолирани в картата,
	   иначе при движение Safari изпуска съседните слоеве (текст, градиент). */
	isolation: isolate;
	-webkit-mask-image: -webkit-radial-gradient(white, black);
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
	/* box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45); */
}
/* Собствени композитни слоеве за елементите над blend-овете — Safari иначе ги губи при transform на лентата */
.ab-sc__gradient,
.ab-sc__dim,
.ab-sc__content {
	transform: translateZ(0);
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
}

/* Фон — oversize, за да има място за паралакса */
.ab-sc__bg {
	position: absolute;
	inset: -12%;
	z-index: 0;
	z-index: -2;
	will-change: transform;
}
.ab-sc__bg img,
.ab-sc__bg video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	transform: scale(1);
	transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}
/* Hover scale — само на фона (паралаксът е inline transform на .ab-sc__bg, затова мащабираме медията) */
.ab-sc--hover .ab-sc__card:hover .ab-sc__bg img,
.ab-sc--hover .ab-sc__card:hover .ab-sc__bg video {
	transform: scale(1.06);
}

/* Пушек — под градиента */
.ab-sc__smoke {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	height: 55%;
	z-index: 1;
	pointer-events: none;
	mix-blend-mode: screen;
	/* Мек преход към нулата отгоре и отстрани — иначе натрупаният пушек прави видим правоъгълник */
	-webkit-mask-image: linear-gradient(to top, #000 0%, #000 45%, transparent 100%), linear-gradient(to right, transparent 0, #000 18%, #000 82%, transparent 100%);
	mask-image: linear-gradient(to top, #000 0%, #000 45%, transparent 100%), linear-gradient(to right, transparent 0, #000 18%, #000 82%, transparent 100%);
	-webkit-mask-composite: source-in;
	mask-composite: intersect;
}

/* Дишащо сияние зад бутилката */
.ab-sc__glow {
	position: absolute;
	left: -10%;
	top: 45%;
	width: 120%;
	aspect-ratio: 1;
	margin-top: -60%;
	background: radial-gradient(circle, rgba(255, 190, 90, 0.9) 0%, rgba(255, 150, 50, 0.45) 22%, rgba(255, 120, 30, 0.12) 45%, rgba(0, 0, 0, 0) 65%);
	mix-blend-mode: screen;
	opacity: 0;
	z-index: 1;
	pointer-events: none;
	will-change: opacity, transform;
}

/* Градиент от плътен фон отдолу към прозрачно */
.ab-sc__gradient {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: var(--ab-sc-grad-h, 55%);
	z-index: 2;
	pointer-events: none;
	background: linear-gradient(to top, var(--ab-sc-bg, #241D1D) 0%, rgba(0, 0, 0, 0) 100%);
}
@supports (background: color-mix(in srgb, red 50%, transparent)) {
	.ab-sc__gradient {
		background: linear-gradient(
			to top,
			var(--ab-sc-bg, #241D1D) 0%,
			color-mix(in srgb, var(--ab-sc-bg, #241D1D) 92%, transparent) 28%,
			color-mix(in srgb, var(--ab-sc-bg, #241D1D) 55%, transparent) 60%,
			color-mix(in srgb, var(--ab-sc-bg, #241D1D) 0%, transparent) 100%
		);
	}
}

/* Затъмняване на страничните карти (opacity се задава от JS) */
.ab-sc__dim {
	position: absolute;
	inset: 0;
	z-index: 4;
	background: var(--ab-sc-bg, #241D1D);
	opacity: 0;
	pointer-events: none;
}

/* ── Съдържание ────────────────────────────────────────────────── */

.ab-sc__content {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 3%;
	z-index: 3;
	padding: 0 8%;
	/* padding-bottom: 5px; */
	text-align: center;
}

.ab-sc__title {
	margin: 0 0 0px;
	font-family: "Bona Nova", Georgia, serif;
	font-weight: 700;
	font-size: var(--ab-sc-title-size, 40px);
	line-height: 1.1;
	letter-spacing: 0;
	text-transform: uppercase;
	color: var(--ab-sc-title-color, #fff);
	/* text-shadow:
		0 0 16px rgba(255, 255, 255, 0.55),
		0 0 40px rgba(255, 255, 255, 0.22); */
	text-shadow: 0 0px 7px rgb(255 255 255 / 94%);
}

.ab-sc__subtitle {
	/* font-family: 'Franklin Gothic Medium Cond'; */
	margin: 0 0 16px;
	font-size: var(--ab-sc-sub-size, 18px);
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0;
	color: var(--ab-sc-sub-color, var(--ab-sc-accent, #B58753));
}

.ab-sc__desc {
	margin: 0;
	font-size: var(--ab-sc-text-size, 16px);
	line-height: 1.3;
	color: var(--ab-sc-text-color, #fff);
}

/* Бутон — показва се само на активната карта (JS анимира height/opacity) */
.ab-sc__btn-wrap {
	display: block;
	height: 0;
	overflow: hidden;
	opacity: 0;
	padding-bottom: 20px;
}
.ab-sc__btn {
	display: inline-block;
	margin-top: 20px;
	margin-bottom: 2px;
	padding: 8px 38px;
	border: 1px solid #B58753;
	border-radius: 999px;
	font-size: 16px;
	/* font-weight: 600; */
	letter-spacing: 0;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--ab-sc-accent, #B58753);
	color: #B58753;
	background: transparent;
	transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}
.ab-sc__btn:hover,
.ab-sc__btn:focus-visible {
	background:  #B58753;
	color: var(--ab-sc-bg, #241D1D);
	color: #fff;
	box-shadow: 0 0 24px rgba(195, 155, 99, 0.45);
	text-decoration: none;
}

/* ── Стрелки ───────────────────────────────────────────────────── */

.ab-sc__arrow {
	position: absolute;
	top: 50%;
	z-index: 5;
	width: 60px;
	height: 60px;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--ab-sc-accent, #B58753);
	cursor: pointer;
	transform: translateY(-50%);
	transition: transform 0.3s ease, opacity 0.3s ease;
	-webkit-tap-highlight-color: transparent;
	appearance: none;
	-webkit-appearance: none;
}
.ab-sc__arrow svg {
	display: block;
	width: 100%;
	height: 100%;
	overflow: visible;
}
.ab-sc__arrow:hover {
	transform: translateY(-50%) scale(1.08);
	color: #fff;
}
.ab-sc__arrow:focus-visible {
	outline: 2px solid var(--ab-sc-accent, #B58753);
	outline-offset: 6px;
	border-radius: 50%;
}
.ab-sc__arrow--prev {
	left: max(12px, calc(50% - var(--ab-sc-container, 1400px) / 2 - 90px));
}
.ab-sc__arrow--next {
	right: max(12px, calc(50% - var(--ab-sc-container, 1400px) / 2 - 90px));
}
.ab-sc__arrow.is-disabled {
	opacity: 0.3;
	pointer-events: none;
}

/* ── Точки ─────────────────────────────────────────────────────── */

.ab-sc__dots {
	display: flex;
	justify-content: center;
	gap: 12px;
	margin-top: 16px;
}
.ab-sc__dot {
	width: 14px;
	height: 14px;
	margin: 0;
	padding: 0;
	border: 1px solid var(--ab-sc-accent, #B58753);
	border:none;
	border-radius: 50%;
	background: transparent;
	background:rgba(255,255,255,0.1);
	cursor: pointer;
	transition: background 0.3s ease, transform 0.3s ease;
	appearance: none;
	-webkit-appearance: none;
}
.ab-sc__dot.is-active {
	background: var(--ab-sc-accent, #B58753);
	/* transform: scale(1.3); */
}

/* ── Мобилно / малки екрани ────────────────────────────────────── */

@media (max-width: 991px) {
	.ab-sc {
		--ab-sc-slide-w: min(var(--ab-sc-card-w, 450px), 68%);
	}
	.ab-sc__stage {
		-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 60px, #000 calc(100% - 60px), transparent 100%);
		mask-image: linear-gradient(90deg, transparent 0, #000 60px, #000 calc(100% - 60px), transparent 100%);
	}
	.ab-sc__arrow {
		width: 44px;
		height: 44px;
	}
	.ab-sc__title {
		font-size: calc(var(--ab-sc-title-size, 40px) * 0.8);
	}
}

@media (max-width: 575px) {
	.ab-sc {
		--ab-sc-slide-w: min(var(--ab-sc-card-w, 450px), 80%);
	}
	.ab-sc__stage {
		padding: calc(var(--ab-sc-frame-off, 22px) * 0.6 + 12px) 0;
	}
	.ab-sc__frame {
		inset: calc(-0.6 * var(--ab-sc-frame-off, 22px));
	}
	.ab-sc__arrow {
		width: 36px;
		height: 36px;
	}
	.ab-sc__arrow--prev {
		left: 6px;
	}
	.ab-sc__arrow--next {
		right: 6px;
	}
	.ab-sc__title {
		font-size: calc(var(--ab-sc-title-size, 40px) * 0.7);
	}
	.ab-sc__btn {
		margin-top: 18px;
		padding: 11px 26px;
	}
}

/* ── Без анимации ──────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
	.ab-sc__bg img,
	.ab-sc__bg video,
	.ab-sc__arrow,
	.ab-sc__dot {
		transition: none;
	}
	.ab-sc--hover .ab-sc__card:hover .ab-sc__bg img,
	.ab-sc--hover .ab-sc__card:hover .ab-sc__bg video {
		transform: scale(1);
	}
}
