/* ASC-PEDIDOS-BANDEJA-TPV-V1 · bandeja de pedidos online. Tokens Ascua (css/ascua-tokens.css) con respaldo literal.
   Criterio: se lee a un metro, con prisa: número grande, hora grande, botón principal ancho y naranja. */

/* «!» en el botón Pedidos: mismo aspecto que el de Reservas (css/plano-v2.css) */
#btn-pedidos, #mob-btn-pedidos { position: relative; }
#btn-pedidos .ped-aviso, #mob-btn-pedidos .ped-aviso {
  position: absolute; top: -8px; right: -8px;
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--ascua-orange, #F56820); color: #fff;
  font: 800 14px/22px 'Figtree', 'Inter', system-ui, sans-serif; text-align: center;
  box-shadow: 0 0 0 2px var(--bone, #FAF7F2), 0 2px 6px rgba(0, 0, 0, .25);
  pointer-events: none; animation: pedAvisoLatido 1.6s ease-in-out infinite;
}
body.dark #btn-pedidos .ped-aviso, body.dark #mob-btn-pedidos .ped-aviso { box-shadow: 0 0 0 2px #0D0C0A, 0 2px 8px rgba(0, 0, 0, .5); }
@keyframes pedAvisoLatido { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }
@media (prefers-reduced-motion: reduce) { #btn-pedidos .ped-aviso, #mob-btn-pedidos .ped-aviso { animation: none; } }

/* Panel */
#pedidos-overlay {
  position: fixed; inset: 0; z-index: 790; background: rgba(13, 12, 10, .55);
  display: flex; align-items: stretch; justify-content: center; padding: 16px;
}
#pedidos-panel {
  width: 100%; max-width: 980px; display: flex; flex-direction: column; overflow: hidden;
  background: var(--ascua-surface, #FBF9F5); color: var(--ascua-text, #23201B);
  border-radius: var(--ascua-radius-lg, 20px); box-shadow: var(--ascua-shadow-md, 0 4px 14px rgba(35,32,27,.14));
  font-family: 'Figtree', 'Inter', system-ui, sans-serif;
}
.ped-cab { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 8px; }
.ped-cab h2 { margin: 0; font-size: 1.35rem; font-weight: 800; }
.ped-x { width: 46px; height: 46px; border: 0; border-radius: 12px; font-size: 1.2rem; cursor: pointer;
  background: var(--ascua-card, #fff); color: var(--ascua-text, #23201B); box-shadow: var(--ascua-shadow-sm, 0 2px 6px rgba(35,32,27,.1)); }
.ped-tabs { display: flex; gap: 8px; padding: 4px 20px 12px; flex-wrap: wrap; }
.ped-tab { min-height: 44px; padding: 0 16px; border-radius: 22px; cursor: pointer; font: 700 .95rem/1 inherit;
  border: 1.5px solid var(--ascua-border-strong, rgba(90,85,76,.3)); background: transparent; color: var(--ascua-text-secondary, #6E6862); }
.ped-tab.on { background: var(--ascua-orange, #F56820); border-color: var(--ascua-orange, #F56820); color: #fff; }
.ped-cnt { display: inline-block; min-width: 22px; padding: 2px 6px; margin-left: 4px; border-radius: 11px;
  background: rgba(0,0,0,.12); font-size: .82rem; }
.ped-tab.on .ped-cnt { background: rgba(255,255,255,.25); }
.ped-lista { flex: 1; overflow-y: auto; padding: 0 20px 20px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; align-content: start; }
.ped-vacio { grid-column: 1 / -1; text-align: center; color: var(--ascua-text-secondary, #6E6862); padding: 48px 0; font-size: 1.05rem; }

.ped-card { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px;
  background: var(--ascua-card, #fff); border: 1px solid var(--ascua-border, rgba(90,85,76,.16));
  border-radius: var(--ascua-radius-md, 14px); box-shadow: var(--ascua-shadow-sm, 0 2px 6px rgba(35,32,27,.1)); }
.ped-card.ped-pagado, .ped-card.ped-pendiente_pago { border: 2px solid var(--ascua-orange, #F56820); }
.ped-card header { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ped-num { font-size: 1.5rem; font-weight: 800; }
.ped-hora { margin-left: auto; font-size: 1.35rem; font-weight: 800; }
.ped-canal { padding: 3px 9px; border-radius: 8px; font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .02em;
  background: var(--ascua-orange-soft, rgba(245,104,32,.1)); color: var(--ascua-orange-pressed, #D4530F); }
.ped-canal-glovo { background: #FFC244; color: #1F1F1F; }
.ped-canal-uber  { background: #06C167; color: #fff; }
.ped-canal-justeat { background: #FF8000; color: #fff; }
.ped-tipo { font-size: .9rem; font-weight: 700; color: var(--ascua-text-secondary, #6E6862); }
.ped-cli { font-weight: 700; }
.ped-cli a { color: inherit; }
.ped-dir { font-size: .92rem; color: var(--ascua-text-muted, #57514B); }
.ped-lineas { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 1rem; }
.ped-com { display: block; margin-left: 24px; font-size: .88rem; color: var(--ascua-text-secondary, #6E6862); }
.ped-notas { padding: 8px 10px; border-radius: 10px; font-weight: 700; font-size: .95rem;
  background: rgba(178,106,0,.12); color: var(--ascua-warn, #B26A00); }
.ped-card footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ped-total { font-size: 1.2rem; font-weight: 800; color: var(--ascua-price, #3A342C); }
.ped-pago { font-size: .85rem; font-weight: 700; padding: 3px 8px; border-radius: 8px; }
.ped-pago-pagado { background: rgba(22,163,74,.12); color: var(--ascua-kitchen-pressed, #166534); }
.ped-pago-cobrar { background: rgba(178,106,0,.14); color: var(--ascua-warn, #B26A00); }
.ped-pago-plat   { background: rgba(90,85,76,.12); color: var(--ascua-text-muted, #57514B); }
.ped-acciones, .ped-motivos { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ped-motivos span { font-weight: 700; font-size: .9rem; }
.ped-btn { min-height: 52px; padding: 0 18px; border-radius: 12px; cursor: pointer; font: 800 1rem/1 inherit; border: 0; }
.ped-btn.pri { flex: 1; background: var(--ascua-orange, #F56820); color: #fff; }
.ped-btn.pri:active { background: var(--ascua-orange-pressed, #D4530F); }
.ped-btn.sec { background: transparent; color: var(--ascua-text, #23201B); border: 1.5px solid var(--ascua-border-strong, rgba(90,85,76,.3)); }
.ped-btn.txt { background: transparent; color: var(--ascua-danger, #C0392B); min-height: 44px; padding: 0 8px; }
.ped-btn:disabled { opacity: .5; cursor: wait; }

body.dark #pedidos-panel { background: #161411; color: #F3EEE7; }
body.dark .ped-card, body.dark .ped-x { background: #201D19; border-color: rgba(255,255,255,.08); color: #F3EEE7; }
body.dark .ped-total { color: #F3EEE7; }
body.dark .ped-btn.sec { color: #F3EEE7; border-color: rgba(255,255,255,.22); }

@media (max-width: 640px) {
  #pedidos-overlay { padding: 0; }
  #pedidos-panel { border-radius: 0; }
  .ped-lista { grid-template-columns: 1fr; padding: 0 12px 16px; }
}
