.before-after {
    position: relative;
    overflow: hidden;
}

.before-img, .after-img {
    width: 100%;
    height: auto;
    position: absolute;
    top: 0;
    left: 0;
}

.after-img {
    background: url('after.jpg') center center no-repeat;
    background-size: cover;
    z-index: 1;
}

.overlay {
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.5);
    z-index: 2;
    transition: width 0.3s ease;
}

.before-after:hover .overlay {
    width: 100%;
}
