/* ============================================================
   Strictly Stereo — Product Gallery  v2.0
   Desktop : thumbnail strip left | square main image right
   Mobile  : full-width square image | dot/lozenge overlay
   ============================================================ */

/* ── Outer grid ── */

.ss-gallery {
    display: grid;
    grid-template-columns: 112px 1fr;
    gap: 12px;
    align-items: stretch;
    width: 100%;
    margin-bottom: 2rem;
}

/* ── Thumbnail rail ── */

.ss-gallery__rail {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: none;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
    padding-right: 2px;
}

.ss-gallery__rail::-webkit-scrollbar       { width: 3px; }
.ss-gallery__rail::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

.ss-gallery__thumb {
    position: relative;
    display: block;
    width: 100px;
    height: 100px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 3px;       /* 3px as requested */
    overflow: hidden;
    cursor: pointer;
    background: #f5f5f5;
    flex-shrink: 0;
    transition: border-color 0.15s ease;
}

.ss-gallery__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ss-gallery__thumb:hover:not(.is-active) { border-color: #bbb; }
.ss-gallery__thumb.is-active             { border-color: #1a1a1a; }

/* ── Main panel ── */

.ss-gallery__main {
    position: relative;
    width: 100%;
}

/* ── Slides container — always square ── */

.ss-gallery__slides {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f5f5f5;
    overflow: hidden;
}

.ss-gallery__slide {
    position: absolute;
    inset: 0;
    display: none;
}

.ss-gallery__slide.is-active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Zoom link & image ── */

.ss-gallery__zoom {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    cursor: zoom-in;
}

.ss-gallery__zoom img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.15s ease;
}

/* Fade during variation swap */
.ss-gallery__slide.is-swapping .ss-gallery__zoom img { opacity: 0.5; }

/* ── Dot / lozenge nav — desktop: hidden ── */

.ss-gallery__dots { display: none; }

/* ============================================================
   Mobile  ≤ 640px
   - Hide rail
   - Show dot/lozenge overlay, no background/scrim
   ============================================================ */

@media ( max-width: 640px ) {

    .ss-gallery {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .ss-gallery__rail { display: none; }

    /* Dot strip — overlaid, centred at bottom of image */
    .ss-gallery__dots {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        position: absolute;
        bottom: 12px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 10;
        /* No background panel at all */
    }

    .ss-gallery__dot {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        border: none;
        padding: 0;
        pointer-events: none;   /* indicator only — navigation is by swipe */
        flex-shrink: 0;
        transition: width 0.2s ease, border-radius 0.2s ease, opacity 0.2s ease;

        /*
         * Product images are almost always on a white/light background.
         * Black (#1a1a1a) gives maximum contrast.
         * If you use dark lifestyle shots, swap to #fff here.
         */
        background: #1a1a1a;
        opacity: 0.3;
    }

    /* Active dot expands to a lozenge */
    .ss-gallery__dot.is-active {
        width: 22px;
        border-radius: 3px;
        opacity: 1;
    }

    /* Swipe affordance */
    .ss-gallery__slides {
        touch-action: pan-y;
    }
}

/* ============================================================
   Lightbox
   ============================================================ */

.ss-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba( 0, 0, 0, 0.9 );
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.ss-lightbox.is-open   { display: flex; }

.ss-lightbox__img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}

.ss-lightbox__close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 32px;
    line-height: 1;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.75;
}

.ss-lightbox__close:hover { opacity: 1; }
