/* TCG GLOBE GALAXY PRODUCT IMAGE STAGE V3 EDGE BLEND */
/*
 * The galaxy artwork now sits on a separate stage underneath each product
 * photograph. The photograph's outer margins fade into that stage so pale
 * or white canvas edges blend into the TCG Globe crystal galaxy.
 */

:root{
    --tcg-stage-deep:#080013;
    --tcg-stage-purple:#3c0868;
    --tcg-stage-violet:#7a20c9;
    --tcg-stage-pink:#d05cff;
    --tcg-stage-line:rgba(218,145,255,.48);
}

/* Shared artwork treatment used by every product-image stage. */
.product-image-link,
.product-image-box::before,
.related-card::before,
.basket-item::before,
.wishlist-item::before,
.order-item::before,
.review-prompt::after{
    background-color:var(--tcg-stage-deep);
    background-image:
        radial-gradient(
            ellipse at 50% 50%,
            rgba(255,238,255,.24) 0%,
            rgba(218,130,255,.13) 24%,
            transparent 54%
        ),
        linear-gradient(
            180deg,
            rgba(7,0,20,.03) 0%,
            rgba(8,0,24,.10) 55%,
            rgba(3,0,12,.24) 100%
        ),
        url("../backgrounds/product-galaxy-stage.png");
    background-size:auto,cover,cover;
    background-position:center,center,center;
    background-repeat:no-repeat;
    border:1px solid var(--tcg-stage-line);
    box-shadow:
        0 0 18px rgba(188,74,255,.30),
        0 0 42px rgba(104,28,199,.18),
        inset 0 0 28px rgba(255,255,255,.045);
}

/*
 * Category card stage.
 * The original image margin is moved onto the stage so page spacing stays
 * identical to V1/V2.
 */
.product-image-link{
    position:relative;
    display:block;
    overflow:hidden;
    isolation:isolate;
    border-radius:22px;
    margin-bottom:18px;
}

/* Full View Details stage, fitted exactly inside the existing image box. */
.product-image-box{
    position:relative;
    isolation:isolate;
}

.product-image-box::before{
    content:"";
    position:absolute;
    inset:24px;
    z-index:0;
    border-radius:24px;
    pointer-events:none;
}

/* Related-product stage, aligned with the existing 180px image area. */
.related-card{
    position:relative;
    isolation:isolate;
    overflow:hidden;
}

.related-card::before{
    content:"";
    position:absolute;
    top:16px;
    left:16px;
    right:16px;
    height:180px;
    z-index:0;
    border-radius:16px;
    pointer-events:none;
}

/* Basket thumbnail stage. */
.basket-item{
    isolation:isolate;
}

.basket-item::before{
    content:"";
    position:absolute;
    top:20px;
    left:20px;
    width:105px;
    height:105px;
    z-index:0;
    border-radius:18px;
    pointer-events:none;
}

/* Wishlist thumbnail stage. */
.wishlist-item{
    isolation:isolate;
}

.wishlist-item::before{
    content:"";
    position:absolute;
    top:50%;
    left:20px;
    width:110px;
    height:110px;
    z-index:0;
    border-radius:18px;
    transform:translateY(-50%);
    pointer-events:none;
}

/* My Orders item thumbnail stage. */
.order-item{
    position:relative;
    isolation:isolate;
}

.order-item::before{
    content:"";
    position:absolute;
    top:13px;
    left:13px;
    width:62px;
    height:62px;
    z-index:0;
    border-radius:14px;
    pointer-events:none;
}

/* Delivered-review prompt thumbnail stage. */
.review-prompt{
    isolation:isolate;
}

.review-prompt::after{
    content:"";
    position:absolute;
    top:20px;
    left:20px;
    width:76px;
    height:76px;
    z-index:0;
    border-radius:18px;
    pointer-events:none;
}

/*
 * Product photographs sit above their separate stages.
 * A soft alpha mask fades only the outside of the photograph into the
 * artwork. The centre remains fully opaque to preserve genuine packaging.
 */
img.product-image,
img.main-image,
.related-card img,
img.product-img,
img.item-img,
img.review-prompt-image{
    position:relative;
    z-index:1;
    object-fit:contain !important;
    object-position:center !important;
    background:none !important;
    border-color:transparent !important;
    box-shadow:none !important;
    -webkit-mask-image:
        radial-gradient(
            ellipse closest-side at 50% 50%,
            #000 0%,
            #000 70%,
            rgba(0,0,0,.96) 78%,
            rgba(0,0,0,.72) 87%,
            rgba(0,0,0,.24) 96%,
            transparent 100%
        );
    mask-image:
        radial-gradient(
            ellipse closest-side at 50% 50%,
            #000 0%,
            #000 70%,
            rgba(0,0,0,.96) 78%,
            rgba(0,0,0,.72) 87%,
            rgba(0,0,0,.24) 96%,
            transparent 100%
        );
    -webkit-mask-size:100% 100%;
    mask-size:100% 100%;
    -webkit-mask-position:center;
    mask-position:center;
    -webkit-mask-repeat:no-repeat;
    mask-repeat:no-repeat;
    filter:
        drop-shadow(0 11px 15px rgba(0,0,0,.28))
        saturate(1.035)
        contrast(1.015);
}

/* Preserve the working dimensions and spacing from the earlier system. */
img.product-image{
    margin-bottom:0 !important;
    padding:12px;
}

img.main-image{
    padding:18px;
    -webkit-mask-image:
        radial-gradient(
            ellipse closest-side at 50% 50%,
            #000 0%,
            #000 75%,
            rgba(0,0,0,.96) 82%,
            rgba(0,0,0,.70) 90%,
            rgba(0,0,0,.22) 97%,
            transparent 100%
        );
    mask-image:
        radial-gradient(
            ellipse closest-side at 50% 50%,
            #000 0%,
            #000 75%,
            rgba(0,0,0,.96) 82%,
            rgba(0,0,0,.70) 90%,
            rgba(0,0,0,.22) 97%,
            transparent 100%
        );
}

.related-card img{
    padding:8px;
}

img.product-img,
img.item-img,
img.review-prompt-image{
    padding:5px;
    -webkit-mask-image:
        radial-gradient(
            ellipse closest-side at 50% 50%,
            #000 0%,
            #000 78%,
            rgba(0,0,0,.95) 85%,
            rgba(0,0,0,.66) 92%,
            transparent 100%
        );
    mask-image:
        radial-gradient(
            ellipse closest-side at 50% 50%,
            #000 0%,
            #000 78%,
            rgba(0,0,0,.95) 85%,
            rgba(0,0,0,.66) 92%,
            transparent 100%
        );
}

/* Keep review prompt text and controls above its artwork stage. */
.review-prompt-image,
.review-prompt-copy,
.review-prompt-actions{
    position:relative;
    z-index:2;
}

/* Premium lift without changing any click behaviour. */
.product-image-link img.product-image,
.related-card img{
    transition:transform .25s ease,filter .25s ease;
}

.product-image-link:hover img.product-image,
.related-card:hover img{
    transform:translateY(-2px) scale(1.012);
    filter:
        drop-shadow(0 13px 18px rgba(0,0,0,.32))
        drop-shadow(0 0 15px rgba(211,108,255,.26))
        saturate(1.045)
        contrast(1.02);
}

.product-image-link:hover,
.related-card:hover::before{
    box-shadow:
        0 0 24px rgba(211,108,255,.44),
        0 0 52px rgba(111,34,212,.24),
        inset 0 0 30px rgba(255,255,255,.055);
}

@media(max-width:980px){
    .wishlist-item::before{
        top:20px;
        left:50%;
        transform:translateX(-50%);
    }
}

@media(max-width:720px){
    .basket-item::before{
        top:20px;
        left:50%;
        transform:translateX(-50%);
    }

    img.product-image{
        padding:9px;
    }

    img.main-image{
        padding:12px;
    }

    img.product-img,
    img.item-img,
    img.review-prompt-image{
        padding:4px;
    }
}

@media(max-width:760px){
    .review-prompt::after{
        top:17px;
        left:17px;
        width:64px;
        height:64px;
    }
}

@media(prefers-reduced-motion:reduce){
    .product-image-link img.product-image,
    .related-card img{
        transition:none;
    }
}

/* TCG GLOBE HOMEPAGE FEATURED + NEW RELEASE PRODUCT STAGE V4 */
/*
 * Extends the shared V3 Galaxy Product Image System to both homepage
 * product grids without changing cards, ribbons, prices, buttons or links.
 */
.featured-image-wrap{
    position:relative !important;
    isolation:isolate;
    overflow:hidden !important;
    display:grid !important;
    place-items:center !important;
    background-color:var(--tcg-stage-deep) !important;
    background-image:
        radial-gradient(
            ellipse at 50% 50%,
            rgba(255,238,255,.24) 0%,
            rgba(218,130,255,.13) 24%,
            transparent 54%
        ),
        linear-gradient(
            180deg,
            rgba(7,0,20,.03) 0%,
            rgba(8,0,24,.10) 55%,
            rgba(3,0,12,.24) 100%
        ),
        url("../backgrounds/product-galaxy-stage.png") !important;
    background-size:auto,cover,cover !important;
    background-position:center,center,center !important;
    background-repeat:no-repeat !important;
    border:1px solid var(--tcg-stage-line) !important;
    box-shadow:
        0 0 18px rgba(188,74,255,.30),
        0 0 42px rgba(104,28,199,.18),
        inset 0 0 28px rgba(255,255,255,.045) !important;
}

img.featured-image{
    position:relative !important;
    z-index:1;
    display:block !important;
    width:100% !important;
    height:100% !important;
    max-width:100% !important;
    max-height:100% !important;
    padding:12px;
    object-fit:contain !important;
    object-position:center center !important;
    background:none !important;
    border:0 !important;
    box-shadow:none !important;
    -webkit-mask-image:
        radial-gradient(
            ellipse closest-side at 50% 50%,
            #000 0%,
            #000 70%,
            rgba(0,0,0,.96) 78%,
            rgba(0,0,0,.72) 87%,
            rgba(0,0,0,.24) 96%,
            transparent 100%
        );
    mask-image:
        radial-gradient(
            ellipse closest-side at 50% 50%,
            #000 0%,
            #000 70%,
            rgba(0,0,0,.96) 78%,
            rgba(0,0,0,.72) 87%,
            rgba(0,0,0,.24) 96%,
            transparent 100%
        );
    -webkit-mask-size:100% 100%;
    mask-size:100% 100%;
    -webkit-mask-position:center;
    mask-position:center;
    -webkit-mask-repeat:no-repeat;
    mask-repeat:no-repeat;
    filter:
        drop-shadow(0 11px 15px rgba(0,0,0,.28))
        saturate(1.035)
        contrast(1.015);
    transition:transform .25s ease,filter .25s ease;
}

.featured-card:hover img.featured-image{
    transform:translateY(-2px) scale(1.012);
    filter:
        drop-shadow(0 13px 18px rgba(0,0,0,.32))
        drop-shadow(0 0 15px rgba(211,108,255,.26))
        saturate(1.045)
        contrast(1.02);
}

.featured-card:hover .featured-image-wrap{
    box-shadow:
        0 0 24px rgba(211,108,255,.44),
        0 0 52px rgba(111,34,212,.24),
        inset 0 0 30px rgba(255,255,255,.055) !important;
}

@media(max-width:750px){
    img.featured-image{
        padding:9px;
    }
}

@media(max-width:420px){
    img.featured-image{
        padding:8px;
    }
}

@media(prefers-reduced-motion:reduce){
    img.featured-image{
        transition:none;
    }
}
