/* ============================================================
   DEUSPIXEL – Product Gallery
   CREATED: 14 Sep 2026
   LAST UPDATED: 14 Sep 2026
   VERSION: 1.2.0
   PURPOSE: Full-height portrait WooCommerce gallery without crop.
   WEBSITE: https://deuspixel.com/
   ============================================================ */

.single-product .dpx-product-gallery {
    width: 100%;
    min-width: 0;
    margin: 0 0 28px;
}

.single-product .dpx-product-gallery__stage-wrap {
    position: relative;
    width: 100%;
}

.single-product .dpx-product-gallery__stage {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    background: #fff;
    cursor: zoom-in;
    overflow: hidden;
    border-radius: 18px;
    box-shadow: 0 2px 12px rgba(30,20,70,.05);
}

.single-product .dpx-product-gallery__main-image {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    object-fit: contain !important;
    object-position: center top !important;
    margin: 0 !important;
}

/* Small glass-morphism arrows sit on the far image edges. */
.single-product .dpx-product-gallery__nav {
    position: absolute;
    top: 50%;
    z-index: 5;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.66);
    border-radius: 50%;
    background: rgba(255,255,255,.44);
    color: #6d28d9;
    font-size: 29px;
    font-weight: 500;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
    cursor: pointer;
    box-shadow: 0 5px 18px rgba(30,20,70,.13);
    -webkit-backdrop-filter: blur(14px) saturate(150%);
    backdrop-filter: blur(14px) saturate(150%);
    opacity: .78;
    transition: opacity .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}

.single-product .dpx-product-gallery__nav--prev { left: 10px; }
.single-product .dpx-product-gallery__nav--next { right: 10px; }

.single-product .dpx-product-gallery__nav:hover,
.single-product .dpx-product-gallery__nav:focus-visible {
    opacity: 1;
    background: rgba(255,255,255,.78);
    box-shadow: 0 7px 22px rgba(30,20,70,.18);
}

.single-product .dpx-product-gallery__nav--prev:hover,
.single-product .dpx-product-gallery__nav--prev:focus-visible {
    transform: translateY(-50%) translateX(-1px);
}

.single-product .dpx-product-gallery__nav--next:hover,
.single-product .dpx-product-gallery__nav--next:focus-visible {
    transform: translateY(-50%) translateX(1px);
}

.single-product .dpx-product-gallery__thumbs {
    display: flex;
    gap: 8px;
    width: 100%;
    padding: 10px 2px 6px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

.single-product .dpx-product-gallery__thumb {
    flex: 0 0 78px;
    width: 78px;
    height: auto;
    aspect-ratio: 9 / 16;
    padding: 3px;
    border: 2px solid transparent;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    cursor: pointer;
    scroll-snap-align: start;
    box-sizing: border-box;
}

.single-product .dpx-product-gallery__thumb.is-active {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(139,92,246,.12);
}

.single-product .dpx-product-gallery__thumb img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: center !important;
    border-radius: 8px !important;
    background: #fff !important;
    margin: 0 !important;
}

.single-product .dpx-product-gallery__lightbox[hidden] { display: none !important; }

.single-product .dpx-product-gallery__lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(9,7,15,.94);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.single-product .dpx-product-gallery__lightbox img {
    display: block;
    max-width: 96vw;
    max-height: 94vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.single-product .dpx-product-gallery__lightbox-close {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 2;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.90);
    color: #1e1b2e;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

@media (max-width: 767px) {
    .single-product .dpx-product-gallery { margin-bottom: 22px; }
    .single-product .dpx-product-gallery__stage { border-radius: 14px; }

    .single-product .dpx-product-gallery__nav {
        width: 38px;
        height: 38px;
        font-size: 27px;
        opacity: .72;
    }

    .single-product .dpx-product-gallery__nav--prev { left: 8px; }
    .single-product .dpx-product-gallery__nav--next { right: 8px; }

    /* Four complete thumbnails are visible on mobile; no partial fifth tile. */
    .single-product .dpx-product-gallery__thumbs {
        gap: 8px;
        padding: 10px 0 6px;
        scroll-padding-inline: 0;
    }

    .single-product .dpx-product-gallery__thumb {
        flex: 0 0 calc((100% - 24px) / 4);
        width: calc((100% - 24px) / 4);
        min-width: 0;
        aspect-ratio: 9 / 16;
        border-radius: 11px;
    }
}
