/* ==========================================================
   DPV Before / After Compare — Stylesheet v1.0.1
   Image comparison slider — no text/badges, pure visual.
   ========================================================== */


/* ----------------------------------------------------------
   ELEMENTOR FLEX CONTAINER FIX
   Elementor container width = Default/Auto can shrink-wrap widgets.
   Because the image layers in this component are absolutely positioned,
   the widget has no natural content width and may collapse to the slider line.
   Give this widget a real width by default so it remains visible without
   manually setting Elementor Width to Full Width.
---------------------------------------------------------- */
.elementor-widget-dpv_before_after,
.elementor-widget-dpv_before_after > .elementor-widget-container {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.dpv-ba-wrapper {
    --dpv-ba-line-size: 2px;

    display: block;
    position: relative;
    width: 100%;
    inline-size: 100%;
    min-width: min(280px, 100%);
    height: 480px;
    max-width: 100%;
    overflow: hidden;
    border-radius: 12px;
    background: #e8e8ea;
    user-select: none;
    touch-action: pan-y;
}

/* ----------------------------------------------------------
   IMAGE LAYERS
---------------------------------------------------------- */
.dpv-ba-image-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: transparent;
}

.dpv-ba-before {
    z-index: 1;
}

.dpv-ba-after {
    z-index: 2;
    will-change: clip-path;
}

.dpv-ba-img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100% !important;
    height: 100% !important;
    min-width: 100%;
    min-height: 100%;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    object-fit: cover;
    object-position: center center;
    pointer-events: none;
}

/* ----------------------------------------------------------
   SLIDER LINE
---------------------------------------------------------- */
.dpv-ba-line {
    position: absolute;
    z-index: 3;
    background-color: #7c5cff;
    pointer-events: none;
}

/* Horizontal: vertical line, full height */
.dpv-ba-horizontal .dpv-ba-line {
    top: 0;
    bottom: 0;
    left: 50%;
    width: var(--dpv-ba-line-size);
    transform: translateX(-50%);
}

/* Vertical: horizontal line, full width */
.dpv-ba-vertical .dpv-ba-line {
    left: 0;
    right: 0;
    top: 50%;
    height: var(--dpv-ba-line-size);
    transform: translateY(-50%);
}

/* ----------------------------------------------------------
   HANDLE
---------------------------------------------------------- */
.dpv-ba-handle {
    position: absolute;
    width: 48px;
    height: 48px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 4;
    cursor: grab;
}

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

.dpv-ba-handle svg {
    width: 50%;
    height: 50%;
    stroke: #7c5cff;
    pointer-events: none;
}

.dpv-ba-handle:focus-visible {
    outline: 2px solid #7c5cff;
    outline-offset: 2px;
}

/* Horizontal: handle centered on vertical line */
.dpv-ba-horizontal .dpv-ba-handle {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    cursor: ew-resize;
}

/* Vertical: handle centered on horizontal line */
.dpv-ba-vertical .dpv-ba-handle {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    cursor: ns-resize;
}

/* Keep page scrolling natural on touch devices. */
.dpv-ba-horizontal {
    touch-action: pan-y;
}

.dpv-ba-vertical {
    touch-action: pan-x;
}

/* ----------------------------------------------------------
   RESPONSIVE
---------------------------------------------------------- */
@media (max-width: 767px) {
    .dpv-ba-wrapper {
        height: 320px;
    }

    .dpv-ba-handle {
        width: 40px;
        height: 40px;
    }
}
