﻿/* ===== Suprafețe pentru print ===== */
.print-surface {
    display: none;
}

.print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

    .print-table th, .print-table td {
        border: 1px solid #ccc;
        padding: 6px;
        text-align: center;
    }

.print-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 10px;
}

    .print-header h2 {
        margin: 0;
    }

    .print-header .meta {
        text-align: right;
        font-size: 12px;
    }

/* ===== Layout termic (70mm) ===== */
.thermal {
    width: 70mm;
    margin: 0 auto;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

    .thermal .ticket-title {
        text-align: center;
        font-weight: 700;
        font-size: 16px;
    }

    .thermal .ticket-meta {
        font-size: 11px;
        line-height: 1.2;
    }

    .thermal hr {
        border: 0;
        border-top: 1px dashed #000;
        margin: 6px 0;
    }

.ticket-item {
    border: 1px solid #000;
    border-radius: 4px;
    padding: 6px;
    margin: 6px 0;
    page-break-inside: avoid;
}

.ti-line {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    font-size: 12px;
}

.ti-label {
    font-weight: 600;
}

.ti-val {
    text-align: right;
    max-width: 42mm;
    word-wrap: break-word;
}

/* ===== Tipărire ===== */
@media print {
    /* ascunde UI-ul normal */
    header, nav, footer, #paramsForm, #orderSection {
        display: none !important;
    }

    /* implicit: NU afișa nicio suprafață de print */
    .print-surface {
        display: none !important;
    }

    /* afișează DOAR suprafața potrivită, în funcție de clasa de pe <body> */
    body.print-a4 .a4 {
        display: block !important;
    }

    body.print-thermal .thermal {
        display: block !important;
    }

    /* dimensiuni pagină */
    @page {
        size: A4 portrait;
        margin: 12mm;
    }

    body.print-thermal @page {
        size: 70mm auto;
        margin: 4mm;
    }

    /* A4: thead + evită ruperi */
    .a4 thead {
        display: table-header-group;
    }

    .a4 tr {
        page-break-inside: avoid;
    }
}

