
.before-after-slider {
    position: relative;

    width: 100%;
    aspect-ratio: 4 / 3;

    overflow: hidden;

    background: #e7ddd3;
}


.after-image {
    position: absolute;

    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: center;

    display: block;

    z-index: 1;
}


.before-image-wrapper {
    position: absolute;

    top: 0;
    left: 0;

    width: 50%;
    height: 100%;

    overflow: hidden;

    z-index: 2;
}


.before-image {
    position: absolute;

    top: 0;
    left: 0;

    height: 100%;

    max-width: none;

    object-fit: cover;
    object-position: center;

    display: block;
}



.slider-line {
    position: absolute;

    top: 0;
    bottom: 0;
    left: 50%;

    width: 1px;

    background: rgba(255, 255, 255, 0.95);

    transform: translateX(-50%);

    z-index: 4;

    pointer-events: none;
}



.slider-handle {
    position: absolute;

    top: 50%;
    left: 50%;

    width: 54px;
    height: 54px;

    transform: translate(-50%, -50%);

    border: none;
    border-radius: 50%;

    background: #f8f4ef;
    color: #2f2925;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 6px;

    font-size: 18px;

    z-index: 5;

    pointer-events: none;

    box-shadow: 0 8px 25px rgba(47, 41, 37, 0.15);
}


.before-label,
.after-label {
    position: absolute;

    top: 20px;

    z-index: 6;

    padding: 8px 12px;

    background: rgba(248, 244, 239, 0.9);

    font-size: 10px;

    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.before-label {
    left: 20px;
}

.after-label {
    right: 20px;
}



.comparison-range {
    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    opacity: 0;

    cursor: ew-resize;

    z-index: 10;
}



@media (max-width: 700px) {

    .before-after-slider {
        width: 100%;
        aspect-ratio: 4 / 3;
    }

    .after-image {
        width: 100%;
        height: 100%;

        object-fit: cover;
        object-position: center;
    }

    .before-image-wrapper {
        height: 100%;
    }

    .before-image {
        width: 200%;
        height: 100%;

        max-width: none;

        object-fit: cover;
        object-position: center;
    }

    .slider-handle {
        width: 42px;
        height: 42px;

        font-size: 14px;
    }

    .before-label,
    .after-label {
        top: 12px;

        padding: 6px 9px;

        font-size: 8px;
    }

    .before-label {
        left: 12px;
    }

    .after-label {
        right: 12px;
    }
}