@media screen {
 html.ea-mobile-app-m2 .ea-m4-tools{justify-content:flex-start;flex-wrap:wrap}
 html.ea-mobile-app-m2 .ea-m4-tools>.ea-m3-help{margin-left:auto}
 html.ea-mobile-app-m2 .ea-m5-zoom{gap:4px;font-size:14px}
 html.ea-mobile-app-m2 .ea-m5-zoom button{min-width:32px;min-height:32px}
 html.ea-mobile-app-m2 #ea-m5-exit{z-index:12000}
 html.ea-mobile-app-m2 #ea-m5-exit .dialog{max-width:360px!important;animation:none!important}
 html.ea-mobile-app-m2 #ea-m5-exit .foot{justify-content:flex-end}
 html.ea-mobile-app-m2 .dialog:has(#lookup-search) .modal-zoom,html.ea-mobile-app-m2 .dialog:has(#lookup-search) tbody{animation:none!important;transition:none!important;overflow-anchor:none}
 html.ea-mobile-app-m2 .ea-dashboard-v1 .annual-chart11{min-width:0!important;width:100%;max-width:100%;overflow-x:auto;overflow-y:hidden;touch-action:pan-x pan-y pinch-zoom!important;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
 html.ea-mobile-app-m2 .ea-dashboard-v1 .annual-column11{flex:0 0 52px;min-width:52px}
 html.ea-mobile-app-m2 .ea-dashboard-v1 .tablewrap{touch-action:pan-x pan-y pinch-zoom!important;overscroll-behavior-x:contain}
}

/* G4-R2: valores numéricos de todo el sistema, incluidos caja y cobros. */
@media screen {
 #app #content input:is([type=number],[inputmode=decimal],[inputmode=numeric]),
 #modal .dialog input:is([type=number],[inputmode=decimal],[inputmode=numeric]){width:15ch!important;max-width:100%!important;min-width:0!important;box-sizing:border-box!important;flex:0 0 auto;padding-left:8px!important;padding-right:8px!important}
 #app #content input:is([name=quantity],[data-lookup-qty],[name=minimum],[name=tax],[name=discount],[name=expiry_days],[name=valid_days],[name=year]),
 #modal .dialog input:is([name=quantity],[data-lookup-qty],[name=minimum],[name=tax],[name=discount],[name=expiry_days],[name=valid_days],[name=year]),
 #app #content #line-qty,#app #content #order-quantity,#app #content #cart-table input[aria-label^="Cantidad"],
 #modal .dialog form[onsubmit^="saveReturn"] input[type=number]{width:10ch!important}
 #app #content :is(.quantity-control,.price-control),#modal .dialog :is(.quantity-control,.price-control){width:max-content!important;max-width:100%!important;min-width:0!important;flex:none}
}

/* Tres zonas a través del contenedor .modal-zoom que usa realmente el sistema. */
@media screen and (max-width:1100px) {
 body:has(#modal .dialog :is(#lookup-search,#movement-search)){overflow:hidden}
 #modal .overlay:has(:is(#lookup-search,#movement-search)){overflow:hidden}
 #modal .dialog:has(:is(#lookup-search,#movement-search)){align-self:flex-start;display:flex;flex-direction:column;height:calc(var(--ea-m2-view-height,100dvh) - 12px);max-height:calc(var(--ea-m2-view-height,100dvh) - 12px)!important;overflow:hidden;overflow-anchor:none}
 #modal .dialog:has(:is(#lookup-search,#movement-search))>.dialoghead{flex:0 0 auto}
 #modal .dialog:has(:is(#lookup-search,#movement-search))>.modal-zoom{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;overflow:hidden}
 #modal .dialog:has(:is(#lookup-search,#movement-search))>.modal-zoom>:is(.toolbar,.tabs,input,.foot){flex:0 0 auto}
 #modal .dialog:has(:is(#lookup-search,#movement-search))>.modal-zoom>.tablewrap{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:auto;-webkit-overflow-scrolling:touch}
 #modal .dialog:has(:is(#lookup-search,#movement-search))>.modal-zoom>.foot{display:flex;flex-wrap:wrap;gap:6px;margin:0;padding:8px 0 max(8px,env(safe-area-inset-bottom));background:var(--ea-surface,var(--panel,#fff));box-shadow:0 -6px 14px #18243a12}
 #modal .dialog:has(#lookup-search)>.modal-zoom>.foot>button{flex:1 1 0;white-space:normal}
 #modal .dialog:has(:is(#lookup-search,#movement-search)) .tablewrap table,
 :is(.ea-g4-product-table,#campaign-products .tablewrap,#order-lines .tablewrap,#modal form[onsubmit^="saveReturn"] .tablewrap) table{border-collapse:separate;border-spacing:0}
 #modal .dialog:has(:is(#lookup-search,#movement-search)) .tablewrap thead th,
 :is(.ea-g4-product-table,#campaign-products .tablewrap,#order-lines .tablewrap,#modal form[onsubmit^="saveReturn"] .tablewrap) thead th{position:sticky;top:0;z-index:2;background:var(--ea-surface,var(--panel,#fff))}
 :is(.ea-g4-product-table,#campaign-products .tablewrap,#order-lines .tablewrap,#modal form[onsubmit^="saveReturn"] .tablewrap){max-height:55dvh;overflow:auto;overscroll-behavior:auto;-webkit-overflow-scrolling:touch}
}

@media screen and (max-width:800px){html:not(.ea-mobile-app-m2) .topbar h1{font-size:23px!important}html:not(.ea-mobile-app-m2) #ea-mobile-nav button{font-size:16px!important}}

/* G4-R3: las flechas no heredan la altura mínima de botones generales. */
@media screen and (max-width:1100px) {
 :is(#app #content,#modal .dialog) :is(.quantity-control,.price-control) {align-items:center!important;height:48px;}
 html body :is(#app #content,#modal .dialog) :is(.quantity-control,.price-control)>input {height:48px!important;min-height:48px!important;line-height:24px!important;padding-top:8px!important;padding-bottom:8px!important;}
 :is(#app #content,#modal .dialog) .quantity-arrows {height:48px;flex:0 0 22px;}
 html body :is(#app #content,#modal .dialog) .quantity-arrows>button {height:24px!important;min-height:0!important;max-height:24px;flex:1 1 0;padding:0!important;line-height:1!important;font-size:12px!important;border-radius:0!important;}
 html body :is(#app #content,#modal .dialog) .price-arrows {height:48px!important;min-height:0!important;flex:0 0 22px;padding:0!important;line-height:14px!important;font-size:12px!important;}
}

@media screen and (max-width:700px){
 html.ea-mobile-app-m2 #document-form .lineform:has(#line-subtotal)>div:not(:first-child):not(:last-child){flex:0 1 calc(50% - 6px);}
 html.ea-mobile-app-m2 #document-form .lineform:has(#line-subtotal)>div:last-child{align-self:flex-end;}
}

/* G5: encabezados y barra horizontal al alcance en todas las tablas de productos de PC. */
@media screen {
 .g5-horizontal-scroll[hidden]{display:none!important;}
 .g5-horizontal-scroll{display:none;}
}
@media screen and (min-width:801px){
 html:not(.ea-mobile-app-m2) .g5-product-list{max-height:var(--g5-list-height,60dvh)!important;overflow:auto;overscroll-behavior:auto;}
 html:not(.ea-mobile-app-m2) .g5-product-list table{border-collapse:separate;border-spacing:0;}
 html:not(.ea-mobile-app-m2) .g5-product-list thead th{position:sticky;top:0;z-index:2;background:var(--ea-surface,var(--panel,#fff));}
 html:not(.ea-mobile-app-m2) .g5-product-list :is(th,td){padding:6px 8px;}
 html:not(.ea-mobile-app-m2) .g5-product-list{scrollbar-width:auto;scrollbar-gutter:stable;}
 html:not(.ea-mobile-app-m2) .g5-horizontal-scroll{display:block;overflow-x:scroll;overflow-y:hidden;height:18px;min-height:18px;flex:0 0 18px;width:100%;overscroll-behavior:auto;background:var(--ea-soft,#e6eaf2);}
 html:not(.ea-mobile-app-m2) .g5-scroll-track{height:1px;}
 html:not(.ea-mobile-app-m2) #modal .dialog.g5-product-picker{display:flex;flex-direction:column;height:calc(100dvh - 20px);max-height:calc(100dvh - 20px)!important;overflow:hidden;}
 html:not(.ea-mobile-app-m2) #modal .dialog.g5-product-picker>.dialoghead{flex:0 0 auto;}
 html:not(.ea-mobile-app-m2) #modal .dialog.g5-product-picker>.modal-zoom{display:flex;flex-direction:column;min-height:0;flex:1 1 auto;overflow:hidden;}
 html:not(.ea-mobile-app-m2) #modal .dialog.g5-product-picker>.modal-zoom>:is(.toolbar,.tabs,input,.foot,.g5-horizontal-scroll){flex-shrink:0;}
 html:not(.ea-mobile-app-m2) #modal .dialog.g5-product-picker>.modal-zoom>.g5-product-list{flex:1 1 auto;min-height:80px;max-height:none!important;}
 html:not(.ea-mobile-app-m2) #modal .dialog.g5-product-picker>.modal-zoom>.foot{margin-top:8px;}
}
@media print{
 .g5-horizontal-scroll{display:none!important;}
 .g5-product-list{max-height:none!important;overflow:visible!important;}
 .g5-product-list thead th{position:static!important;}
 #modal .dialog.g5-product-picker{height:auto!important;max-height:none!important;overflow:visible!important;}
}

@media screen and (max-width:800px){
 .g5-product-list{max-height:55dvh;overflow:auto;overscroll-behavior:auto;-webkit-overflow-scrolling:touch;}
 .g5-product-list table{border-collapse:separate;border-spacing:0;}
 .g5-product-list thead th{position:sticky;top:0;z-index:2;background:var(--ea-surface,var(--panel,#fff));}
 #modal .dialog.g5-product-picker>.modal-zoom>.g5-product-list{max-height:none;}
}
