.baew-grid {
	--baew-columns: 2;
	--baew-gap: 24px;
	display: grid;
	grid-template-columns: repeat(var(--baew-columns), minmax(0, 1fr));
	gap: var(--baew-gap);
}

.baew-item {
	min-width: 0;
}

.baew-comparison {
	--baew-position: 50%;
	--baew-height: 360px;
	position: relative;
	width: 100%;
	height: var(--baew-height);
	overflow: hidden;
	border-radius: 14px;
	isolation: isolate;
	cursor: ew-resize;
	background: #f3f3f3;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.10);
	touch-action: none;
	user-select: none;
}

.baew-comparison:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 4px;
}

.baew-image,
.baew-before-layer {
	position: absolute;
	inset: 0;
}

.baew-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	pointer-events: none;
}

.baew-image-after {
	z-index: 1;
}

.baew-before-layer {
	z-index: 2;
	width: var(--baew-position);
	overflow: hidden;
}

.baew-before-layer .baew-image-before {
	width: calc(100% / (var(--baew-position-num, 50) / 100));
	min-width: 100%;
	max-width: none;
}

.baew-divider {
	position: absolute;
	z-index: 4;
	top: 0;
	bottom: 0;
	left: var(--baew-position);
	width: 2px;
	transform: translateX(-50%);
	background: rgba(255, 255, 255, 0.95);
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
	pointer-events: none;
}

.baew-handle {
	position: absolute;
	z-index: 5;
	top: 50%;
	left: var(--baew-position);
	width: 48px;
	height: 48px;
	transform: translate(-50%, -50%);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.96);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
	pointer-events: none;
}

.baew-arrow {
	position: absolute;
	top: 50%;
	width: 0;
	height: 0;
	transform: translateY(-50%);
}

.baew-arrow-left {
	left: 11px;
	border-top: 7px solid transparent;
	border-bottom: 7px solid transparent;
	border-right: 9px solid #111;
}

.baew-arrow-right {
	right: 11px;
	border-top: 7px solid transparent;
	border-bottom: 7px solid transparent;
	border-left: 9px solid #111;
}

.baew-label {
	position: absolute;
	z-index: 6;
	top: 16px;
	padding: 7px 11px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.58);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	backdrop-filter: blur(5px);
	pointer-events: none;
}

.baew-label-before {
	left: 16px;
}

.baew-label-after {
	right: 16px;
}

.baew-title {
	margin: 14px 0 0;
	font-size: 18px;
	line-height: 1.25;
}

@media (max-width: 767px) {
	.baew-grid {
		grid-template-columns: repeat(var(--baew-columns, 1), minmax(0, 1fr));
	}

	.baew-comparison {
		--baew-height: 300px;
	}
}
