/* ── Before / After Gallery Section ────────────────────────── */

.ba-gallery-section {
	background: #f8f8f8;
}

/* ── Header ─────────────────────────────────────────────── */

.ba-gallery-section .section-header {
	margin-bottom: 48px;
}

/* ── Grid ────────────────────────────────────────────────── */

.ba-gallery-grid {
	position: relative;
}

.ba-gallery-track {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
}

@media (max-width: 900px) {
	.ba-gallery-track {
		display: flex;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
	}

	.ba-gallery-track .before-after-images {
		flex: 0 0 300px;
		scroll-snap-align: start;
	}
}

/* ── Before / After Instance ─────────────────────────────── */

.before-after-images {
	position: relative;
	overflow: hidden;
	border-radius: 12px;
	aspect-ratio: 1 / 1;
	cursor: ew-resize;
	user-select: none;
	touch-action: auto;
	background: #222;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ba-gallery-grid .before-after-images:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.before-after-images img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
}

/* ── Slider Handle ───────────────────────────────────────── */

.before-after-images .slider {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	width: 3px;
	background: #fff;
	transform: translateX(-50%);
	z-index: 3;
	pointer-events: auto;
	cursor: ew-resize;
	touch-action: none;
}

.before-after-images .slider::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #fff;
	transform: translate(-50%, -50%);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none'%3E%3Cpath d='M7 4l-5 6 5 6M13 4l5 6-5 6' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 20px;
}

/* ── Labels ──────────────────────────────────────────────── */

.ba-label {
	position: absolute;
	bottom: 12px;
	padding: 4px 14px;
	border-radius: 32px;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #fff;
	z-index: 2;
	pointer-events: none;
	transition: opacity 0.15s ease;
}

.ba-label-before {
	left: 12px;
	background: #B91C1C;
}

.ba-label-after {
	right: 12px;
	background: #047857;
}
