/* MGB System · Experiencia móvil compartida (solo presentación).
 * Se incorpora al final de los estilos públicos, sin cambiar checkout ni tarifas.
 */
.mgb-mobile-nav-toggle,.mgb-mobile-filter-toggle,.mgb-mobile-buy{display:none}
:is(.mgb-mobile-nav-toggle,.mgb-mobile-filter-toggle,.mgb-mobile-buy button):focus-visible{
 outline:3px solid #63c7e9;outline-offset:3px
}
@media (max-width:800px){
 html{scroll-padding-top:115px}
 :is(.catalog,.section-store,.section-products,.detail,.mx-dialog,.mx-order-product){min-width:0}
 :is(.catalog,.section-store,.detail) img{max-width:100%}
 .mgb-mobile-filter-toggle{
  display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;
  min-height:48px;border:1px solid #bed9e6;border-radius:12px;padding:12px 15px;
  background:#eaf6fb;color:#105879;text-align:left;font-size:14px;font-weight:800;cursor:pointer;
 }
 .mgb-mobile-filter-toggle:after{content:'▾';font-size:16px;transition:transform .18s}
 .mgb-mobile-filter-toggle[aria-expanded="true"]:after{transform:rotate(180deg)}
 #catalogo .filterpanel[data-mgb-collapsed="true"],
 #productos .section-sidebar[data-mgb-collapsed="true"],
 .mgb-mobile-home-filters[data-mgb-collapsed="true"],
 #homeFacetSection[data-mgb-collapsed="true"]{display:none!important}
 #catalogo .catalog>.mgb-mobile-filter-toggle,
 #productos .section-store>.mgb-mobile-filter-toggle{grid-column:1/-1}
 #catalogo .catalog,#productos .section-store{gap:11px}
 #catalogo .filterpanel,#productos .section-sidebar{width:100%;max-width:none;position:static}
 #catalogo .filterpanel :is(select,input[type="number"],input[type="search"]),
 #productos .section-sidebar :is(select,input[type="number"],input[type="search"]){max-width:100%}
 #catalogo .store-control:has(.mgb-mobile-home-filters){display:flex;flex-wrap:wrap;gap:10px;align-items:center}
 #catalogo .store-control:has(.mgb-mobile-home-filters)>.store-search{flex:1 1 165px;min-width:0;width:auto}
 #catalogo .store-control:has(.mgb-mobile-home-filters)>#homeSearchSubmit{flex:0 0 auto;min-height:44px}
 #catalogo .store-control:has(.mgb-mobile-home-filters)>.mgb-mobile-filter-toggle{order:5}
 #catalogo .mgb-mobile-home-filters{display:grid;order:6;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;gap:10px}
 #catalogo .mgb-mobile-home-filters :is(input:not([type="checkbox"]),select){width:100%;min-width:0;max-width:100%;font-size:16px}
 #catalogo .mgb-mobile-home-filters #resetFilters{grid-column:1/-1;min-height:44px}
 /* Menús largos: usar scroll interno y no desbordar la pantalla. */
 header.header .header-line>.nav.open,
 header.bar .navlinks.open{max-height:min(70dvh,550px);overflow-y:auto;overscroll-behavior:contain}
 header.header .mgb-shop-menu:not([hidden]){max-height:min(43dvh,390px);overflow-y:auto;overscroll-behavior:contain}
 header.bar .megawrap.open{max-height:min(45dvh,400px);overflow-y:auto;overscroll-behavior:contain}
 :is(header.header .menu-toggle,header.bar .mobiletoggle){min-width:44px;min-height:44px}
 header.header .nav.open>a,header.bar .navlinks.open>a{display:flex;align-items:center;min-height:44px}
 .mgb-shop-group a{min-height:38px;display:flex!important;align-items:center}
 /* El encabezado de la ficha tenía enlaces desplegados y ningún hamburger. */
 header.bar .head:has(>.mgb-mobile-nav-toggle){display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:10px 0}
 header.bar .head>.brandmark{order:0;min-width:0}
 header.bar .head>.mgb-mobile-nav-toggle{
  order:1;display:flex;align-items:center;justify-content:center;min-height:44px;
  padding:9px 14px;margin-left:auto;background:#eff7fa;color:#153f55;
  border:1px solid #bad6e2;border-radius:10px;font-weight:750;font-size:14px
 }
 header.bar .head>.mgb-global-search{order:2;flex:0 0 100%;width:100%;max-width:none;margin:2px 0 0}
 header.bar .head>nav#mgb-mobile-product-menu{
  display:none;order:3;flex:0 0 100%;width:100%;max-height:min(62dvh,470px);
  margin:0;padding:9px 10px;overflow-y:auto;overscroll-behavior:contain;
  border:1px solid #d7e6ee;border-radius:12px;background:#f8fcfd;
  align-items:stretch;gap:3px;flex-direction:column
 }
 header.bar .head.mgb-mobile-menu-open>nav#mgb-mobile-product-menu{display:flex}
 header.bar #mgb-mobile-product-menu>a{min-height:44px;padding:11px 12px;display:flex;align-items:center;width:100%;border-radius:8px}
 header.bar #mgb-mobile-product-menu>.mgb-shop{width:100%}
 /* Evitar zoom al enfocar campos en iPhone y hacer más cómodos filtros y formularios. */
 :is(.mgb-global-search,.search,.store-control,.filterpanel,.section-sidebar,.mx-dialog,.shipping-fields)
 :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea){font-size:16px}
 .mx :is(button,.mx-btn){touch-action:manipulation}
 .mx-dialog{max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);overscroll-behavior:contain}
 .mx-dialog:not(.mx-checkout-dialog) .mx-close{min-width:44px;min-height:44px}
 .mx-utility{bottom:calc(8px + env(safe-area-inset-bottom));left:8px;right:8px}
 .mx-utility button{min-height:44px}
 .mgb-media-gallery .mgb-media-arrow{min-width:42px;min-height:44px}
 #catalogo :is(.items,.store-grid),#productos .store-grid{min-width:0}
 .mx-cartline>*{min-width:0;overflow-wrap:anywhere}
}
@media (min-width:801px){
 .mgb-mobile-home-filters{display:contents}
}
@media (max-width:600px){
 .mx-dialog.mx-checkout-dialog{
  width:100%;max-width:none;height:100dvh;max-height:100dvh;
  padding-bottom:env(safe-area-inset-bottom);border-radius:0
 }
 .mx-checkout-dialog .mx-checkout-footer{bottom:0;padding-bottom:calc(12px + env(safe-area-inset-bottom))}
 .mx-checkout-dialog :is(input:not([type="checkbox"]),select,textarea){font-size:16px}
 .mx-order-product{min-width:0}
 .mx-order-product-main,.mx-order-product-name{min-width:0;overflow-wrap:anywhere}
 .mx-order-total{flex-wrap:wrap}
 .mx-dialog:not(.mx-checkout-dialog){padding:15px}
 /* Una compra real de la ficha conserva su botón original y agrega un atajo móvil. */
 body.mgb-mobile-buy-enabled{padding-bottom:145px}
 .mgb-mobile-buy{
  position:fixed;z-index:39;left:9px;right:9px;bottom:calc(64px + env(safe-area-inset-bottom));
  display:none;align-items:center;justify-content:space-between;gap:10px;
  padding:9px 10px 9px 14px;border:1px solid #bcdbe9;border-radius:12px;
  box-shadow:0 6px 22px #082c3b2f;background:#fff;color:#14374c
 }
 .mgb-mobile-buy.mgb-mobile-buy-visible{display:flex}
 .mgb-mobile-buy>strong{min-width:0;flex:1;font-size:16px;line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .mgb-mobile-buy button{flex:0 0 auto;min-height:45px;border:0;border-radius:9px;background:#113d56;color:#fff;font-size:14px;font-weight:800;padding:11px 17px;cursor:pointer}
 body:has(dialog[open]) .mgb-mobile-buy{display:none!important}
}
@media (max-width:420px){
 #catalogo .mgb-mobile-home-filters{grid-template-columns:minmax(0,1fr)}
 .mgb-mobile-buy button{padding:11px 12px;font-size:13px}
}
@media (prefers-reduced-motion:reduce){
 .mgb-mobile-filter-toggle:after{transition:none}
}
