/* ═══════════════════════════════════════════════
   Before After Slider – bas.css
   ═══════════════════════════════════════════════ */

.bas-wrapper {
    position: relative;
    display: block;
    width: 100%;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    cursor: col-resize;
    border-radius: 8px;
    /* GPU hint */
    will-change: contents;
}

.bas-wrapper[data-orientation="vertical"] {
    cursor: row-resize;
}

/* ── Imágenes ──────────────────────────────────── */
.bas-img {
    display: block;
    width: 100%;
    line-height: 0;
}

.bas-img img {
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
    -webkit-user-drag: none;
}

/* AFTER ocupa el espacio base */
.bas-img-after {
    position: relative;
    z-index: 1;
}

/* BEFORE se superpone con clip-path — misma posición y tamaño que AFTER */
.bas-img-before {
    position: absolute;
    inset: 0;
    z-index: 2;
    overflow: hidden;
    clip-path: inset(0 50% 0 0);
    will-change: clip-path;
    transition: clip-path 0ms linear;
}

.bas-img-before img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
}

/* Vertical: clip desde abajo */
.bas-wrapper[data-orientation="vertical"] .bas-img-before {
    clip-path: inset(0 0 50% 0);
}

/* ── Etiquetas ─────────────────────────────────── */
.bas-label {
    position: absolute;
    bottom: 12px;
    padding: 4px 10px;
    border-radius: 4px;
    background: rgba(0,0,0,.45);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .02em;
    line-height: 1;
    pointer-events: none;
    z-index: 10;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

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

/* En vertical las etiquetas van arriba/abajo */
.bas-wrapper[data-orientation="vertical"] .bas-label-before {
    bottom: auto;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
}
.bas-wrapper[data-orientation="vertical"] .bas-label-after {
    bottom: 12px;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
}

/* ── Handle wrap ───────────────────────────────── */
.bas-handle-wrap {
    position: absolute;
    z-index: 20;
    /* posición actualizada por JS */
    left: 50%;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateX(-50%);
    pointer-events: none;
    will-change: left, top;
}

.bas-wrapper[data-orientation="vertical"] .bas-handle-wrap {
    flex-direction: row;
    left: 0;
    right: 0;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
}

/* Líneas divisoras */
.bas-handle-line {
    flex: 1;
    width: 2px;
    background: #fff;
    opacity: .8;
}

.bas-wrapper[data-orientation="vertical"] .bas-handle-line {
    width: auto;
    height: 2px;
    flex: 1;
}

/* Círculo handle */
.bas-handle {
    position: relative;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff;
    border: none;
    box-shadow: 0 2px 12px rgba(0,0,0,.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: grab;
    pointer-events: all;
    transition: transform .15s ease, box-shadow .15s ease;
    padding: 0;
}

.bas-arrow {
    display: block;
    flex-shrink: 0;
}

.bas-handle:active { cursor: grabbing; transform: scale(1.08); }
.bas-handle:hover  { box-shadow: 0 4px 18px rgba(0,0,0,.4); }

/* Flechas dentro del handle */
.bas-handle-arrow {
    font-size: 18px;
    font-style: normal;
    font-weight: 900;
    line-height: 1;
    color: #333;
    display: block;
    user-select: none;
}

/* ── Responsive ────────────────────────────────── */
@media (max-width: 480px) {
    .bas-handle { width: 38px; height: 38px; }
    .bas-handle-arrow { font-size: 18px; }
    .bas-label { font-size: 11px; padding: 3px 8px; }
}
