/* ================================================================
   WEB Product Image Gallery Widget
   ================================================================ */

/* ---- Outer wrapper ---- */
.web-gallery {
    display: flex;
    flex-direction: column;
    width: 100%;
    user-select: none;
}

.web-gallery--thumbs-left {
    flex-direction: row;
    gap: 12px;
    align-items: flex-start;
}

.web-gallery--thumbs-left .web-gallery__stage {
    flex: 1 1 0;
    min-width: 0;
}

/* ---- Stage ---- */
.web-gallery__stage {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* ---- Main image container ---- */
.web-gallery__main-wrap {
    position: relative;
    width: 100%;
    height: auto;
    background-color: #f0f0f0;
    border-radius: 12px;
    /* NO overflow:hidden here — that clips the nav arrows */
    flex-shrink: 0;
}

/* ---- Slides — CSS scroll-snap (no JS measurement needed) ---- */

/* Outer: clips overflow, sets width reference */
.web-gallery__slides {
    overflow: hidden;
    border-radius: inherit;
    width: 100%;
}

/* Inner: flex row — JS sets pixel width after paint */
.web-gallery__slides-inner {
    display: flex;
    align-items: flex-start;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* Slides — JS sets pixel width after paint */
.web-gallery__slide {
    flex-shrink: 0;
    min-height: 0;
}

.web-gallery__main-img {
    width: 100%;
    height: auto;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
    min-height: 1px;
}

/* Nav arrows — high specificity + !important to beat any theme */
.web-gallery__main-wrap .web-pg-slidebtn {
    position: absolute !important;
    top: 0 !important;
    bottom: 0 !important;
    margin: auto 0 !important;
    width: 36px !important;
    height: 36px !important;
    z-index: 20 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    color: #1a1a1a !important;
    fill: #1a1a1a !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.22) !important;
    padding: 0 !important;
    transition: box-shadow 0.2s !important;
    line-height: 1 !important;
    text-decoration: none !important;
    font-size: 0 !important;
}
.web-gallery__main-wrap .web-pg-slidebtn:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.32) !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
}
.web-gallery__main-wrap .web-pg-slidebtn--prev { left: 10px !important; right: auto !important; }
.web-gallery__main-wrap .web-pg-slidebtn--next { right: 10px !important; left: auto !important; }
.web-gallery__main-wrap .web-pg-slidebtn svg {
    display: block !important;
    pointer-events: none !important;
    color: #1a1a1a !important;
    stroke: #1a1a1a !important;
    fill: none !important;
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0 !important;
}

/* ---- Zoom button ---- */
.web-gallery__zoom-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 10;
    width: 56px;
height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    color: #1a1a1a;
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
    outline: none;
}

.web-gallery__zoom-btn:hover {
    background: #f8f8f8;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    transform: scale(1.06);
}

.web-gallery__zoom-btn svg,
.web-gallery__zoom-btn i {
    pointer-events: none;
    display: block;
}



/* ---- Thumbnails wrap ---- */
.web-gallery__thumbs-wrap {
    margin-top: 12px;
    overflow: hidden;
}

/* Left-position thumbnails */
.web-gallery--thumbs-left .web-gallery__thumbs-wrap {
    margin-top: 0;
    width: 72px;
    flex-shrink: 0;
    order: -1;
}

.web-gallery--thumbs-left .web-gallery__thumbs {
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 520px;
}

/* ---- Thumbnails strip ---- */
.web-gallery__thumbs {
    display: flex;
    flex-direction: wrap;
    gap: 8px;
    padding: 2px 2px 4px;
    
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;
    padding: 2px 2px 4px;
}

.web-gallery__thumbs::-webkit-scrollbar {
    display: none;
}

/* ---- Single thumbnail ---- */
.web-gallery__thumb {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
    transition: border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
    outline: none;
    position: relative;
}

.web-gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 4px;
    pointer-events: none;
}

.web-gallery__thumb:hover {
    border-color: rgba(0, 0, 0, 0.35);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
}

.web-gallery__thumb.is-active {
    border-color: #1a1a1a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Thumbnail overlay on hover */
.web-gallery__thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.2s;
    border-radius: 4px;
}

.web-gallery__thumb:hover::after {
    background: rgba(0, 0, 0, 0.04);
}

/* "+N more" thumbnail */
.web-gallery__thumb--more {
    background: #1a1a1a;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
}

.web-gallery__thumb--more span {
    pointer-events: none;
}

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

.web-gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.web-gallery-lightbox.is-open {
    opacity: 1;
    pointer-events: auto;
}

.web-gallery-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    cursor: zoom-out;
}

.web-gallery-lightbox__inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: min(90vw, 1000px);
    max-height: 90vh;
    width: 100%;
}

.web-gallery-lightbox__img {
    display: block;
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    transition: transform 0.25s ease;
}

/* Lightbox close button */
.web-gallery-lightbox__close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s, transform 0.15s;
    outline: none;
}

.web-gallery-lightbox__close:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: scale(1.08) rotate(90deg);
}

/* Lightbox arrows */
.web-gallery-lightbox__arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s, transform 0.15s;
    outline: none;
}

.web-gallery-lightbox__arrow:hover {
    background: rgba(255, 255, 255, 0.22);
}

.web-gallery-lightbox__arrow--prev { left: 20px; }
.web-gallery-lightbox__arrow--next { right: 20px; }

.web-gallery-lightbox__arrow--prev:hover { transform: translateY(-50%) scale(1.06) translateX(-2px); }
.web-gallery-lightbox__arrow--next:hover { transform: translateY(-50%) scale(1.06) translateX(2px); }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .web-gallery--thumbs-left {
        flex-direction: column;
    }

    .web-gallery--thumbs-left .web-gallery__thumbs-wrap {
        order: 1;
        width: 100%;
        margin-top: 10px;
    }

    .web-gallery--thumbs-left .web-gallery__thumbs {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        max-height: none;
    }

    .web-gallery__main-wrap {
    height: auto !important;
}

    .web-gallery__arrow {
        display: none;
    }

    .web-gallery-lightbox__arrow--prev { left: 8px; }
    .web-gallery-lightbox__arrow--next { right: 8px; }
}
