.product-detail__media-column,.product-detail-image{min-width:0}
.variation-options summary{cursor:pointer;list-style:none}.variation-options summary::-webkit-details-marker{display:none}.variation-options summary h6{display:flex;justify-content:space-between;align-items:center}.variation-options summary span{font-size:1.2em}
.product-detail__media-column .product-gallery,.product-detail-image .product-detail-gallery-shell{width:100%;max-width:100%}
.product-detail__media-column .main-image,.product-detail-image .main-image{width:100%;max-width:100%;height:auto;min-height:0;aspect-ratio:auto;overflow:hidden}
.product-detail__media-column .main-image>img,.product-detail-image .main-image>img,.product-detail-gallery__infinite img,.product-gallery__infinite img,.product-detail-gallery .gallery-layout .tab-pane>img{display:block;width:100%!important;max-width:100%!important;height:auto!important;aspect-ratio:auto!important;object-fit:contain!important;object-position:center!important}
/* Override legacy theme frame rules that force 4:5/cover on product media. */
html body .product-detail .product-gallery .main-image,
html body .anvogue-detail .product-gallery .main-image{height:auto!important;min-height:0!important;aspect-ratio:auto!important;}
html body .product-detail .product-gallery .main-image>img,
html body .anvogue-detail .product-gallery .main-image>img{width:100%!important;max-width:100%!important;height:auto!important;aspect-ratio:auto!important;object-fit:contain!important;object-position:center!important;}
html body .product-detail__media-column .product-gallery .main-image{height:auto!important;min-height:0!important;aspect-ratio:auto!important;}
html body .product-detail__media-column .product-gallery .main-image>img{width:100%!important;max-width:100%!important;height:auto!important;aspect-ratio:auto!important;object-fit:contain!important;object-position:center!important;}
.product-detail-gallery__grid img,.product-gallery__grid img{width:100%;max-width:100%;height:auto;aspect-ratio:auto;object-fit:contain}

/* The saved thumbnail position owns the layout, including later theme layers. */
.gallery-thumbnails-left {
    --gallery-columns: 82px minmax(0, 1fr);
    --gallery-areas: "thumbs main";
}
.gallery-thumbnails-right {
    --gallery-columns: minmax(0, 1fr) 82px;
    --gallery-areas: "main thumbs";
}
.gallery-thumbnails-bottom {
    --gallery-columns: minmax(0, 1fr);
    --gallery-areas: "main" "thumbs";
}
.gallery-thumbnails-top {
    --gallery-columns: minmax(0, 1fr);
    --gallery-areas: "thumbs" "main";
}
[data-product-detail-layout] .pd-gallery-device.product-gallery.gallery-thumbnails[data-gallery-preset],
[data-product-detail-layout] .pd-gallery-device .gallery-layout.gallery-thumbnails {
    grid-template-columns: var(--gallery-columns) !important;
    grid-template-areas: var(--gallery-areas) !important;
    grid-template-rows: auto;
    gap: 12px;
    align-items: stretch !important;
    min-width: 0;
}
[data-product-detail-layout] .pd-gallery-device .gallery-layout.gallery-thumbnails {
    display: grid !important;
    position: relative;
}
/* Apply display only to the active device copy; the other gallery stays hidden. */
@media (min-width: 768px) {
    [data-product-detail-layout] .pd-gallery-device--desktop.product-gallery.gallery-thumbnails[data-gallery-preset] {
        display: grid !important;
    }
}
@media (max-width: 767.98px) {
    [data-product-detail-layout] .pd-gallery-device--mobile.product-gallery.gallery-thumbnails[data-gallery-preset] {
        display: grid !important;
    }
}
[data-product-detail-layout] .gallery-thumbnails > :is(.main-image, .tab-content) {
    grid-area: main !important;
    min-width: 0;
    width: 100%;
}
[data-product-detail-layout] .pd-gallery-device .gallery-thumbnails > .nav,
[data-product-detail-layout] .pd-gallery-device.product-gallery.gallery-thumbnails[data-gallery-preset] > .thumbs-wrapper {
    grid-area: thumbs !important;
    position: relative !important;
    inset: auto;
    min-width: 0;
    min-height: 0;
    width: auto;
    margin: 0 !important;
    order: 0;
    overflow: hidden !important;
}
[data-product-detail-layout] .pd-gallery-device .gallery-thumbnails:is(.gallery-thumbnails-left,.gallery-thumbnails-right) > .nav {
    position: absolute !important;
    inset: 0;
    width: 82px;
    max-height: none;
    flex-direction: column;
    flex-wrap: nowrap;
    overflow-y: auto !important;
}
[data-product-detail-layout] .pd-gallery-device.product-gallery.gallery-thumbnails:is(.gallery-thumbnails-left,.gallery-thumbnails-right)[data-gallery-preset] .thumbs {
    position: absolute !important;
    inset: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap;
    height: 100% !important;
    margin: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}
[data-product-detail-layout] .pd-gallery-device .gallery-thumbnails:is(.gallery-thumbnails-bottom,.gallery-thumbnails-top) > .nav,
[data-product-detail-layout] .pd-gallery-device.product-gallery.gallery-thumbnails:is(.gallery-thumbnails-bottom,.gallery-thumbnails-top)[data-gallery-preset] .thumbs {
    display: flex !important;
    position: static !important;
    flex-direction: row !important;
    flex-wrap: nowrap;
    width: 100%;
    height: auto !important;
    max-height: none;
    margin: 0 !important;
    gap: 12px;
    overflow-x: auto !important;
    overflow-y: hidden !important;
}
[data-product-detail-layout] .gallery-thumbnails .thumbs img,
[data-product-detail-layout] .gallery-thumbnails > .nav .nav-link {
    flex-shrink: 0;
}

/* The mobile gallery has its own legacy flex rules in both themes.  Reassert
   the saved thumbnail preset after those rules so bottom/right/top selections
   keep the same position on a phone as they do on desktop. */
@media (max-width: 767.98px) {
    [data-product-detail-layout] .pd-gallery-device--mobile.product-gallery.gallery-thumbnails[data-gallery-preset],
    [data-product-detail-layout] .pd-gallery-device--mobile .gallery-layout.gallery-thumbnails {
        display: grid !important;
        grid-template-columns: var(--gallery-columns) !important;
        grid-template-rows: auto !important;
        grid-template-areas: var(--gallery-areas) !important;
        gap: 12px !important;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        align-items: stretch !important;
    }

    [data-product-detail-layout] .pd-gallery-device--mobile.product-gallery.gallery-thumbnails[data-gallery-preset] > .main-image,
    [data-product-detail-layout] .pd-gallery-device--mobile .gallery-layout.gallery-thumbnails > .tab-content {
        grid-area: main !important;
        min-width: 0;
        width: 100%;
    }

    [data-product-detail-layout] .pd-gallery-device--mobile.product-gallery.gallery-thumbnails[data-gallery-preset] > .thumbs-wrapper,
    [data-product-detail-layout] .pd-gallery-device--mobile .gallery-layout.gallery-thumbnails > .nav {
        grid-area: thumbs !important;
        position: relative !important;
        inset: auto !important;
        width: auto !important;
        min-width: 0;
        min-height: 0;
        margin: 0 !important;
        order: 0 !important;
        overflow: hidden !important;
    }

    [data-product-detail-layout] .pd-gallery-device--mobile.product-gallery.gallery-thumbnails:is(.gallery-thumbnails-left,.gallery-thumbnails-right)[data-gallery-preset] > .thumbs-wrapper .thumbs,
    [data-product-detail-layout] .pd-gallery-device--mobile .gallery-layout.gallery-thumbnails:is(.gallery-thumbnails-left,.gallery-thumbnails-right) > .nav {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap;
        width: 82px !important;
        height: 100% !important;
        max-height: none;
        margin: 0 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }

    [data-product-detail-layout] .pd-gallery-device--mobile.product-gallery.gallery-thumbnails:is(.gallery-thumbnails-bottom,.gallery-thumbnails-top)[data-gallery-preset] > .thumbs-wrapper .thumbs,
    [data-product-detail-layout] .pd-gallery-device--mobile .gallery-layout.gallery-thumbnails:is(.gallery-thumbnails-bottom,.gallery-thumbnails-top) > .nav {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap;
        width: 100% !important;
        height: auto !important;
        max-height: none;
        margin: 0 !important;
        gap: 12px;
        overflow-x: auto !important;
        overflow-y: hidden !important;
    }
}
