/* ─────────────────────────────────────────────
   TicketCraft — Ticket Styles (Clean B&W)
   These styles apply to the preview AND print.
   58mm thermal printer target: ~384px wide.
   ───────────────────────────────────────────── */

/* ════════════ TICKET ROOT ════════════ */
.ticket-root {
  width: 384px;
  min-width: 384px;
  max-width: 384px;
  background: #ffffff;
  color: #000000;
  font-family: 'Courier New', Courier, monospace;
  font-size: 10px;
  line-height: 1.35;
  padding: 20px 12px;
  box-sizing: border-box;
  overflow: hidden;
  word-break: break-word;
  /* Preview only shadow */
  box-shadow: 0 0 0 1px rgba(0,0,0,0.06);
}

/* ════════════ HEADER ════════════ */
.ticket-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #888;
  margin-bottom: 6px;
}
.ticket-header.align-left   { align-items: flex-start; text-align: left; }
.ticket-header.align-center { align-items: center;     text-align: center; }
.ticket-header.align-right  { align-items: flex-end;   text-align: right; }

.ticket-logo {
  max-width: 120px;
  max-height: 60px;
  object-fit: contain;
  margin-bottom: 4px;
  filter: grayscale(100%) contrast(1.5);
}

.ticket-business-name {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.2;
  word-break: break-word;
}

.ticket-business-sub {
  font-size: 9px;
  color: #333;
  line-height: 1.3;
}

.ticket-meta {
  font-size: 9px;
  color: #444;
  margin-top: 2px;
}

/* ════════════ DIVIDERS ════════════ */
.ticket-divider {
  border: none;
  border-top: 1px dashed #888;
  margin: 5px 0;
}
.ticket-divider-solid {
  border: none;
  border-top: 1px solid #000;
  margin: 5px 0;
}
.ticket-divider-double {
  border: none;
  border-top: 2px double #000;
  margin: 5px 0;
}

/* ════════════ ITEMS TABLE ════════════ */
.ticket-items {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
  margin-bottom: 4px;
}

.ticket-items thead th {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 0;
  border-bottom: 1px solid #000;
}
.ticket-items thead th:first-child  { text-align: left; }
.ticket-items thead th:not(:first-child) { text-align: right; }

.ticket-items tbody tr { vertical-align: top; }
.ticket-items tbody tr:last-child td { }

.ticket-item-name {
  text-align: left;
  padding: 2px 0;
  max-width: 200px;
  word-break: break-word;
  padding-right: 4px;
}
.ticket-item-name .item-desc {
  font-size: 8.5px;
  color: #555;
  display: block;
}
.ticket-item-qty,
.ticket-item-price,
.ticket-item-total {
  text-align: right;
  padding: 2px 0;
  white-space: nowrap;
}
.ticket-item-qty    { width: 32px; }
.ticket-item-price  { width: 56px; }
.ticket-item-total  { width: 60px; font-weight: 600; }

/* Alt row shading for readability */
.ticket-items tbody tr:nth-child(odd) td {
  /* No background — thermal printers */
}

/* ════════════ TOTALS ════════════ */
.ticket-totals {
  width: 100%;
  font-size: 10px;
}
.ticket-totals td { padding: 1.5px 0; }
.ticket-totals .label { text-align: left; color: #333; }
.ticket-totals .value { text-align: right; font-family: 'Courier New', monospace; }
.ticket-totals .total-row td {
  font-size: 13px;
  font-weight: 700;
  padding-top: 4px;
}
.ticket-totals .total-label { text-align: left; }
.ticket-totals .total-value { text-align: right; }

/* ════════════ FOOTER ════════════ */
.ticket-footer {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #888;
  text-align: center;
  font-size: 9px;
  color: #333;
  line-height: 1.5;
}
.ticket-footer .footer-main {
  font-size: 10px;
  font-weight: 600;
  color: #000;
  margin-bottom: 2px;
}
.ticket-footer .footer-extra {
  font-size: 8.5px;
  color: #555;
}

/* ════════════ QR CODE ════════════ */
.ticket-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #888;
}
.ticket-qr canvas,
.ticket-qr img {
  width: 80px !important;
  height: 80px !important;
}
.ticket-qr-label {
  font-size: 8px;
  color: #555;
  text-align: center;
}

/* ════════════ TICKET STAMP LINE ════════════ */
.ticket-stamp {
  font-size: 8px;
  color: #999;
  text-align: center;
  margin-top: 4px;
  font-style: italic;
}

/* ════════════ PREVIEW WRAPPER ════════════ */
.ticket-preview-shell .ticket-root {
  /* Keep visible in preview */
}
