/* ─────────────────────────────────────────────
   TicketCraft — Print Styles
   Laser-focused on 58mm thermal accuracy
   ───────────────────────────────────────────── */

@media print {
  /* Hide EVERYTHING except the ticket */
  body > *:not(#print-mode) { display: none !important; }
  #print-mode { display: block !important; }

  /* Reset page */
  @page {
    size: 58mm auto;
    margin: 0;
    padding: 0;
  }

  html, body {
    width: 58mm;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    color: #000 !important;
    font-size: 10px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  #print-mode {
    display: block !important;
    width: 58mm;
    margin: 0;
    padding: 0;
  }

  #ticket-print-clone {
    width: 58mm;
    min-width: 58mm;
    max-width: 58mm;
    margin: 0;
    padding: 0;
  }

  /* Force ticket to proper size for print */
  #ticket-print-clone .ticket-root {
    width: 58mm !important;
    min-width: 58mm !important;
    max-width: 58mm !important;
    padding: 6mm 4mm !important; /* Proper margins for thermal print */
    box-shadow: none !important;
    page-break-inside: avoid;
  }

  /* Remove decorative elements */
  .ticket-shadow-top,
  .ticket-shadow-bottom { display: none !important; }

  /* Ensure no page breaks inside rows */
  .ticket-items tbody tr { page-break-inside: avoid; }

  /* Make sure images print correctly */
  img { max-width: 100% !important; }
}
