.wpbac-compare {
    --wpbac-position: 50%;
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 1.5rem 0;
}

.wpbac-stage {
    position: relative;
    overflow: hidden;
    width: 100%;
    background: #111;
    border-radius: 8px;
    isolation: isolate;
    touch-action: pan-y;
}

.wpbac-image {
    display: block;
    width: 100%;
    height: auto;
    max-width: none;
    user-select: none;
    pointer-events: none;
}

.wpbac-image-after {
    position: relative;
    z-index: 1;
}

.wpbac-image-before {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    clip-path: inset(0 calc(100% - var(--wpbac-position)) 0 0);
}

.wpbac-label {
    position: absolute;
    top: 12px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.62);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
}

.wpbac-label-before {
    left: 12px;
}

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

.wpbac-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--wpbac-position);
    z-index: 3;
    width: 2px;
    background: #fff;
    transform: translateX(-50%);
    pointer-events: none;
}

.wpbac-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 42px;
    height: 42px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.42);
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.32);
    transform: translate(-50%, -50%);
}

.wpbac-handle::before,
.wpbac-handle::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 0;
    height: 0;
    transform: translateY(-50%);
}

.wpbac-handle::before {
    left: 9px;
    border-top: 6px solid transparent;
    border-right: 7px solid #fff;
    border-bottom: 6px solid transparent;
}

.wpbac-handle::after {
    right: 9px;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 7px solid #fff;
}

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

.wpbac-error {
    padding: 12px;
    border-left: 4px solid #d63638;
    background: #fff5f5;
    color: #7a1315;
}

@media (max-width: 600px) {
    .wpbac-label {
        top: 8px;
        min-height: 24px;
        padding: 3px 8px;
        font-size: 12px;
    }

    .wpbac-label-before {
        left: 8px;
    }

    .wpbac-label-after {
        right: 8px;
    }

    .wpbac-handle {
        width: 36px;
        height: 36px;
    }
}
