.wdbxc-before-after {
	--wdbxc-ba-position: 50%;
	--wdbxc-ba-divider-color: #fff;
	--wdbxc-ba-divider-width: 3px;
	--wdbxc-ba-handle-size: 54px;
	--wdbxc-ba-handle-position-y: 50%;
	--wdbxc-ba-handle-background: #fff;
	--wdbxc-ba-handle-color: #111827;
	--wdbxc-ba-aspect-ratio: 16 / 9;
	position: relative;
	width: 100%;
	height: auto;
	overflow: hidden;
	isolation: isolate;
	background: transparent;
}

.wdbxc-before-after__image {
	position: absolute;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
	user-select: none;
}

.wdbxc-before-after__image--before {
	z-index: 2;
	clip-path: inset(0 calc(100% - var(--wdbxc-ba-position)) 0 0);
}

.wdbxc-before-after__image--after {
	position: relative;
	z-index: 1;
	inset: auto;
	width: 100%;
}

.wdbxc-before-after__image img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: center;
}

.wdbxc-before-after__image--after img {
	height: auto;
	aspect-ratio: var(--wdbxc-ba-aspect-ratio);
}

.wdbxc-before-after__range {
	position: absolute;
	z-index: 6;
	top: var(--wdbxc-ba-handle-position-y);
	left: var(--wdbxc-ba-position);
	width: var(--wdbxc-ba-handle-size);
	height: var(--wdbxc-ba-handle-size);
	margin: 0;
	opacity: 0;
	clip-path: circle(50%);
	pointer-events: none;
	transform: translate(-50%, -50%);
}

.wdbxc-before-after__divider {
	position: absolute;
	z-index: 4;
	top: 0;
	bottom: 0;
	left: var(--wdbxc-ba-position);
	width: var(--wdbxc-ba-divider-width);
	background: var(--wdbxc-ba-divider-color);
	transform: translateX(-50%);
	pointer-events: none;
}

.wdbxc-before-after__handle {
	position: absolute;
	z-index: 5;
	top: var(--wdbxc-ba-handle-position-y);
	left: var(--wdbxc-ba-position);
	display: grid;
	box-sizing: border-box;
	width: var(--wdbxc-ba-handle-size);
	height: var(--wdbxc-ba-handle-size);
	place-items: center;
	border: var(--wdbxc-ba-divider-width) solid var(--wdbxc-ba-divider-color);
	border-radius: 50%;
	background: var(--wdbxc-ba-handle-background);
	color: var(--wdbxc-ba-handle-color);
	box-shadow: 0 3px 12px rgba(0, 0, 0, 0.22);
	cursor: ew-resize;
	transform: translate(-50%, -50%);
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
}

.wdbxc-before-after__handle-icon {
	font-size: calc(var(--wdbxc-ba-handle-size) * 0.5);
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.08em;
}

.wdbxc-before-after__range:focus-visible:not(.wdbxc-before-after__range--pointer-focus) ~ .wdbxc-before-after__handle {
	outline: 3px solid #2563eb;
	outline-offset: 3px;
}

.wdbxc-before-after__label-layer {
	position: absolute;
	z-index: 3;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
}

.wdbxc-before-after__label-layer--before {
	clip-path: inset(0 calc(100% - var(--wdbxc-ba-position)) 0 0);
}

.wdbxc-before-after__label-layer--after {
	clip-path: inset(0 0 0 var(--wdbxc-ba-position));
}

.wdbxc-before-after__editor-notice {
	padding: 16px;
	border: 1px dashed #b7bcc5;
	border-radius: 4px;
	background: #f7f8fa;
	color: #4b5563;
	font-size: 13px;
	line-height: 1.5;
	text-align: center;
}

.wdbxc-before-after__label {
	position: absolute;
	top: 20px;
	padding: 6px 12px;
	border-radius: 4px;
	background: rgba(17, 24, 39, 0.72);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	pointer-events: none;
}

.wdbxc-before-after__label--before {
	left: 20px;
}

.wdbxc-before-after__label--after {
	right: 20px;
}

@media (max-width: 767px) {
	.wdbxc-before-after__label {
		top: 12px;
	}

	.wdbxc-before-after__label--before {
		left: 12px;
	}

	.wdbxc-before-after__label--after {
		right: 12px;
	}
}
