/* =====================================================
   Gestão Fábrica — print.css
   Suporte a:
     • Cupom fiscal / pedido  → impressora térmica 80 mm
     • Etiqueta adesiva       → 150 × 100 mm
   ===================================================== */

/* ── Ocultar tudo na impressão por padrão ─────────────── */
@media print {
    body * { visibility: hidden; }

    /* ── Esconder elementos de navegação / UI ──────────── */
    .no-print,
    .mud-drawer,
    .mud-appbar,
    .mud-snackbar-container,
    nav, header { display: none !important; }


    /* ══════════════════════════════════════════════════
       CUPOM TÉRMICO 80 mm
       Ative envolvendo o conteúdo em: <div id="thermal-receipt">
       ══════════════════════════════════════════════════ */
    #thermal-receipt,
    #thermal-receipt * { visibility: visible; }

    #thermal-receipt {
        position: fixed;
        left: 0; top: 0;
        width: 80mm;
        margin: 0;
        padding: 2mm 3mm;
        font-family: 'Courier New', Courier, monospace;
        font-size: 9pt;
        line-height: 1.35;
        color: #000;
        background: #fff;
    }

    #thermal-receipt .receipt-header {
        text-align: center;
        font-weight: bold;
        font-size: 11pt;
        border-bottom: 1px dashed #000;
        padding-bottom: 3mm;
        margin-bottom: 3mm;
    }

    #thermal-receipt table {
        width: 100%;
        border-collapse: collapse;
        font-size: 8pt;
    }
    #thermal-receipt th {
        border-bottom: 1px solid #000;
        text-align: left;
        padding: 1mm 0;
    }
    #thermal-receipt td {
        padding: 0.8mm 0;
        vertical-align: top;
    }
    #thermal-receipt .td-right { text-align: right; }
    #thermal-receipt .td-center { text-align: center; }

    #thermal-receipt .receipt-totals {
        border-top: 1px dashed #000;
        margin-top: 2mm;
        padding-top: 2mm;
        font-weight: bold;
    }
    #thermal-receipt .receipt-footer {
        text-align: center;
        font-size: 8pt;
        margin-top: 3mm;
        border-top: 1px dashed #000;
        padding-top: 2mm;
    }

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


    /* ══════════════════════════════════════════════════
       ETIQUETA ADESIVA 150 × 100 mm
       Ative envolvendo o conteúdo em: <div id="label-print">
       ══════════════════════════════════════════════════ */
    #label-print,
    #label-print * { visibility: visible; }

    #label-print {
        position: fixed;
        left: 0; top: 0;
        width: 150mm;
        height: 100mm;
        margin: 0;
        padding: 3mm;
        overflow: hidden;
        font-family: Arial, Helvetica, sans-serif;
        font-size: 7pt;
        color: #000;
        background: #fff;
        display: flex;
        flex-direction: column;
        gap: 1.5mm;
    }

    #label-print .label-title-row {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
    }

    #label-print .label-product-name {
        font-size: 13pt;
        font-weight: 900;
        line-height: 1.1;
        flex: 1;
    }

    #label-print .label-weight {
        font-size: 9pt;
        font-weight: 700;
        text-align: right;
    }

    #label-print .label-badge {
        display: inline-block;
        border: 2.5px solid #000;
        border-radius: 3px;
        padding: 1mm 2mm;
        font-size: 6pt;
        font-weight: 900;
        text-align: center;
        letter-spacing: .3px;
        line-height: 1.2;
        text-transform: uppercase;
    }
    #label-print .label-badge-alto-sodio {
        background: #000;
        color: #fff;
    }
    #label-print .label-badge-placeholder {
        border-color: #ccc;
        color: #ccc;
    }

    #label-print .label-main {
        display: flex;
        flex: 1;
        gap: 3mm;
    }

    #label-print .label-left { flex: 1.4; }
    #label-print .label-right { flex: 1; }

    /* Tabela nutricional */
    #label-print .nutrition-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 6pt;
    }
    #label-print .nutrition-table th,
    #label-print .nutrition-table td {
        padding: 0.5mm 1mm;
        border: 0.4pt solid #000;
        vertical-align: middle;
    }
    #label-print .nutrition-table thead tr:first-child th {
        background: #000;
        color: #fff;
        font-size: 7pt;
        text-align: center;
        font-weight: 900;
        padding: 1mm;
    }
    #label-print .nutrition-table .sub-header th {
        background: #ddd;
        font-size: 5.5pt;
        font-weight: 700;
    }
    #label-print .nutrition-table td:last-child,
    #label-print .nutrition-table th:last-child {
        text-align: right;
        white-space: nowrap;
    }

    #label-print .label-section-title {
        font-weight: 800;
        font-size: 6.5pt;
        text-transform: uppercase;
        margin-bottom: 0.5mm;
    }
    #label-print .label-section-body {
        font-size: 6pt;
        line-height: 1.3;
    }
    #label-print .label-allergen {
        font-weight: 700;
        font-size: 6pt;
    }

    #label-print .label-footer {
        display: flex;
        justify-content: space-between;
        border-top: 0.5pt solid #000;
        padding-top: 1mm;
        font-size: 6pt;
    }
    #label-print .label-footer .label-company { flex: 1; line-height: 1.3; }
    #label-print .label-footer .label-dates   { text-align: right; font-weight: 700; line-height: 1.4; }

    @page label {
        size: 150mm 100mm;
        margin: 0;
    }
}
