/* Print styles for pizzacalculator.pro
   Only #print-view-wrapper is shown when printing.
   All other page content is hidden via the rule below. */

@media print {
  @page {
    size: auto;
    margin: 4mm;
  }

  /* Hide all screen content — only show the branded print view */
  body > *:not(#print-view-wrapper) { display: none !important; }
  #print-view-wrapper { display: block !important; }

  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  html, body {
    width: 100%;
    margin: 0;
    padding: 0;
    background: #fff;
    font-family: 'Inter', system-ui, sans-serif;
  }

  /* ── Single-column layout: rec below table ── */
  .print-view {
    display: block;
    width: 100%;
    color: #1A1208;
    font-size: 9pt;
    line-height: 1.4;
  }

  /* ── Header ── */
  .print-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 2px solid #C4621A;
    margin-bottom: 12px;
    page-break-inside: avoid;
  }
  .print-logo-row {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .print-logo-text strong {
    display: block;
    font-size: 13px;
    font-weight: 800;
    color: #1A1208;
    line-height: 1.2;
  }
  .print-logo-text span {
    font-size: 10px;
    color: #A34F12;
    font-weight: 500;
  }
  .print-date {
    font-size: 10px;
    color: #6B5744;
    text-align: right;
    white-space: nowrap;
    line-height: 1.4;
  }

  /* ── Title ── */
  .print-title {
    font-size: 17px;
    font-weight: 800;
    color: #1A1208;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
    page-break-after: avoid;
  }

  /* ── Hero result ── */
  .print-result-hero {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #FEF3E8;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
    border: 1px solid #E8DDD2;
    page-break-inside: avoid;
  }
  .print-pizzas-num {
    font-size: 40px;
    font-weight: 900;
    color: #C4621A;
    line-height: 1;
    flex-shrink: 0;
  }
  .print-pizzas-label {
    font-size: 14px;
    font-weight: 700;
    color: #1A1208;
  }
  .print-pizzas-sub {
    font-size: 11px;
    color: #6B5744;
    margin-top: 2px;
  }

  /* ── Summary table ── */
  .print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9pt;
    margin-bottom: 0;
    page-break-inside: avoid;
  }
  .print-table th {
    text-align: left;
    padding: 5px 7px;
    background: #FDF8F3;
    font-weight: 600;
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6B5744;
    border-bottom: 1px solid #E8DDD2;
  }
  .print-table td {
    padding: 5px 7px;
    border-bottom: 1px solid #F0E8DF;
    color: #1A1208;
    vertical-align: top;
    font-size: 9pt;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .print-table td:first-child {
    color: #6B5744;
    font-weight: 500;
    width: 40%;
  }
  .print-table tr { page-break-inside: avoid; }
  .print-table tr:last-child td { border-bottom: none; }

  /* ── Recommendation — below table ── */
  .print-rec {
    background: #F5F0FF;
    border-left: 3px solid #1E3FAB;
    padding: 8px 10px;
    border-radius: 0 6px 6px 0;
    font-size: 9pt;
    color: #1E3FAB;
    font-style: italic;
    margin-top: 10px;
    page-break-inside: avoid;
  }

  /* ── Footer ── */
  .print-footer {
    border-top: 1px solid #E8DDD2;
    margin-top: 10px;
    padding-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 9px;
    color: #9C8674;
    page-break-inside: avoid;
    page-break-before: avoid;
  }
  .print-footer strong { color: #A34F12; }
  .print-footer-url {
    font-weight: 700;
    font-size: 10px;
    color: #A34F12;
  }
}
