/* Vorher/Nachher Comparison Slider */

.p3-vorher-nachher-section {
    padding: var(--wp--preset--spacing--60) var(--wp--preset--spacing--30);
    margin: 0;
}

.p3-vorher-nachher-section .p3-vn-heading {
    text-align: center;
    margin-bottom: var(--wp--preset--spacing--40);
}

.p3-vn-slider {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    max-width: 900px;
    margin: 0 auto;
    cursor: col-resize;
    user-select: none;
    -webkit-user-select: none;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

.p3-vn-slider img {
    display: block;
    width: 100%;
    height: auto;
}

/* Before image — always visible as base layer */
.p3-vn-before {
    position: relative;
    z-index: 1;
}

/* After image — overlaid, clipped from right */
.p3-vn-after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    clip-path: inset(0 0 0 50%);
}

.p3-vn-after img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Draggable divider line */
.p3-vn-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 3px;
    background: #fff;
    z-index: 3;
    transform: translateX(-50%);
    pointer-events: none;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
}

/* Drag handle */
.p3-vn-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: #fff;
    border-radius: 50%;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    cursor: col-resize;
    pointer-events: auto;
}

.p3-vn-handle svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #1e293b;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Labels */
.p3-vn-label {
    position: absolute;
    top: 16px;
    z-index: 5;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 5px 14px;
    border-radius: 4px;
    pointer-events: none;
}

.p3-vn-label--before {
    left: 16px;
}

.p3-vn-label--after {
    right: 16px;
}

/* Scroll-reveal animation */
.p3-vn-slider[data-animate] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.p3-vn-slider[data-animate].is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 600px) {
    .p3-vn-handle {
        width: 36px;
        height: 36px;
    }

    .p3-vn-handle svg {
        width: 16px;
        height: 16px;
    }

    .p3-vn-label {
        font-size: 11px;
        padding: 4px 10px;
        top: 10px;
    }

    .p3-vn-label--before {
        left: 10px;
    }

    .p3-vn-label--after {
        right: 10px;
    }
}
