/*
 * Ecom Before After Slider
 * Isolated classes to avoid conflicts with themes, WooCommerce, Elementor, and other plugins.
 */

.ecom-bas-slider {
    --ecom-bas-position: 50%;
    --ecom-bas-width: 100%;
    --ecom-bas-height: 480px;
    --ecom-bas-fit: cover;
    --ecom-bas-radius: 14px;

    position: relative;
    width: min(100%, var(--ecom-bas-width));
    height: var(--ecom-bas-height);
    margin: 0 auto;
    overflow: hidden;
    border-radius: var(--ecom-bas-radius);
    background: #f2f2f2;
    isolation: isolate;
    touch-action: none;
    user-select: none;
    box-sizing: border-box;
}

.ecom-bas-slider *,
.ecom-bas-slider *::before,
.ecom-bas-slider *::after {
    box-sizing: border-box;
}

.ecom-bas-has-shadow {
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.16);
}

.ecom-bas-image,
.ecom-bas-after-wrap {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.ecom-bas-image {
    display: block;
    max-width: none !important;
    object-fit: var(--ecom-bas-fit);
    object-position: center;
    pointer-events: none;
    user-select: none;
}

.ecom-bas-image-before {
    z-index: 1;
}

.ecom-bas-after-wrap {
    z-index: 2;
    overflow: hidden;
    clip-path: inset(0 calc(100% - var(--ecom-bas-position)) 0 0);
}

.ecom-bas-range {
    position: absolute;
    inset: 0;
    z-index: 6;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: ew-resize;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
}

.ecom-bas-range::-webkit-slider-thumb {
    width: 44px;
    height: 44px;
    cursor: ew-resize;
    appearance: none;
    -webkit-appearance: none;
}

.ecom-bas-range::-moz-range-thumb {
    width: 44px;
    height: 44px;
    cursor: ew-resize;
    border: 0;
    background: transparent;
}

.ecom-bas-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--ecom-bas-position);
    z-index: 4;
    width: 3px;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.22);
    pointer-events: none;
}

.ecom-bas-handle {
    position: absolute;
    top: 50%;
    left: var(--ecom-bas-position);
    z-index: 5;
    width: 48px;
    height: 48px;
    transform: translate(-50%, -50%);
    border: 3px solid #ffffff;
    border-radius: 999px;
    background: rgba(17, 17, 17, 0.38);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(5px);
    pointer-events: none;
}

.ecom-bas-arrow {
    position: absolute;
    top: 50%;
    width: 0;
    height: 0;
    transform: translateY(-50%);
}

.ecom-bas-arrow-left {
    left: 12px;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-right: 8px solid #ffffff;
}

.ecom-bas-arrow-right {
    right: 12px;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 8px solid #ffffff;
}

.ecom-bas-label {
    position: absolute;
    top: 16px;
    z-index: 3;
    max-width: calc(50% - 18px);
    padding: 7px 12px;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.48);
    font-size: 13px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    pointer-events: none;
    backdrop-filter: blur(5px);
}

.ecom-bas-label-before {
    left: 16px;
}

.ecom-bas-label-after {
    right: 16px;
}

.ecom-bas-error {
    padding: 12px 14px;
    border-left: 4px solid #d63638;
    background: #fff5f5;
    color: #6b1515;
}

@media (max-width: 767px) {
    .ecom-bas-slider {
        --ecom-bas-height: min(420px, 72vw);
    }

    .ecom-bas-handle {
        width: 42px;
        height: 42px;
    }

    .ecom-bas-label {
        top: 12px;
        padding: 6px 10px;
        font-size: 11px;
    }

    .ecom-bas-label-before {
        left: 12px;
    }

    .ecom-bas-label-after {
        right: 12px;
    }
}
