@font-face {
  font-family: "Noto Sans Bengali";
  src: url("/fonts/noto-sans-bengali-regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Noto Sans Bengali";
  src: url("/fonts/noto-sans-bengali-bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/*
 * Fallback page box only. Real print height is content-measured in JS
 * (see measureReceiptPrintHeightMm) and injected as @page size 80mm × Nmm.
 * Height "auto" is ignored by browsers → large A4 with a tiny strip.
 */
@page {
  size: 80mm 297mm;
  margin: 0;
}

.print-receipt-sheet,
.print-receipt-sheet * {
  box-sizing: border-box;
}

.print-receipt-sheet {
  width: 80mm;
  max-width: 80mm;
  margin: 0;
  padding: 8px 6px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #ffffff;
  color: #000000;
  font-family: "Noto Sans Bengali", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
  overflow: visible;
  word-break: break-word;
}

.print-receipt-sheet .flex {
  display: flex;
}

.print-receipt-sheet .grid {
  display: grid;
}

.print-receipt-sheet .items-start {
  align-items: flex-start;
}

.print-receipt-sheet .items-center {
  align-items: center;
}

.print-receipt-sheet .justify-between {
  justify-content: space-between;
}

.print-receipt-sheet .text-center {
  text-align: center;
}

.print-receipt-sheet .text-right {
  text-align: right;
}

.print-receipt-sheet .font-bold {
  font-weight: 700;
}

.print-receipt-sheet .font-mono {
  font-family: "Courier New", monospace;
}

.print-receipt-sheet .uppercase {
  text-transform: uppercase;
}

.print-receipt-sheet .whitespace-pre-wrap {
  white-space: pre-wrap;
}

.print-receipt-sheet .mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.print-receipt-sheet .mt-1 {
  margin-top: 0.25rem;
}

.print-receipt-sheet .mt-2 {
  margin-top: 0.5rem;
}

.print-receipt-sheet .mt-3 {
  margin-top: 0.75rem;
}

.print-receipt-sheet .mb-3 {
  margin-bottom: 0.75rem;
}

.print-receipt-sheet .space-y-1 > * + * {
  margin-top: 0.25rem;
}

.print-receipt-sheet .space-y-2 > * + * {
  margin-top: 0.5rem;
}

.print-receipt-sheet .space-y-3 > * + * {
  margin-top: 0.75rem;
}

.print-receipt-sheet .gap-2 {
  gap: 0.35rem;
}

.print-receipt-sheet .gap-4 {
  gap: 0.75rem;
}

.print-receipt-sheet .border-b {
  border-bottom: 1px solid #000000;
}

.print-receipt-sheet .border {
  border: 1px solid #000000;
}

.print-receipt-sheet .border-2 {
  border-width: 2px;
}

.print-receipt-sheet .border-black {
  border-color: #000000;
}

.print-receipt-sheet .border-black\/20,
.print-receipt-sheet .border-black\/30 {
  border-color: rgba(0, 0, 0, 0.25);
}

.print-receipt-sheet .border-dashed {
  border-style: dashed;
}

.print-receipt-sheet .rounded-md,
.print-receipt-sheet .rounded-xl,
.print-receipt-sheet .rounded-\[1\.75rem\] {
  border-radius: 0;
}

.print-receipt-sheet .pb-4 {
  padding-bottom: 0.75rem;
}

.print-receipt-sheet .py-4 {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.print-receipt-sheet .px-3 {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.print-receipt-sheet .px-5,
.print-receipt-sheet .py-5 {
  padding-left: 0;
  padding-right: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.print-receipt-sheet .py-2 {
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.print-receipt-sheet .pt-4 {
  padding-top: 0.75rem;
}

.print-receipt-sheet .text-xs {
  font-size: 11px;
}

.print-receipt-sheet .text-sm {
  font-size: 12px;
}

.print-receipt-sheet .text-lg {
  font-size: 14px;
}

.print-receipt-sheet .text-\[11px\] {
  font-size: 10px;
}

.print-receipt-sheet .text-\[13px\] {
  font-size: 12px;
}

.print-receipt-sheet .leading-6 {
  line-height: 1.45;
}

.print-receipt-sheet .tracking-\[0\.16em\],
.print-receipt-sheet .tracking-\[0\.24em\],
.print-receipt-sheet .tracking-wide {
  letter-spacing: 0.08em;
}

.print-receipt-sheet .text-neutral-500,
.print-receipt-sheet .text-neutral-600,
.print-receipt-sheet .text-neutral-700,
.print-receipt-sheet .text-muted {
  color: #333333;
}

.print-receipt-sheet .text-red-700 {
  color: #b91c1c;
}

.print-receipt-sheet .bg-red-50 {
  background: #fef2f2;
}

.print-receipt-sheet .border-red-600 {
  border-color: #dc2626;
}

.print-receipt-sheet .bg-black\/5 {
  background: rgba(0, 0, 0, 0.04);
}

.print-receipt-sheet [class*="grid-cols-"] {
  grid-template-columns: 1.65fr 0.55fr 0.9fr 0.9fr;
  column-gap: 0.25rem;
}

.print-receipt-sheet .mb-3 {
  margin-bottom: 0.75rem;
}

.print-receipt-sheet .h-12 {
  height: 3rem;
}

.print-receipt-sheet .w-auto {
  width: auto;
}

.print-receipt-sheet .w-full {
  width: 100%;
}

.print-receipt-sheet .max-w-\[27rem\] {
  max-width: 27rem;
}

.print-receipt-sheet .object-contain {
  object-fit: contain;
}

.print-receipt-sheet img {
  display: block;
  max-width: 96px;
  width: auto;
  height: auto;
  margin: 0 auto 0.5rem;
}

@media print {
  html,
  body {
    width: 80mm !important;
    max-width: 80mm !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #ffffff !important;
    color: #000000 !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  /* Top-left thermal strip — never center on a large sheet. */
  html.receipt-print-frame,
  html.receipt-print-frame body {
    width: 80mm !important;
    max-width: 80mm !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Avoid dialog overflow/transform clipping if parent page is printed. */
  html:not(.receipt-print-frame),
  html:not(.receipt-print-frame) body {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
  }

  html:not(.receipt-print-frame) body * {
    visibility: hidden !important;
  }

  html:not(.receipt-print-frame) [data-print-root="true"],
  html:not(.receipt-print-frame) [data-print-root="true"] * {
    visibility: visible !important;
  }

  html:not(.receipt-print-frame) [data-print-root="true"] {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 2147483647 !important;
    transform: none !important;
    max-height: none !important;
    overflow: visible !important;
  }

  [data-print-root="true"],
  .print-receipt-sheet {
    width: 80mm !important;
    max-width: 80mm !important;
    margin: 0 !important;
    padding: 8px 6px !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #ffffff !important;
    color: #000000 !important;
    page-break-inside: auto;
    break-inside: auto;
    max-height: none !important;
    overflow: visible !important;
  }

  html.receipt-print-frame [data-print-root="true"] {
    position: static !important;
  }

  [data-print-hide="true"] {
    display: none !important;
  }

  .print-receipt-sheet,
  .print-receipt-sheet * {
    overflow: visible !important;
    max-height: none !important;
  }
}
