﻿/* ================== PRINT MODE ================== */
@media screen {
    body {
        zoom: 1.25; /* hoặc dùng transform: scale(1.25) nếu zoom không ăn */
        transform-origin: top left;
    }
}

@media print {

    @page {
        size: 80mm auto; /* Chiều rộng 80mm, cao tự động */
        margin: 0;
    }
    html, body, .receipt-container, table {
        height: auto !important;
        max-height: none !important;
    }
    body {
        margin: 0;
        padding: 0;
        font-size: 35px !important;
        font-family: 'Times New Roman', Times, serif;
        color: black;
    }

    header, footer, .no-print {
        display: none !important;
    }

        /* Ẩn mọi thứ ngoài bill */
        body * {
            visibility: hidden;
        }

    .receipt-container, .receipt-container * {
        visibility: visible;
    }

    /* Giữ màu và font */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Tối ưu layout khi in */
    .receipt-container {
        border: none;
        width: 640px !important;
        margin: 0 4mm;
        padding: 0 4mm;
        box-shadow: none;
        page-break-inside: avoid;
        font-size: 7.5mm !important;
    }

        .receipt-container.scale-2 {
            transform: scale(0.6);
            transform-origin: top left;
        }

    .receipt-info{
        width: 100%;
        font-size: 8.3mm !important;
        font-weight: 500;
    }
    .customer-info {
        width: 100%;
        font-size: 8.3mm !important;
        font-weight: 500;
    }

    .receipt-info a{
        font-weight: 700 !important;
    }
    .receipt-top {
        margin-top: 10px;
    }

    .company-titles {
        margin-left: 0 !important;
        width: 100%;
    }

        .company-titles h3,
        .company-titles h4 {
            font-size: 12mm !important;
            font-weight: 700 !important;
        }
    .logo-company img {
        position: relative;
        width: 30mm !important;
        height: 30mm !important;
    }

    .order-info,
    .total-section {
        float: none;
        width: 100%;
        font-size: 9mm !important
    }
    /* Giảm padding bảng khi in */
    table th, table td {
        padding: 2px 4px;
    }

    table, table th, table td {
        border: 3px solid #000; /* Đường viền đen dày 2px */
        border-collapse: collapse;
    }

    table thead {
        display: table-row-group !important; /* Ngăn lặp lại trên trang mới */
    }
}
