/* BUILD201 — F12 raised above totals + locked cashier bottom dock.
   Cart rows scroll inside their own area. F12, totals and right-side actions never move
   when items are punched into the cart on desktop. */

@media (min-width:1050px){
  /* Reserve a fixed bottom dock so cart growth can never push cashier controls down. */
  .posScreen .cartPanel{
    grid-template-rows:34px auto minmax(0,1fr) 34px 132px!important;
  }
  .posScreen .cartItemsScroll{
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
  }
  .posScreen .cartStatsBar{
    position:relative!important;
    z-index:8!important;
    flex:0 0 auto!important;
  }
  .posScreen .cartFixedFooter{
    height:132px!important;
    min-height:132px!important;
    max-height:132px!important;
    align-self:end!important;
    position:relative!important;
    z-index:12!important;
    display:grid!important;
    grid-template-columns:clamp(230px,25%,320px) minmax(0,1fr)!important;
    grid-template-rows:58px 68px!important;
    grid-template-areas:
      "barcode barcode"
      "total summary"!important;
    gap:6px!important;
    overflow:hidden!important;
    background:#fff!important;
  }

  /* F12 is now ABOVE the totals and remains locked in place. */
  .posScreen .barcodeDock{
    grid-area:barcode!important;
    min-height:58px!important;
    height:58px!important;
    margin:0!important;
  }
  .posScreen .barcodeShortcut,
  .posScreen .barcodeInputWrap,
  .posScreen .barcodeDock input,
  .barcodeVisual{
    height:46px!important;
    min-height:46px!important;
  }

  /* Totals are the permanent bottom-most cashier row. */
  .posScreen .cartTotal,
  .posScreen .cartSummary>span{
    min-height:68px!important;
    height:68px!important;
  }
  .posScreen .cartTotal{grid-area:total!important}
  .posScreen .cartSummary{grid-area:summary!important}

  /* Right action rail is locked to the same workspace and does not grow with cart rows. */
  .posScreen .checkoutActions{
    top:7px!important;
    bottom:7px!important;
    height:auto!important;
    max-height:calc(100% - 14px)!important;
    overflow:hidden!important;
  }
}

/* Short laptop screens: preserve the exact same order while shrinking only the fixed dock. */
@media (min-width:1050px) and (max-height:820px){
  .posScreen .cartPanel{
    grid-template-rows:30px auto minmax(0,1fr) 28px 108px!important;
  }
  .posScreen .cartFixedFooter{
    height:108px!important;
    min-height:108px!important;
    max-height:108px!important;
    grid-template-rows:48px 54px!important;
  }
  .posScreen .barcodeDock{height:48px!important;min-height:48px!important}
  .posScreen .barcodeShortcut,
  .posScreen .barcodeInputWrap,
  .posScreen .barcodeDock input,
  .barcodeVisual{height:38px!important;min-height:38px!important}
  .posScreen .cartTotal,
  .posScreen .cartSummary>span{height:54px!important;min-height:54px!important}
}

@media (min-width:1050px) and (max-height:680px){
  .posScreen .cartPanel{
    grid-template-rows:28px auto minmax(0,1fr) 25px 92px!important;
  }
  .posScreen .cartFixedFooter{
    height:92px!important;
    min-height:92px!important;
    max-height:92px!important;
    grid-template-rows:40px 46px!important;
  }
  .posScreen .barcodeDock{height:40px!important;min-height:40px!important;padding:3px!important}
  .posScreen .barcodeShortcut,
  .posScreen .barcodeInputWrap,
  .posScreen .barcodeDock input,
  .barcodeVisual{height:32px!important;min-height:32px!important}
  .posScreen .barcodeDock input{font-size:14px!important}
  .posScreen .cartTotal,
  .posScreen .cartSummary>span{height:46px!important;min-height:46px!important;padding:4px 7px!important}
  .posScreen .cartTotal strong{font-size:21px!important}
  .posScreen .cartSummary b{font-size:14px!important;margin-top:2px!important}
}

/* Tablet/mobile keeps natural scrolling, but F12 still appears before the totals. */
@media (max-width:1049px){
  .posScreen .cartFixedFooter{
    grid-template-columns:1fr!important;
    grid-template-areas:"barcode" "total" "summary"!important;
  }
}
