/* SEDI Mobile Precision Guard v1.1.0 — Mobile Authority + performance. Desktop stays untouched. */
:root{--smpg-safe-top:env(safe-area-inset-top,0px);--smpg-safe-right:env(safe-area-inset-right,0px);--smpg-safe-bottom:env(safe-area-inset-bottom,0px);--smpg-safe-left:env(safe-area-inset-left,0px);--smpg-vh:1vh;--smpg-vw:1vw;--smpg-app-gutter:clamp(14px,4.1vw,20px);--smpg-touch-min:44px}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-padding-top:var(--wp-admin--admin-bar--height,0px)}
body.smpg-enabled{max-width:100%;min-height:calc(var(--smpg-vh,1vh)*100)}
body.smpg-enabled img,body.smpg-enabled video,body.smpg-enabled canvas{max-width:100%;height:auto}
body.smpg-enabled iframe{max-width:100%}
body.smpg-enabled [data-smpg-safe-top]{padding-top:max(var(--smpg-safe-top),var(--smpg-safe-top-min,0px))}
body.smpg-enabled [data-smpg-safe-bottom],body.smpg-enabled [data-sedi-sticky-bottom],body.smpg-enabled .sedi-mobile-sticky{padding-bottom:max(var(--smpg-safe-bottom),var(--smpg-safe-bottom-min,0px))}
body.smpg-enabled input,body.smpg-enabled select,body.smpg-enabled textarea{max-width:100%}

/* MOBILE AUTHORITY. Activated by the early head gate using the configured breakpoint. */
html.smpg-mobile-authority{width:100%!important;max-width:100%!important;overflow-x:clip!important}
html.smpg-mobile-authority body.smpg-enabled{width:100%!important;max-width:100%!important;min-width:0!important;overflow-x:clip!important;-webkit-overflow-scrolling:touch}
html.smpg-mobile-authority body.smpg-enabled *,html.smpg-mobile-authority body.smpg-enabled *::before,html.smpg-mobile-authority body.smpg-enabled *::after{box-sizing:border-box}
html.smpg-mobile-authority body.smpg-enabled img,html.smpg-mobile-authority body.smpg-enabled picture,html.smpg-mobile-authority body.smpg-enabled video,html.smpg-mobile-authority body.smpg-enabled svg,html.smpg-mobile-authority body.smpg-enabled canvas,html.smpg-mobile-authority body.smpg-enabled iframe{max-width:100%!important}
html.smpg-mobile-authority body.smpg-enabled table{max-width:100%}
html.smpg-mobile-authority body.smpg-enabled input:not([type=checkbox]):not([type=radio]),html.smpg-mobile-authority body.smpg-enabled select,html.smpg-mobile-authority body.smpg-enabled textarea{font-size:max(16px,1em)!important}

/* Structural containment: prevent the classic 1200/1440 desktop canvas from surviving on phone. */
html.smpg-mobile-authority body.smpg-enabled :where(main,.site,.site-content,.content-area,.site-main,.entry-content,.page-content,.wp-site-blocks,.woocommerce,.woocommerce-page,[data-sedi-shell],.sedi-shell,.elementor,.elementor-section-wrap,.elementor-inner,.e-con,.e-con-inner){max-width:100%!important;min-width:0!important}
html.smpg-mobile-authority body.smpg-enabled :where(.container,.container-fluid,.elementor-container,.e-con-inner,.site-content,.content-area,.woocommerce){width:100%!important;max-width:100%!important;min-width:0!important}
html.smpg-mobile-authority body.smpg-enabled [style*="min-width: 1"],html.smpg-mobile-authority body.smpg-enabled [style*="min-width:1"]{min-width:0!important}

/* Reflow only content canvases; header/footer keep their existing approved mobile controls. */
html.smpg-mobile-authority body.smpg-mobile-reflow-enabled main :where(.elementor-container,.elementor-row){flex-wrap:wrap!important}
html.smpg-mobile-authority body.smpg-mobile-reflow-enabled main .elementor-column{width:100%!important;max-width:100%!important;min-width:0!important;flex:0 0 100%!important}
html.smpg-mobile-authority body.smpg-mobile-reflow-enabled main :where(.e-con.e-flex,.e-con>.e-con-inner){min-width:0!important;max-width:100%!important}
html.smpg-mobile-authority body.smpg-mobile-reflow-enabled main .e-con.e-flex:not(.smpg-keep-row){flex-wrap:wrap!important}
html.smpg-mobile-authority body.smpg-mobile-reflow-enabled main .e-con.e-flex:not(.smpg-keep-row)>:where(.e-con,.elementor-element){min-width:0!important;max-width:100%!important}
html.smpg-mobile-authority body.smpg-mobile-reflow-enabled main :where(.wp-block-columns):not(.is-not-stacked-on-mobile){flex-wrap:wrap!important}
html.smpg-mobile-authority body.smpg-mobile-reflow-enabled main :where(.wp-block-columns):not(.is-not-stacked-on-mobile)>.wp-block-column{flex-basis:100%!important;min-width:0!important}

/* App gutter: only top-level content surfaces, not every nested component. */
html.smpg-mobile-authority body.smpg-enabled :where(main.site-main,.site-content>.container,.content-area>.container,.wp-site-blocks>main){padding-left:max(var(--smpg-app-gutter),var(--smpg-safe-left))!important;padding-right:max(var(--smpg-app-gutter),var(--smpg-safe-right))!important}

/* WooCommerce catalog = premium two-up mobile shop, never squeezed four-column desktop cards. */
html.smpg-mobile-authority body.smpg-mobile-reflow-enabled :where(.woocommerce ul.products,ul.products.columns-2,ul.products.columns-3,ul.products.columns-4,ul.products.columns-5,ul.products.columns-6){display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:clamp(12px,3.2vw,18px)!important;width:100%!important;margin-left:0!important;margin-right:0!important}
html.smpg-mobile-authority body.smpg-mobile-reflow-enabled :where(.woocommerce ul.products,ul.products) li.product{float:none!important;clear:none!important;width:100%!important;max-width:100%!important;min-width:0!important;margin:0!important}
html.smpg-mobile-authority body.smpg-mobile-reflow-enabled :where(.woocommerce ul.products,ul.products) li.product img{width:100%!important;aspect-ratio:1/1;object-fit:cover}

/* Single product reflow. */
html.smpg-mobile-authority body.smpg-mobile-reflow-enabled .woocommerce div.product{display:block!important;width:100%!important;max-width:100%!important}
html.smpg-mobile-authority body.smpg-mobile-reflow-enabled .woocommerce div.product :where(.woocommerce-product-gallery,.summary){float:none!important;width:100%!important;max-width:100%!important;margin-left:0!important;margin-right:0!important}
html.smpg-mobile-authority body.smpg-mobile-reflow-enabled .woocommerce div.product .summary{margin-top:18px!important}

/* Cart / checkout / account stay functional and readable inside the app shell. */
html.smpg-mobile-authority body.smpg-enabled .woocommerce table.shop_table{display:block;max-width:100%!important;overflow-x:auto;-webkit-overflow-scrolling:touch}
html.smpg-mobile-authority body.smpg-enabled :where(.woocommerce form,.woocommerce .checkout,.woocommerce-checkout-review-order,.woocommerce-checkout-payment){max-width:100%!important;min-width:0!important}
html.smpg-mobile-authority body.smpg-enabled :where(.woocommerce .col2-set,.woocommerce-page .col2-set){display:block!important;width:100%!important}
html.smpg-mobile-authority body.smpg-enabled :where(.woocommerce .col2-set .col-1,.woocommerce .col2-set .col-2,.woocommerce-page .col2-set .col-1,.woocommerce-page .col2-set .col-2){float:none!important;width:100%!important;max-width:100%!important;margin:0 0 16px!important}

/* SEDI standalone portals/auth/commerce: their design remains authority; guard only guarantees viewport/app containment. */
html.smpg-mobile-authority body.smpg-enabled :where(.sedi-portal-access,.portal-access-shell,.developer-access-shell,.workspace-shell,.screen,.checkout-shell,.cart-shell,.customer-shell,.owner-shell){width:100%!important;max-width:100%!important;min-width:0!important}
html.smpg-mobile-authority body.smpg-enabled :where(.portal-access-shell,.developer-access-grid){max-width:100vw!important}

/* Touch ergonomics without changing visual tokens. */
html.smpg-mobile-authority body.smpg-touch-targets-enabled :where(button,.button,.btn,input[type=submit],input[type=button],a.button,[role=button]){min-height:var(--smpg-touch-min)}
html.smpg-mobile-authority body.smpg-touch-targets-enabled :where(input,select,textarea){min-height:44px}
html.smpg-mobile-authority body.smpg-touch-targets-enabled :where(.quantity input.qty){min-width:52px}

/* Very small phones: keep catalog useful but avoid unreadably tiny cards. */
@media(max-width:360px){html.smpg-mobile-authority body.smpg-mobile-reflow-enabled :where(.woocommerce ul.products,ul.products.columns-2,ul.products.columns-3,ul.products.columns-4,ul.products.columns-5,ul.products.columns-6){grid-template-columns:1fr!important}}

/* Landscape phones: retain app containment and safe vertical geometry. */
@media(max-height:520px) and (orientation:landscape){html.smpg-mobile-authority body.smpg-enabled{min-height:100dvh!important}html.smpg-mobile-authority body.smpg-enabled [data-sedi-sticky-bottom]{position:relative!important}}

@supports(content-visibility:auto){body.smpg-performance-mode:not(.smpg-protected-route) .products>li.product,body.smpg-performance-mode:not(.smpg-protected-route) [data-sedi-product-card]{content-visibility:auto;contain-intrinsic-size:auto 420px}}

/* Motion remains opt-in/declarative only. */
body.smpg-motion-ready [data-sedi-motion="reveal"],body.smpg-motion-ready [data-bravaro-motion="reveal"]{opacity:0;transform:translate3d(0,18px,0);transition:opacity .52s ease,transform .52s cubic-bezier(.2,.7,.2,1)}
body.smpg-motion-ready [data-sedi-motion="reveal"].smpg-motion-in,body.smpg-motion-ready [data-bravaro-motion="reveal"].smpg-motion-in{opacity:1;transform:none}
body.smpg-motion-ready [data-sedi-motion="stagger"]>*{opacity:0;transform:translate3d(0,14px,0);transition:opacity .48s ease,transform .48s cubic-bezier(.2,.7,.2,1)}
body.smpg-motion-ready [data-sedi-motion="stagger"].smpg-motion-in>*{opacity:1;transform:none}
body.smpg-motion-ready [data-sedi-motion="stagger"].smpg-motion-in>*:nth-child(2){transition-delay:.05s}body.smpg-motion-ready [data-sedi-motion="stagger"].smpg-motion-in>*:nth-child(3){transition-delay:.1s}body.smpg-motion-ready [data-sedi-motion="stagger"].smpg-motion-in>*:nth-child(4){transition-delay:.15s}
@media(prefers-reduced-motion:reduce),(hover:none) and (pointer:coarse){body.smpg-motion-ready [data-sedi-motion],body.smpg-motion-ready [data-bravaro-motion]{opacity:1!important;transform:none!important;transition:none!important}body.smpg-motion-ready [data-sedi-motion]>*{opacity:1!important;transform:none!important;transition:none!important}}
