/* ==========================================================================
   INVOX HF - Print Stylesheet (A4 Bon de Livraison/Facture & Ticket 80mm/58mm)
   ========================================================================== */

#print-container {
  display: none;
}

@page {
  size: A4 portrait;
  margin: 8mm 10mm 10mm 10mm;
}

@media print {
  body * {
    visibility: hidden;
  }

  #print-container, #print-container * {
    visibility: visible;
  }

  #print-container {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    background: white;
    color: black;
  }

  /* Format Document A4 */
  .a4-document {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 10pt;
    line-height: 1.35;
    color: #111827;
  }

  .a4-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #0284c7;
    padding-bottom: 10px;
    margin-bottom: 12px;
  }

  .a4-company-name {
    font-size: 17pt;
    font-weight: 800;
    color: #0284c7;
    text-transform: uppercase;
  }

  .a4-doc-title {
    text-align: right;
  }

  .a4-doc-type {
    font-size: 18pt;
    font-weight: 800;
    color: #111827;
    text-transform: uppercase;
  }

  .a4-doc-ref {
    font-size: 12pt;
    font-weight: 600;
    color: #0284c7;
  }

  .a4-info-grid {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 20px;
  }

  .a4-info-box {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px;
    background-color: #f9fafb;
  }

  .a4-info-box h4 {
    font-size: 9pt;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    margin-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 4px;
  }

  .a4-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
  }

  .a4-table th {
    background-color: #f3f4f6;
    color: #374151;
    font-size: 9pt;
    font-weight: 700;
    text-transform: uppercase;
    border: 1px solid #d1d5db;
    padding: 8px 10px;
    text-align: left;
  }

  .a4-table td {
    border: 1px solid #e5e7eb;
    padding: 8px 10px;
    font-size: 10pt;
  }

  .a4-totals-grid {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 25px;
  }

  .a4-bottom-grid {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 25px;
  }

  .a4-totals-table {
    width: 300px;
    border-collapse: collapse;
  }

  .a4-totals-table td {
    padding: 6px 12px;
    font-size: 10pt;
  }

  .a4-totals-table .total-row {
    font-size: 12pt;
    font-weight: 800;
    background-color: #f0f9ff;
    color: #0369a1;
    border-top: 2px solid #0284c7;
    border-bottom: 2px solid #0284c7;
  }

  .a4-signatures {
    display: flex;
    justify-content: space-between;
    margin-top: 25px;
    padding-top: 10px;
  }

  .a4-sign-box {
    width: 220px;
    text-align: center;
    border-top: 1px dashed #9ca3af;
    padding-top: 6px;
    font-size: 9pt;
    font-weight: 600;
  }

  .a4-footer {
    margin-top: 25px;
    text-align: center;
    font-size: 8pt;
    color: #6b7280;
    border-top: 1px solid #e5e7eb;
    padding-top: 6px;
  }

  /* Format Ticket de Caisse POS 80mm */
  .pos-ticket {
    width: 78mm;
    margin: 0 auto;
    padding: 5mm;
    box-sizing: border-box;
    font-family: 'Courier New', Courier, monospace;
    font-size: 9pt;
    line-height: 1.3;
    color: #000000;
  }

  .pos-ticket-header {
    text-align: center;
    margin-bottom: 10px;
    border-bottom: 1px dashed #000;
    padding-bottom: 8px;
  }

  .pos-ticket-title {
    font-size: 12pt;
    font-weight: bold;
  }

  .pos-ticket-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
  }

  .pos-ticket-table th {
    border-bottom: 1px solid #000;
    font-size: 8pt;
    text-align: left;
    padding: 3px 0;
  }

  .pos-ticket-table td {
    padding: 3px 0;
    font-size: 8.5pt;
  }

  .pos-ticket-totals {
    border-top: 1px dashed #000;
    padding-top: 6px;
    margin-top: 6px;
  }

  .pos-ticket-totals .pos-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3px;
  }

  .pos-ticket-totals .pos-total-bold {
    font-size: 11pt;
    font-weight: bold;
    border-top: 1px solid #000;
    border-bottom: 1px solid #000;
    padding: 4px 0;
    margin: 4px 0;
  }

  .pos-ticket-footer {
    text-align: center;
    margin-top: 15px;
    border-top: 1px dashed #000;
    padding-top: 8px;
    font-size: 8pt;
  }
}
