/* print.css — hojas de 80 mm para ticketera térmica. En pantalla la zona de impresión no se ve. */

#zona-impresion { display: none; }

.ticket { width: 72mm; font-family: "Cascadia Mono", "Consolas", "Courier New", monospace; font-size: 11pt; line-height: 1.3; color: #000; }
.tk-cabeza { text-align: center; }
.tk-logo { display: block; width: 40mm; height: 40mm; object-fit: contain; margin: 0 auto 2mm; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.tk-negocio { font-size: 15pt; font-weight: 700; }
.tk-titulo { text-align: center; font-size: 13pt; font-weight: 700; margin: 1mm 0; }
.tk-fila { display: flex; justify-content: space-between; gap: 3mm; }
.tk-fila > span:last-child { text-align: right; white-space: nowrap; }
.tk-item { margin: 0.6mm 0; }
.tk-item-grande { font-size: 14pt; font-weight: 700; }
.tk-extra { padding-left: 4mm; font-size: 10pt; font-weight: 400; }
.tk-aviso { padding-left: 4mm; font-size: 12pt; font-weight: 700; text-decoration: underline; }
.tk-fila > span:first-child { white-space: pre-wrap; }
.tk-total { font-size: 14pt; font-weight: 700; }
.tk-raya { border-top: 1px dashed #000; margin: 1.5mm 0; }
.tk-nota { text-align: center; font-size: 9.5pt; margin-top: 1mm; }
.tk-firma { margin-top: 14mm; border-top: 1px solid #000; text-align: center; font-size: 10pt; }

/* Ticket de venta: la vista previa y la impresión comparten el mismo documento. */
.ticket-vista { width: fit-content; max-width: 100%; margin: 0 auto; padding: 4mm; background: #fff; color: #000; border: 1px solid #ddd; }
.ticket.ticket-venta { width: 72mm; max-width: 100%; font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-weight: 400; line-height: 1.35; color: #000; background: #fff; font-variant-numeric: tabular-nums; }
.ticket-venta * { box-sizing: border-box; color: inherit; }
.tk-marca-venta { text-align: center; margin-bottom: 1.5mm; line-height: 1; }
.tk-logo-recorte { width: 52mm; height: 38.5mm; overflow: hidden; margin: 0 auto; }
.tk-logo-venta { display: block; width: 52mm; height: 52mm; max-width: none; object-fit: contain; }
.tk-marca-brasa { font-size: 14pt; font-weight: 900; letter-spacing: -.2pt; }
.tk-marca-parrillas { font-size: 15pt; font-weight: 900; }
.tk-cabeza-venta .tk-ruc { display: block; margin: 1.5mm 0 .5mm; font-size: 12pt; }
.tk-direccion { max-width: 65mm; margin: 0 auto; text-wrap: balance; white-space: pre-line; }
.ticket-venta .tk-raya { border-top: 1px solid #000; margin: 2.5mm 0; }
.ticket-venta .tk-titulo { font-size: 16pt; line-height: 1.15; font-weight: 800; }
.tk-numero { text-align: center; font-weight: 700; font-size: 12pt; margin-top: 1mm; }
.tk-datos > div { margin: .4mm 0; overflow-wrap: anywhere; }
.ticket-venta .tk-fila { gap: 2mm; }
.ticket-venta .tk-fila > span:first-child { min-width: 0; }
.tk-detalle { width: 100%; border-collapse: collapse; table-layout: fixed; margin: 0 0 2mm; font-size: 9.5pt; }
.tk-detalle th, .tk-detalle td { padding: 1.5mm .5mm; border: 0; color: #000; background: #fff; vertical-align: top; }
.tk-detalle th { font-size: 8.3pt; font-weight: 800; border-bottom: 1px solid #000; white-space: nowrap; text-align: left; }
.tk-detalle tbody tr:last-child td { border-bottom: 1px solid #000; }
.tk-detalle th:nth-child(1), .tk-detalle td:nth-child(1) { width: 14%; text-align: center; }
.tk-detalle th:nth-child(2), .tk-detalle td:nth-child(2) { width: 40%; overflow-wrap: anywhere; }
.tk-detalle th:nth-child(1) { text-align: left; }
.tk-detalle th:nth-child(2) { padding-left: 1.5mm; }
.tk-detalle th:nth-child(3), .tk-detalle td:nth-child(3) { width: 22%; text-align: right; }
.tk-detalle th:nth-child(4), .tk-detalle td:nth-child(4) { width: 24%; text-align: right; }
.ticket-venta .tk-total { font-size: 13pt; font-weight: 800; align-items: center; }
.tk-pago > div { margin: .5mm 0; }
.tk-despedida { text-align: center; font-size: 11pt; font-style: italic; }
.tk-despedida strong { display: block; font-size: 14pt; font-weight: 800; margin-bottom: .5mm; }
.tk-aclaracion { margin-top: 2mm; text-align: center; font-size: 8pt; }

@media screen {
  body.imprimiendo #zona-impresion { display: block; position: fixed; left: -10000px; top: 0; width: 72mm; visibility: hidden; }
}

@media print {
  @page { size: 80mm 200mm; margin: 3mm 4mm; }
  html, body { background: #fff !important; }
  body > *:not(#zona-impresion) { display: none !important; }
  #zona-impresion { display: block !important; }
  .ticket { page-break-after: always; break-after: page; }
  .ticket:last-child { page-break-after: auto; break-after: auto; }
  .ticket-venta { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .ticket-venta tr, .ticket-venta .tk-total, .tk-despedida { break-inside: avoid; }
}
