/* Before & After Slider — bricks-before-after v1.5 */

/*
 * O elemento-raiz do Bricks renderiza o .bba-wrapper diretamente.
 * Os estilos da aba Style (width, height, min-width, etc.) são aplicados
 * pelo Bricks nesse elemento-raiz — que agora É o .bba-wrapper.
 */
.bba-wrapper {
    position: relative !important;
    overflow: hidden;
    cursor: col-resize;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    display: block;
    line-height: 0;
    /* width/height/min-width/max-width controlados pela aba Style do Bricks */
}

.bba-wrapper[data-mode="drag"]              { cursor: grab; }
.bba-wrapper[data-mode="drag"].bba-dragging { cursor: grabbing; }

/* Placeholder (sem imagens) */
.bba-wrapper.bba-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 2rem;
    text-align: center;
    border: 2px dashed #ccc;
    border-radius: 8px;
    color: #888;
    min-height: 120px;
    line-height: 1.5;
}

/*
 * EMPILHAMENTO: pela ordem do DOM.
 * .bba-after  vem primeiro  → fica embaixo (sempre visível)
 * .bba-before vem por último → fica em cima (recortada pelo JS)
 */
.bba-before,
.bba-after {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Spacer invisível — só existe quando aspect = auto */
.bba-spacer {
    display: block;
    width: 100%;
    height: auto;
    visibility: hidden;
    pointer-events: none;
    position: relative;
}

.bba-before img,
.bba-after img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    pointer-events: none !important;
    border-radius: inherit;
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
}

/* Divisor vertical */
.bba-divider {
    position: absolute !important;
    top: 0 !important;
    width: 2px !important;
    height: 100% !important;
    background: #ffffff;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 10;
}

/* Handle circular */
.bba-handle {
    position: absolute !important;
    top: 50% !important;
    width: 44px;
    height: 44px;
    background: #ffffff;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.15);
    display: flex !important;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 11;
    color: #555;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    line-height: 0;
}
.bba-handle svg {
    width: 20px;
    height: 20px;
    display: block;
    flex-shrink: 0;
}

/* Labels */
.bba-label {
    position: absolute !important;
    top: 12px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
    padding: 4px 10px !important;
    border-radius: 99px !important;
    pointer-events: none !important;
    z-index: 5;
    line-height: 1.4 !important;
    opacity: 1;
    transition: opacity 0.25s ease;
}
.bba-label-before {
    left: 12px !important;
    background: rgba(0,0,0,0.55) !important;
    color: #ffffff !important;
}
.bba-label-after {
    right: 12px !important;
    background: rgba(255,255,255,0.88) !important;
    color: #1a1a1a !important;
}

/* Dica */
.bba-hint {
    text-align: center;
    font-size: 12px;
    color: #888;
    margin: 8px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    line-height: 1.5;
}
.bba-hint svg { flex-shrink: 0; opacity: 0.6; }

@media (max-width: 600px) {
    .bba-label { font-size: 10px !important; padding: 3px 8px !important; top: 8px !important; }
    .bba-label-before { left: 8px !important; }
    .bba-label-after  { right: 8px !important; }
    .bba-handle { width: 36px; height: 36px; }
    .bba-handle svg { width: 16px; height: 16px; }
}
