/*------------------------------------------------------------------
[ AB Process — закачена секция с етапи и разкриване през бутилка ]

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

.ab-process {
	position: relative;
	width: 100%;
	background: var(--ab-proc-bg, #231a17);
	color: var(--ab-proc-text-color, #fff);
	font-family: inherit;
	/* Row stretch на WPBakery слага margin по ширина — не пречи */
}

.ab-process__stage {
	position: relative;
	height: calc(100vh - var(--ab-proc-offset, 0px));
	height: calc(100svh - var(--ab-proc-offset, 0px));
	overflow: hidden;
	background: var(--ab-proc-bg, #231a17);
	isolation: isolate;
}

/* ── Фонове ────────────────────────────────────────────────────── */

.ab-process__bgs {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.ab-process__bg {
	position: absolute;
	inset: 0;
	opacity: 0;
	will-change: opacity, transform;
	transform-origin: 50% 50%;
}
.ab-process__bg.is-active {
	opacity: 1;
}

.ab-process__bg-img,
.ab-process__bg img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

/* ── Градиенти към фона на сайта ───────────────────────────────── */

.ab-process__fade {
	position: absolute;
	left: 0;
	right: 0;
	height: var(--ab-proc-fade-h, 180px);
	z-index: 1;
	pointer-events: none;
}
.ab-process__fade--top {
	top: 0;
	background: linear-gradient(to bottom, var(--ab-proc-fade, #231a17) 0%, rgba(0, 0, 0, 0) 100%);
}
.ab-process__fade--bottom {
	bottom: 0;
	background: linear-gradient(to top, var(--ab-proc-fade, #231a17) 0%, rgba(0, 0, 0, 0) 100%);
}
.ab-process__fade--bottom{
	background: linear-gradient(to top, #241D1D 0%, #241D1D 60%, #241d1d00 100%);
	height: 300px;
}

/* ── Слайдове ──────────────────────────────────────────────────── */

.ab-process__slides {
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
}

.ab-process__slide {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: flex-start;
	padding: 10vh 0 0;
	opacity: 0;
	visibility: hidden;
}
.ab-process__slide.is-active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

/* .container на темата, ограничен до --ab-proc-container (по подразбиране 1400px) */
.ab-process .ab-process__container {
	display: flex;
	width: 100%;
	max-width: var(--ab-proc-container, 1400px);
	margin: 0 auto;
	padding-left: 15px;
	padding-right: 15px;
}
.ab-process__slide--right .ab-process__container {
	justify-content: flex-end;
}
.ab-process__slide--left .ab-process__container {
	justify-content: flex-start;
}

.ab-process__content {
	width: 50%;
	max-width: var(--ab-proc-text-w, 760px);
	will-change: transform;
}
.ab-process__slide--right .ab-process__content {
	padding-left: 2vw;
}
.ab-process__slide--left .ab-process__content {
	padding-right: 2vw;
}

.ab-process__title {
	margin: 0 0 22px;
	font-family: "Bona Nova", Georgia, serif;
	font-weight: 700;
	font-size: var(--ab-proc-title-size, 64px);
	line-height: 1.05;
	letter-spacing: 0;
	text-transform: none;
	color: var(--ab-proc-title-color, #fff);
	text-shadow:
		0 0 18px rgba(255, 255, 255, 0.55),
		0 0 48px rgba(255, 255, 255, 0.25);
}

.ab-process__ornament {
	width: 240px;
	max-width: 60%;
	height: 14px;
	margin: 0 0 34px;
	color: var(--ab-proc-accent, #C39B63);
	display: none;
}
.ab-process__ornament-svg {
	display: block;
	width: 100%;
	height: 100%;
	overflow: visible;
}

.ab-process__desc {
	font-size: var(--ab-proc-text-size, 17px);
	line-height: 1.75;
	color: var(--ab-proc-text-color, #fff);
}
.ab-process__desc p {
	margin: 0 0 1em;
	color: inherit;
}
.ab-process__desc p:last-child {
	margin-bottom: 0;
}
.ab-process__desc a {
	color: var(--ab-proc-accent, #C39B63);
}

/* ── Навигация — карти ─────────────────────────────────────────── */

.ab-process__nav {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 3;
	padding: 0 0 1.5vh;
}

.ab-process__cards {
	display: flex;
	gap: 20px;
	padding: 24px 6vw 52px; /* долу: място за иконата, която стърчи под картата */
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}
.ab-process__cards::-webkit-scrollbar {
	display: none;
}
/* Центриране, което не чупи скрола при препълване */
.ab-process__card:first-child {
	margin-left: auto;
}
.ab-process__card:last-child {
	margin-right: auto;
}

.ab-process__card {
	position: relative;
	flex: 0 0 var(--ab-proc-card-w, 250px);
	width: var(--ab-proc-card-w, 250px);
	height: var(--ab-proc-card-h, 340px);
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-align: center;
	cursor: pointer;
	scroll-snap-align: center;
	opacity: var(--ab-proc-card-op, 0.45);
	transform: translateY(0);
	transition: opacity 0.4s ease, transform 0.4s ease;
	-webkit-tap-highlight-color: transparent;
	appearance: none;
	-webkit-appearance: none;
}
.ab-process__card:hover,
.ab-process__card:focus-visible {
	opacity: 0.85;
	transform: translateY(-6px);
}
.ab-process__card.is-active {
	opacity: 1;
	transform: translateY(-26px);
}
.ab-process__card:focus-visible {
	outline: 2px solid var(--ab-proc-accent, #C39B63);
	outline-offset: 4px;
	border-radius: 16px;
	transform: translateY(-6px);
}

.ab-process__card-inner {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 16px;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.35);
	/* box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); */
}
.ab-process__card.is-active .ab-process__card-inner {
/* box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); */
}

.ab-process__card-img {
	position: absolute;
	inset: 0;
	display: block;
}
.ab-process__card-img img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}
/* Затъмняване към долния край, за да чете заглавието */
.ab-process__card-img::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to bottom, rgba(24, 16, 12, 0) 35%, rgba(24, 16, 12, 0.92) 78%, rgba(24, 16, 12, 1) 100%);
	/* background: linear-gradient(to bottom, rgba(24, 16, 12, 0) 35%, rgba(24, 16, 12, 0.92) 78%, #241D1D 100%) */
	background: linear-gradient(to bottom, #241d1d00 35%, #241d1dcf 78%, #241d1d 100%);
}

.ab-process__card-title {
	position: absolute;
	left: 12px;
	right: 12px;
	bottom: 72px;
	display: block;
	font-family: "Bona Nova", Georgia, serif;
	font-weight: 700;
	font-size: 22px;
	line-height: 1.2;
	color: var(--ab-proc-title-color, #fff);
	text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}
.ab-process__card.is-active .ab-process__card-title {
	text-shadow:
		0 0 14px rgba(255, 255, 255, 0.45),
		0 2px 12px rgba(0, 0, 0, 0.5);
}

/* Иконата — кръг, който стърчи наполовина под картата */
.ab-process__card-icon {
	position: absolute;
	left: 50%;
	bottom: -50px;
	width: 100px;
	height: 100px;
	transform: translateX(-50%);
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: var(--ab-proc-bg, #231a17);
	border-top: 5px solid var(--ab-proc-accent, #C39B63);
	border-top: 5px solid  #b5875366;
	color: var(--ab-proc-accent, #C39B63);
	/* box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35); */
	transition: box-shadow 0.4s ease;
}
.ab-process__card.is-active .ab-process__card-icon {
	/* box-shadow:
		0 0 0 4px var(--ab-proc-bg, #231a17),
		0 0 22px rgba(195, 155, 99, 0.45); */
}
.ab-process__card-icon svg,
.ab-process__card-icon img {
	display: block;
	width: 34px;
	height: 34px;
	max-width: 60%;
	max-height: 60%;
	object-fit: contain;
	width: 64px;
	height: 64px;
	max-width: 80%;
	max-height: 80%;
}

/* ── Прогрес и брояч ───────────────────────────────────────────── */

.ab-process__meta {
	display: flex;
	align-items: center;
	gap: 22px;
	width: min(1100px, 88vw);
	margin: 0 auto;
	transition: opacity 0.45s ease, transform 0.45s ease, visibility 0.45s;
}
/* Скрит, докато секцията е още закачена след последния етап (пауза/hold) */
.ab-process__meta.is-out {
	opacity: 0;
	visibility: hidden;
	transform: translateY(14px);
	pointer-events: none;
}

.ab-process__progress {
	position: relative;
	flex: 1 1 auto;
	height: 1px;
	background: rgba(255, 255, 255, 0.18);
	overflow: hidden;
}
.ab-process__progress-bar {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 0;
	background: var(--ab-proc-accent, #C39B63);
	box-shadow: 0 0 10px var(--ab-proc-accent, #C39B63);
}

.ab-process__counter {
	flex: 0 0 auto;
	font-family: "Bona Nova", Georgia, serif;
	font-size: 15px;
	/* letter-spacing: 0.18em; */
	color: var(--ab-proc-accent, #C39B63);
	white-space: nowrap;
}
.ab-process__counter-current {
	color: var(--ab-proc-title-color, #fff);
}
.ab-process__counter-sep {
	margin: 0 0.35em;
	opacity: 0.6;
}

/* ── Маска — бутилка ───────────────────────────────────────────── */

.ab-process__mask {
	position: absolute;
	inset: 0;
	z-index: 10;
	display: none; /* включва се от JS с .ab-process--ready */
	width: 100%;
	height: 100%;
	pointer-events: none;
}
.ab-process__mask-fill {
	fill: var(--ab-proc-bg, #231a17);
}
.ab-process--ready .ab-process__mask {
	display: block;
}
.ab-process--revealed .ab-process__mask {
	display: none;
}

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

@media (max-width: 1199px) {
	.ab-process__content {
		width: 56%;
	}
	.ab-process__title {
		font-size: calc(var(--ab-proc-title-size, 64px) * 0.8);
	}
}

@media (max-width: 991px) {
	.ab-process__slide {
		padding: 9vh 0 0;
	}
	.ab-process .ab-process__container {
		padding-left: 6vw;
		padding-right: 6vw;
	}
	.ab-process__content {
		width: 100%;
		max-width: none;
	}
	.ab-process__slide--right .ab-process__content,
	.ab-process__slide--left .ab-process__content {
		padding: 0;
	}
	.ab-process__title {
		font-size: calc(var(--ab-proc-title-size, 64px) * 0.62);
		margin-bottom: 14px;
	}
	.ab-process__ornament {
		margin-bottom: 20px;
	}
	.ab-process__desc {
		font-size: calc(var(--ab-proc-text-size, 17px) * 0.94);
		line-height: 1.6;
		/* Текстът не бива да минава под картите */
		max-height: calc(100svh - var(--ab-proc-offset, 0px) - 9vh - 120px - var(--ab-proc-card-h, 340px) * 0.62 - 80px);
		overflow: hidden;
	}
	.ab-process__cards {
		gap: 14px;
		padding: 30px 5vw 40px;
		scroll-snap-type: x mandatory;
	}
	.ab-process__card {
		flex-basis: calc(var(--ab-proc-card-w, 250px) * 0.62);
		width: calc(var(--ab-proc-card-w, 250px) * 0.62);
		height: calc(var(--ab-proc-card-h, 340px) * 0.62);
		flex-basis: calc(var(--ab-proc-card-w, 250px) * 0.72);
		width: calc(var(--ab-proc-card-w, 250px) * 0.72);
		height: calc(var(--ab-proc-card-h, 340px) * 0.72);
	}
	.ab-process__card-inner {
		border-radius: 12px;
	}
	.ab-process__card-title {
		bottom: 52px;
        font-size: 18px;
        left: 8px;
        right: 8px;
	}
	.ab-process__card-icon {
		width: 76px;
        height: 76px;
        bottom: -46px;
	}
	.ab-process__card-icon svg,
	.ab-process__card-icon img {
		width: 44px;
		height: 44px;
	}
	.ab-process__nav {
		padding-bottom: 3vh;
	}
	.ab-process__meta {
		width: 90vw;
		gap: 14px;
	}
	.ab-process__counter {
		font-size: 13px;
	}
}

@media (max-width: 575px) {
	.ab-process__slide {
		padding-top: 0vh;
	}
	.ab-process__title {
		font-size: calc(var(--ab-proc-title-size, 64px) * 0.5);
	}
	.ab-process__desc {
		font-size: calc(var(--ab-proc-text-size, 17px) * 0.88);
	}
}

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

@media (prefers-reduced-motion: reduce) {
	.ab-process__card,
	.ab-process__card-icon {
		transition: none;
	}
}
.ab-process--static .ab-process__mask {
	display: none;
}
.ab-process--static .ab-process__slide,
.ab-process--static .ab-process__bg {
	transition: opacity 0.6s ease;
}
