/* === Comparador Antes / Después para el Barrio Pesquero === */
.bp-comparador {
    position: relative;
    width: 100%;
    max-width: 780px;
    margin: 30px auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(10, 27, 63, 0.12);
    user-select: none;
    --pos: 50%;
}

.bp-comparador img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    pointer-events: none;
}

/* Capa superior histórica: mantiene dimensiones idénticas al contenedor y usa clip-path para no distorsionar el encuadre */
.bp-comparador .img-antes-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 2;
    clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0);
    -webkit-clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0);
}

.bp-comparador .img-antes-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Tirador interactivo con soporte de teclado y ratón */
.bp-comparador .slider-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--pos, 50%);
    width: 4px;
    background: #D4A853;
    z-index: 3;
    cursor: ew-resize;
    transform: translateX(-50%);
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    outline: none;
}

.bp-comparador .slider-handle:focus-visible {
    outline: 3px solid #0A1B3F;
    outline-offset: 3px;
}

.bp-comparador .slider-handle:focus-visible .slider-button {
    box-shadow: 0 0 0 3px #D4A853, 0 4px 14px rgba(0,0,0,0.4);
}

.bp-comparador .slider-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: #0A1B3F;
    border: 2px solid #D4A853;
    border-radius: 50%;
    color: #D4A853;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bp-comparador:hover .slider-button {
    transform: translate(-50%, -50%) scale(1.05);
}

.bp-comparador .badge-antes,
.bp-comparador .badge-despues {
    position: absolute;
    bottom: 12px;
    padding: 4px 12px;
    background: rgba(10, 27, 63, 0.85);
    color: #FFF8F0;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 4;
    pointer-events: none;
    border: 1px solid rgba(212, 168, 83, 0.4);
}

.bp-comparador .badge-antes { left: 12px; }
.bp-comparador .badge-despues { right: 12px; }
