/* ==========================================================================
   Smart Shop - Thermal Label & Invoice Printing Styles
   ========================================================================== */

@page {
  size: 100mm 150mm; /* Standard 4x6 inch thermal sticker */
  margin: 0mm;
}

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

@media print {
  /* Hide all screen UI when printing */
  body * {
    visibility: hidden;
  }
  
  #print-area, #print-area * {
    visibility: visible;
  }
  
  #print-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    background: #ffffff !important;
    color: #000000 !important;
  }
  
  .no-print {
    display: none !important;
  }

  /* Force page breaks between multiple shipping labels */
  .shipping-label-card {
    page-break-after: always;
    page-break-inside: avoid;
    break-after: page;
    break-inside: avoid;
  }
  
  .shipping-label-card:last-child {
    page-break-after: auto;
    break-after: auto;
  }
}

/* Shipping Sticker Design */
.thermal-sticker-100x150 {
  width: 100mm;
  min-height: 148mm;
  max-height: 150mm;
  padding: 5mm;
  box-sizing: border-box;
  background: #ffffff;
  color: #000000;
  font-family: 'Sarabun', 'Prompt', sans-serif;
  font-size: 11pt;
  line-height: 1.35;
  border: 1px dashed #94a3b8;
  margin: 0 auto 10mm auto;
  position: relative;
}

@media print {
  .thermal-sticker-100x150 {
    border: none;
    margin: 0;
    width: 100%;
    height: 100%;
  }
}

.sticker-header {
  border-bottom: 2px solid #000;
  padding-bottom: 4px;
  margin-bottom: 6px;
}

.sticker-box {
  border: 1.5px solid #000;
  border-radius: 4px;
  padding: 6px 8px;
  margin-bottom: 6px;
}

.sticker-box-highlight {
  border: 2px solid #000;
  background-color: #f8fafc;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 6px;
}

@media print {
  .sticker-box-highlight {
    background-color: #ffffff !important;
  }
}

.sender-info {
  font-size: 9.5pt;
  line-height: 1.3;
}

.recipient-info {
  font-size: 12pt;
  font-weight: 500;
  line-height: 1.4;
}

.recipient-address {
  font-size: 13pt;
  font-weight: 600;
  color: #000;
}

.postal-code-box {
  display: inline-flex;
  gap: 3px;
  margin-top: 4px;
}

.postal-digit {
  display: inline-block;
  width: 22px;
  height: 28px;
  border: 2px solid #000;
  font-size: 14pt;
  font-weight: 800;
  text-align: center;
  line-height: 26px;
  background: #ffffff;
}

.barcode-container {
  text-align: center;
  margin: 4px 0;
}

.barcode-svg {
  max-width: 90%;
  height: 48px;
  margin: 0 auto;
}

.cod-badge {
  background: #000000;
  color: #ffffff;
  font-weight: 800;
  padding: 4px 8px;
  font-size: 13pt;
  border-radius: 4px;
  text-align: center;
  display: inline-block;
}

@media print {
  .cod-badge {
    background: #000000 !important;
    color: #ffffff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

.packing-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 8.5pt;
  margin-top: 4px;
}

.packing-items-table th, 
.packing-items-table td {
  border: 1px solid #cbd5e1;
  padding: 2px 4px;
}

@media print {
  .packing-items-table th, 
  .packing-items-table td {
    border: 1px solid #000000;
  }
}
