/* ============================================================
   JB Simple Image Zoom  –  v1.0.0
   ============================================================ */

/* ── Container wrapping the image ── */
.jb-zoom-wrap {
    position: relative;
    overflow: hidden;
    cursor: grab;
    border-radius: 6px;
    background: #0a0a0a;
    /* Let the image define its own height */
    line-height: 0;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none; /* we handle touch ourselves */
}

.jb-zoom-wrap.jb-grabbing {
    cursor: grabbing;
}

/* ── The image itself ── */
.jb-zoom-wrap img {
    display: block;
    width: 100%;
    height: auto;
    transform-origin: 0 0;
    transition: transform 0.25s ease;
    pointer-events: none; /* prevents ghost drag */
    will-change: transform;
}

.jb-zoom-wrap.jb-panning img {
    transition: none; /* instant while dragging */
}

/* ── Controls bar ── */
.jb-zoom-controls {
    position: relative;
    margin-top: 10px;
    margin-left: auto;
    width: fit-content;
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 14px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18),
                0 2px 6px  rgba(0, 0, 0, 0.10);
    overflow: hidden;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Buttons ── */
.jb-zoom-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 56px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #1a1a1a;
    font-size: 28px;
    font-weight: 600;
    line-height: 1;
    transition: background 0.15s ease, color 0.15s ease;
    padding: 0;
    margin: 0;
    outline: none;
    -webkit-appearance: none;
}

.jb-zoom-btn:hover {
    background: rgba(0, 0, 0, 0.07);
}

.jb-zoom-btn:active {
    background: rgba(0, 0, 0, 0.14);
}

.jb-zoom-btn:disabled {
    opacity: 0.3;
    cursor: default;
    background: transparent !important;
}

/* SVG icons inside buttons */
.jb-zoom-btn svg {
    width: 28px;
    height: 28px;
    stroke: currentColor;
    stroke-width: 2.8;
    fill: none;
    stroke-linecap: round;
}

/* ── Zoom level label ── */
.jb-zoom-level {
    min-width: 64px;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: #333;
    letter-spacing: 0.02em;
    padding: 0 4px;
    border-left: 1px solid rgba(0, 0, 0, 0.10);
    border-right: 1px solid rgba(0, 0, 0, 0.10);
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Reset button ── */
.jb-zoom-btn-reset {
    font-size: 15px;
    font-weight: 700;
    width: auto;
    padding: 0 18px;
    color: #555;
    border-left: 1px solid rgba(0, 0, 0, 0.10);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.jb-zoom-btn-reset:hover {
    color: #1a1a1a;
}

/* ── Hide native magnifier overlays that may linger ── */
.zoomImg,
.drift-zoom-pane,
.xzoom-preview,
.xzoom-lens,
.xzoom-source,
.zoom-overlay,
.woocommerce-product-gallery__trigger,
.wd-product-zoom,
.zoomContainer,
img.zoomImg {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Override Woodmart zoom cursor */
.woocommerce-product-gallery__image a,
.woocommerce-product-gallery__image {
    cursor: default !important;
}

/* ── Responsive tweaks ── */
@media (max-width: 600px) {
    .jb-zoom-controls {
        bottom: 12px;
        right: 12px;
        border-radius: 10px;
    }

    .jb-zoom-btn {
        width: 50px;
        height: 48px;
        font-size: 24px;
    }

    .jb-zoom-btn svg {
        width: 24px;
        height: 24px;
    }

    .jb-zoom-level {
        min-width: 54px;
        font-size: 14px;
        height: 48px;
    }

    .jb-zoom-btn-reset {
        padding: 0 14px;
        font-size: 13px;
    }
}
