/* ==========================================================================
   Doo Image Before/After — frontend styles
   ========================================================================== */

.doo-iba {
	box-sizing: border-box;
	cursor: pointer;
	line-height: 0;
	margin: 0;
	overflow: hidden;
	padding: 0;
	position: relative;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	max-width: 100%;
}

.doo-iba *,
.doo-iba ::before,
.doo-iba ::after { box-sizing: inherit; }

.doo-iba img,
.doo-iba picture > img { max-width: none; }

.doo-iba > img,
.doo-iba > picture > img {
	display: block;
	width: 100%;
	height: auto;
}

/* Cocoen envuelve la primera imagen en un <div> que se recorta para mostrar
   solo una porción (el lado "antes"). */
.doo-iba > div:first-child {
	left: 0;
	top: 0;
	overflow: hidden;
	position: absolute;
}

.doo-iba--horizontal > div:first-child {
	width: 50%;
	height: 100%;
}

.doo-iba--vertical > div:first-child {
	width: 100%;
	height: 50%;
}

/* Slider line */
.cocoen-drag {
	background: #fff;
	position: absolute;
	z-index: 2;
	box-shadow: 0 0 6px rgba(0, 0, 0, 0.35);
}

.doo-iba > div { z-index: 1; }

.doo-iba--horizontal .cocoen-drag {
	cursor: ew-resize;
	top: 0;
	bottom: 0;
	left: 50%;
	width: 3px;
	margin-left: -1.5px;
}

.doo-iba--vertical .cocoen-drag {
	cursor: ns-resize;
	left: 0;
	right: 0;
	top: 50%;
	height: 3px;
	margin-top: -1.5px;
	width: auto;
}

/* Handle (círculo centrado en la barra) */
.doo-iba .cocoen-drag::before {
	content: "";
	position: absolute;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
}

/* Flechas dentro del handle */
.doo-iba .cocoen-drag::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	pointer-events: none;
}

.doo-iba--horizontal .cocoen-drag::after {
	width: 20px;
	height: 10px;
	background:
		linear-gradient(45deg, transparent 50%, #333 50%) no-repeat 0 0 / 5px 5px,
		linear-gradient(-45deg, #333 50%, transparent 50%) no-repeat 0 100% / 5px 5px,
		linear-gradient(45deg, #333 50%, transparent 50%) no-repeat 100% 100% / 5px 5px,
		linear-gradient(-45deg, transparent 50%, #333 50%) no-repeat 100% 0 / 5px 5px;
}

.doo-iba--vertical .cocoen-drag::after {
	width: 10px;
	height: 20px;
	background:
		linear-gradient(135deg, transparent 50%, #333 50%) no-repeat 0 0 / 5px 5px,
		linear-gradient(-135deg, transparent 50%, #333 50%) no-repeat 100% 0 / 5px 5px,
		linear-gradient(45deg, #333 50%, transparent 50%) no-repeat 100% 100% / 5px 5px,
		linear-gradient(-45deg, #333 50%, transparent 50%) no-repeat 0 100% / 5px 5px;
}

/* Labels */
.doo-iba__label {
	position: absolute;
	z-index: 3;
	padding: 6px 12px;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-size: 14px;
	line-height: 1.2;
	pointer-events: none;
	border-radius: 4px;
}

.doo-iba--horizontal .doo-iba__label--before { top: 12px; left: 12px; }
.doo-iba--horizontal .doo-iba__label--after  { top: 12px; right: 12px; }
.doo-iba--vertical   .doo-iba__label--before { top: 12px; left: 12px; }
.doo-iba--vertical   .doo-iba__label--after  { bottom: 12px; left: 12px; }

/* Placeholder editor */
.doo-iba-placeholder {
	padding: 1.5em;
	border: 2px dashed #ccd0d4;
	text-align: center;
	color: #50575e;
}
