/*
 * ORDNT POS — móvil sin columnas recortadas.
 * Implementación compartida en frontend; jamás cambia el DOM del Ticket
 * ni el orden de sus controles. iPad y desktop conservan 3 columnas.
 */
.ordnt-pos-mobile-ticket-toggle {display:none;}

/* Never leave an injected phone-only category selector visible on iPad/PC. */
body.ordnt-pos-live .ordnt-mobile-category-picker {display:none!important;}

/* Web iPad POS: orientation/width notice does not replace or rerender the sale. */
body.ordnt-pos-live .ordnt-pos-ipad-orientation-guard[hidden]{display:none!important;}
body.ordnt-pos-live .ordnt-pos-ipad-orientation-guard{
  position:fixed;inset:0;z-index:10000;box-sizing:border-box;
  display:grid!important;place-items:center;overflow:auto;
  padding:calc(22px + env(safe-area-inset-top,0px))
          calc(22px + env(safe-area-inset-right,0px))
          calc(22px + env(safe-area-inset-bottom,0px))
          calc(22px + env(safe-area-inset-left,0px));
  background:#f3f7fd;color:#183b67;
  font-family:Inter,system-ui,-apple-system,sans-serif;
}
body.ordnt-pos-live .ordnt-pos-ipad-guard-card{
  display:grid;justify-items:center;gap:16px;
  max-width:410px;padding:32px 24px;text-align:center;
  background:#fff;border:1px solid #dce7f5;border-radius:22px;
  box-shadow:0 12px 35px rgba(24,59,103,.07);
}
body.ordnt-pos-live .ordnt-pos-ipad-guard-card img{
  width:min(170px,65vw);height:53px;object-fit:contain;
}
body.ordnt-pos-live .ordnt-pos-ipad-guard-card svg{
  width:76px;height:76px;stroke:#1769f7;
}
body.ordnt-pos-live .ordnt-pos-ipad-guard-card h1{
  margin:0;font-size:clamp(20px,4vw,27px);
  line-height:1.24;font-weight:850;
}
body.ordnt-pos-live .ordnt-pos-ipad-guard-card p{
  margin:0;color:#6a7f9a;font-size:15px;line-height:1.5;
}
@media (max-width:650px), (max-width:850px) and (max-height:480px) {
  body.ordnt-pos-live.ordnt-pos-standalone {
    --ordnt-pos-compact-layout: 1;
  }
  html:has(body.ordnt-pos-standalone) {
    width:100%;
    height:100dvh;
    overflow:hidden;
  }
  body.ordnt-pos-live.ordnt-pos-standalone {
    width:100%;
    height:100dvh!important;
    min-height:0!important;
    overflow:hidden!important;
    overscroll-behavior:none;
  }
  body.ordnt-pos-live #settingsAppMain,
  body.ordnt-pos-live .ordnt-simple-pos.ordnt-pos-canonical {
    width:100%;
    min-width:0;
    height:100dvh!important;
    min-height:0!important;
    overflow:hidden!important;
  }

  /* Catálogo en dos columnas; Categorías compactas + Productos reales.
     Solo el catálogo/ticket manejan sus listas largas de forma interna. */
  body.ordnt-pos-live .ordnt-simple-pos.ordnt-pos-canonical
    .ordnt-simple-polotab-layout:not(.ordnt-pos-workspace-mode):not(.ordnt-pos-cash-mode) {
    grid-template-columns:minmax(70px,24%) minmax(0,1fr)!important;
    grid-template-areas:"categories articles"!important;
    gap:5px!important;
    min-width:0;
    min-height:0;
    overflow:hidden;
  }
  body.ordnt-pos-live .ordnt-simple-polotab-layout:not(.ordnt-pos-cash-mode)
    > .ordnt-simple-category-rail {
    min-width:0!important;
    grid-area:categories!important;
    overflow-x:hidden!important;
  }
  body.ordnt-pos-live .ordnt-simple-polotab-layout:not(.ordnt-pos-cash-mode)
    > .ordnt-simple-stage {
    min-width:0!important;
    min-height:0!important;
    grid-area:articles!important;
    overflow:hidden!important;
  }
  body.ordnt-pos-live .ordnt-simple-polotab-layout:not(.ordnt-pos-cash-mode)
    > .ordnt-simple-ticket {
    display:none!important;
  }
  body.ordnt-pos-live .ordnt-simple-pos.ordnt-pos-canonical
    .ordnt-simple-polotab-layout.ordnt-pos-workspace-mode:not(.ordnt-pos-cash-mode) {
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-areas:"workspace"!important;
    min-height:0;
    overflow:hidden;
  }
  body.ordnt-pos-live .ordnt-simple-polotab-layout.ordnt-pos-workspace-mode
    > .ordnt-pos-workspace-pane {
    grid-area:workspace!important;
    min-width:0!important;
    min-height:0!important;
  }

  /* Ticket móvil es otra VISTA de la misma orden, no otro ticket.
     Se conservan todos los controles nativos y su ubicación relativa. */
  body.ordnt-pos-live.ordnt-pos-mobile-ticket-open
    .ordnt-simple-pos.ordnt-pos-canonical
    .ordnt-simple-polotab-layout:not(.ordnt-pos-cash-mode) {
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-areas:"ticket"!important;
    min-width:0;
    overflow:hidden;
  }
  body.ordnt-pos-live.ordnt-pos-mobile-ticket-open
    .ordnt-simple-polotab-layout:not(.ordnt-pos-cash-mode)
    > .ordnt-simple-stage,
  body.ordnt-pos-live.ordnt-pos-mobile-ticket-open
    .ordnt-simple-polotab-layout:not(.ordnt-pos-cash-mode)
    > .ordnt-simple-category-rail,
  body.ordnt-pos-live.ordnt-pos-mobile-ticket-open
    .ordnt-simple-polotab-layout:not(.ordnt-pos-cash-mode)
    > .ordnt-pos-workspace-pane {display:none!important;}
  body.ordnt-pos-live.ordnt-pos-mobile-ticket-open
    .ordnt-simple-polotab-layout:not(.ordnt-pos-cash-mode)
    > .ordnt-simple-ticket {
    display:grid!important;
    grid-area:ticket!important;
    box-sizing:border-box!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    min-height:0!important;
    padding-top:42px!important;
    overflow:hidden!important;
  }

  body.ordnt-pos-live .ordnt-pos-mobile-ticket-toggle:not([hidden]) {
    position:fixed;
    right:max(11px,env(safe-area-inset-right));
    bottom:max(12px,env(safe-area-inset-bottom));
    z-index:60;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:118px;
    min-height:46px;
    padding:8px 13px;
    border:1px solid #1a55e3;
    border-radius:12px;
    background:#245ff5;
    box-shadow:0 7px 20px rgba(27,82,176,.25);
    color:#fff;
    font:800 13px/1.2 Inter,system-ui,sans-serif;
    cursor:pointer;
    touch-action:manipulation;
  }
  body.ordnt-pos-live.ordnt-pos-mobile-ticket-open
    .ordnt-pos-mobile-ticket-toggle:not([hidden]) {
    top:58px;
    bottom:auto;
    left:max(12px,env(safe-area-inset-left));
    right:auto;
    min-height:36px;
    min-width:93px;
    padding:6px 9px;
    border-color:#b8cdf1;
    background:#eff5ff;
    box-shadow:none;
    color:#2256b3;
    font-size:11px;
  }
  body.ordnt-pos-live .ordnt-simple-products {
    min-height:0!important;
    max-width:100%;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    overflow-x:hidden!important;
  }
  body.ordnt-pos-live .ordnt-simple-polotab-layout:not(.ordnt-pos-workspace-mode)
    > .ordnt-simple-stage {
    padding-bottom:52px;
  }
}
@media (max-width:375px) {
  body.ordnt-pos-live .ordnt-simple-pos.ordnt-pos-canonical
    .ordnt-simple-polotab-layout:not(.ordnt-pos-workspace-mode):not(.ordnt-pos-cash-mode) {
    grid-template-columns:minmax(62px,22%) minmax(0,1fr)!important;
    gap:4px!important;
  }
}
