/* استایل اصلی اسلایدر - با قابلیت مرکزینگ */
.wmba-slider {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    /* مرکزینگ افقی */
    display: block;
    overflow: hidden;
    cursor: ew-resize;
    user-select: none;
    background: #f0f0f0;
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* کانتینر اصلی اسلایدر با قابلیت مرکزینگ */
.wmba-slider-container {
    position: relative;
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.wmba-slider-wrapper {
    position: relative;
    width: 100%;
    background: #e0e0e0;
    overflow: hidden;
    transform: translateZ(0);
    margin: 0 auto;
}

/* اطمینان از نمایش صحیح تصاویر */
.wmba-slider-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.wmba-before {
    z-index: 1;
}

.wmba-after {
    z-index: 2;
    will-change: clip-path;
    transform: translateZ(0);
}

/* دسته اسلایدر */
.wmba-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #ffffff;
    z-index: 10;
    cursor: ew-resize;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.2), 0 0 0 4px rgba(255,255,255,0.3);
    pointer-events: auto;
    transition: background 0.1s ease;
    transform: translateZ(0);
    will-change: left;
}

/* دکمه گرد روی دسته */
.wmba-handle::after {
    content: "⇄";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: #333;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
    pointer-events: none;
    transition: transform 0.1s ease, background 0.1s ease;
    cursor: ew-resize;
}

/* افکت شیشه‌ای */
.wmba-slider.glass .wmba-handle::after {
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.7);
}

/* حالت درگ */
.wmba-slider.dragging {
    cursor: ew-resize;
}

.wmba-slider.dragging .wmba-handle {
    background: #ffd700;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.3), 0 0 0 4px rgba(255,215,0,0.4);
    transition: none;
}

.wmba-slider.dragging .wmba-handle::after {
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(255, 215, 0, 0.9);
    transition: none;
}

.wmba-slider.dragging .wmba-after {
    will-change: clip-path;
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .wmba-handle::after {
        width: 34px;
        height: 34px;
        font-size: 16px;
    }
}

/* اطمینان از نمایش صحیح */
.wmba-before,
.wmba-after {
    opacity: 1;
    visibility: visible;
}

/* کاهش repaint در حین درگ */
.wmba-slider.dragging * {
    pointer-events: none;
}

.wmba-slider.dragging .wmba-handle {
    pointer-events: auto;
}

/* کلاس کمکی برای مرکزینگ در صفحه */
.wmba-slider-centered {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}