/*
 * Print stylesheet for Tier 1 order print views.
 * Used by the dedicated `print` layout — no Tailwind/daisyUI loaded there
 * so crisp, predictable A4 output without UI chrome interference.
 *
 * The build bundles this onto every page, so body-level rules are scoped to
 * `body.print-doc` (set only by the print layout) — otherwise the on-screen
 * `padding: 24pt` below leaks a blank strip across the top of every admin
 * page. Print-only `.order*` classes don't exist elsewhere, so they're left
 * unscoped.
 */

@page {
  size: A4;
  margin: 12mm 14mm;
}

* { box-sizing: border-box; }

body.print-doc {
  margin: 0;
  padding: 0;
  font-family: -apple-system, "Helvetica Neue", "Segoe UI", Arial, sans-serif;
  font-size: 11pt;
  line-height: 1.4;
  color: #111;
  background: #fff;
}

.order {
  max-width: 180mm;
  margin: 0 auto;
  padding: 0;
}

.order + .order {
  page-break-before: always;
  break-before: page;
  margin-top: 0;
}

.order__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 2px solid #111;
  padding-bottom: 6pt;
  margin-bottom: 12pt;
}

.order__ref {
  font-size: 18pt;
  font-weight: 700;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
}

.order__pickup {
  font-size: 12pt;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.order__customer {
  font-size: 22pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin: 0 0 2pt;
}

.order__customer-meta {
  font-size: 10pt;
  color: #444;
  margin: 0 0 14pt;
}

.order__section-title {
  font-size: 9pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #444;
  border-bottom: 1px solid #ccc;
  padding-bottom: 3pt;
  margin: 14pt 0 6pt;
}

.order__items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.order__item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8pt 0;
  border-bottom: 1px dashed #ccc;
  page-break-inside: avoid;
}

.order__item:last-child {
  border-bottom: none;
}

.order__item-body {
  flex: 1;
  padding-right: 10pt;
}

.order__item-name {
  font-size: 13pt;
  font-weight: 700;
  margin: 0 0 2pt;
}

.order__option-group {
  margin: 0;
  font-size: 10.5pt;
  color: #222;
}

.order__option-group strong {
  font-weight: 600;
}

.order__item-note {
  margin: 4pt 0 0;
  padding: 3pt 6pt;
  font-style: italic;
  font-size: 10.5pt;
  border-left: 2px solid #111;
}

/*
 * Natasha's Law: every component (product + selected options) that
 * introduces an allergen must surface it. Set-union dedupe happens in the
 * model — the view just renders the joined list with a clear label.
 */
.order__item-allergens {
  margin: 6pt 0 0;
  padding-top: 4pt;
  border-top: 1px solid #ccc;
  font-size: 9.5pt;
  color: #222;
}

.order__item-allergens strong {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 8.5pt;
  margin-right: 4pt;
}

.order__item-price {
  font-size: 12pt;
  font-weight: 600;
  white-space: nowrap;
  text-align: right;
  min-width: 60pt;
}

.order__totals {
  margin-top: 14pt;
  padding-top: 10pt;
  border-top: 2px solid #111;
  text-align: right;
  font-size: 14pt;
  font-weight: 700;
}

.order__notes {
  margin-top: 10pt;
  padding: 8pt 10pt;
  border: 1px solid #999;
  font-size: 10.5pt;
}

.order__notes-label {
  display: block;
  font-size: 8.5pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #555;
  margin-bottom: 3pt;
}

/*
 * On-screen preview — when an operator opens the print page in a tab, the
 * print dialog appears, but if dismissed they should still see a clean view.
 */
@media screen {
  body.print-doc {
    background: #f3f3ee;
    padding: 24pt 0;
  }

  .order {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 14mm;
    margin-bottom: 12pt;
  }

  .order + .order {
    margin-top: 12pt;
  }
}

/*
 * Print-only — no shadows, no background, no decoration.
 */
@media print {
  body.print-doc {
    background: #fff;
  }

  .order {
    box-shadow: none;
    padding: 0;
  }

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