/**
 * Estilos do Slider Comparativo Antes/Depois — PRST Engine.
 *
 * Layout responsivo com handle arrastável, labels sobrepostos
 * e animações suaves.
 *
 * @package PRST_Engine
 * @since   1.0.0
 */

/* ============================================================
   Container Principal
   ============================================================ */
.prst-compare {
    --prst-handle-color: #ffffff;
    --prst-handle-size: 40px;
    --prst-handle-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    --prst-label-bg: rgba(0, 0, 0, 0.55);
    --prst-label-color: #ffffff;

    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    cursor: col-resize;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    line-height: 0;
}

.prst-compare--dragging {
    cursor: grabbing;
}

/* ============================================================
   Camada "Antes" (Abaixo)
   ============================================================ */
.prst-compare__before {
    position: relative;
    width: 100%;
    display: block;
}

.prst-compare__before-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* ============================================================
   Camada "Depois" (Acima, recortada)
   ============================================================ */
.prst-compare__after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: inset(0 0 0 50%);
    transition: clip-path 0s;
}

.prst-compare__after-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* ============================================================
   Handle (Barra Divisória)
   ============================================================ */
.prst-compare__handle {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: var(--prst-handle-color);
    transform: translateX(-50%);
    z-index: 10;
    cursor: col-resize;
    box-shadow: var(--prst-handle-shadow);
    outline: none;
}

.prst-compare__handle::before,
.prst-compare__handle::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
}

/* Seta para cima */
.prst-compare__handle::before {
    top: 50%;
    margin-top: calc(var(--prst-handle-size) * -0.75);
}

/* Seta para baixo */
.prst-compare__handle::after {
    top: 50%;
    margin-top: calc(var(--prst-handle-size) * 0.25);
}

/* Botão circular no meio do handle */
.prst-compare__handle-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: var(--prst-handle-size);
    height: var(--prst-handle-size);
    border-radius: 50%;
    background: var(--prst-handle-color);
    box-shadow: var(--prst-handle-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 11;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.prst-compare__handle-btn:hover,
.prst-compare--dragging .prst-compare__handle-btn {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Ícone de setas dentro do botão */
.prst-compare__handle-icon {
    display: flex;
    align-items: center;
    gap: 4px;
}

.prst-compare__handle-icon::before,
.prst-compare__handle-icon::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
}

/* Seta esquerda */
.prst-compare__handle-icon::before {
    border-width: 6px 8px 6px 0;
    border-color: transparent #555 transparent transparent;
}

/* Seta direita */
.prst-compare__handle-icon::after {
    border-width: 6px 0 6px 8px;
    border-color: transparent transparent transparent #555;
}

/* ============================================================
   Labels Antes/Depois
   ============================================================ */
.prst-compare__label {
    position: absolute;
    bottom: 16px;
    padding: 6px 14px;
    background: var(--prst-label-bg);
    color: var(--prst-label-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: 20px;
    z-index: 5;
    pointer-events: none;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.prst-compare:hover .prst-compare__label {
    opacity: 1;
}

.prst-compare__label--before {
    left: 16px;
}

.prst-compare__label--after {
    right: 16px;
}

/* ============================================================
   Responsivo
   ============================================================ */
@media (max-width: 600px) {
    .prst-compare {
        border-radius: 8px;
        --prst-handle-size: 34px;
    }

    .prst-compare__label {
        font-size: 10px;
        padding: 4px 10px;
        bottom: 10px;
    }

    .prst-compare__label--before {
        left: 10px;
    }

    .prst-compare__label--after {
        right: 10px;
    }
}

/* ============================================================
   Shortcode Wrapper
   ============================================================ */
.prst-compare-wrapper {
    margin: 24px 0;
}

.prst-compare-wrapper .prst-compare-title {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #333;
}
