/* =============================
   隼 Global Layout
============================= */
body {
  font-family: monospace;
  background: #fff;
  color: #000;
  -webkit-text-size-adjust: 100%;
}

/* =============================
   隼 Invoice Layout
============================= */
.invoice-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  overflow-x: hidden;
}

.invoice-thermal {
  width: 72mm; /* Lebar standar kertas thermal */
  margin: auto;
  padding: 5px;
  font-size: 12px;
  overflow-x: hidden;
  word-break: break-word;
  transform-origin: top center;
  transition: transform 0.2s ease;
  background: white; /* Pastikan background putih */
  color: #000000; /* Pastikan teks default hitam pekat */
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 4px;
}

.logo {
  max-width: 90%;
  max-height: 60px;
}

.invoice-title {
  margin-top: 2px;
  font-weight: bold;
  font-size: 14px;
}

/* Garis & struktur item */
.line {
  border-top: 1px solid #000000; /* Garis hitam pekat */
  margin: 2px 0;
}

.item-header, /* Pastikan semua elemen ini hitam */
.summary-row,
.item-row,
.summary-row,
.status,
.catatan,
.footer,
.infoOrder span,
#detailItem span,
.summary-old span {
  color: #000000;
}

/* Status & catatan */
.status {
  text-align: center;
  font-weight: bold;
  font-size: 14px;
  margin: 4px 0;
}

.catatan {
  font-size: 12px;
  margin-top: 4px;
  text-align: left;
}

.footer {
  font-size: 10px;
  margin-top: 4px;
  text-align: center;
}

/* QR code */
.qr {
  display: flex;
  justify-content: center;
  margin: 6px 0;
  padding: 12px 0;
}

.qr img {
  width: 120px;
  height: 120px;
  page-break-inside: avoid;
}

/* =============================
   隼 Custom Fullscreen Loader
============================= */
.chill-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: white;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
  transition: background-color 0.6s ease;
  overflow: hidden;
}

.chill-loader.fade-bg {
  background-color: transparent;
}

.loader-content {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  transition: opacity 0.6s ease;
}

.loader-content.fade-out {
  opacity: 0;
  pointer-events: none;
}

.circle-text {
  position: absolute;
  width: 280px;
  height: 280px;
  animation: spin 10s linear infinite;
  pointer-events: none;
}

.circle-text svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.rotating-text {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.8px;
  fill: #333;
  dominant-baseline: middle;
}

.mascot {
  width: 165px;
  height: 179px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-5px, -10px);
}

.mascot img {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* =============================
   隼 Tampilan HP (Tidak relevan untuk print, biarkan saja)
============================= */
@media (max-width: 600px) {
  /* ... (style mobile tetap sama) ... */
}

/* ================================================== */
/* 🖨️ OPTIMASI KHUSUS UNTUK PRINT THERMAL 🖨️    */
/* ================================================== */
@media print {
  body {
    font-family: "Roboto Mono", monospace; /* Font sudah bagus */
    color: #000000 !important; /* Paksa semua teks jadi hitam pekat */
    background: white !important; /* Paksa background putih */
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    font-size: 11pt; /* Sedikit perbesar font base untuk print */
    line-height: 1.2;
  }

  /* Sembunyikan elemen yang tidak perlu dicetak */
  .no-print,
  .chill-loader,
  .download-btn {
    /* Tombol download juga disembunyikan */
    display: none !important;
  }

  /* Atur layout cetak */
  .invoice-wrapper {
    display: block; /* Hapus flexbox */
    width: 100%;
    margin: 0;
    padding: 0;
  }
  .invoice-thermal {
    width: 72mm; /* Paksa lebar sesuai kertas */
    margin: 0 auto; /* Tengah secara horizontal */
    padding: 2mm 0; /* Beri sedikit margin atas bawah */
    box-shadow: none; /* Hapus shadow */
    overflow: visible; /* Tampilkan semua konten */
    transform: none !important; /* Hapus scaling */
  }

  /* Pastikan elemen tidak terpotong antar halaman (meskipun thermal biasanya roll) */
  .invoice-thermal,
  .invoice-thermal * {
    page-break-inside: avoid;
  }

  /* ⬇️ PERTEBAL TEKS SAAT PRINT ⬇️ */
  /* Tingkatkan ketebalan font standar */
  body,
  .invoice-thermal {
    font-weight: 600; /* Lebih tebal dari normal (400) */
  }
  /* Buat elemen bold jadi lebih tebal lagi */
  strong,
  b,
  .invoice-title,
  .status,
  .item-header-old span {
    font-weight: 700; /* Bold standar, atau bisa coba 900 jika kurang */
  }
  /* Khusus nilai angka di summary, buat lebih tebal */
  .summary-value {
    font-weight: 700;
  }

  /* ⬇️ (OPSIONAL/EKSPERIMENTAL) Text Stroke ⬇️ */
  /* Coba uncomment (hapus //) baris ini jika hasil masih kurang pekat */
  /* body, .invoice-thermal { */
  /* -webkit-text-stroke: 0.1px black; */ /* Outline hitam sangat tipis */
  /* text-stroke: 0.1px black; */
  /* } */

  /* Pastikan garis benar-benar hitam */
  .line,
  .summary-divider,
  .item-header-old {
    border-color: #000000 !important;
  }

  /* Atur ulang ukuran font spesifik jika perlu */
  .footer {
    font-size: 9pt; /* Sedikit perkecil footer */
  }
  .item-line2 {
    font-size: 10pt; /* Deskripsi item */
  }
  .payment-history-old .summary-label small {
    font-size: 9pt; /* Tanggal pembayaran */
  }
}
