/* ── Wrapper ──────────────────────────────────────────────────────────────── */
#receiptContainer {
    position: fixed;
    left: -9999px;
    top: 0;
    width: 80mm;
}

/* ── Receipt card ─────────────────────────────────────────────────────────── */
#receipt {
    width: 80mm;
    background: #fff;
    color: #000;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    font-weight: bold;
    border: 2px solid #000;
    padding: 8px;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.receipt-header {
    border-bottom: 3px solid #000;
    padding: 8px 0 12px;
    margin-bottom: 8px;
    text-align: center;
}

.receipt-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.receipt-logo-wrap img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    display: block;
}

.receipt-store-name {
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 0.12em;
    color: #000;
    margin-bottom: 3px;
    font-family: Arial Black, Arial, Helvetica, sans-serif;
    text-transform: uppercase;
}

.receipt-store-tagline {
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.08em;
    color: #000;
    text-transform: uppercase;
    font-family: Arial, Helvetica, sans-serif;
    margin-bottom: 4px;
}

.receipt-store-address,
.receipt-store-contact {
    font-size: 12px;
    font-weight: bold;
    color: #000;
    line-height: 1.4;
    font-family: Arial, Helvetica, sans-serif;
}

/* ── Meta grid (2×2) ─────────────────────────────────────────────────────── */
.receipt-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 2px solid #000;
}

.receipt-meta-cell {
    padding: 6px 8px;
    border-right: 2px solid #000;
}
.receipt-meta-cell:nth-child(even) {
    border-right: none;
}
.receipt-meta-cell:nth-child(n+3) {
    border-top: 2px solid #000;
}

.receipt-meta-label {
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #000;
    margin-bottom: 2px;
    font-family: Arial, Helvetica, sans-serif;
}

.receipt-meta-value {
    font-size: 14px;
    font-weight: 900;
    color: #000;
    font-family: Arial, Helvetica, sans-serif;
}

/* ── Receipt ID / Session bar ─────────────────────────────────────────────── */
.receipt-id-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 2px solid #000;
}

.receipt-id-value {
    font-size: 13px;
    font-weight: bold;
    color: #000;
    font-family: 'Courier New', Courier, monospace;
}

.receipt-session-value {
    font-size: 14px;
    font-weight: 900;
    color: #000;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 0.05em;
}

/* ── Client row ───────────────────────────────────────────────────────────── */
.receipt-client-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-top: 3px double #000;
    border-bottom: 3px double #000;
    font-family: Arial Black, Arial, Helvetica, sans-serif;
}

.receipt-client-row .receipt-meta-label {
    color: #000;
    font-size: 12px;
    font-weight: 900;
    margin: 0;
}

.receipt-client-name {
    font-size: 19px;
    font-weight: 900;
    color: #000;
    flex: 1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-family: Arial Black, Arial, Helvetica, sans-serif;
}

.receipt-held-badge {
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0.08em;
    color: #000;
    padding: 0;
    background: transparent;
    border: none;
    font-family: Arial Black, Arial, Helvetica, sans-serif;
}

/* ── Items section ────────────────────────────────────────────────────────── */
.receipt-items-section {
    padding: 8px 0;
    border-bottom: 2px solid #000;
}

.receipt-items-header {
    display: flex;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #000;
    padding-bottom: 5px;
    margin-bottom: 4px;
    border-bottom: 2px solid #000;
    font-family: Arial, Helvetica, sans-serif;
}

.receipt-col-item  { flex: 1; }
.receipt-col-qty   { width: 35px; text-align: center; }
.receipt-col-price { width: 75px; text-align: right; }

.receipt-item {
    display: flex;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px dashed #000;
    font-weight: bold;
}
.receipt-item:last-child { border-bottom: none; }

.receipt-item-name {
    flex: 1;
    font-size: 13px;
    font-weight: bold;
    color: #000;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.3;
}
.receipt-item-qty {
    width: 35px;
    text-align: center;
    font-size: 13px;
    font-weight: 900;
    color: #000;
    font-family: Arial, Helvetica, sans-serif;
}
.receipt-item-price {
    width: 75px;
    text-align: right;
    font-size: 13px;
    font-weight: bold;
    color: #000;
    font-family: Arial, Helvetica, sans-serif;
}

/* ── Totals section ───────────────────────────────────────────────────────── */
.receipt-totals-section {
    padding: 8px 0;
}

.receipt-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 14px;
    font-weight: bold;
    color: #000;
    font-family: Arial, Helvetica, sans-serif;
}

.receipt-discount {
    color: #000;
}

.receipt-grand-total {
    border-top: 3px double #000;
    margin-top: 6px;
    padding-top: 8px;
    font-size: 19px;
    font-weight: 900;
    color: #000;
}

.receipt-payment-row {
    border-top: 2px solid #000;
    margin-top: 6px;
    padding-top: 8px;
}

.receipt-payment-badge {
    font-size: 12px;
    font-weight: 900;
    background: #000;
    color: #fff;
    padding: 3px 10px;
    border-radius: 3px;
    font-family: Arial, Helvetica, sans-serif;
}

.receipt-payment-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0 2px;
    padding: 6px 0;
    background: transparent;
    color: #000;
    border: none;
    border-top: 3px double #000;
    border-bottom: 3px double #000;
    font-family: Arial Black, Arial, Helvetica, sans-serif;
}

.receipt-payment-banner .receipt-payment-label {
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 0.08em;
    color: #000;
}

.receipt-payment-banner .receipt-payment-method {
    font-size: 19px;
    font-weight: 900;
    letter-spacing: 0.08em;
    color: #000;
}

.receipt-debt-due {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    padding: 6px 0;
    background: transparent;
    color: #000;
    border-top: 2px solid #000;
    font-size: 17px;
    font-weight: 900;
    letter-spacing: 0.04em;
    font-family: Arial Black, Arial, Helvetica, sans-serif;
}

.receipt-debt-due span { color: #000; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.receipt-footer {
    padding: 10px 0 6px;
    text-align: center;
    border-top: 3px solid #000;
    font-family: Arial, Helvetica, sans-serif;
}

.receipt-footer-divider {
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 0.3em;
    color: #000;
    margin: 6px 0;
}

.receipt-footer-dots {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin: 5px 0;
}
.receipt-footer-dots span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #000;
    display: inline-block;
}

.receipt-footer-message {
    font-size: 14px;
    font-weight: 900;
    color: #000;
    margin: 6px 0 2px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.receipt-footer-sub {
    font-size: 12px;
    font-weight: bold;
    color: #000;
}

.receipt-footer-brand {
    font-size: 11px;
    font-weight: bold;
    color: #000;
    margin-top: 8px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-family: 'Courier New', Courier, monospace;
}

/* ── Multi-receipt (client statement) ────────────────────────────────────── */
.mr-title {
    text-align: center;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 6px 0;
    border-bottom: 2px solid #000;
    font-family: Arial, Helvetica, sans-serif;
}

.mr-client {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 5px 0;
    border-bottom: 3px double #000;
}

.mr-client-label {
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    font-family: Arial, Helvetica, sans-serif;
    white-space: nowrap;
    flex-shrink: 0;
}

.mr-client-name {
    font-size: 15px;
    font-weight: 900;
    text-transform: uppercase;
    font-family: Arial Black, Arial, Helvetica, sans-serif;
    flex: 1;
    letter-spacing: 0.04em;
}

.mr-print-date {
    font-size: 10px;
    font-weight: bold;
    color: #000;
    padding: 3px 0 5px;
    font-family: Arial, Helvetica, sans-serif;
    border-bottom: 1px solid #000;
    margin-bottom: 2px;
}

.mr-order {
    border-bottom: 2px dashed #000;
    padding: 3px 0 5px;
    margin-bottom: 2px;
}

.mr-order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: bold;
    padding: 3px 0 4px;
    border-bottom: 1px solid #000;
    margin-bottom: 2px;
    font-family: Arial, Helvetica, sans-serif;
}

.mr-order-date {
    color: #000;
}

.mr-order-id {
    color: #000;
    font-family: 'Courier New', Courier, monospace;
    font-weight: 900;
}

.mr-order-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 900;
    padding: 4px 0 0;
    border-top: 1px solid #000;
    margin-top: 3px;
    font-family: Arial, Helvetica, sans-serif;
}

.mr-grand-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 17px;
    font-weight: 900;
    padding: 8px 0;
    border-top: 3px double #000;
    border-bottom: 3px double #000;
    margin: 4px 0;
    font-family: Arial Black, Arial, Helvetica, sans-serif;
    color: #000;
}

/* ── Print styles ─────────────────────────────────────────────────────────── */
@media print {
    html, body {
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    body > *:not(#receiptContainer) {
        display: none !important;
    }

    #receiptContainer {
        position: static !important;
        left: auto !important;
        width: 80mm !important;
        display: block !important;
    }

    #receipt {
        border: none;
        box-shadow: none;
        width: 80mm;
        padding: 2mm;
    }

    @page {
        size: 80mm auto;
        margin: 0;
    }
}
