/* ========== Before After Widget ========== */
.cc-ba-widget {
	direction: rtl;
	width: 100%;
	font-family: inherit;
	box-sizing: border-box;
	background: transparent;
	color: #fff;
}

.cc-ba-widget *,
.cc-ba-widget *::before,
.cc-ba-widget *::after {
	box-sizing: border-box;
}

/* ---------- Section Titles ---------- */
.cc-ba-section-title-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	margin-bottom: 28px;
	text-align: center;
}

.cc-ba-section-title-wrap .cc-ba-title-line {
	flex: 1;
	max-width: 80px;
	height: 1px;
	background: linear-gradient(90deg, transparent, #7c3aed, transparent);
	opacity: 0.7;
}

.cc-ba-section-title {
	margin: 0;
	font-size: 28px;
	font-weight: 700;
	background: linear-gradient(90deg, #a78bfa, #60a5fa);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	letter-spacing: -0.02em;
	white-space: nowrap;
}

/* ---------- Compare (Before/After) Section ---------- */
.cc-ba-compare-section {
	position: relative;
	width: 100%;
	margin-bottom: 48px;
}

.cc-ba-slides-wrap {
	position: relative;
	width: 100%;
	border-radius: 20px;
	overflow: hidden;
	background: #0d0d14;
	isolation: isolate;
}

.cc-ba-slides-track {
	position: relative;
	width: 100%;
	height: 340px;
	min-height: 260px;
}

.cc-ba-slide {
	display: block;
	width: 100%;
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 100%;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	z-index: 0;
}

.cc-ba-slide.active {
	/* keep absolute so multiple actives never stack vertically */
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	z-index: 1;
}

/* Classic drag before/after */
.cc-ba-compare {
	position: relative;
	width: 100%;
	overflow: hidden;
	user-select: none;
	-webkit-user-select: none;
	touch-action: pan-y;
	cursor: default;
	direction: ltr; /* visual left=before, right=after */
	height: 340px;
	min-height: 260px;
	background: #0d0d14;
}

.cc-ba-compare img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	pointer-events: none;
	user-select: none;
	-webkit-user-drag: none;
	min-height: 100%;
}

.cc-ba-img-before {
	z-index: 1;
}

.cc-ba-img-after {
	z-index: 2;
	clip-path: inset(0 0 0 var(--ba-pos, 50%));
	transition: none !important;
}

.cc-ba-label {
	position: absolute;
	top: 14px;
	z-index: 6;
	padding: 6px 14px;
	border-radius: 20px;
	font-size: 13px;
	font-weight: 600;
	color: #fff;
	background: rgba(20, 20, 30, 0.78);
	backdrop-filter: blur(6px);
	border: 1px solid rgba(255, 255, 255, 0.12);
	pointer-events: none;
	direction: rtl;
}

.cc-ba-label-before {
	left: 14px;
}

.cc-ba-label-after {
	right: 14px;
}

/* Vertical divider + handle */
.cc-ba-handle {
	position: absolute;
	top: 0;
	bottom: 0;
	left: var(--ba-pos, 50%);
	width: 28px;
	margin-left: 0;
	z-index: 10;
	transform: translateX(-50%);
	pointer-events: auto;
	cursor: col-resize;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: none !important;
	touch-action: none;
}
.cc-ba-compare.is-dragging,
.cc-ba-compare.is-dragging * {
	transition: none !important;
	touch-action: none !important;
}
.cc-ba-compare.is-dragging {
	touch-action: none !important;
}

.cc-ba-handle-line {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	width: 2px;
	background: rgba(255, 255, 255, 0.75);
	transform: translateX(-50%);
	box-shadow: 0 0 10px rgba(167, 139, 250, 0.4);
}

.cc-ba-handle-btn {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 52px;
	height: 52px;
	border-radius: 50%;
	border: 2.5px solid #a78bfa;
	background: rgba(18, 12, 28, 0.92);
	color: #e9d5ff;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow:
		0 0 0 1px rgba(167, 139, 250, 0.25),
		0 0 18px rgba(139, 92, 246, 0.55),
		0 0 36px rgba(124, 58, 237, 0.35);
	pointer-events: auto;
	cursor: col-resize;
	padding: 0;
	transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.cc-ba-handle-btn:hover {
	background: rgba(88, 28, 135, 0.95);
	color: #fff;
	border-color: #c4b5fd;
	box-shadow:
		0 0 0 1px rgba(196, 181, 253, 0.35),
		0 0 22px rgba(167, 139, 250, 0.7),
		0 0 40px rgba(124, 58, 237, 0.45);
}
.cc-ba-compare.is-dragging .cc-ba-handle-btn {
	background: rgba(88, 28, 135, 0.95);
	color: #fff;
	border-color: #c4b5fd;
	transition: none !important;
	transform: translate(-50%, -50%);
}

.cc-ba-handle-btn svg {
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* Side arrows (for multiple compare items) */
.cc-ba-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 15;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 2px solid rgba(167, 139, 250, 0.55);
	background: rgba(12, 12, 20, 0.8);
	color: #c4b5fd;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.25s ease;
	box-shadow: 0 0 18px rgba(124, 58, 237, 0.3);
	padding: 0;
}

.cc-ba-arrow:hover {
	background: rgba(124, 58, 237, 0.85);
	color: #fff;
	border-color: #a78bfa;
	box-shadow: 0 0 26px rgba(124, 58, 237, 0.5);
}

.cc-ba-arrow svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.cc-ba-arrow-prev {
	left: 12px;
	right: auto;
}

.cc-ba-arrow-next {
	right: 12px;
	left: auto;
}

.cc-ba-arrow.is-hidden,
.cc-ba-dots.is-hidden,
.cc-ba-vid-arrow.is-hidden,
.cc-ba-vid-dots.is-hidden {
	display: none !important;
}

/* Dots */
.cc-ba-dots {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 18px;
}

.cc-ba-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.25);
	border: none;
	cursor: pointer;
	padding: 0;
	transition: all 0.25s ease;
}

.cc-ba-dot.active {
	background: #a78bfa;
	box-shadow: 0 0 10px rgba(167, 139, 250, 0.6);
	transform: scale(1.15);
}

.cc-ba-dot:hover {
	background: rgba(167, 139, 250, 0.7);
}

/* ---------- Videos Section ---------- */
.cc-ba-videos-section {
	position: relative;
	width: 100%;
}

.cc-ba-videos-outer {
	position: relative;
	overflow: hidden;
	padding: 0 52px;
}

.cc-ba-videos-outer.no-nav {
	padding: 0;
}

.cc-ba-videos-track {
	display: flex;
	gap: 16px;
	transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
	will-change: transform;
}

.cc-ba-video-item {
	flex: 0 0 calc(25% - 12px);
	min-width: 0;
	position: relative;
	border-radius: 16px;
	overflow: hidden;
	background: #0d0d14;
	aspect-ratio: auto;
	cursor: pointer;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cc-ba-video-item:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 32px rgba(124, 58, 237, 0.25);
}

.cc-ba-video-thumb {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cc-ba-play-btn {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 56px;
	height: 56px;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, 0.85);
	background: rgba(15, 15, 25, 0.55);
	backdrop-filter: blur(4px);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.25s ease;
	z-index: 3;
	padding: 0;
	color: #fff;
	pointer-events: none; /* whole item is clickable */
}

.cc-ba-video-item:hover .cc-ba-play-btn {
	background: rgba(124, 58, 237, 0.85);
	border-color: #c4b5fd;
	box-shadow: 0 0 24px rgba(124, 58, 237, 0.5);
	transform: translate(-50%, -50%) scale(1.08);
}

.cc-ba-play-btn svg {
	width: 22px;
	height: 22px;
	fill: currentColor;
	margin-left: 3px;
}

.cc-ba-duration {
	position: absolute;
	bottom: 10px;
	left: 10px;
	z-index: 3;
	padding: 4px 10px;
	border-radius: 8px;
	font-size: 12px;
	font-weight: 600;
	color: #fff;
	background: rgba(10, 10, 18, 0.75);
	backdrop-filter: blur(4px);
	pointer-events: none;
	direction: ltr;
}

/* Video arrows */
.cc-ba-vid-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 2px solid rgba(167, 139, 250, 0.55);
	background: rgba(12, 12, 20, 0.85);
	color: #c4b5fd;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.25s ease;
	padding: 0;
}

.cc-ba-vid-arrow:hover:not(.disabled) {
	background: rgba(124, 58, 237, 0.85);
	color: #fff;
	border-color: #a78bfa;
}

.cc-ba-vid-arrow.disabled {
	opacity: 0.35;
	cursor: default;
	pointer-events: none;
}

.cc-ba-vid-arrow svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.cc-ba-vid-arrow-prev {
	left: 0;
	right: auto;
}

.cc-ba-vid-arrow-next {
	right: 0;
	left: auto;
}

/* Video dots */
.cc-ba-vid-dots {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 18px;
}

.cc-ba-vid-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.25);
	border: none;
	cursor: pointer;
	padding: 0;
	transition: all 0.25s ease;
}

.cc-ba-vid-dot.active {
	background: #a78bfa;
	box-shadow: 0 0 10px rgba(167, 139, 250, 0.6);
	transform: scale(1.15);
}

/* ---------- Video Popup (centered modal) ---------- */
.cc-ba-popup-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(0, 0, 0, 0.8);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
	backdrop-filter: blur(6px);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
}

.cc-ba-popup-overlay.is-open {
	opacity: 1;
	visibility: visible;
}

.cc-ba-popup {
	position: relative;
	left: auto;
	right: auto;
	bottom: auto;
	top: auto;
	z-index: 100000;
	width: 100%;
	max-width: 800px;
	background: #0d0d14;
	border-radius: 16px;
	padding: 12px 12px 16px;
	transform: scale(0.96);
	opacity: 0;
	transition: transform 0.25s ease, opacity 0.25s ease;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
	box-sizing: border-box;
}

.cc-ba-popup-overlay.is-open .cc-ba-popup {
	transform: scale(1);
	opacity: 1;
}

.cc-ba-popup-bar {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	margin-bottom: 8px;
	flex-shrink: 0;
}

.cc-ba-popup-handle {
	display: none;
}

.cc-ba-popup-close {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	margin: 0;
	transition: background 0.2s;
}

.cc-ba-popup-close:hover {
	background: rgba(255, 255, 255, 0.2);
}

.cc-ba-popup-close svg {
	width: 18px;
	height: 18px;
	stroke: currentColor;
	fill: none;
	stroke-width: 2;
}

.cc-ba-popup-video-wrap {
	position: relative;
	width: 100%;
	border-radius: 10px;
	overflow: hidden;
	background: #000;
	aspect-ratio: 16 / 9;
	flex-shrink: 0;
}

.cc-ba-popup-video-wrap video {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: contain;
	background: #000;
}

.cc-ba-popup-video-wrap iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 1199px) {
	.cc-ba-video-item {
		flex: 0 0 calc(33.333% - 11px);
	}
}

@media (max-width: 899px) {
	.cc-ba-video-item {
		flex: 0 0 calc(50% - 8px);
	}
	.cc-ba-section-title {
		font-size: 24px;
	}
}

@media (max-width: 767px) {
	.cc-ba-section-title {
		font-size: 22px;
	}
	.cc-ba-section-title-wrap .cc-ba-title-line {
		max-width: 40px;
	}

	/* Keep side-by-side drag comparison on mobile – do NOT stack */
	.cc-ba-slides-track {
		height: 260px;
		min-height: 220px;
	}
	.cc-ba-compare {
		height: 260px;
		min-height: 220px;
	}

	.cc-ba-handle-btn {
		width: 44px;
		height: 44px;
	}

	.cc-ba-arrow {
		width: 40px;
		height: 40px;
	}
	.cc-ba-arrow-prev {
		left: 8px;
	}
	.cc-ba-arrow-next {
		right: 8px;
	}

	.cc-ba-videos-outer {
		padding: 0 40px;
	}
	.cc-ba-videos-outer.no-nav {
		padding: 0;
	}

	.cc-ba-video-item {
		flex: 0 0 calc(50% - 8px);
	}

	.cc-ba-play-btn {
		width: 48px;
		height: 48px;
	}

	.cc-ba-popup {
		padding: 10px 10px 14px;
		border-radius: 14px;
		max-width: 100%;
		width: 100%;
	}
}

@media (max-width: 480px) {
	.cc-ba-section-title {
		font-size: 20px;
	}
	.cc-ba-label {
		font-size: 12px;
		padding: 5px 10px;
	}
	.cc-ba-video-item {
		flex: 0 0 100%;
	}
	.cc-ba-videos-outer {
		padding: 0 36px;
	}
	.cc-ba-videos-outer.no-nav {
		padding: 0;
	}
}


/* Mobile videos: native horizontal scroll, no arrows */
@media (max-width: 767px) {
	.cc-ba-videos-outer {
		padding: 0 !important;
		overflow: visible;
	}
	.cc-ba-videos-outer.is-mobile-scroll,
	.cc-ba-videos-outer {
		overflow-x: auto;
		overflow-y: hidden;
		-webkit-overflow-scrolling: touch;
		scroll-snap-type: x mandatory;
		padding: 0 12px !important;
		scrollbar-width: none;
	}
	.cc-ba-videos-outer::-webkit-scrollbar {
		display: none;
	}
	.cc-ba-videos-track {
		transform: none !important;
		width: max-content;
		gap: 12px;
	}
	.cc-ba-video-item {
		flex: 0 0 78vw;
		max-width: 320px;
		scroll-snap-align: center;
	}
	.cc-ba-vid-arrow {
		display: none !important;
	}
	.cc-ba-vid-dots {
		display: none !important;
	}
}


/* While dragging compare handle – lock page scroll & prevent extra UI */
html.cc-ba-dragging,
html.cc-ba-dragging body {
	overflow: hidden !important;
}
html.cc-ba-dragging .cc-ba-videos-section {
	pointer-events: none;
}
