/* TVE Modern UI v5.6 — mobile shell & native Woo gallery stability.
 * No viewport-zoom suppression; no JS slider replacement; no styling of Woo
 * carousel tracks/slides. Desktop (>991px) is unchanged. */
@media screen and (max-width:991.98px) {
  html body.tve-modern-ui { --tvemui-mobile-side: 14px; }
  html body.tve-modern-ui :is(#page,.site, .site-header,.site-content,.site-footer) {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  html body.tve-modern-ui #page { width:100% !important; }
  html body.tve-modern-ui :is(.site-content > .container,#content.site-content > .container,
    .site-header > .container,.site-footer > .container) {
    box-sizing:border-box !important;
    width:100% !important;
    max-width:100% !important;
    padding-left:var(--tvemui-mobile-side) !important;
    padding-right:var(--tvemui-mobile-side) !important;
    margin-left:auto !important;
    margin-right:auto !important;
  }
  /* Keep the native carousel width algorithm. Only its viewport and
     surrounding column may be constrained. */
  html body.tve-modern-ui.single-product .product-images-wrapper,
  html body.tve-modern-ui.single-product .product-images-wrapper :is(
    .woocommerce-product-gallery,.electro-wc-product-gallery,.flex-viewport) {
    min-width:0 !important;
    max-width:100% !important;
    box-sizing:border-box !important;
  }
  html body.tve-modern-ui.single-product .product-images-wrapper :is(
    .woocommerce-product-gallery__image img,.electro-wc-product-gallery__image img) {
    max-width:100% !important;
    height:auto !important;
    object-fit:contain;
  }
  /* Earlier generic .site-content figure styles also cap ALL figures to
     100% -- including Electro's actual FlexSlider <figure> track. Remove
     only that cap; JS inline width/transform must remain authoritative. */
  html body.tve-modern-ui.single-product .product-images-wrapper :is(
    .woocommerce-product-gallery__wrapper,.electro-wc-product-gallery__wrapper,
    .woocommerce-product-gallery__image,.electro-wc-product-gallery__image) {
    max-width:none !important;
  }
  /* Never set width or transform for a carousel track/slide here. */
  html body.tve-modern-ui #content :is(.site-content-inner.row,#primary.content-area,#main.site-main) {
    min-width:0 !important;
    max-width:100% !important;
    margin-left:0 !important;
    margin-right:0 !important;
    box-sizing:border-box !important;
  }
}
@media screen and (min-width:576px) and (max-width:767.98px){
  html body.tve-modern-ui { --tvemui-mobile-side: 18px; }
}
@media screen and (min-width:768px) and (max-width:991.98px){
  html body.tve-modern-ui { --tvemui-mobile-side: 22px; }
}
