/* ==========================================================================
   Print receipt — loaded only on pages that render a .qm-print-receipt block
   (customer order tracking). On screen the receipt stays hidden; when the
   customer prints, everything else on the page is hidden and only the clean
   receipt is sent to the printer. Because this sheet is page-scoped (loaded
   via pageStyles), the global visibility rule never affects other pages.
   ========================================================================== */

/* The receipt is print-only: never shown in the normal on-screen layout.
   (.qm-print-area is the opposite: a normal on-screen block that becomes the
   only printed content — used by report pages such as the drawer Z-report.) */
.qm-print-receipt { display: none; }

@media print {
    /* Isolate the printable block: hide the whole page, then re-show only it.
       visibility (not display) keeps the block's own box model intact. */
    body * { visibility: hidden; }
    .qm-print-receipt,
    .qm-print-receipt *,
    .qm-print-area,
    .qm-print-area * { visibility: visible; }
    .qm-print-area { position: absolute; top: 0; left: 0; width: 100%; margin: 0; }
    .qm-print-area .qm-card { border: 0; box-shadow: none; }
    .qm-print-receipt {
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        padding: 0;
        margin: 0;
        color: #000;
        background: #fff;
        font-family: "Courier New", ui-monospace, monospace;
        font-size: 12px;
        line-height: 1.5;
    }

    .qm-rcpt-inner { max-width: 320px; margin: 0 auto; }
    .qm-rcpt-head { text-align: center; margin-bottom: 10px; }
    .qm-rcpt-name { font-size: 16px; font-weight: 700; letter-spacing: .04em; }
    .qm-rcpt-meta { font-size: 11px; }
    .qm-rcpt-rule { border: 0; border-top: 1px dashed #000; margin: 8px 0; }
    .qm-rcpt-line { display: flex; justify-content: space-between; gap: 12px; }
    .qm-rcpt-line span:last-child { white-space: nowrap; }
    .qm-rcpt-item-note { padding-left: 14px; font-size: 11px; }
    .qm-rcpt-total { display: flex; justify-content: space-between; font-weight: 700; font-size: 14px; margin-top: 4px; }
    .qm-rcpt-foot { text-align: center; margin-top: 12px; font-size: 11px; }

    /* Keep the printed page free of browser backgrounds/shadows. */
    @page { margin: 12mm; }
}
