/* ============================================================
   ADQP POS — Estilos de impressão para talão térmico
   ============================================================ */

/* ── Esconder talão no ecrã (só aparece no modal) ─────────── */
#talao-print-root { display: none; }

/* ── @media print: esconde tudo exceto o talão ─────────────── */
@media print {
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

  /* @page.size é injectada dinamicamente em JS conforme a largura do rolo
     (58/80/112mm) configurada em /admin/configuracoes.php — ver
     aplicarLarguraPagina() em index.php. Sem injecção, browser assume A4
     e a TM-T20III corta o talão. */
  @page {
    margin: 0;
  }

  body > * { display: none !important; }

  #talao-print-root {
    display: block !important;
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 9999;
  }

  .talao-no-print { display: none !important; }
}

/* ── Bloco do talão ─────────────────────────────────────────── */
.talao {
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  line-height: 1.45;
  color: #000;
  background: #fff;
  padding: 6mm 4mm 8mm;
  margin: 0 auto;
  /* largura definida por classe */
}

.talao.w58  { width: 58mm;  max-width: 58mm;  }
.talao.w80  { width: 80mm;  max-width: 80mm;  }
.talao.w112 { width: 112mm; max-width: 112mm; }

/* ── Blocos do talão ────────────────────────────────────────── */
.tal-centro   { text-align: center; }
.tal-nome-bar { font-size: 14px; font-weight: bold; text-align: center; letter-spacing: .04em; }
.tal-sep      { border: none; border-top: 1px dashed #000; margin: 4px 0; }
.tal-sep-sol  { border: none; border-top: 1px solid #000; margin: 4px 0; }
.tal-ped      { text-align: center; font-size: 15px; font-weight: bold; letter-spacing: .1em; margin: 3px 0; }
.tal-num-ped  { text-align: center; font-size: 16px; font-weight: bold; margin: 2px 0; }
.tal-reprint  { text-align: center; font-size: 12px; font-weight: bold; letter-spacing: .08em;
                border: 1px solid #000; padding: 1px 0; margin: 4px 0; }
.tal-meta     { display: flex; justify-content: space-between; font-size: 12px; }
.tal-meta-full{ font-size: 12px; margin: 1px 0; }

/* ── Linha de item ──────────────────────────────────────────── */
.tal-itens    { margin: 4px 0; }
.tal-item     { display: flex; gap: 4px; font-size: 12px; margin: 1px 0; }
.tal-item-qt  { white-space: nowrap; flex-shrink: 0; }
.tal-item-nom { flex: 1; overflow: hidden; }
.tal-item-preco { white-space: nowrap; text-align: right; flex-shrink: 0; }
.tal-item-unit  { font-size: 11px; color: #555; padding-left: calc(1.4em + 4px); }

/* ── Total e rodapé ─────────────────────────────────────────── */
.tal-total    { display: flex; justify-content: space-between; font-size: 15px; font-weight: bold;
                margin: 4px 0; }
.tal-pag      { font-size: 12px; margin: 2px 0; display: flex; justify-content: space-between; }
.tal-rodape   { text-align: center; font-size: 11px; margin-top: 6px; }
