/* A definite dialog height lets the list shrink instead of clipping checkout. */
html body #modal:has(.cart-sheet){
 --cart-available-height:calc(100dvh - 32px);
 height:var(--cart-dialog-height,min(820px,var(--cart-available-height)))!important;
 max-height:var(--cart-available-height)!important;
 overflow:hidden!important;
}
html body #modal:has(.cart-sheet)>#modal-body{height:100%!important;max-height:100%!important;min-height:0!important;overflow:hidden!important;padding:0!important}
html body #modal .cart-sheet{display:flex!important;flex-direction:column;height:100%!important;max-height:100%!important;min-height:0!important;overflow:hidden!important}
html body #modal .cart-sheet-header,html body #modal .cart-sheet-footer{flex:0 0 auto}
html body #modal .cart-sheet .cart-list{flex:1 1 auto!important;min-height:0!important;min-width:0;max-height:none;overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y}
@media(max-width:767px){html body #modal:has(.cart-sheet){--cart-available-height:var(--cart-height-limit,calc(100dvh - 52px))}}
/* On short phone screens, preserve enough space to read full rows by scrolling the whole surface. */
@media(max-width:767px) and (max-height:700px){
 html body #modal:has(.cart-sheet)>#modal-body{overflow-y:auto!important;touch-action:pan-y}
 html body #modal .cart-sheet{height:auto!important;max-height:none!important;overflow:visible!important}
 html body #modal .cart-sheet .cart-list{flex:none!important;overflow:visible!important}
}
