﻿/* ============================================================
   Comparison Block
   Stili strutturali + default visivi.
   I controlli Bricks sovrascrivono i default con CSS specifico
   per elemento, quindi non c'e conflitto.
   ============================================================ */

/* --- Wrapper --- */

.brxe-prefix-comparison {
	position: relative;
	width: 100%;
	overflow: hidden;
	cursor: ew-resize;
	touch-action: none; /* il gesto va ai pointer events, niente scroll/zoom del browser */
	/* aspect-ratio: 4 / 3; */
}

/* --- Figure (contiene tutto il visual) --- */

.prefix-comparison-figure {
	position: absolute;
	inset: 0;
	margin: 0;
	padding: 0;
}

/* --- Immagine dopo (sfondo pieno) --- */

.prefix-comparison-img-after {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* --- Divisor: clip dell'immagine prima --- */

.prefix-comparison-divisor {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	clip-path: inset(0 50% 0 0);
}

.prefix-comparison-img-before {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* --- Riga divisoria --- */

.prefix-comparison-handle {
	position: absolute;
	top: 0;
	left: 50%;
	width: 4px;
	height: 100%;
	background-color: #ffffff;
	transform: translateX(-50%);
	z-index: 20;
	box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
	cursor: ew-resize;
	pointer-events: none;
}

/* --- Pulsante cerchio --- */

.prefix-comparison-handle-btn {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 44px;
	height: 44px;
	background-color: #ffffff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 2px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
	z-index: 21;
	pointer-events: none;
}

/* --- Icone frecce --- */

.prefix-comparison-icon {
	font-size: 20px;
	color: #333333;
	line-height: 0;
	user-select: none;
}

/* --- Label Prima / Dopo --- */

.prefix-comparison-label {
	position: absolute;
	top: 12px;
	z-index: 15;
	background-color: rgba(0, 0, 0, 0.5);
	color: #ffffff;
	padding: 6px 12px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 500;
	pointer-events: none;
	transition: opacity 0.2s ease;
	white-space: nowrap;
}

.prefix-comparison-label-before {
	left: 12px;
}

.prefix-comparison-label-after {
	right: 12px;
}

/* --- Input range: sopra tutto, trasparente, cattura il drag --- */

.prefix-comparison-range {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	z-index: 10;
	margin: 0;
	pointer-events: none; /* interazione gestita via JS sul wrapper (pointer events) */
	-webkit-appearance: none;
	appearance: none;
}

/* --- Placeholder (nessuna immagine) --- */

.prefix-comparison-placeholder {
	padding: 20px;
	background: #f0f0f0;
	border-radius: 8px;
	text-align: center;
	color: #666;
}