.sba-slider {
    --sba-position: 50%;
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    background: #eee;
    line-height: 0;
    isolation: isolate;
    aspect-ratio: 4 / 5;
}

.sba-slider[style*="--sba-height: auto"] {
    height: auto;
}

.sba-slider[style*="--sba-height:"] {
    height: var(--sba-height);
}

.sba-image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    user-select: none;
    -webkit-user-drag: none;
}

.sba-after-image { z-index: 1; }

.sba-before-image {
    z-index: 2;
    clip-path: inset(0 calc(100% - var(--sba-position)) 0 0);
}

.sba-divider {
    position: absolute;
    z-index: 6;
    top: 0;
    bottom: 0;
    left: var(--sba-position);
    width: 2px;
    background: #fff;
    transform: translateX(-50%);
    box-shadow: 0 0 2px rgba(0,0,0,.35);
    pointer-events: none;
}

.sba-label {
    position: absolute;
    bottom: 20px;
    z-index: 5;
    padding: 8px 14px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    border-radius: 3px;
    white-space: nowrap;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

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

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

.sba-handle {
    position: absolute;
    z-index: 8;
    top: 50%;
    left: var(--sba-position);
    transform: translate(-50%, -50%);
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: #303030;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    box-shadow: 0 3px 12px rgba(0,0,0,.28);
    pointer-events: none;
}

.sba-arrow {
    font: 400 29px/1 Arial, sans-serif;
    margin-top: -2px;
}

.sba-range {
    position: absolute;
    inset: 0;
    z-index: 10;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: ew-resize;
}

.sba-slider:focus-within .sba-handle {
    outline: 3px solid rgba(255,255,255,.95);
    outline-offset: 2px;
}

.sba-error {
    padding: 12px 16px;
    background: #f8f8f8;
    border: 1px solid #ddd;
    color: #333;
}

@media (max-width: 600px) {
    .sba-handle { width: 52px; height: 52px; }
    .sba-label { bottom: 12px; font-size: 12px; }
    .sba-before-label { left: 14px; }
    .sba-after-label { right: 14px; }
}
