/* ── Toggle button ────────────────────────────────────────────────────── */
#model-toggle {
    display: inline-block;
    margin-top: 8px;
    background: none;
    border: none;
    color: #777;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    pointer-events: auto;
    /* position:relative creates a stacking context so z-index is honoured,
       keeping the button above WoodMart gallery overlay layers on desktop */
    position: relative;
    z-index: 10;
}

#model-toggle:hover {
    color: #000;
}

/* ── Model viewer ─────────────────────────────────────────────────────── */
#sassy-model-viewer {
    position: relative;
    width: 100%;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

/* ── Slides ───────────────────────────────────────────────────────────── */
.sassy-model-slide {
    display: none;
}

.sassy-model-slide.sassy-active {
    display: block;
}

.sassy-model-slide img {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none; /* prevent drag interference */
}

/* ── Prev / Next arrows ───────────────────────────────────────────────── */
.sassy-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s, opacity 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.sassy-prev { left: 10px; }
.sassy-next { right: 10px; }

.sassy-arrow:hover {
    background: #fff;
}

.sassy-arrow.sassy-arrow-disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

/* ── Dot indicators ───────────────────────────────────────────────────── */
.sassy-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 10px 0 4px;
}

.sassy-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    cursor: pointer;
    transition: background 0.2s;
}

.sassy-dot.sassy-dot-active {
    background: #555;
}

/* ── Mobile: float toggle button over the gallery as a pill ───────────── */
@media (max-width: 768px) {
    .woocommerce-product-gallery {
        position: relative;
    }

    #model-toggle {
        position: absolute;
        top: 12px;
        right: 12px;
        z-index: 99;
        background: rgba(255, 255, 255, 0.95);
        padding: 6px 12px;
        border-radius: 20px;
        font-size: 12px;
        text-decoration: none;
        box-shadow: 0 2px 6px rgba(0,0,0,0.15);
        margin-top: 0;
    }

    /* Smaller arrows on mobile — fingers have less precision than cursors */
    .sassy-arrow {
        width: 28px;
        height: 28px;
        font-size: 18px;
    }
}
