/* ==========================================================================
   Desayunos Ümami — Ticket de compra (ticket.html)
   En pantalla parece un ticket de papel. Al imprimir solo sale el ticket,
   en blanco y negro, al ancho elegido: hoja carta, 80 mm o 58 mm.
   ========================================================================== */

.tk-main { max-width: 560px; }

/* ---------- Herramientas ---------- */
.tk-herramientas { display: grid; gap: 12px; }
.tk-formatos { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tk-formatos__etiqueta { font-weight: 800; margin-right: 2px; }
.tk-formato {
  min-height: 40px; padding: 6px 14px; border-radius: 999px; cursor: pointer;
  border: 2px solid #E3D3AE; background: var(--blanco); color: var(--cafe); font-weight: 700;
}
.tk-formato[aria-pressed="true"] { border-color: var(--cafe); background: var(--crema); box-shadow: inset 0 0 0 1px var(--cafe); }
.tk-botones { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 480px) { .tk-botones { grid-template-columns: repeat(3, 1fr); } }
.tk-botones .btn { padding-left: 12px; padding-right: 12px; }
.tk-ayuda { background: var(--crema); border-left: 6px solid var(--dorado); border-radius: var(--radio-sm); padding: 12px 14px; display: grid; gap: 8px; font-size: .95rem; }
.tk-ayuda .btn { justify-self: start; min-height: 40px; padding: 8px 16px; font-size: .92rem; }
.tk-nota { font-size: .88rem; color: var(--cafe-suave); }
.tk-nota a { color: var(--cafe); font-weight: 800; }

/* ---------- El papel ---------- */
.tk-papel {
  background: var(--blanco); color: #222; margin: 14px auto 0; max-width: 380px;
  padding: 22px 18px 26px; border-radius: 6px; box-shadow: var(--sombra);
  font-size: .95rem; line-height: 1.35; font-variant-numeric: tabular-nums;
  border-top: 6px solid var(--mostaza);
}
.tk-cab { text-align: center; display: grid; gap: 2px; justify-items: center; padding-bottom: 10px; border-bottom: 2px dashed #bbb; }
.tk-logo { display: inline-flex; align-items: baseline; gap: 6px; color: var(--cafe); }
.tk-logo__taza { width: 30px; height: 30px; align-self: center; }
.tk-logo__umami { font-family: var(--f-titulo); font-size: 2.1rem; line-height: 1; }
.tk-logo__sabor { font-weight: 800; font-size: .72rem; letter-spacing: .3em; }
.tk-negocio { font-weight: 900; font-size: 1.05rem; margin-top: 2px; }
.tk-chico { font-size: .82rem; color: #555; }
.tk-titulo { text-align: center; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; font-size: .85rem; margin: 10px 0 4px; }
.tk-cancelado { text-align: center; font-weight: 900; border: 2px solid currentColor; color: var(--rojo); padding: 6px; margin: 8px 0; border-radius: 4px; letter-spacing: .06em; }
.tk-cancelado small { font-weight: 700; letter-spacing: 0; }

.tk-bloque { padding: 8px 0; border-bottom: 1px dashed #bbb; display: grid; gap: 2px; }
.tk-fila { display: flex; justify-content: space-between; gap: 12px; }
.tk-fila > span:first-child { color: #555; flex: none; }
.tk-fila > span:last-child { text-align: right; overflow-wrap: anywhere; }
.tk-fila--fuerte > span:last-child { font-weight: 900; }
.tk-fila--total { font-weight: 900; font-size: 1.15em; margin-top: 4px; padding-top: 6px; border-top: 2px solid #222; }
.tk-fila--total > span:first-child { color: inherit; }

.tk-items { padding: 8px 0; border-bottom: 1px dashed #bbb; display: grid; gap: 8px; }
.tk-item__linea { display: flex; justify-content: space-between; gap: 12px; }
.tk-item__linea > span:last-child { white-space: nowrap; text-align: right; }
.tk-item__det { font-size: .86em; color: #444; padding-left: 1.2em; }
.tk-item__nota { font-style: italic; }
.tk-coment { padding: 8px 0; border-bottom: 1px dashed #bbb; font-size: .9em; overflow-wrap: anywhere; }
.tk-pie { text-align: center; padding-top: 12px; display: grid; gap: 2px; }
.tk-gracias { font-weight: 900; }

/* ---------- Impresión ---------- */
@media print {
  html, body, .pagina-simple { background: #fff !important; }
  .no-imprimir, .p-cabecera, .toast, .noscript { display: none !important; }
  .p-main, .tk-main { padding: 0 !important; margin: 0 !important; max-width: none !important; width: auto !important; }
  .tk-papel {
    box-shadow: none !important; border-radius: 0; margin: 0 auto; padding: 0;
    border-top: 0; color: #000; max-width: none;
  }
  .tk-papel * { color: #000 !important; }
  .tk-logo__taza { color: #000; }
  .tk-cab, .tk-bloque, .tk-items, .tk-coment { border-color: #000; }
  .tk-fila--total { border-top-color: #000; }
  .tk-item, .tk-fila { break-inside: avoid; page-break-inside: avoid; }

  html[data-formato="carta"] .tk-papel { width: 125mm; font-size: 11pt; }
  html[data-formato="80"] .tk-papel { width: 72mm; font-size: 9pt; margin: 0; }
  html[data-formato="58"] .tk-papel { width: 50mm; font-size: 7.5pt; margin: 0; }
  html[data-formato="58"] .tk-logo__umami { font-size: 1.6rem; }
  html[data-formato="58"] .tk-fila { gap: 6px; }
}

/* Promociones aplicadas (supabase/promociones.sql) */
.tk-fila--promo { color: #1E7A34; font-weight: 700; }
@media print { .tk-fila--promo { color: #000; } }
