/* ==========================================================================
   LADICO Before After Slider — slider.css  v2.0.0
   5 stili handle, gestione colore via CSS custom property.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Contenitore
   -------------------------------------------------------------------------- */
.ladico-slider {
	--slider-color: #1e90ff;

	position: relative;
	display: block;
	width: 100%;
	overflow: hidden;
	user-select: none;
	-webkit-user-select: none;
	touch-action: none;
	cursor: ew-resize;
	line-height: 0;
}

/* --------------------------------------------------------------------------
   Immagine "Prima" — flusso normale, determina l'altezza del contenitore
   -------------------------------------------------------------------------- */
.ladico-slider__before {
	display: block;
	width: 100%;
}

.ladico-slider__before img {
	display: block;
	width: 100%;
	height: auto;
	pointer-events: none;
	max-width: none;
}

/* --------------------------------------------------------------------------
   Immagine "Dopo" — sovrapposta, clip-path aggiornato da JS
   -------------------------------------------------------------------------- */
.ladico-slider__after {
	position: absolute;
	inset: 0;
	clip-path: inset(0 50% 0 0);
	will-change: clip-path;
}

.ladico-slider__after img {
	display: block;
	width: 100%;
	height: 100% !important; /* protegge da height:auto dei temi */
	max-width: none;
	object-fit: cover;
	pointer-events: none;
}

/* --------------------------------------------------------------------------
   Divisore — asse mobile che contiene linea (::before) e knob
   -------------------------------------------------------------------------- */
.ladico-slider__divider {
	position: absolute;
	top: 0;
	left: 50%;
	height: 100%;
	width: 0;
	z-index: 4;
	cursor: ew-resize;
	touch-action: none;
}

.ladico-slider__divider::before {
	content: '';
	position: absolute;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	height: 100%;
	background: var(--slider-color);
	pointer-events: none;
}

/* --------------------------------------------------------------------------
   Handle knob — centrato sul divisore
   -------------------------------------------------------------------------- */
.ladico-slider__handle {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	cursor: ew-resize;
}

.ladico-arrow {
	flex-shrink: 0;
	pointer-events: none;
}

/* ==========================================================================
   STILE 1 — Cerchio minimale con ombreggiatura
   ========================================================================== */
.ladico-style-1 .ladico-slider__divider::before { width: 2px; }

.ladico-style-1 .ladico-slider__handle {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--slider-color);
	box-shadow:
		0 2px 16px rgba(0, 0, 0, 0.4),
		0 0 0 3px rgba(255, 255, 255, 0.2);
	gap: 4px;
}

.ladico-style-1 .ladico-arrow { width: 13px; height: 13px; }

/* ==========================================================================
   STILE 2 — Rettangolo verticale con icone freccia SVG
   ========================================================================== */
.ladico-style-2 .ladico-slider__divider::before { width: 3px; }

.ladico-style-2 .ladico-slider__handle {
	width: 44px;
	height: 60px;
	border-radius: 8px;
	background: var(--slider-color);
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
	gap: 2px;
}

.ladico-style-2 .ladico-arrow { width: 18px; height: 18px; }

/* ==========================================================================
   STILE 3 — Linea sottilissima con piccolo rombo centrale
   ========================================================================== */
.ladico-style-3 .ladico-slider__divider::before { width: 1px; opacity: 0.85; }

.ladico-style-3 .ladico-slider__handle {
	width: 16px;
	height: 16px;
	background: var(--slider-color);
	transform: translate(-50%, -50%) rotate(45deg);
	border-radius: 2px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.ladico-style-3 .ladico-arrow { display: none; }

/* ==========================================================================
   STILE 4 — Pill arrotondato (capsule orizzontale)
   ========================================================================== */
.ladico-style-4 .ladico-slider__divider::before { width: 2px; }

.ladico-style-4 .ladico-slider__handle {
	width: 72px;
	height: 36px;
	border-radius: 999px;
	background: var(--slider-color);
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
	gap: 6px;
}

.ladico-style-4 .ladico-arrow { width: 14px; height: 14px; }

/* ==========================================================================
   STILE 5 — Ghost: cerchio trasparente con solo bordo colorato
   ========================================================================== */
.ladico-style-5 .ladico-slider__divider::before { width: 2px; opacity: 0.7; }

.ladico-style-5 .ladico-slider__handle {
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.1);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	border: 2px solid var(--slider-color);
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
	gap: 4px;
}

.ladico-style-5 .ladico-arrow {
	width: 13px;
	height: 13px;
	stroke: var(--slider-color);
}

/* Anteprima admin — placeholder widget Elementor */
.ladico-el-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	min-height: 120px;
	background: #f0f0f0;
	color: #888;
	font-size: 13px;
	text-align: center;
	border: 2px dashed #ccc;
	border-radius: 4px;
	padding: 24px;
}
