/* 🖨️ style_print.css - Arkusz stylów wydruku oraz generowania PDF */

#sekcjaWydruku {
  display: none;
}

@media print {
  /* Ukrywamy wszystkie elementy strony poza sekcją wydruku */
  body > *:not(#sekcjaWydruku) {
    display: none !important;
  }

  body, html {
    background: #ffffff !important;
    color: #111111 !important;
    margin: 0 !important;
    padding: 0 !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 10pt !important;
    line-height: 1.35 !important;
    width: 100% !important;
  }

  @page {
    margin: 12mm 15mm;
    size: A4 portrait;
  }

  #sekcjaWydruku {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
  }

  .print-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #002244;
    padding-bottom: 12px;
    margin-bottom: 18px;
  }

  .print-logo {
    max-height: 92px; /* 🟢 powiększone o kolejne 15% (z 80px do 92px) */
    max-width: 335px;
    object-fit: contain;
  }

  .print-meta {
    text-align: right;
    font-size: 0.9em;
    color: #333333;
  }

  .print-title {
    font-size: 1.3em;
    font-weight: bold;
    color: #002244;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .print-mode-subtitle {
    font-size: 0.95em;
    font-weight: bold;
    color: #4a6380;
    margin-bottom: 4px;
    letter-spacing: 0.2px;
  }

  .print-brand {
    font-size: 1.3em;
    font-weight: bold;
    color: #002244;
    margin-bottom: 4px;
  }

  .print-meta-line {
    margin: 2px 0;
  }

  .print-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.92em;
  }

  .print-table th,
  .print-table td {
    border: 1px solid #cccccc;
    padding: 6px 10px;
    text-align: left;
  }

  .print-table th {
    background: #6b829e !important;
    background-image: none !important;
    color: #ffffff !important;
    font-weight: bold;
    font-size: 1.12em !important; /* 🟢 powiększone o kolejne 10% */
    border-bottom: 2px solid #4a6380 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .print-table th span {
    color: #f1f5f9 !important;
    font-size: 1.0em !important; /* 🟢 powiększone o kolejne 10% */
  }

  .print-table tbody td {
    font-size: 1.02em; /* 🟢 powiększone o 10% (z 0.92em do 1.02em) */
    padding: 5px 10px; /* 🟢 zrównoważony padding, aby całkowita wysokość wiersza nie uległa zmianie */
    line-height: 1.25;
  }

  .print-table tbody tr:nth-child(even) {
    background-color: #fafafa !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .print-table tr {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .print-col-nr {
    width: 35px;
    text-align: center !important;
  }

  .print-col-kod {
    width: 88px;
    font-weight: bold;
    color: #002244;
  }

  .print-col-nazwa {
    width: auto; /* 🟢 poszerzona o odzyskane miejsce z ilości */
    min-width: 255px;
  }

  .print-col-dek {
    width: 86px;
    font-weight: 500;
  }

  /* 🎨 Specjalne formatowanie kolumn dla wydruku według dekoracji */
  .print-table-patterns .print-col-dek {
    width: 105px !important;
    font-weight: bold;
    color: #002244;
  }

  .print-table-patterns .print-col-kod {
    font-weight: 600;
  }

  .print-col-qty {
    width: 95px; /* 🟢 węższa o 10% (z 105px na 95px) */
    text-align: right !important;
    font-weight: bold;
    color: #002244;
    font-size: 1.15em;
  }

  .print-total-row {
    background-color: #e2e8f0 !important;
    font-weight: bold;
    font-size: 1.16em !important; /* 🟢 większe o 10% (z 1.05em na 1.16em) */
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .print-total-row td {
    border-top: 2px solid #002244;
    padding: 8px 10px;
    font-size: 1.16em !important; /* 🟢 większe o 10% */
  }

  /* 📝 Sekcja uwag do zamówienia na wydruku PDF */
  .print-notes-section {
    margin-top: 15px;
    padding: 8px 12px;
    border: 1.5px solid #94a3b8;
    border-radius: 4px;
    background-color: #f8fafc !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .print-notes-title {
    font-weight: bold;
    font-size: 0.95em;
    color: #002244;
    margin-bottom: 4px;
  }

  .print-notes-content {
    font-size: 0.9em;
    color: #1e293b;
    line-height: 1.35;
    white-space: pre-wrap;
  }
}

/* BISCUIT: dane 55%, pusta kolumna na odręczne notatki 45%. */
@media print {
  .print-header-biscuit .print-mode-subtitle { font-size: 1.3em; }
  .print-header-biscuit .print-brand { font-size: 0.95em; }
  .print-table-biscuit th { white-space: nowrap; }
  .print-table-biscuit { table-layout: fixed; }
  .print-table-biscuit th,
  .print-table-biscuit td {
    box-sizing: border-box;
    min-width: 0;
    width: auto;
    padding-left: 4px;
    padding-right: 4px;
    overflow-wrap: anywhere;
  }
  .print-table-biscuit .print-col-nr {
    width: auto;
    padding-left: 1px;
    padding-right: 1px;
  }
  .print-table-biscuit th.print-col-kod,
  .print-table-biscuit th.print-col-notes { padding-left: 8px; }
  .print-table-biscuit th.print-col-nazwa { padding-left: 9px; }
  .print-table-biscuit .print-col-qty { text-align: center !important; white-space: nowrap; }
  .print-table-biscuit td.print-col-notes { background: white !important; }
}
