before-after .ba-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 20px;
}

before-after img.ba-before,
before-after img.ba-after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    pointer-events: none;
    transition: opacity 0.6s ease;
}

before-after .ba-loader {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.6);
    z-index: 50;
    overflow: hidden;
    border-radius: 12px;
}

before-after .ba-loader::before {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(
        -90deg,
        rgba(220, 220, 220, 0.6) 0%,
        rgba(200, 200, 200, 0.6) 50%,
        rgba(220, 220, 220, 0.6) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

before-after .ba-handle {
    --ba-line-thickness: 5px;
    position: absolute;
    top: 0;
    bottom: 0;
    width: var(--ba-line-thickness);
    background: #fff;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

before-after .ba-grip {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: grab;
    transition: all 200ms ease-in-out;
}

before-after .ba-grip:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.56);
}

before-after .ba-grip:active {
    cursor: grabbing;
}


.ba-grip .arrow {
    display: inline-block;
    width: 9px;
    height: 16px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="9" height="16" viewBox="0 0 9 16" fill="none"><path d="M6.42195 15.061L1.12895 9.76797C0.896734 9.53581 0.712527 9.26018 0.586849 8.95683C0.461171 8.65347 0.396484 8.32833 0.396484 7.99997C0.396484 7.67161 0.461171 7.34646 0.586849 7.04311C0.712527 6.73975 0.896734 6.46412 1.12895 6.23197L6.42195 0.938965L8.54295 3.06096L3.59995 7.99997L8.53895 12.939L6.42195 15.061Z" fill="black"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
}

.flipped-180 {
    rotate: 180deg;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
