/* Before & After Slider for Elementor
 * ------------------------------------ */

.bas-wrap {
	--bas-accent: #0d9488;
	--bas-radius: 16px;
	max-width: 900px;
	margin: 0 auto;
	text-align: center;
}

/* Heading */
.bas-heading {
	margin-bottom: 1.75rem;
}

.bas-subtitle {
	display: block;
	color: var(--bas-accent);
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	font-size: 0.8rem;
	margin-bottom: 0.6rem;
}

.bas-title {
	margin: 0;
	font-size: clamp(1.8rem, 4vw, 2.6rem);
	font-weight: 800;
	line-height: 1.12;
	color: #0f2233;
}

/* Comparison container */
.bas-container {
	--bas-pos: 50%;
	position: relative;
	overflow: hidden;
	border: 1px solid #e2e8f0;
	border-radius: var(--bas-radius);
	background: #f1f5f9;
	cursor: ew-resize;
	user-select: none;
	-webkit-user-select: none;
	touch-action: pan-y;
	line-height: 0;
}

/* After image sits in normal flow and defines the height */
.bas-img-after {
	display: block;
	width: 100%;
	height: auto;
}

/* When a fixed orientation/ratio is chosen, the container height is set by
 * aspect-ratio and the After image fills it (cropped with object-fit). */
.bas-has-ratio .bas-img-after {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Before image overlays and is clipped to the slider position */
.bas-before {
	position: absolute;
	inset: 0;
	clip-path: inset(0 calc(100% - var(--bas-pos)) 0 0);
	-webkit-clip-path: inset(0 calc(100% - var(--bas-pos)) 0 0);
	will-change: clip-path;
}

.bas-before img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Before / After pill labels */
.bas-label {
	position: absolute;
	bottom: 16px;
	z-index: 3;
	padding: 6px 14px;
	border-radius: 8px;
	background: #334155;
	color: #fff;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	line-height: 1;
	pointer-events: none;
}

.bas-label-before { left: 16px; }
.bas-label-after  { right: 16px; }

/* Divider line + drag handle */
.bas-divider {
	position: absolute;
	top: 0;
	bottom: 0;
	left: var(--bas-pos);
	width: 3px;
	transform: translateX(-50%);
	background: #fff;
	box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08), 0 0 8px rgba(0, 0, 0, 0.25);
	pointer-events: none;
	z-index: 4;
}

.bas-handle {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
	display: flex;
	align-items: center;
	justify-content: center;
}

.bas-handle::before,
.bas-handle::after {
	content: "";
	position: absolute;
	width: 0;
	height: 0;
	border-top: 5px solid transparent;
	border-bottom: 5px solid transparent;
}

.bas-handle::before {
	left: 11px;
	border-right: 7px solid var(--bas-accent);
}

.bas-handle::after {
	right: 11px;
	border-left: 7px solid var(--bas-accent);
}

/* The teal slider bar under the image */
.bas-range {
	-webkit-appearance: none;
	appearance: none;
	display: block;
	width: 100%;
	height: 8px;
	margin: 22px 0 0;
	border-radius: 999px;
	background: var(--bas-accent);
	outline: none;
	cursor: pointer;
}

.bas-range::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 22px;
	height: 22px;
	margin-top: -7px;
	border-radius: 50%;
	background: var(--bas-accent);
	border: 3px solid #fff;
	box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
	cursor: pointer;
}

.bas-range::-moz-range-thumb {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--bas-accent);
	border: 3px solid #fff;
	box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
	cursor: pointer;
}

.bas-range::-moz-range-track {
	height: 8px;
	border-radius: 999px;
	background: var(--bas-accent);
}

.bas-range:focus-visible {
	box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.35);
}

/* Caption */
.bas-caption {
	margin: 14px 0 0;
	color: #94a3b8;
	font-size: 0.85rem;
	line-height: 1.5;
}
