/* Ticket #1857: fullscreen uses the available viewport, not the 525px product limit. */
#image_wrapper.fullscreen .gallery-with-action-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 20px minmax(0, 1fr) auto;
    height: 100%;
}
#image_wrapper.fullscreen .gallery-with-action-main > .col:nth-child(2) {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
#image_wrapper.fullscreen #gallery_wrapper {
    flex: 1 1 0;
    min-height: 0;
}
#image_wrapper.fullscreen #gallery {
    height: 100% !important;
    max-height: none !important;
}
#image_wrapper.fullscreen #gallery .slick-list,
#image_wrapper.fullscreen #gallery .slick-track,
#image_wrapper.fullscreen #gallery .js-gallery-images {
    height: 100%;
}
#image_wrapper.fullscreen #gallery .js-gallery-images::before {
    display: none;
}
#image_wrapper.fullscreen #gallery .js-gallery-images > .inner {
    position: absolute;
    inset: 0;
    height: 100%;
    max-height: 100% !important;
}
#image_wrapper.fullscreen #gallery .js-gallery-images img {
    width: 100%;
    height: 100%;
    max-height: 100% !important;
    object-fit: contain;
}
#image_wrapper.fullscreen .gallery-text {
    flex: 0 0 auto;
    padding-bottom: 8px !important;
}
/* The nested mobile modal must escape the sticky wrapper's stacking context. */
.product-detail #image_wrapper:has(#productImagesModal.show) {
    position: static !important;
}

