/* 
 * Professional CSS for 80mm Receipt Printing
 * Optimized for compact, professional thermal printer output
 */

/* Print-specific styles for 80mm receipts */
@media print {
    /* Set proper page size for 80mm receipts */
    @page {
        size: 80mm auto;
        margin: 0.1in 0.05in;
    }
    
    /* Base font sizing - unified 14px for all text */
    html {
        font-family: "Courier New", monospace !important;
        font-size: 14px !important;
        line-height: 1.2 !important;
    }
    
    /* Receipt title - same size as other text but bold */
    h1 {
        font-size: 14px !important;
        font-weight: bold !important;
        text-align: center !important;
        margin: 4pt 0 6pt 0 !important;
        text-transform: uppercase !important;
    }
    
    /* Section headers - same size but bold */
    h3 {
        font-size: 14px !important;
        font-weight: bold !important;
        color: #000 !important;
        margin: 4pt 0 2pt 0 !important;
        text-transform: uppercase !important;
        border-bottom: 1px solid #000 !important;
        padding-bottom: 2pt !important;
    }
    
    /* Paragraph text - unified 14px */
    p {
        font-size: 14px !important;
        line-height: 1.2 !important;
        margin: 2pt 0 !important;
    }
    
    /* Table styling for line items - clean and minimal */
    table {
        width: 100% !important;
        font-size: 14px !important;
        border-collapse: collapse !important;
        margin: 4pt 0 !important;
        background-color: transparent !important;
        border: none !important;
    }
    
    table td {
        padding: 2pt 0 !important;
        border-bottom: none !important;
        vertical-align: top !important;
        font-size: 14px !important;
    }
    
    /* Right-align prices */
    table td:last-child {
        text-align: right !important;
        width: 25% !important;
    }
    
    /* Bold total line */
    table tr:last-child {
        font-weight: bold !important;
        font-size: 14px !important;
        color: #000 !important;
        border-top: 1px solid #000 !important;
    }
    
    table tr:last-child td {
        padding: 4pt 0 2pt 0 !important;
        border-bottom: none !important;
        font-size: 14px !important;
    }
    
    /* Footer styling */
    footer {
        font-size: 14px !important;
        margin-top: 6pt !important;
        padding-top: 4pt !important;
        border-top: 1px solid #000 !important;
        text-align: center !important;
    }
    
    /* Header spacing */
    header {
        margin-bottom: 6pt !important;
        text-align: center !important;
    }
    
    /* Ensure proper text rendering */
    body {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    /* Hide elements that shouldn't print */
    .no-print {
        display: none !important;
    }
}

/* Screen styles for preview (optional) */
@media screen {
    /* When viewing on screen, also increase font sizes for better preview */
    .receipt-preview {
        font-family: "Courier New", monospace;
        font-size: 16px;
        max-width: 300px;
        margin: 0 auto;
        padding: 20px;
        background: #fff;
        border: 1px solid #ddd;
    }
    
    .receipt-preview h1 {
        font-size: 20px;
        text-align: center;
        margin-bottom: 10px;
    }
    
    .receipt-preview h3 {
        font-size: 14px;
        margin: 8px 0 4px 0;
        color: #333;
    }
    
    .receipt-preview table {
        width: 100%;
        font-size: 14px;
        border-collapse: collapse;
        margin: 8px 0;
    }
    
    .receipt-preview table td {
        padding: 4px;
        border-bottom: 1px dotted #ccc;
    }
    
    .receipt-preview table td:last-child {
        text-align: right;
        font-weight: bold;
    }
}

/* Additional styles for professional receipt formatting */
@media print {
    /* Optimize spacing for thermal printers */
    * {
        box-sizing: border-box !important;
    }
    
    /* Ensure consistent margins */
    body {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Compact amount display - unified 14px */
    .amount, .price {
        font-weight: normal !important;
        font-size: 14px !important;
    }
    
    /* Style for order details - unified 14px */
    .order-details {
        font-size: 14px !important;
        margin: 3pt 0 !important;
    }
    
    /* Ensure proper line spacing */
    .line-item {
        margin: 1pt 0 !important;
        padding: 1pt 0 !important;
        font-size: 14px !important;
    }
    
    /* Style for payment information - unified 14px */
    .payment-info {
        font-size: 14px !important;
        margin: 4pt 0 !important;
    }
    
    /* Minimal spacing around sections */
    .receipt-section {
        margin: 4pt 0 !important;
        font-size: 14px !important;
    }
    
    /* Make sure text is dark enough for thermal printers */
    body, p, td, h1, h2, h3 {
        color: #000 !important;
        font-size: 14px !important;
    }
    
    /* Dashed line separator style */
    .separator {
        border-top: 1px dashed #000 !important;
        margin: 4pt 0 !important;
    }
    
    /* Store info at top - unified 14px */
    .store-info {
        font-size: 14px !important;
        text-align: center !important;
        margin-bottom: 4pt !important;
    }
    
    /* Item columns alignment */
    .qty-col {
        width: 10% !important;
        text-align: center !important;
    }
    
    .desc-col {
        width: 65% !important;
        text-align: left !important;
    }
    
    .price-col {
        width: 12% !important;
        text-align: right !important;
    }
    
    .total-col {
        width: 13% !important;
        text-align: right !important;
    }
    
    /* Barcode styling - unified 14px */
    .barcode {
        text-align: center !important;
        margin: 6pt 0 !important;
        font-size: 14px !important;
    }
    
    /* Thank you message - unified 14px but bold */
    .thank-you {
        text-align: center !important;
        font-size: 14px !important;
        font-weight: bold !important;
        margin: 8pt 0 4pt 0 !important;
    }
}