/* ==========================================================================
   Before & After Slider Widget
   ========================================================================== */

.gemtech-before-after {
	position: relative;
	overflow: hidden;
	width: 100%;
	height: 450px;
	cursor: col-resize;
	user-select: none;
	-webkit-user-select: none;
	touch-action: pan-y;
}

/* ── Images ── */

.gemtech-before-after__before,
.gemtech-before-after__after {
	position: absolute;
	inset: 0;
}

.gemtech-before-after__before img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
}

/* The after pane clips its content; its width is set by JS */
.gemtech-before-after__after {
	z-index: 2;
	overflow: hidden;
	width: 50%;
}

.gemtech-before-after__after-inner {
	position: absolute;
	inset: 0;
}

/* The after image must be sized to the outer container, not the clipped pane */
.gemtech-before-after__after-inner img {
	display: block;
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
	max-width: none; /* prevent theme styles from constraining width */
}

/* ── Handle ── */

.gemtech-before-after__handle {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	z-index: 10;
	transform: translateX(-50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	cursor: col-resize;
	touch-action: none;
}

.gemtech-before-after__handle:focus {
	outline: none;
}

.gemtech-before-after__handle:focus-visible .gemtech-before-after__button {
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.8), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.gemtech-before-after__divider {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 2px;
	background-color: #ffffff;
	pointer-events: none;
}

.gemtech-before-after__button {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background-color: #ffffff;
	border: none;
	padding: 0;
	cursor: col-resize;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.gemtech-before-after__button:hover {
	transform: scale(1.08);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

/* CSS chevron arrows */
.gemtech-before-after__arrow {
	display: block;
	flex-shrink: 0;
	width: 7px;
	height: 7px;
	border-top: 2px solid #333333;
	border-right: 2px solid #333333;
}

.gemtech-before-after__arrow--left {
	transform: rotate(-135deg);
	margin-right: -3px;
}

.gemtech-before-after__arrow--right {
	transform: rotate(45deg);
	margin-left: -3px;
}

/* ── Labels ── */

.gemtech-before-after__label {
	position: absolute;
	bottom: 16px;
	z-index: 5;
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	color: #ffffff;
	background-color: rgba(0, 0, 0, 0.5);
	padding: 6px 12px;
	border-radius: 4px;
	pointer-events: none;
	white-space: nowrap;
}

.gemtech-before-after__label--before {
	left: 16px;
}

.gemtech-before-after__label--after {
	right: 16px;
}
