/* Before After Slider Section */
.ba-section {
    padding: 80px 20px;
    background-color: #ffffff;
}

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

.ba-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #313131;
    text-align: center;
    margin-bottom: 50px;
}

.ba-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.ba-slider {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    user-select: none;
    touch-action: pan-y;
}

.ba-slider img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ba-before {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    overflow: hidden;
    z-index: 2;
}

/* We need to ensure the before image is full width of the container even if its box is half width */
.ba-before img {
    width: auto;
    height: 100%;
    max-width: none;
}

.ba-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    max-width: none !important;
    background: #ffffff;
    z-index: 100;
    /* Force it to be above everything else */
    cursor: ew-resize;
    transform: translateX(-50%);
    pointer-events: auto;
    /* Enable interaction only on the handle */
    touch-action: none;
    /* Prevent scroll on touch devices when sliding */
}

.ba-handle::after {
    content: '';
    position: absolute;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 44px !important;
    height: 44px !important;
    max-width: none !important;
    background-color: #F25B0A !important;
    border: 3px solid #ffffff !important;
    border-radius: 50% !important;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.4) !important;
    box-sizing: border-box !important;
    display: block !important;
    z-index: 10 !important;
}

.ba-label {
    position: absolute;
    bottom: 20px;
    padding: 8px 15px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 4px;
    pointer-events: none;
    z-index: 1;
    /* Below the handle but above images */
    white-space: nowrap;
}

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

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

@media (max-width: 992px) {
    .ba-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .ba-grid {
        grid-template-columns: 1fr;
    }

    .ba-title {
        font-size: 2rem;
    }
}