/* Checkout modal specific layout and components */
#checkoutBack{ z-index: 980; }

.checkout-modal{
  display:flex;
  flex-direction:column;
  gap:16px;
  padding:clamp(18px,2.6vw,28px);
  padding-bottom:clamp(12px,2vw,20px);
  --checkout-zoom:1;
}

.checkout-modal.checkout-modal--scaled{
  transform-origin:top center;
  zoom:var(--checkout-zoom);
}

@supports not (zoom:1){
  .checkout-modal.checkout-modal--scaled{
    transform:scale(var(--checkout-zoom));
  }
}

.checkout-modal__body{
  display:flex;
  flex-direction:column;
  gap:16px;
}

.checkout-modal__footer{
  width:100%;
  padding:12px clamp(18px,2.6vw,28px);
  border-top:1px solid rgba(255,255,255,0.18);
  background:transparent;
}

.checkout-modal__footer .co-total-actions{
  margin:0;
}

.checkout-loading{
  margin-top:8px;
  font-weight:600;
}

.checkout-modal .co-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:clamp(10px, 1.8vh, 14px);
}

.checkout-modal .co-grid .row{
  display:grid;
  grid-template-columns:1fr;
  gap:8px;
}

.checkout-modal .co-grid .btn{
  min-height:44px;
}

.checkout-modal .co-cart-section{
  grid-column:1 / -1;
  display:flex;
  flex-direction:column;
  gap:14px;
}

.checkout-modal .co-cart-section.has-bundles .multi-cart-controls{ margin-top:-4px; }

.checkout-modal .co-cart-row{
  border:1px solid rgba(255,255,255,0.15);
  border-radius:14px;
  padding:14px;
  background:rgba(9,37,74,0.5);
  display:flex;
  flex-direction:column;
  gap:12px;
}

.checkout-modal .co-cart-row.co-cart-primary{ background:rgba(9,37,74,0.35); }
.checkout-modal .co-cart-label{ font-weight:700; font-size:1.05em; }
.checkout-modal .co-cart-head{ position:relative; display:flex; align-items:center; gap:10px; padding-right:48px; }
.checkout-modal .co-cart-head .co-cart-label{ flex:1 1 auto; }
.checkout-modal .co-cart-head .co-cart-remove{ position:absolute; right:0; top:6px; padding:4px 10px; min-width:auto; min-height:auto; line-height:1; background:transparent; border:1px solid rgba(255,255,255,0.25); color:inherit; }
.checkout-modal .co-cart-head .co-cart-remove:hover{ background:rgba(255,255,255,0.1); }

.checkout-modal .co-cart-controls{
  display:flex;
  gap:12px;
  align-items:flex-end;
  flex-wrap:nowrap;
  min-width:0;
  overflow-x:auto;
}

.checkout-modal .co-doc-box{ flex:0 0 45%; min-width:220px; display:flex; flex-direction:column; gap:6px; }
.checkout-modal .co-doc-box select{ width:100%; }

.checkout-modal .co-pay-actions{ flex:1 1 55%; min-width:0; display:flex; gap:8px; align-items:flex-end; }
.checkout-modal .co-pay-stack{ flex:1 1 auto; display:flex; flex-direction:column; gap:6px; min-width:0; }
.checkout-modal .co-pay-stack .co-pay-label{ white-space:nowrap; font-size:0.9em; opacity:0.85; }
.checkout-modal .co-pay-stack .co-pay-row{ display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:8px; min-width:0; }
.checkout-modal .co-pay-row .co-pay{ justify-content:center; min-width:0; font-size:clamp(0.85rem, 1.2vw, 1rem); line-height:1.2; }
.checkout-modal .co-pay.is-active{ background:#f0f0f0 !important; color:#0f1c2c !important; box-shadow:inset 0 0 0 2px rgba(0,0,0,0.25); }

.checkout-modal .co-client-label-row{ display:flex; align-items:center; gap:10px; margin-bottom:6px; flex-wrap:nowrap; }
.checkout-modal .co-client-label-row label{ white-space:nowrap; }

.checkout-modal .co-client-actions{ display:flex; gap:10px; align-items:center; margin-top:6px; flex-wrap:nowrap; overflow-x:auto; padding-bottom:2px; }
.checkout-modal .co-client-actions button{ flex:0 0 auto; }
.checkout-modal .co-client-actions #coRecentClients{ margin-top:0; }
.checkout-modal .co-client-actions .co-recent-list{ overflow:hidden; }

#coRecentClients{ display:flex; gap:8px; align-items:center; flex-wrap:nowrap; min-width:0; flex:1 1 auto; }
#coRecentClients.ghost{ display:none; }
#coRecentClients .co-recent-label{ opacity:0.8; white-space:nowrap; }
#coRecentClients .co-recent-list{ display:flex; gap:6px; flex-wrap:nowrap; min-width:0; flex:1 1 auto; }
.co-recent-client-btn{ background:var(--ok); color:#fff; border:1px solid rgba(255,255,255,0.18); border-radius:999px; padding:6px 14px; font-size:calc(14px * var(--ui-scale)); font-weight:700; display:inline-flex; align-items:center; gap:6px; transition:background .18s ease, transform .12s ease; box-shadow:0 4px 12px rgba(0,0,0,0.18); flex:1 1 0; min-width:0; justify-content:center; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.co-recent-client-btn:hover{ background:var(--ok-dark); transform:translateY(-1px); }
.co-recent-client-btn:focus-visible{ outline:2px solid rgba(255,255,255,0.55); outline-offset:2px; }
.co-recent-client-btn .co-recent-name{ line-height:1.2; }

.checkout-modal .co-bundles{ grid-column:1 / -1; display:flex; flex-direction:column; gap:12px; }
.checkout-modal .co-bundles:empty{ display:none; }
.checkout-modal .co-bundle-transfer{ display:flex; flex-direction:column; gap:6px; align-items:flex-start; }
.checkout-modal .co-bundle-transfer.ghost{ display:none; }
.checkout-modal .co-bundle-transfer select{ min-width:140px; }
.checkout-modal .multi-cart-controls{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; position:relative; width:100%; }
.checkout-modal .multi-cart-controls.ghost{ display:none; }
.checkout-modal #coAddCartBundle{ min-width:220px; flex:1 1 auto; }
.checkout-modal #coAddCartBundle.is-blocked{ opacity:0.65; box-shadow:none; }
.checkout-modal #coAddCartBundle[aria-disabled="true"]{ cursor:default; }
.checkout-modal #coBundleDropdown{ position:absolute; top:calc(100% + 6px); left:0; right:auto; width:100%; max-width:320px; }
.checkout-modal .multi-cart-note{ font-size:0.9em; opacity:0.85; }

.co-total-actions{ display:flex; gap:12px; align-items:center; justify-content:center; flex-wrap:nowrap; min-width:0; }
.co-total-bar{ flex:1 1 320px; min-width:0; padding:8px 16px; text-align:left; font-weight:700; font-size:clamp(1.05rem,2.2vh,1.4rem); color:#fff; background:rgba(0,0,0,0.18); border-radius:14px; letter-spacing:0.3px; }
.co-total-bar span{ font-size:1.05em; margin-left:6px; display:inline-block; }
.co-action-buttons{ display:flex; gap:10px; flex-wrap:nowrap; justify-content:flex-end; flex:0 0 auto; }
.co-action-buttons .btn{ min-width:140px; }

.checkout-modal .co-pay-select{
  display:none;
  width:100%;
  min-height:44px;
  padding:10px 12px;
  border-radius:10px;
}

#global-modal[data-modal="checkout"] .pos-modal__body{
  padding:0;
  gap:0;
}

@media (max-width: 1024px){
  .checkout-modal .co-grid{ grid-template-columns:1fr; }
  .co-docpay-row{ flex-direction:column; align-items:stretch; }
  .co-pay-row{ flex-direction:column; }
}

@media (max-width:760px){
  .checkout-modal .co-grid{ grid-template-columns:1fr; }
  .co-action-buttons{ width:100%; justify-content:flex-end; flex-wrap:wrap; }
  .co-action-buttons .btn{ flex:0 0 auto; }
}

@media (max-width:620px){
  .co-total-actions{ flex-direction:column; align-items:flex-end; gap:2px; }
  .co-total-bar{ width:100%; text-align:right; border-radius:12px; padding-bottom:6px; flex:0 0 auto; }
  .co-action-buttons{ width:100%; justify-content:flex-end; }
}

@media (max-width:560px){
  .checkout-modal .co-pay-stack .co-pay-row{ display:none; }
  .checkout-modal .co-pay-select{ display:block; }
  .co-action-buttons .btn{ min-width:120px; }
}
