/* Last shell stylesheet: shared forms, dialogs, errors and reduced-height screens. */
.modal-feedback{margin:12px;padding:12px;border:1px solid #efc1bc;border-radius:10px;background:#fff2f0;color:#a42f25;white-space:pre-wrap;overflow-wrap:anywhere;flex-shrink:0;font-size:14px;line-height:1.5}
@media(max-width:767px), (max-width:1023px) and (max-height:500px){
 :root{--mobile-viewport-height:100dvh;--mobile-viewport-top:0px}
 body>main{height:var(--mobile-viewport-height)!important;top:var(--mobile-viewport-top)}
 .view-section,.view-section form,.view-section fieldset,dialog form,dialog fieldset{min-width:0;max-width:100%}
 input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea{font-size:16px!important;min-width:0;max-width:100%;box-sizing:border-box;scroll-margin-block:64px}
 textarea{min-height:88px}
 .view-section input:not([type=checkbox]):not([type=radio]):not([type=hidden]),.view-section select,dialog input:not([type=checkbox]):not([type=radio]):not([type=hidden]),dialog select{min-height:44px}
 .view-section button,dialog button,[id^=modal-] button{min-height:44px;max-width:100%;white-space:normal}
 .view-section label,dialog label,.op-error,[role=status],.toast{overflow-wrap:anywhere;min-width:0}
 .view-section [role=tablist],.op-tabs,.ad-tabs{max-width:100%;overflow-x:auto}
 .purchase-screen{width:100%;box-sizing:border-box;min-width:0;padding:14px 0 24px}
 .purchase-screen header>*,.purchase-actions,.purchase-screen nav,.purchase-screen form{min-width:0;max-width:100%;flex-wrap:wrap}
 .purchase-screen header>.purchase-actions{display:grid;grid-template-columns:1fr;width:100%}
 .purchase-screen form input{flex-basis:100%;width:100%}
 .purchase-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
 .purchase-dialog footer{flex-wrap:wrap}
 dialog[open]{box-sizing:border-box;max-width:calc(100vw - 20px)!important;max-height:calc(var(--mobile-viewport-height) - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom))!important;overflow:auto;overscroll-behavior:contain;scroll-padding-block:16px}
 [id^=modal-].fixed.inset-0{top:var(--mobile-viewport-top)!important;bottom:auto!important;height:var(--mobile-viewport-height);box-sizing:border-box;overflow:auto}
 [id^=modal-].fixed.inset-0>div{max-height:calc(var(--mobile-viewport-height) - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom))!important;min-height:0;min-width:0;box-sizing:border-box}
 [id^=modal-] .overflow-y-auto.flex-1{min-height:0;scroll-padding-block:16px}
 [id^=modal-] .grid-cols-2,[id^=modal-] .grid-cols-3,.finance-fields fieldset,#finance-policy-form fieldset{grid-template-columns:minmax(0,1fr)!important}
 [id^=modal-] .grid>*,dialog .grid>*{min-width:0}
 [id^=modal-] button[onclick^="closeModal"]{min-width:44px;flex-shrink:0}
 #account-statement-view>div:first-child{flex-wrap:wrap;gap:12px;padding:16px}
 .cloud-overlay{top:var(--mobile-viewport-top);bottom:auto;height:var(--mobile-viewport-height);box-sizing:border-box}
 .cloud-dialog{max-height:calc(var(--mobile-viewport-height) - 24px);overflow:auto}
 .mobile-keyboard-open #mobile-bottom-nav{display:none!important}
 .mobile-keyboard-open body>main>.flex-1.overflow-auto{bottom:0!important}
 .mobile-keyboard-open #toast-container{bottom:12px}
 .mobile-keyboard-open dialog[open]{position:fixed;top:calc(var(--mobile-viewport-top) + 12px);bottom:auto;margin:0 auto}
 .mobile-keyboard-open #cart-panel{max-height:24dvh}
 @media(max-height:500px){
  #mobile-topbar{height:calc(48px + env(safe-area-inset-top))}
  body>main>.flex-1.overflow-auto{top:calc(48px + env(safe-area-inset-top))!important}
  #mobile-bottom-nav{height:calc(50px + env(safe-area-inset-bottom))}
  #mobile-bottom-nav button{height:44px}
  body>main>.flex-1.overflow-auto{bottom:calc(50px + env(safe-area-inset-bottom))!important}
  #view-ventas>div{overflow:auto;height:auto!important;min-height:100%}
  #cart-panel{max-height:none}
 }
}

/* Keep products usable without squeezing the entire cart into the same screen. */
#pos-mobile-mode{display:none}
@media(max-width:767px), (max-width:1023px) and (max-height:500px){
 #pos-mobile-mode{display:grid;grid-template-columns:1fr 1.5fr;gap:8px;margin-bottom:10px}
 #pos-mobile-mode button{padding:8px;border:1px solid #cee3e9;border-radius:12px;background:#fff;color:#34506a;font-size:12px;font-weight:700}
 #pos-mobile-mode button[aria-pressed=true]{background:#008e98;color:#fff;border-color:#008e98}
 #view-ventas>div{height:calc(100% - 54px)!important;grid-template-rows:minmax(0,1fr);overflow:hidden}
 #view-ventas:not(.pos-cart-open) #cart-panel{display:none}
 #view-ventas.pos-cart-open>div>div:first-child{display:none}
 #view-ventas.pos-cart-open #cart-panel{display:flex;max-height:none;height:100%!important;overflow-y:auto}
 #view-ventas.pos-cart-open #cart-items{max-height:none;min-height:84px;flex:1;overflow-y:auto}
 #view-ventas .pos-terminal-link{display:none}
 #view-ventas>div>div:first-child>div:first-child{padding:8px!important}
 #view-ventas>div>div:first-child{gap:10px}
 #pos-workstation .pos-warning{font-size:12px}
}

@media(max-width:420px) and (max-height:650px){
 #pos-products-grid>div{height:140px}
 #pos-products-grid>div>div:first-child{height:54px}
 #pos-products-grid>div>div:last-child{padding:7px}
 #pos-products-grid .text-xl{font-size:14px}
 #pos-products-grid h4{font-size:10px}
}
@media(max-width:1023px) and (max-height:500px){
 #pos-workstation{display:grid;grid-template-columns:minmax(0,1fr) auto;padding:6px 10px;margin-bottom:7px;font-size:11px}
 #pos-workstation strong{font-size:13px}
 #pos-workstation .pos-terminal-summary{display:grid;grid-template-columns:1fr auto;gap:2px 12px}
 #pos-workstation .pos-terminal-summary>span:nth-of-type(2){grid-column:1/-1}
 #pos-workstation small{display:none}
 #pos-workstation details{margin:0}
 #pos-workstation details[open]{grid-column:1/-1}
 #pos-workstation summary{min-height:32px;font-size:12px}
 #pos-products-grid>div{height:140px}
 #pos-products-grid>div>div:first-child{height:54px}
}

@media(max-width:1023px) and (max-height:500px){
 #pos-products-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 #pos-products-grid>div{display:grid;grid-template-columns:64px minmax(0,1fr);height:82px}
 #pos-products-grid>div>div:first-child{height:82px;width:64px;border-bottom:0;border-right:1px solid #e2e8f0}
 #pos-products-grid>div>div:last-child{padding:6px;min-width:0}
 #pos-products-grid h4{font-size:11px}
 #pos-products-grid .text-xl{font-size:15px}
}
@media(min-width:600px) and (max-width:1023px) and (max-height:500px){#pos-products-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
