.aeg-compare {
	--pos: 50%;
	-webkit-user-select: none;
	box-sizing: border-box;
	margin-left: auto;
	margin-right: auto;
	max-width: 100%;
	width: var(--aeg-story-item-width, 82%);
	user-select: none;
}

.aeg-compare.is-horizontal-left { margin-left: 0 !important; margin-right: auto !important; }
.aeg-compare.is-horizontal-center { margin-left: auto !important; margin-right: auto !important; }
.aeg-compare.is-horizontal-right { margin-left: auto !important; margin-right: 0 !important; }

.aeg-compare__stage {
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	aspect-ratio: 3 / 2;
	background: #111;
	cursor: ew-resize;
	overflow: hidden;
	position: relative;
	touch-action: pan-y;
	user-select: none;
	width: 100%;
}

.aeg-compare__stage * {
	-webkit-user-select: none;
	user-select: none;
}

.aeg-compare__range {
	-webkit-appearance: none;
	appearance: none;
	background: transparent;
	border: 0;
	cursor: ew-resize;
	height: 100%;
	inset: 0;
	margin: 0;
	opacity: 0;
	padding: 0;
	position: absolute;
	touch-action: none;
	width: 100%;
	z-index: 5;
}

.aeg-compare__range::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	height: 42px;
	width: 42px;
}

.aeg-compare__range:focus-visible {
	opacity: 0.001;
	outline: 3px solid #2271b1;
	outline-offset: -3px;
}

/*
 * Defensive compatibility with cached markup from 1.1.0. Editorial
 * Galleries' Story presentation can wrap the first image in a film-frame
 * span. A comparison stage is not a single-photo Story item, so neutralize
 * that wrapper if it is ever present and let the two slider images fill the
 * same stage as intended.
 */
.aeg-compare__stage > .aeg-film-frame {
	background: transparent !important;
	height: 100% !important;
	inset: 0 !important;
	max-width: none !important;
	overflow: visible !important;
	padding: 0 !important;
	position: absolute !important;
	width: 100% !important;
}

.aeg-compare__stage > .aeg-film-frame::after {
	content: none !important;
}

.aeg-compare__stage > .aeg-film-frame > .aeg-compare__img {
	height: 100% !important;
	max-width: none !important;
	width: 100% !important;
}

.aeg-compare__img {
	-webkit-user-drag: none;
	display: block;
	height: 100%;
	inset: 0;
	object-fit: cover;
	pointer-events: none;
	position: absolute;
	width: 100%;
}

.aeg-compare__img--before {
	clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}

.aeg-compare__handle {
	background: rgba(255, 255, 255, 0.96);
	bottom: 0;
	left: var(--pos);
	position: absolute;
	pointer-events: none;
	top: 0;
	transform: translateX(-1px);
	width: 2px;
	z-index: 4;
}

.aeg-compare__knob {
	align-items: center;
	background: #fff;
	border-radius: 999px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
	color: #111;
	display: flex;
	height: 42px;
	justify-content: center;
	left: 50%;
	position: absolute;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 42px;
}

.aeg-compare__label {
	background: rgba(0, 0, 0, 0.58);
	border-radius: 2px;
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	padding: 6px 9px;
	position: absolute;
	pointer-events: none;
	text-transform: uppercase;
	top: 14px;
	z-index: 3;
}

.aeg-compare__label--before {
	left: 14px;
}

.aeg-compare__label--after {
	right: 14px;
}

.aeg-compare__toggles {
	display: flex;
	gap: 6px;
	justify-content: center;
	margin-bottom: 10px;
}

.aeg-compare__toggle {
	background: transparent;
	border: 1px solid currentColor;
	border-radius: 999px;
	color: inherit;
	cursor: pointer;
	font: inherit;
	font-size: 12px;
	line-height: 1;
	opacity: 0.58;
	padding: 7px 12px;
}

.aeg-compare__toggle.is-active {
	background: #111;
	border-color: #111;
	color: #fff;
	opacity: 1;
}

@media (min-width: 601px) {
	.single-product .woocommerce-Tabs-panel--description .aeg-compare {
		max-width: none;
		width: var(--aeg-compare-product-width, var(--aeg-story-item-width, 82%));
	}

	.single-product .woocommerce-Tabs-panel--description .aeg-compare.is-horizontal-center {
		left: 50%;
		position: relative;
		transform: translateX(-50%);
	}

	.single-product .woocommerce-Tabs-panel--description .aeg-compare.is-horizontal-right {
		left: 100%;
		position: relative;
		transform: translateX(-100%);
	}
}

@media (max-width: 600px) {
	.aeg-compare {
		left: auto !important;
		transform: none !important;
		width: 100%;
	}

	.aeg-compare__knob {
		height: 36px;
		width: 36px;
	}

	.aeg-compare__label {
		font-size: 10px;
		padding: 5px 7px;
		top: 10px;
	}

	.aeg-compare__label--before {
		left: 10px;
	}

	.aeg-compare__label--after {
		right: 10px;
	}
}
