/* =========================================
   Vio Before After Widget  —  vioweb.ir
   نویسنده: حسین نظری
   ========================================= */

/* ── پوسته بیرونی ── */
.vio-ba-outer {
    display: block;
    width: 100%;
    padding: 28px;
    box-sizing: border-box;
    background: linear-gradient(145deg, #E8A227 0%, #9B6FC8 100%);
    border-radius: 12px;
}

/* ── قاب تصویر ── */
.vio-ba-container {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: 18px;
    user-select: none;
    -webkit-user-select: none;
    cursor: col-resize;
    box-shadow: 0 8px 32px rgba(0,0,0,0.22);
}

/* ── تصویر بعد (پایه) ── */
.vio-ba-after {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* ── تصویر قبل (روکش) ── */
.vio-ba-before {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    overflow: hidden;
    background-size: cover;
    background-position: center left;
    background-repeat: no-repeat;
    will-change: width;
}

/* ── خط جداکننده ── */
.vio-ba-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ffffff;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 5;
    will-change: left;
}

/* ── هندل ── */
.vio-ba-handle {
    position: absolute;
    top: 50%;
    width: 56px;
    height: 56px;
    transform: translate(-50%, -50%);
    z-index: 10;
    cursor: grab;
    will-change: left;
    transition: transform 0.15s ease;
}

.vio-ba-handle:active {
    cursor: grabbing;
}

.vio-ba-handle-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    /* گرادیان دو رنگ روی هندل */
    background: linear-gradient(90deg, var(--vio-hleft, #C4AADF) 50%, var(--vio-hright, #E8B4C8) 50%);
    box-shadow: 0 4px 18px rgba(0,0,0,0.28);
    backdrop-filter: blur(2px);
    overflow: hidden;
}

/* ── فلش‌ها ── */
.vio-ba-arrow {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ── برچسب‌ها ── */
.vio-ba-label {
    position: absolute;
    bottom: 14px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(4px);
    pointer-events: none;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.vio-ba-label-before {
    left: 14px;
}

.vio-ba-label-after {
    right: 14px;
}

/* ── موبایل ── */
@media (max-width: 767px) {
    .vio-ba-outer {
        padding: 16px;
    }
    .vio-ba-container {
        height: 260px;
        border-radius: 12px;
    }
    .vio-ba-handle {
        width: 44px;
        height: 44px;
    }
    .vio-ba-arrow {
        width: 16px;
        height: 16px;
    }
}
