/* =============================================================
   POSWEB Restaurante v0.19.24 - PWA Production Polish
   Tipografía táctil, estado de sincronización y apariencia app.
   Capa visual final: no modifica la lógica de comandas/cobros.
   ============================================================= */
:root{
  --pwr-app-font:16px;
  --pwr-touch:48px;
  --pwr-radius-app:16px;
  --pwr-shadow-app:0 12px 34px rgba(15,23,42,.16);
}

/* Evita el pequeño flash/selección típico de una página web en terminales táctiles. */
html[data-pwr-standalone="1"],
html[data-pwr-runtime="native"]{
  background:#f3f5f7;
  -webkit-tap-highlight-color:transparent;
}
html[data-pwr-standalone="1"] body,
html[data-pwr-runtime="native"] body{
  overscroll-behavior:none;
  -webkit-touch-callout:none;
}

/* Controles táctiles globales POSWEB. */
#pwr-app button,
#pwr-app a.pwr-btn,
.pwr-commercial-app button,
.pwr-commercial-app a,
.pwr-dashboard-v17 button,
.pwr-reports-shell button,
.pwr-kds-app button{
  touch-action:manipulation;
}

/* Estado compacto de conexión/sincronización. */
.pwr-runtime-status-chip{
  min-height:42px;
  border:1px solid rgba(255,255,255,.18);
  border-radius:999px;
  padding:7px 11px;
  display:inline-flex;
  align-items:center;
  gap:7px;
  background:rgba(255,255,255,.10);
  color:#fff;
  font:800 12px/1 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  cursor:pointer;
  white-space:nowrap;
  box-shadow:none;
}
.pwr-runtime-status-chip .pwr-runtime-dot{
  width:9px;height:9px;border-radius:50%;background:#22c55e;box-shadow:0 0 0 3px rgba(34,197,94,.16);flex:0 0 auto;
}
.pwr-runtime-status-chip[data-state="offline"] .pwr-runtime-dot{background:#ef4444;box-shadow:0 0 0 3px rgba(239,68,68,.18)}
.pwr-runtime-status-chip[data-state="syncing"] .pwr-runtime-dot{background:#f59e0b;box-shadow:0 0 0 3px rgba(245,158,11,.20);animation:pwrPulse124 1.15s ease-in-out infinite}
.pwr-runtime-status-chip[data-state="warning"] .pwr-runtime-dot{background:#f59e0b;box-shadow:0 0 0 3px rgba(245,158,11,.20)}
@keyframes pwrPulse124{50%{opacity:.38;transform:scale(.78)}}

/* Si no existe una topbar compatible, el estado se fija como burbuja discreta. */
body > .pwr-runtime-status-chip.pwr-runtime-floating{
  position:fixed;
  right:max(12px,env(safe-area-inset-right));
  top:max(12px,env(safe-area-inset-top));
  z-index:2147483000;
  background:#0f172a;
  border-color:#334155;
  box-shadow:var(--pwr-shadow-app);
}

/* Sustituye el antiguo badge amarillo de v0.19.23 por el centro de estado. */
[data-pwr-local-orders-badge]{display:none!important}

/* Centro de estado: bottom sheet en móvil, tarjeta central en tablet/PC. */
.pwr-runtime-sheet{
  position:fixed;
  inset:0;
  z-index:2147483600;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  background:rgba(2,6,23,.48);
  backdrop-filter:blur(4px);
  -webkit-backdrop-filter:blur(4px);
  padding:0;
}
.pwr-runtime-sheet[hidden]{display:none!important}
.pwr-runtime-card{
  width:min(620px,100%);
  max-height:min(82dvh,760px);
  overflow:auto;
  background:#fff;
  color:#0f172a;
  border-radius:22px 22px 0 0;
  padding:18px 16px calc(18px + env(safe-area-inset-bottom));
  box-shadow:0 -18px 55px rgba(2,6,23,.28);
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
.pwr-runtime-card-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.pwr-runtime-card-head small{display:block;color:#64748b;font-size:12px;font-weight:900;letter-spacing:.05em;text-transform:uppercase;margin-bottom:3px}
.pwr-runtime-card-head h2{margin:0;font-size:23px;line-height:1.1;color:#0f172a}
.pwr-runtime-close{width:44px;height:44px;border:0;border-radius:999px;background:#eef2f7;color:#0f172a;font-size:25px;cursor:pointer}
.pwr-runtime-list{display:grid;gap:9px}
.pwr-runtime-row{min-height:58px;border:1px solid #e2e8f0;border-radius:14px;padding:10px 12px;display:flex;align-items:center;justify-content:space-between;gap:12px;background:#fff}
.pwr-runtime-row strong{display:block;font-size:15px;color:#0f172a}
.pwr-runtime-row small{display:block;color:#64748b;font-size:13px;line-height:1.3;margin-top:2px}
.pwr-runtime-value{font-size:14px;font-weight:900;text-align:right;color:#0f172a}
.pwr-runtime-value.ok{color:#15803d}.pwr-runtime-value.warn{color:#b45309}.pwr-runtime-value.bad{color:#b91c1c}
.pwr-runtime-actions{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:14px}
.pwr-runtime-action{min-height:50px;border:0;border-radius:14px;font-size:15px;font-weight:900;cursor:pointer;padding:10px 13px}
.pwr-runtime-action.primary{background:#0f172a;color:#fff}.pwr-runtime-action.secondary{background:#e9eff8;color:#17365f}.pwr-runtime-action:disabled{opacity:.48;cursor:not-allowed}
.pwr-runtime-note{margin:12px 1px 0;color:#64748b;font-size:12px;line-height:1.45}

@media (min-width:760px){
  .pwr-runtime-sheet{align-items:center;padding:24px}
  .pwr-runtime-card{border-radius:22px;padding:20px;box-shadow:0 22px 80px rgba(2,6,23,.30)}
}

/* =============================================================
   CELULAR - escala visual de aplicación (no mini-web).
   ============================================================= */
@media (max-width:759px){
  #pwr-app{font-size:16px!important}
  #pwr-app .pwr-topbar{min-height:calc(72px + env(safe-area-inset-top))!important;flex-basis:calc(72px + env(safe-area-inset-top))!important;padding:max(8px,env(safe-area-inset-top)) 10px 8px!important;gap:8px!important}
  #pwr-app .pwr-topbar h2{font-size:18px!important;line-height:1.1!important;letter-spacing:-.01em!important}
  #pwr-app .pwr-topbar span{font-size:13px!important;line-height:1.2!important}
  #pwr-app .pwr-top-actions{gap:5px!important}
  #pwr-app .pwr-top-action-icon,
  #pwr-app .pwr-top-action-text,
  #pwr-app .pwr-icon-btn{min-width:46px!important;width:46px!important;min-height:46px!important;height:46px!important;border-radius:13px!important}
  #pwr-app .pwr-section-title h3{font-size:23px!important}
  #pwr-app .pwr-legend{font-size:13px!important;gap:10px!important}
  #pwr-app .pwr-salon-title{font-size:13px!important;letter-spacing:.045em!important;margin:14px 0 9px!important}
  #pwr-app .pwr-service-new{min-height:60px!important;border-radius:15px!important}
  #pwr-app .pwr-service-new span{font-size:15px!important}
  #pwr-app .pwr-service-section-title strong{font-size:15px!important}
  #pwr-app .pwr-service-section-title span{font-size:12px!important;min-width:26px!important;height:26px!important}
  #pwr-app .pwr-service-payment-summary{font-size:12px!important;line-height:1.35!important}
  #pwr-app .pwr-tables-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
  #pwr-app .pwr-table-card{min-height:126px!important;border-radius:17px!important;padding:14px!important;gap:6px!important}
  #pwr-app .pwr-table-card strong{font-size:18px!important;line-height:1.15!important}
  #pwr-app .pwr-table-card small{font-size:14px!important;line-height:1.25!important}
  #pwr-app .pwr-table-state{font-size:12px!important;padding:5px 8px!important}
  #pwr-app .pwr-order-head small{font-size:13px!important}
  #pwr-app .pwr-order-head h3{font-size:24px!important}
  #pwr-app .pwr-status,.pwr-fulfillment-status{font-size:12px!important;min-height:34px!important;padding:7px 10px!important}
  #pwr-app .pwr-order-flow-nav button{min-height:50px!important;font-size:15px!important}
  #pwr-app .pwr-order-flow-nav button b{font-size:12px!important;min-width:24px!important;height:24px!important}
  #pwr-app .pwr-product-search input[type="search"]{min-height:54px!important;border-radius:15px!important;padding:11px 15px!important;font-size:17px!important}
  #pwr-app .pwr-product{min-height:82px!important;border-radius:15px!important;padding:11px!important;gap:10px!important}
  #pwr-app .pwr-product-station{width:48px!important;height:48px!important;border-radius:12px!important;font-size:20px!important}
  #pwr-app .pwr-product-copy strong{font-size:17px!important;line-height:1.2!important;white-space:normal!important;display:-webkit-box!important;-webkit-box-orient:vertical!important;-webkit-line-clamp:2!important}
  #pwr-app .pwr-product-copy small{font-size:13px!important;line-height:1.25!important}
  #pwr-app .pwr-product b{font-size:24px!important;min-width:32px!important}
  #pwr-app .pwr-ticket-title{font-size:22px!important}
  #pwr-app .pwr-item-main strong{font-size:18px!important;line-height:1.25!important}
  #pwr-app .pwr-item-main small{font-size:13px!important;line-height:1.3!important}
  #pwr-app .pwr-item-modifiers span{font-size:13px!important;line-height:1.35!important}
  #pwr-app .pwr-item-controls button{min-width:46px!important;width:46px!important;min-height:46px!important;height:46px!important;font-size:23px!important}
  #pwr-app .pwr-item-controls span{min-height:46px!important;font-size:17px!important}
  #pwr-app .pwr-item-controls input[data-action="notes"]{min-height:48px!important;height:48px!important;font-size:16px!important}
  #pwr-app .pwr-total-row{font-size:20px!important}
  #pwr-app .pwr-total-row strong{font-size:31px!important}
  #pwr-app .pwr-order-actions .pwr-btn{min-height:54px!important;border-radius:15px!important;font-size:16px!important;padding:11px 10px!important}
  #pwr-app #pwr-open-checkout{min-height:62px!important;font-size:19px!important}
  #pwr-app .pwr-mobile-cart-bar{min-height:62px!important;border-radius:16px!important;font-size:15px!important}
  #pwr-app .pwr-mobile-cart-bar strong{font-size:17px!important}
  #pwr-app .pwr-modal-card{border-radius:22px 22px 0 0!important}
  #pwr-app .pwr-modal-card h2,#pwr-app .pwr-modal-card h3{font-size:22px!important}
  #pwr-app .pwr-modal-card label,#pwr-app .pwr-modal-card p{font-size:15px!important;line-height:1.4!important}
  #pwr-app .pwr-modal-card input,#pwr-app .pwr-modal-card textarea,#pwr-app .pwr-modal-card select{font-size:16px!important;min-height:48px!important}

  /* Shell comercial/administración: textos pequeños corregidos. */
  .pwr-app-mobilebar strong{font-size:16px!important;max-width:44vw!important}
  .pwr-commercial-section-head h2{font-size:24px!important}
  .pwr-commercial-section-head p{font-size:14px!important;line-height:1.5!important}
  .pwr-product-card-body>h3{font-size:18px!important;line-height:1.25!important}
  .pwr-product-card-kicker{font-size:11px!important}
  .pwr-product-card-price{font-size:21px!important}
  .pwr-product-card-info-row,.pwr-product-card-info-row *{font-size:13px!important}
  .pwr-product-card-actions a,.pwr-product-card-actions button{min-height:46px!important;font-size:13px!important}
  .pwr-new-product-button{min-height:52px!important;font-size:14px!important}

  .pwr-runtime-status-chip{min-width:44px;min-height:44px;padding:7px 10px;font-size:12px}
  .pwr-runtime-status-chip .pwr-runtime-label{display:none}
}

@media (max-width:390px){
  #pwr-app .pwr-tables-grid{grid-template-columns:1fr 1fr!important}
  #pwr-app .pwr-table-card{min-height:118px!important;padding:12px!important}
  #pwr-app .pwr-table-card strong{font-size:17px!important}
  #pwr-app .pwr-topbar h2{font-size:16px!important}
  #pwr-app .pwr-topbar span{font-size:12px!important}
}

/* =============================================================
   TABLET - mayor legibilidad y densidad táctil sin desperdiciar espacio.
   ============================================================= */
@media (min-width:760px) and (max-width:1180px){
  #pwr-app{font-size:16px!important}
  #pwr-app .pwr-topbar h2{font-size:21px!important}
  #pwr-app .pwr-topbar span{font-size:13px!important}
  #pwr-app .pwr-table-card strong{font-size:18px!important}
  #pwr-app .pwr-table-card small{font-size:14px!important}
  #pwr-app .pwr-table-state{font-size:12px!important}
  #pwr-app .pwr-product-copy strong{font-size:17px!important}
  #pwr-app .pwr-product-copy small{font-size:13px!important}
  #pwr-app .pwr-product-search input[type="search"]{font-size:17px!important;min-height:52px!important}
  #pwr-app .pwr-ticket-title{font-size:22px!important}
  #pwr-app .pwr-item-main strong{font-size:18px!important}
  #pwr-app .pwr-item-main small{font-size:13px!important}
  #pwr-app .pwr-order-actions .pwr-btn{font-size:16px!important;min-height:54px!important}
  #pwr-app #pwr-open-checkout{font-size:19px!important;min-height:60px!important}
}
