/* POS-POS ticket final layout, isolated from /pos and checkout mechanics.
 * Owned ticket markup and actions are rendered once by sales-view.js.
 */
body.ordnt-pos-live .ordnt-pos-canonical:not(.ordnt-pos-checkout-active) .ordnt-simple-ticket-top {
  min-height:41px!important;
  padding:0 0 5px!important;
  display:flex;
  align-items:center;
  justify-content:space-between!important;
}
body.ordnt-pos-live .ordnt-pos-canonical:not(.ordnt-pos-checkout-active) .ordnt-simple-ticket-top .ordnt-simple-ticket-name:not(.table) {
  box-sizing:border-box;
  min-height:38px!important;
  height:38px!important;
  width:100%!important;
  max-width:none!important;
  padding:3px 5px!important;
  display:grid;
  grid-template-columns:minmax(0,1fr) 22px;
  grid-template-rows:auto auto;
  align-content:center;
  gap:1px 6px;
  border:0!important;
  border-radius:7px!important;
  background:transparent!important;
  color:#193655!important;
  text-align:left;
}
body.ordnt-pos-live .ordnt-pos-canonical:not(.ordnt-pos-checkout-active) .ordnt-simple-ticket-name:not(.table) > span:first-child {
  grid-column:1;grid-row:1;
  font-size:9px!important;
  letter-spacing:.035em;
  color:#69809c!important;
}
body.ordnt-pos-live .ordnt-pos-canonical:not(.ordnt-pos-checkout-active) .ordnt-simple-ticket-name:not(.table) > strong {
  grid-column:1;grid-row:2;max-width:100%!important;
  font-size:12px!important;color:#193655!important;
  text-overflow:ellipsis;white-space:nowrap;overflow:hidden;
}
body.ordnt-pos-live .poscore-ticket-edit-symbol {
  grid-column:2;grid-row:1 / span 2;
  align-self:center;justify-self:center;
  display:flex;color:#4e719d;
}
body.ordnt-pos-live .poscore-ticket-edit-symbol svg{width:17px;height:17px}
body.ordnt-pos-live .ordnt-pos-canonical:not(.ordnt-pos-checkout-active) .ordnt-pos-ticket-table-header[data-sales-transfer-start] {
  cursor:pointer!important;border-radius:8px!important;padding-right:6px!important;
}
body.ordnt-pos-live .ordnt-pos-ticket-table-header[data-sales-transfer-start]:hover {background:#f6f9fe!important}
body.ordnt-pos-live .ordnt-pos-ticket-table-header[data-sales-transfer-start]:focus-visible {outline:2px solid #285dff;outline-offset:2px}
body.ordnt-pos-live .ordnt-pos-ticket-table-header[data-sales-transfer-start][aria-disabled="true"]{cursor:not-allowed!important;opacity:.6}
body.ordnt-pos-live .poscore-ticket-table-chevron {display:flex;align-items:center;justify-content:center;margin-left:auto;color:#285ab6}
body.ordnt-pos-live .poscore-ticket-table-chevron svg {width:21px;height:21px}

/* Un solo ticket en catálogo: sin barra ARTÍCULOS · N ni Cancelar arriba. */
body.ordnt-pos-live .ordnt-pos-canonical:not(.ordnt-pos-checkout-active) .ordnt-pos-ticket-scroll-wrap{
  grid-template-rows:minmax(0,1fr)!important;
}
body.ordnt-pos-live .ordnt-pos-ticket-scroll-track{top:6px}
body.ordnt-pos-live .poscore-ticket-summary{
  display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);
  align-items:center;gap:7px;padding:8px 0 0;border-top:1px solid #e6ebf3;
  box-sizing:border-box;min-width:0;max-width:100%;
}
body.ordnt-pos-live .poscore-ticket-summary.poscore-ticket-summary-only{grid-template-columns:minmax(0,1fr)}
body.ordnt-pos-live .poscore-ticket-summary.poscore-ticket-summary-only .poscore-ticket-amount{
  grid-column:1;justify-self:stretch;
}
body.ordnt-pos-live .poscore-ticket-summary.poscore-ticket-summary-only .poscore-ticket-amount>strong{
  font-size:clamp(23px,2.4vw,34px);
}
body.ordnt-pos-live .poscore-ticket-amount{
  min-width:0;max-width:100%;box-sizing:border-box;width:100%;display:flex;flex-direction:column;align-items:center;
  justify-content:center;gap:3px;text-align:center;padding:4px 5px;
}
body.ordnt-pos-live .poscore-ticket-amount>span{
  color:#47678b;font:850 11px/1.2 Inter,system-ui,sans-serif;letter-spacing:.035em;white-space:normal;
}
body.ordnt-pos-live .poscore-ticket-amount>strong{
  color:#102f55;font:900 clamp(21px,2vw,30px)/1.08 Inter,system-ui,sans-serif;
  font-variant-numeric:tabular-nums;white-space:nowrap;letter-spacing:-.035em;
}
body.ordnt-pos-live .poscore-ticket-leave{
  min-width:0;max-width:100%;box-sizing:border-box;width:100%;min-height:50px;
  padding:8px 6px;display:flex;align-items:center;justify-content:center;gap:7px;
  border:1px solid #cfddf0;border-radius:11px;background:#f4f8fe;color:#245883;
  font:850 12px/1.2 Inter,system-ui,sans-serif;cursor:pointer;white-space:normal;
}
body.ordnt-pos-live .poscore-ticket-leave svg{width:18px;height:18px;flex:0 0 18px}
body.ordnt-pos-live .ordnt-simple-fulfillment button:not(:disabled){
  cursor:pointer!important;touch-action:manipulation;
}
/* One accessible state owns the color, even while Safari retains hover/focus. */
body.ordnt-pos-live .ordnt-simple-fulfillment button[aria-pressed="false"],
body.ordnt-pos-live .ordnt-simple-fulfillment button[aria-pressed="false"]:hover,
body.ordnt-pos-live .ordnt-simple-fulfillment button[aria-pressed="false"]:focus{
  background:#fff!important;border-color:#d1ddea!important;
  color:#285078!important;box-shadow:none!important;
}
body.ordnt-pos-live .ordnt-simple-fulfillment button[aria-pressed="true"],
body.ordnt-pos-live .ordnt-simple-fulfillment button[aria-pressed="true"]:hover,
body.ordnt-pos-live .ordnt-simple-fulfillment button[aria-pressed="true"]:focus{
  background:#eaf2ff!important;border-color:#286fea!important;
  color:#1559b2!important;box-shadow:inset 0 0 0 1px #286fea!important;
}
body.ordnt-pos-live .ordnt-simple-fulfillment button:focus-visible{
  outline:2px solid #176de9;outline-offset:2px;
}
body.ordnt-pos-live .ordnt-sales-action-backdrop[data-sales-action-backdrop="discount"] .ordnt-sales-action-head > button{
  display:grid!important;place-items:center!important;
  font:700 21px/1 Inter,system-ui,sans-serif!important;
  padding:0!important;text-align:center!important;
}
body.ordnt-pos-live .ordnt-pos-ticket-payment-actions{
  min-width:0;display:grid;grid-template-columns:minmax(0,1fr);gap:8px;
}
body.ordnt-pos-live .poscore-ticket-bottom{
  display:grid;grid-template-columns:minmax(0,1fr) 53px;
  position:relative;gap:7px;min-width:0;
}
body.ordnt-pos-live .poscore-ticket-bottom:not(:has(>.poscore-ticket-overflow-toggle)){
  grid-template-columns:minmax(0,1fr);
}
body.ordnt-pos-live .poscore-ticket-checkout{
  min-height:55px;border:1px solid #1367d8;border-radius:11px;
  color:#fff;background:#176de9;font:900 clamp(13px,1.25vw,16px)/1.15 Inter,system-ui,sans-serif;
  padding:6px 4px;cursor:pointer;touch-action:manipulation;
}
body.ordnt-pos-live .poscore-ticket-checkout svg{display:none}
body.ordnt-pos-live .poscore-ticket-overflow-toggle{
  min-height:55px;width:53px;padding:0;border:1px solid #ccdbea;border-radius:11px;
  color:#274867;background:#fff;cursor:pointer;font:900 25px/1 Inter,system-ui,sans-serif;
}
body.ordnt-pos-live .poscore-ticket-overflow-toggle>span{display:block;line-height:1}
body.ordnt-pos-live .poscore-ticket-overflow-toggle:disabled{
  cursor:not-allowed;opacity:.46;background:#f5f7fb;border-color:#e3e8f1;
}
body.ordnt-pos-live .poscore-ticket-overflow-menu{
  position:absolute;right:0;bottom:calc(100% + 8px);z-index:20;
  width:min(258px,calc(100vw - 34px));
  display:grid;gap:2px;padding:7px;background:#fff;
  border:1px solid #d7e2ee;border-radius:12px;box-shadow:0 14px 34px rgba(21,50,83,.19);
}
body.ordnt-pos-live .poscore-ticket-overflow-menu[hidden]{display:none!important}
body.ordnt-pos-live .poscore-ticket-overflow-menu button{
  display:flex;align-items:center;gap:10px;min-height:46px;padding:10px;
  border:0;border-radius:9px;background:transparent;color:#243c58;text-align:left;
  font:800 13px/1.2 Inter,system-ui,sans-serif;cursor:pointer;
}
body.ordnt-pos-live .poscore-ticket-overflow-menu button:hover{background:#f0f5fc}
body.ordnt-pos-live .poscore-ticket-overflow-menu button svg{width:19px;height:19px;flex:0 0 19px}
body.ordnt-pos-live .poscore-ticket-overflow-menu .poscore-ticket-menu-cancel{color:#b4353e}
body.ordnt-pos-live .poscore-ticket-leave:disabled,
body.ordnt-pos-live .poscore-ticket-checkout:disabled{opacity:.5;cursor:not-allowed}
body.ordnt-pos-live .poscore-ticket-bottom button:focus-visible,
body.ordnt-pos-live .poscore-ticket-leave:focus-visible{outline:2px solid #285dff;outline-offset:2px}
body.ordnt-pos-live .ordnt-pos-checkout-footer-actions .poscore-checkout-discount{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
}
body.ordnt-pos-live .poscore-checkout-discount svg{width:17px;height:17px}
/* Ticket nuevo y persistente en Cobrar: misma jerarquía que en Catálogo,
   sin acciones de mesa/servicio que ya no se pueden cambiar al cobrar. */
body.ordnt-pos-live .ordnt-pos-checkout-active .ordnt-simple-ticket{
  min-width:0;min-height:0;
}
body.ordnt-pos-live .ordnt-pos-checkout-active .poscore-checkout-ticket-heading{
  display:flex;align-items:center;justify-content:space-between;
  gap:8px;min-height:42px;padding:4px 10px 9px;
  border-bottom:1px solid #e6ebf3;
}
body.ordnt-pos-live .ordnt-pos-checkout-active .poscore-checkout-ticket-heading strong{
  color:#193655;font:850 14px/1.2 Inter,system-ui,sans-serif;
}
body.ordnt-pos-live .ordnt-pos-checkout-active .poscore-checkout-ticket-heading small{
  color:#69809c;font:750 11px/1.2 Inter,system-ui,sans-serif;
}
body.ordnt-pos-live .ordnt-pos-checkout-active .ordnt-pos-ticket-scroll-wrap{
  grid-template-rows:minmax(0,1fr)!important;
}
body.ordnt-pos-live .ordnt-pos-checkout-active .ordnt-simple-ticket-footer{
  display:grid;gap:8px;
}
body.ordnt-pos-live .ordnt-pos-checkout-active .ordnt-pos-checkout-footer{
  padding:10px 2px 0;border-top:1px solid #e6ebf3;
}
body.ordnt-pos-live .ordnt-pos-checkout-active .ordnt-pos-checkout-total{
  display:flex;flex-direction:column;align-items:flex-start;gap:4px;
}
body.ordnt-pos-live .ordnt-pos-checkout-active .ordnt-pos-checkout-total span{
  color:#47678b;font:850 11px/1.2 Inter,system-ui,sans-serif;
  text-transform:uppercase;letter-spacing:.035em;
}
body.ordnt-pos-live .ordnt-pos-checkout-active .ordnt-pos-checkout-total strong{
  color:#102f55;font:900 clamp(21px,2vw,30px)/1.08 Inter,system-ui,sans-serif;
}
@media(max-width:1050px){
 body.ordnt-pos-live .poscore-ticket-amount>strong{font-size:clamp(18px,2vw,24px)}
 body.ordnt-pos-live .poscore-ticket-summary.poscore-ticket-summary-only .poscore-ticket-amount>strong{font-size:clamp(22px,2.4vw,29px)}
 body.ordnt-pos-live .poscore-ticket-amount>span{font-size:10px}
 body.ordnt-pos-live .poscore-ticket-leave{font-size:11px;min-height:48px}
 body.ordnt-pos-live .poscore-ticket-bottom{grid-template-columns:minmax(0,1fr) 46px}
 body.ordnt-pos-live .poscore-ticket-overflow-toggle{width:46px;min-height:50px}
 body.ordnt-pos-live .poscore-ticket-checkout{min-height:50px}
}
@media(max-height:700px) and (min-width:651px){
 body.ordnt-pos-live .poscore-ticket-summary{padding-top:4px}
 body.ordnt-pos-live .poscore-ticket-leave{min-height:43px}
 body.ordnt-pos-live .poscore-ticket-checkout,
 body.ordnt-pos-live .poscore-ticket-overflow-toggle{min-height:44px}
}

/* Approved server-side payment history, compact and readable in the 25% ticket. */
body.ordnt-pos-live .ordnt-pos-checkout-active .ordnt-pos-checkout-payment-history{
 display:flex;flex-direction:column;gap:6px;max-height:160px;overflow-y:auto;
 padding:10px;border:1px solid #dbe8f7;border-radius:11px;background:#f5f9ff;
}
body.ordnt-pos-live .ordnt-pos-checkout-active .ordnt-pos-checkout-payment-history>strong{
 font:800 12px/1.3 Inter,system-ui,sans-serif;color:#176846;
}
body.ordnt-pos-live .ordnt-pos-checkout-active .ordnt-pos-checkout-payment-line{
 display:flex;gap:8px;justify-content:space-between;align-items:center;
 font-size:11px;line-height:1.3;color:#375775;min-width:0;
}
body.ordnt-pos-live .ordnt-pos-checkout-active .ordnt-pos-checkout-payment-line span{
 min-width:0;overflow-wrap:anywhere;
}
body.ordnt-pos-live .ordnt-pos-checkout-active .ordnt-pos-checkout-payment-line b{
 flex:none;font-variant-numeric:tabular-nums;color:#1a456f;
}
body.ordnt-pos-live .ordnt-pos-checkout-active .ordnt-pos-checkout-payment-tip{
 color:#62788d;font-size:10px;line-height:1.2;padding-left:14px;
}
body.ordnt-pos-live .ordnt-pos-checkout-active .ordnt-pos-checkout-payment-line.total{
 border-top:1px solid #dce7f3;padding-top:6px;font-weight:800;
}

/* Phase 11: only show controls relevant to the order's life cycle.
 * New ticket = choose Aquí/Para llevar. Existing table/held takeaway =
 * show order context instead. The DOM's native handlers remain mounted.
 */
body.ordnt-pos-live .ordnt-pos-canonical:not(.ordnt-pos-checkout-active)
.ordnt-simple-ticket[data-poscore-ticket-context="new"] > .ordnt-simple-ticket-top {
  display:none!important;
}
/* Aquí / Para llevar remains visible for current AND recovered orders,
 * including table orders. Table assignment is a secondary context, never a substitute. */

/* Only eligible open "Aquí" orders expose the native hold action. */
body.ordnt-pos-live .poscore-ticket-leave[hidden]{display:none!important}

body.ordnt-pos-live .ordnt-pos-ticket-table-header .ordnt-pos-table-guests-edit{position:relative;z-index:2;min-height:34px;touch-action:manipulation}
