/*-- -------------------------- -->
<---       Before & After        -->
<--- -------------------------- -*/

@media only screen and (min-width: 0rem) {
    #before-after {
        padding: var(--sectionPadding);
        background-color: #f8f9fb;
        text-align: center;
    }

    #before-after .cs-container {
        width: 100%;
        max-width: 80rem;
        margin: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2.5rem;
    }

    #before-after .cs-title {
        font-family: 'Outfit', sans-serif;
        font-size: clamp(1.75rem, 4vw, 2.75rem);
        font-weight: 900;
        text-transform: uppercase;
        line-height: 1.15em;
        color: #1a1a1a;
        margin: 0;
    }

    #before-after .cs-title span {
        color: var(--primary);
    }

    /* Grid of sliders */
    #before-after .ba-grid {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        gap: 1.5rem;
        list-style: none;
        margin: 0;
        padding: 0;
    }

    /* Individual slider wrapper */
    .ba-item {
        position: relative;
        width: 100%;
        border-radius: 0.75rem;
        overflow: hidden;
        box-shadow: 0 8px 32px rgba(0,0,0,0.12);
        cursor: col-resize;
        user-select: none;
        -webkit-user-select: none;
        aspect-ratio: 4/3;
    }

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

    /* After image sits on top, clipped by clip-path */
    .ba-after {
        clip-path: inset(0 50% 0 0);
        transition: clip-path 0.05s linear;
        z-index: 1;
    }

    /* Labels */
    .ba-label {
        position: absolute;
        bottom: 1rem;
        z-index: 3;
        font-family: 'Outfit', sans-serif;
        font-size: 0.75rem;
        font-weight: 900;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: #fff;
        background-color: var(--primary);
        padding: 0.3rem 0.75rem;
        border-radius: 2rem;
        pointer-events: none;
    }

    .ba-label-before {
        left: 1rem;
    }

    .ba-label-after {
        right: 1rem;
    }

    /* Divider line */
    .ba-divider {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 50%;
        width: 3px;
        background-color: #fff;
        transform: translateX(-50%);
        z-index: 4;
        pointer-events: none;
        box-shadow: 0 0 8px rgba(0,0,0,0.3);
    }

    /* Handle button */
    .ba-handle {
        position: absolute;
        top: 50%;
        left: 50%;
        width: 2.75rem;
        height: 2.75rem;
        background-color: var(--primary);
        border: 3px solid #fff;
        border-radius: 50%;
        transform: translate(-50%, -50%);
        z-index: 5;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 0.25rem;
        pointer-events: none;
        box-shadow: 0 2px 12px rgba(0,0,0,0.25);
    }

    .ba-handle svg {
        width: 1.1rem;
        height: 1.1rem;
        fill: #fff;
        flex-shrink: 0;
    }

    /* CTA button */
    #before-after .cs-btn {
        font-family: 'Outfit', sans-serif;
        font-size: 0.9375rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        text-decoration: none;
        padding: 0.875rem 2.5rem;
        background-color: transparent;
        color: var(--primary);
        border: 2px solid var(--primary);
        border-radius: 0.375rem;
        display: inline-block;
        transition: background-color 0.3s, color 0.3s;
    }

    #before-after .cs-btn:hover {
        background-color: var(--primary);
        color: #fff;
    }
}

@media only screen and (min-width: 48rem) {
    #before-after .ba-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
