/* =========================================
   BEFORE & AFTER SLIDER COMPONENT
   ========================================= */

.ba-section {
    padding: var(--_size-variables---element-spacing--15xl) 0;
    background-color: #ffffff; /* Match the pure white theme of the site */
}

.ba-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.ba-header {
    text-align: center;
    margin-bottom: var(--_size-variables---element-spacing--10xl);
}

.ba-slider-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    height: 500px;
    overflow: hidden;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(1, 31, 35, 0.1);
    touch-action: pan-y; /* Allow vertical scroll on mobile, block horizontal */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.ba-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
    -webkit-user-drag: none;
}

/* The 'Before' image wrapper is cropped using clip-path */
.ba-before-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
    z-index: 10;
}

.ba-before-wrapper .ba-image {
    width: 100%; 
}

/* The Handle */
.ba-handle {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: #fff;
    z-index: 20;
    transform: translateX(-50%);
    cursor: ew-resize;
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
}

/* The Slider Button on the handle */
.ba-slider-button {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 48px;
    height: 48px;
    background: var(--primitive-color--primary-500, #24a3b1);
    color: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    border: 3px solid #fff;
    transition: transform 0.2s ease, background 0.2s ease;
}

.ba-handle:hover .ba-slider-button,
.ba-handle:active .ba-slider-button {
    transform: translate(-50%, -50%) scale(1.1);
    background: var(--primitive-color--primary-900, #011f23);
}

/* Labels */
.ba-label {
    position: absolute;
    bottom: 24px;
    padding: 8px 16px;
    background: rgba(1, 31, 35, 0.7);
    color: #fff;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    z-index: 15;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.ba-label-before {
    left: 24px;
}

.ba-label-after {
    right: 24px;
}

@media (max-width: 767px) {
    .ba-slider-container {
        height: 350px;
        border-radius: 16px;
    }
    
    .ba-slider-button {
        width: 40px;
        height: 40px;
    }
}
