/**
 * A2Z Before After – Navigation Dots  |  widget.css
 * Matches the visual style of A2Z Compare (a2z-compare-*)
 */

/* ── Widget wrapper ─────────────────────────────────────── */
.a2z-ba-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

/* ── Elementor padding reset ────────────────────────────── */
.elementor-widget-a2z-before-after .elementor-widget-container {
    --padding-top: 0px;
    --padding-right: 0px;
    --padding-bottom: 0px;
    --padding-left: 0px;
}

/* ── Header (same as a2z-compare) ───────────────────────── */
.a2z-ba-header-wrapper { width: 100%; margin-bottom: 15px; padding: 0; }

.a2z-ba-header-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 10px;
}
.a2z-ba-header-divider::before,
.a2z-ba-header-divider::after {
    content: '';
    flex: 1;
    height: 2px;
    background-color: #d5d5d5;
}
.a2z-ba-header-title {
    margin: 0;
    white-space: nowrap;
    line-height: 1;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 20px;
    font-family: 'Inter', sans-serif;
}
.a2z-ba-header-description {
    font-family: 'Inter', sans-serif;
    font-size: 16px !important;
    font-weight: 400;
    line-height: 24px;
    text-align: center;
    color: #7a7a7a;
    margin-top: 0 !important;
    padding: 0 60px 15px 60px;
    box-sizing: border-box;
}

/* ── Stage (the comparison area) ────────────────────────── */
.a2z-ba-stage {
    position: relative;
    width: 100%;
    max-width: 1152px;
    /* ratio is passed as a CSS variable from PHP — never inline style */
    aspect-ratio: var(--ba-ratio, 16 / 5);
    margin: 0 auto;
    overflow: hidden;
    background: #f0f0f0;
    cursor: pointer;
    touch-action: pan-y;
}

/* ── Slides (stacked, only .active is visible) ───────────── */
.a2z-ba-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 420ms cubic-bezier(0.4, 0, 0.2, 1);
}
.a2z-ba-slide.active {
    opacity: 1;
    pointer-events: auto;
}

/* ── Before / After layers — match a2z-compare exactly ──── */
.a2z-ba-before {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    /* clip updated by JS */
}
.a2z-ba-after {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    /* clip updated by JS */
}
.a2z-ba-before img,
.a2z-ba-after img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    max-width: none !important;
    pointer-events: none;
    -webkit-user-drag: none;
    draggable: false;
}

/* ── Labels — hidden ─────────────────────────────────────── */
.a2z-ba-label { display: none !important; }

/* ── Handle — identical to a2z-compare ──────────────────── */
.a2z-ba-handle {
    position: absolute;
    top: 0;
    width: 5px;
    height: 100%;
    background-color: #fff;
    z-index: 30;
    cursor: pointer;
    outline: none;
    touch-action: none;
    pointer-events: auto;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.a2z-ba-handle:focus {
    filter: drop-shadow(0 0 3px rgba(0,123,255,.5));
}
.a2z-ba-handle-svg {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 5px rgba(0,0,0,.3));
    flex-shrink: 0;
    z-index: 40;
}
.a2z-ba-handle-svg svg { width: 100%; height: 100%; display: block; }
.a2z-ba-handle-svg svg path { fill: #2b2b2b; }

/* ── Navigation arrows (slide switchers) ────────────────── */
.a2z-ba-nav {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    width: 40px; height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,.2);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 180ms ease, transform 180ms ease;
    padding: 0;
    pointer-events: auto;
}
.a2z-ba-nav:hover  { background: rgba(255,255,255,.38); transform: translateY(-50%) scale(1.1); }
.a2z-ba-nav:active { transform: translateY(-50%) scale(.93); }
.a2z-ba-prev { left: 14px; }
.a2z-ba-next { right: 14px; }

/* ── Navigation dots ────────────────────────────────────── */
.a2z-ba-dots {
    display: flex !important;
    visibility: visible !important;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-top: 0;
    padding: 14px 0;
    line-height: 1;
    /* subtle strip so dots are always readable regardless of page background */
    background: rgba(245,245,245,0.95);
    border-top: 1px solid rgba(0,0,0,0.06);
}
.a2z-ba-dot {
    -webkit-appearance: none !important;
    appearance: none !important;
    display: block !important;
    visibility: visible !important;
    width: 10px !important;
    height: 10px !important;
    border-radius: 50% !important;
    border: 2px solid #999 !important;         /* clearly visible on any bg */
    background: #bbb !important;               /* solid gray — never invisible */
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer;
    transition: background 200ms ease, border-color 200ms ease,
                transform 220ms cubic-bezier(.34,1.56,.64,1);
    flex-shrink: 0;
    line-height: 1;
    font-size: 0;
}
.a2z-ba-dot:hover  { transform: scale(1.25); border-color: #555 !important; background: #888 !important; }
.a2z-ba-dot.active {
    background: #1a1a1a !important;
    border-color: #1a1a1a !important;
    transform: scale(1.3);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
    /* Override the CSS variable — direct property wins over var() */
    .a2z-ba-stage {
        aspect-ratio: 4 / 3;
    }
    .a2z-ba-header-description { font-size: 14px !important; padding: 0; }
    .a2z-ba-header-title { font-size: 18px; }
    .a2z-ba-handle-svg  { width: 32px; height: 32px; }
    .a2z-ba-nav         { width: 32px; height: 32px; }
    .a2z-ba-prev        { left: 8px; }
    .a2z-ba-next        { right: 8px; }
}
