/* Contenedor del Comparador */
.comparison-wrapper {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    aspect-ratio: 16/9;
    cursor: col-resize;
    background-color: #000; /* Fondo negro por si las imágenes cargan lento */
}

/* Imagen Base (Derecha - DESPUÉS) */
.comp-img-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    z-index: 1;
}

/* Imagen Superpuesta (Izquierda - ANTES - Recortada) */
.comp-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%; /* Inicialmente 50% */
    height: 100%;
    overflow: hidden; /* Esto es lo que recorta la imagen */
    z-index: 2;
    border-right: 3px solid #ffffff; /* Línea divisoria */
    box-shadow: 5px 0 15px rgba(0,0,0,0.3); /* Sombra en la línea de corte */
}

/* La imagen dentro del overlay debe medir el 100% del CONTENEDOR PADRE, no del overlay */
/* Esto se ajustará con JS para mayor precisión responsive */
.comp-overlay img {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    pointer-events: none;
    max-width: none; /* Importante para que no se escale */
}

/* Etiquetas (Badges) */
.label-badge {
    position: absolute;
    top: 20px;
    padding: 8px 18px;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    border-radius: 30px;
    z-index: 10;
    pointer-events: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.label-before {
    left: 20px;
    background: rgba(255, 255, 255, 0.9);
    color: #1a202c;
    border: 2px solid #fff;
}

.label-after {
    right: 20px;
    background: #00A9B4; /* Cyan Balimsa */
    color: white;
}

/* Slider Invisible */
.comparison-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    z-index: 20;
    margin: 0;
    cursor: col-resize;
    appearance: none; /* Reset para móviles */
}

/* Botón Central (Handle) */
.slider-handle {
    position: absolute;
    top: 50%;
    left: 50%; /* Se mueve con JS */
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: #00A9B4;
    border: 3px solid #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 5;
    pointer-events: none;
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
    transition: transform 0.2s;
}

.comparison-wrapper:hover .slider-handle {
    transform: translate(-50%, -50%) scale(1.1);
}