/* ClaudeCode 2026-05-20: Mobile-first part-photo gallery. Replaces the legacy
   4-hardcoded-thumb grid + Bootstrap modal slideshow in
   product.VariantsInRightBar.xml.config (now driven by product-gallery.js). */

.pams-part-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 16px 0;
}

.pams-part-gallery__thumb {
    width: 120px;
    height: 120px;
    padding: 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f6f6f6;
    cursor: pointer;
    overflow: hidden;
    flex: 0 0 auto;
}
.pams-part-gallery__thumb:hover,
.pams-part-gallery__thumb:focus {
    outline: 2px solid #1976d2;
    outline-offset: 1px;
}
.pams-part-gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (max-width: 720px) {
    .pams-part-gallery__thumb {
        width: 96px;
        height: 96px;
    }
}
@media (max-width: 480px) {
    /* On phones, three-up grid that fills the row. */
    .pams-part-gallery { gap: 6px; }
    .pams-part-gallery__thumb {
        width: calc((100% - 12px) / 3);
        height: auto;
        aspect-ratio: 1 / 1;
        max-width: 140px;
    }
}

/* Full-screen swipeable lightbox overlay (built once, reused across variants) */
.pams-part-gallery__overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    touch-action: pan-y;
}
.pams-part-gallery__overlay.is-open {
    display: flex;
}

.pams-part-gallery__stage {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 48px;
    box-sizing: border-box;
    user-select: none;
}

.pams-part-gallery__full {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.pams-part-gallery__close,
.pams-part-gallery__nav {
    position: absolute;
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    z-index: 1;
    padding: 0;
}
.pams-part-gallery__close:hover,
.pams-part-gallery__nav:hover { background: rgba(0,0,0,0.85); }

.pams-part-gallery__close       { top: 16px; right: 16px; font-size: 28px; }
.pams-part-gallery__nav--prev   { top: 50%; left: 16px; transform: translateY(-50%); }
.pams-part-gallery__nav--next   { top: 50%; right: 16px; transform: translateY(-50%); }

.pams-part-gallery__counter {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    background: rgba(0,0,0,0.55);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
}

@media (max-width: 720px) {
    .pams-part-gallery__stage { padding: 56px 8px; }
    .pams-part-gallery__close,
    .pams-part-gallery__nav {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    .pams-part-gallery__close     { top: 10px; right: 10px; }
    .pams-part-gallery__nav--prev { left: 6px; }
    .pams-part-gallery__nav--next { right: 6px; }
}
