/* QI Before/After Slider for Divi */

.qi-ba {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
    cursor: col-resize;
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-y;
    background: #f5f5f5;
    --qi-ba-color: #ffffff;
    --qi-ba-line: 3px;
    --qi-ba-size: 32px;
}

.qi-ba-layer {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}

.qi-ba-before {
    z-index: 1;
    clip-path: inset(0 50% 0 0);
}

.qi-ba-after {
    z-index: 0;
}

.qi-ba-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    z-index: 2;
    width: var(--qi-ba-line);
    background: var(--qi-ba-color);
    transform: translateX(-50%);
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
}

.qi-ba-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: var(--qi-ba-size);
    height: var(--qi-ba-size);
    border-radius: 50%;
    background: var(--qi-ba-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.qi-ba-handle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    width: calc(var(--qi-ba-size) * 0.58);
    height: calc(var(--qi-ba-size) * 0.58);
    background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23525252' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'><path d='m9 7-5 5 5 5'/><path d='m15 7 5 5-5 5'/></svg>");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

/* Optional labels */
.qi-ba-label {
    position: absolute;
    bottom: 12px;
    z-index: 3;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    color: #171717;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    pointer-events: none;
}

.qi-ba-label-before { left: 12px; }
.qi-ba-label-after  { right: 12px; }

/* Builder placeholder */
.qi-ba-notice {
    padding: 24px;
    text-align: center;
    color: #737373;
    background: #f5f5f5;
    border: 1px dashed #d4d4d4;
    border-radius: 8px;
}

/* Keyboard focus */
.qi-ba:focus-visible {
    outline: 2px solid #7c3aed;
    outline-offset: 2px;
}
