/* The promo scrolls naturally underneath the sticky header. Its space stays
   in document flow; the approved Refined mattress keeps its compact header. */
@media(max-width:768px){
 body:not(.so-refined) .so-sticky-wrap{display:contents}
 body:not(.so-refined) .so-header{position:sticky;top:0;z-index:1000}
 body.admin-bar:not(.so-refined) .so-header{top:46px}
 body:not(.so-refined) .so-header.is-scrolled~.so-action-bar:not(.is-dismissed){max-height:none;opacity:1;pointer-events:auto}
 body:not(.so-refined) .so-ab-reopen{position:fixed;top:var(--so-header-height);z-index:1001}
}

/* A fixed image frame prevents FlexSlider's transient, multi-image height
   from moving the summary. Images with different proportions remain visible. */
.woocommerce div.product .so-stable-gallery{opacity:1!important;transition:none!important}
.so-stable-gallery>.woocommerce-product-gallery__wrapper,
.so-stable-gallery>.flex-viewport{aspect-ratio:var(--so-gallery-ratio,3/2);height:auto!important;overflow:hidden}
.so-stable-gallery .woocommerce-product-gallery__image>a{display:block;aspect-ratio:var(--so-gallery-ratio,3/2)}
.woocommerce div.product .so-stable-gallery .woocommerce-product-gallery__image>a>img{height:100%;width:100%;object-fit:contain}
.so-stable-gallery>.woocommerce-product-gallery__wrapper>.woocommerce-product-gallery__image:not(:first-child){display:none}
.so-stable-gallery .flex-control-thumbs{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;margin:0!important;padding:0!important}
.so-stable-gallery .flex-control-thumbs li{width:auto!important;float:none!important;aspect-ratio:1}
.so-stable-gallery .flex-control-thumbs img{width:100%;height:100%;object-fit:cover}
.so-stable-gallery.so-gallery-thumbnails:not(:has(.flex-control-thumbs))::after{content:'';display:block;aspect-ratio:4/var(--so-gallery-thumb-rows,1)}

/* Financing text is asynchronously enhanced; reserve its normal two-line
   mobile height so changing the message does not move product choices. */
.single-product .summary>.affirm-as-low-as{min-height:2.8em}
