/* Before After Slider - Elementor Addons By Webvio */

.webvio-ba-wrap {
	--webvio-thumb-active-color: #2563eb;
	box-sizing: border-box;
}

.webvio-ba-wrap *,
.webvio-ba-wrap *::before,
.webvio-ba-wrap *::after {
	box-sizing: border-box;
}

.webvio-ba-layout {
	display: flex;
	align-items: stretch;
	gap: 16px;
	max-width: 100%;
}

/* Thumbnail column (left) - this column drives the row height; main area will match it */
.webvio-ba-thumb-col {
	display: flex;
	flex-direction: column;
	align-items: center;
	flex-shrink: 0;
	align-self: flex-start;
	overflow: hidden;
}

.webvio-ba-thumb-nav {
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	cursor: pointer;
	padding: 0;
	flex-shrink: 0;
	color: #94a3b8;
	background: rgba(15, 23, 42, 0.8);
	border-radius: 4px;
	transition: color 0.2s, background 0.2s, opacity 0.2s;
	width: 100%; /* overridden by widget Arrow width / height / Icon size controls */
}

.webvio-ba-thumb-nav:hover {
	color: #fff;
	background: rgba(30, 41, 59, 0.95);
}

.webvio-ba-thumb-nav:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.webvio-ba-thumb-nav .webvio-ba-thumb-nav-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	line-height: 1;
}

/* Font Awesome / eicons: keep inside button, inherit size and color */
.webvio-ba-thumb-nav .webvio-ba-thumb-nav-icon i {
	display: inline-block;
	font-size: inherit;
	color: inherit;
	line-height: 1;
}

.webvio-ba-thumb-nav img,
.webvio-ba-thumb-nav svg {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

/* Viewport height = N visible × (thumb height + gap) − gap + padding (from widget) */
.webvio-ba-thumb-track {
	flex: 0 0 auto;
	overflow: hidden;
	display: flex;
	align-items: center;
	min-height: 0;
	height: calc(var(--webvio-ba-thumb-visible, 6) * (var(--webvio-ba-thumb-item-h) + var(--webvio-ba-thumb-gap)) - var(--webvio-ba-thumb-gap) + 8px);
}

.webvio-ba-thumb-list {
	overflow: hidden;
	min-height: 0;
	height: 100%;
}

/* Sliding strip: height set inline from widget (thumb count × item h + gap); transform for slide */
.webvio-ba-thumb-list-slide {
	display: flex;
	flex-direction: column;
	gap: var(--webvio-ba-thumb-gap);
	padding: 4px 0;
	transition: transform 0.35s ease;
	will-change: transform;
}

.webvio-ba-thumb-item {
	display: block;
	flex-shrink: 0;
	width: 100px;
	height: var(--webvio-ba-thumb-item-h, 100px);
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.1);
	background: rgba(30, 41, 59, 0.6);
	border-radius: 6px;
	cursor: pointer;
	overflow: hidden;
	transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
	padding: 0 !important;
}

.webvio-ba-thumb-item:hover {
	transform: scale(1.02);
}

.webvio-ba-thumb-item.is-active {
	border-color: var(--webvio-thumb-active-color);
	box-shadow: 0 0 0 2px var(--webvio-thumb-active-color);
}

.webvio-ba-thumb-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	vertical-align: middle;
}

/* Main column (before/after) - height matches thumb column (thumb-col drives row height) */
.webvio-ba-main-col {
	flex: 1;
	min-width: 0;
	position: relative;
	align-self: stretch;
	min-height: 0;
}

.webvio-ba-slide {
	position: absolute;
	inset: 0;
	opacity: 1;
	transition: opacity 0.4s ease;
}

.webvio-ba-slide.is-animating-out {
	opacity: 0;
	pointer-events: none;
	transition-duration: var(--webvio-ba-duration, 400ms);
}

.webvio-ba-slide.is-animating-in {
	animation: webvio-ba-fadeIn var(--webvio-ba-duration, 400ms) ease forwards;
}

.webvio-ba-slide[style*="display: none"] {
	display: none !important;
}

.webvio-ba-slide.is-current {
	z-index: 1;
}

@keyframes webvio-ba-fadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes webvio-ba-slideIn {
	from { opacity: 0; transform: translateX(20px); }
	to { opacity: 1; transform: translateX(0); }
}

@keyframes webvio-ba-zoomIn {
	from { opacity: 0; transform: scale(0.98); }
	to { opacity: 1; transform: scale(1); }
}

.webvio-ba-slide.is-animating-in[data-animation="slide"] {
	animation: webvio-ba-slideIn var(--webvio-ba-duration, 400ms) ease forwards;
}

.webvio-ba-slide.is-animating-in[data-animation="zoom"] {
	animation: webvio-ba-zoomIn var(--webvio-ba-duration, 400ms) ease forwards;
}

/* Fills the slide; height comes from main-col which matches thumb-col height */
.webvio-ba-main {
	position: relative;
	width: 100%;
	height: 100%;
	overflow: hidden;
	border-radius: 8px;
	background: #0f172a;
}

/* Both images same size = 100% of container so result is accurate */
.webvio-ba-before,
.webvio-ba-after {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}

.webvio-ba-before {
	z-index: 0;
}

/* After image: full width of container, revealed via clip-path as user drags */
.webvio-ba-after {
	z-index: 1;
	clip-path: inset(0 0 0 calc(var(--ba-pos, 50) * 1%));
	-webkit-clip-path: inset(0 0 0 calc(var(--ba-pos, 50) * 1%));
}

/* Center divider line - above after image so it's visible */
.webvio-ba-center-line {
	position: absolute;
	top: 0;
	left: 50%;
	bottom: 0;
	width: 1px;
	margin-left: -0.5px;
	background-color: rgba(255, 255, 255, 0.85);
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
	z-index: 2;
	pointer-events: none;
}

/* Handle above center line */
.webvio-ba-handle {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 3;
	width: 44px;
	height: 44px;
	margin-left: -22px;
	border-radius: 50%;
	background: #f1f5f9;
	border: 2px solid rgba(0, 0, 0, 0.08);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	cursor: ew-resize;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: box-shadow 0.2s;
	user-select: none;
	touch-action: none;
}

.webvio-ba-handle:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.webvio-ba-handle .webvio-ba-handle-svg,
.webvio-ba-handle svg {
	width: 23px;
	height: 9px;
	max-width: 100%;
	pointer-events: none;
}

.webvio-ba-handle .webvio-ba-handle-img {
	max-width: 80%;
	max-height: 80%;
	width: auto;
	height: auto;
	object-fit: contain;
	pointer-events: none;
}

/* Labels */
.webvio-ba-label {
	position: absolute;
	padding: 6px 12px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.05em;
	background: rgba(255, 255, 255, 0.9);
	color: #1e293b;
	border-radius: 4px;
	z-index: 4;
	pointer-events: none;
}

/* Label positions - explicit so they override and work correctly */
.webvio-ba-wrap .webvio-ba-label.webvio-ba-pos-bottom-left { bottom: 12px; left: 12px; right: auto; top: auto; transform: none; }
.webvio-ba-wrap .webvio-ba-label.webvio-ba-pos-bottom-center { bottom: 12px; left: 50%; right: auto; top: auto; transform: translateX(-50%); }
.webvio-ba-wrap .webvio-ba-label.webvio-ba-pos-bottom-right { bottom: 12px; right: 12px; left: auto; top: auto; transform: none; }
.webvio-ba-wrap .webvio-ba-label.webvio-ba-pos-top-left { top: 12px; left: 12px; right: auto; bottom: auto; transform: none; }
.webvio-ba-wrap .webvio-ba-label.webvio-ba-pos-top-center { top: 12px; left: 50%; right: auto; bottom: auto; transform: translateX(-50%); }
.webvio-ba-wrap .webvio-ba-label.webvio-ba-pos-top-right { top: 12px; right: 12px; left: auto; bottom: auto; transform: none; }
.webvio-ba-wrap .webvio-ba-label.webvio-ba-pos-left-center { top: 50%; left: 12px; right: auto; bottom: auto; transform: translateY(-50%); }
.webvio-ba-wrap .webvio-ba-label.webvio-ba-pos-right-center { top: 50%; right: 12px; left: auto; bottom: auto; transform: translateY(-50%); }

/* Responsive: on mobile show main first (top), thumbnails at bottom in a horizontal row */
@media (max-width: 767px) {
	.webvio-ba-layout {
		flex-direction: column;
	}
	.webvio-ba-main-col {
		order: 1;
		aspect-ratio: 16 / 9;
		width: 100%;
		min-height: 0;
	}
	.webvio-ba-thumb-col {
		order: 2;
		flex-direction: row;
		width: 100%;
		justify-content: center;
	}
	.webvio-ba-thumb-track {
		width: auto;
		max-width: 100%;
		height: auto;
	}
	.webvio-ba-thumb-list {
		flex-direction: row;
		overflow: hidden;
		max-height: none;
		height: auto;
	}
	.webvio-ba-thumb-list-slide {
		height: auto !important;
		flex-direction: row;
		transition: transform 0.35s ease;
	}
	.webvio-ba-thumb-prev {
		transform: rotate(-90deg);
	}
	.webvio-ba-thumb-next {
		transform: rotate(-90deg);
	}
}
