/* Before/After Carousel - frontend styles */

.bac-wrapper {
	position: relative;
	width: 100%;
	--bac-transition-speed: 450ms;
}

.bac-viewport {
	position: relative !important;
	width: 100% !important;
	overflow: hidden !important;
}

.bac-track {
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: nowrap !important;
	width: 100% !important;
	align-items: flex-start !important;
	transition: transform var(--bac-transition-speed) ease;
	will-change: transform;
}

.bac-slide {
	flex: 0 0 100% !important;
	max-width: 100% !important;
	width: 100% !important;
}

.bac-image-wrap {
	position: relative !important;
	width: 100% !important;
	aspect-ratio: var(--bac-ratio-desktop, 16 / 9);
	overflow: hidden !important;
	user-select: none;
	-webkit-user-select: none;
	touch-action: none;
}

.bac-image {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover !important;
	pointer-events: none;
}

.bac-image-before {
	z-index: 1;
}

.bac-image-after-wrap {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	width: 100% !important;
	height: 100% !important;
	z-index: 2;
	overflow: hidden !important;
	/* clip-path is set inline via JS depending on orientation + position */
}

.bac-image-after-wrap .bac-image-after {
	width: 100% !important;
	height: 100% !important;
}

.bac-divider {
	position: absolute;
	z-index: 3;
	background-color: #ffffff;
	pointer-events: none;
}

.bac-wrapper[data-orientation="horizontal"] .bac-divider {
	top: 0;
	bottom: 0;
	width: 2px;
	transform: translateX(-1px);
}

.bac-wrapper[data-orientation="vertical"] .bac-divider {
	left: 0;
	right: 0;
	height: 2px;
	transform: translateY(-1px);
}

.bac-handle {
	position: absolute;
	z-index: 4;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: #ffffff;
	box-shadow: none;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: ew-resize;
	transform: translate(-50%, -50%);
	top: 50%;
	color: #333333;
}

.bac-wrapper[data-orientation="vertical"] .bac-handle {
	cursor: ns-resize;
	left: 50%;
}

/* Handle icon built with plain CSS (no <svg>/<img> tags) so it survives
   any HTML sanitizer when the markup is pasted into an Elementor HTML
   widget instead of running through the PHP widget/plugin. */
.bac-handle-arrow {
	position: absolute;
	top: 50%;
	width: 7px;
	height: 7px;
	border-style: solid;
	border-color: currentColor;
	border-width: 2px 2px 0 0;
	pointer-events: none;
}

.bac-handle-arrow-left {
	left: 36%;
	transform: translate(-50%, -50%) rotate(-135deg);
}

.bac-handle-arrow-right {
	left: 64%;
	transform: translate(-50%, -50%) rotate(45deg);
}

/* Meta row: Before label - caption pill - After label, below the image */
.bac-meta-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 24px;
}

.bac-meta-label {
	flex: 1 1 0;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: #9a9a9a;
	text-align: left;
}

.bac-meta-after {
	text-align: right;
}

.bac-meta-pill {
	flex: 0 0 auto;
	padding: 7px 18px;
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	color: #4a4a4a;
	background: #eef0f1;
	border-radius: 4px;
	white-space: nowrap;
}

/* Carousel nav row: prev arrow - dots - next arrow */
.bac-nav-row {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 18px;
	margin-top: 28px;
}

.bac-arrow {
	box-sizing: border-box !important;
	flex: 0 0 auto;
	width: 44px !important;
	height: 44px !important;
	min-width: 0 !important;
	border-radius: 6px;
	border-style: solid !important;
	border-width: 1px !important;
	border-color: #e2e2e2;
	background: #ffffff;
	padding: 0 !important;
	margin: 0;
	font-size: 0 !important;
	white-space: normal !important;
	display: flex !important;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease;
}

.bac-arrow:hover {
	background: #f5f5f5;
}

/* Arrow icon built with plain CSS (no <svg> tags) so it survives any
   HTML sanitizer when the markup is pasted into an Elementor HTML widget
   instead of running through the PHP widget/plugin.
   Uses clip-path (filled polygon) instead of the border-corner trick —
   border-corner chevrons can render with a slightly blunted/cut tip at
   small sizes due to anti-aliasing on the border join; clip-path avoids
   that entirely since it's a single filled shape. */
.bac-arrow::before {
	content: "";
	display: block;
	width: 14px;
	height: 14px;
	background-color: #4a4a4a;
}

.bac-arrow-prev::before {
	clip-path: polygon(80% 8%, 28% 50%, 80% 92%, 64% 92%, 12% 50%, 64% 8%);
}

.bac-arrow-next::before {
	clip-path: polygon(20% 8%, 72% 50%, 20% 92%, 36% 92%, 88% 50%, 36% 8%);
}

/* Dots */
.bac-dots {
	display: flex;
	align-items: center;
	gap: 8px;
}

.bac-dot {
	box-sizing: border-box !important;
	display: block !important;
	width: 8px !important;
	height: 8px !important;
	min-width: 0 !important;
	border-radius: 50% !important;
	border: none !important;
	padding: 0 !important;
	margin: 0;
	font-size: 0 !important;
	white-space: normal !important;
	background: #d7d7d7;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.bac-dot.is-active {
	background: #1a1a1a;
}

.bac-empty-notice {
	padding: 20px;
	background: #fff3cd;
	border: 1px dashed #d9a400;
	color: #5c4400;
	font-size: 14px;
	text-align: center;
}

@media (max-width: 767px) {
	.bac-image-wrap {
		aspect-ratio: var(--bac-ratio-mobile, 4 / 5);
	}
	.bac-meta-row {
		flex-wrap: wrap;
		gap: 8px;
	}
	.bac-meta-label {
		flex: 0 0 auto;
	}
	.bac-arrow {
		width: 38px;
		height: 38px;
	}
}