/* 2026-11-07: el comprobante. Dos vidas en un mismo archivo:
     - EN PANTALLA: tiene que PARECER un ticket. Papel sobre fondo gris, borde dentado arriba y
       abajo, sombra. Si se ve como texto suelto en una hoja blanca, el dueño no reconoce lo que
       está viendo aunque el contenido sea correcto.
     - EN PAPEL: 80 mm limpios, sin sombras ni adornos, que es lo único que entiende una térmica.

   Tipografía: sans moderna para el texto y `tabular-nums` para que los importes queden en
   columna. El Courier de antes alineaba bien pero se veía de 1995. */

.tk-fondo {
    min-height: 100vh;
    padding: 2rem 1rem 4rem;
    background: #eef0f3;
}

.tk {
    position: relative;
    width: 80mm;
    max-width: 100%;
    margin: 0 auto;
    padding: 9mm 6mm 10mm;
    background: #fff;
    color: #111;
    font-family: ui-sans-serif, -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
    font-size: 12.5px;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 12px 32px -12px rgba(0,0,0,.25);
}

/* El dentado del papel arriba y abajo. Es lo que hace que se lea como "ticket" de un vistazo. */
.tk::before,
.tk::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 6px;
    background:
        linear-gradient(45deg, transparent 33.33%, #fff 33.33%, #fff 66.66%, transparent 66.66%),
        linear-gradient(-45deg, transparent 33.33%, #fff 33.33%, #fff 66.66%, transparent 66.66%);
    background-size: 10px 12px;
}

.tk::before { top: -6px; transform: scaleY(-1); }
.tk::after  { bottom: -6px; }

/* ------------------------------------------------------------------ cabecera */

.tk-cab { text-align: center; margin-bottom: 5mm; }

.tk-cab img {
    max-width: 34mm;
    max-height: 16mm;
    object-fit: contain;
    margin-bottom: 2.5mm;
}

.tk-cab .nom {
    font-size: 16px;
    font-weight: 750;
    letter-spacing: -.01em;
    line-height: 1.2;
}

.tk-cab .dato { font-size: 11.5px; color: #5b6472; }

/* ------------------------------------------------------------------ separadores */

.tk-sep {
    height: 1px;
    margin: 3.5mm 0;
    background-image: linear-gradient(to right, #c9ced6 50%, transparent 50%);
    background-size: 6px 1px;
    background-repeat: repeat-x;
}

/* ------------------------------------------------------------------ filas */

.tk-fila {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 4mm;
    padding: .4mm 0;
}

.tk-fila .izq { flex: 1; min-width: 0; }
.tk-fila .der { text-align: right; white-space: nowrap; }

.tk-dato .izq { color: #5b6472; font-size: 11.5px; }
.tk-dato .der { font-size: 11.5px; }

/* ------------------------------------------------------------------ renglones */

.tk-lineas { margin: 1mm 0; }
.tk-lineas .tk-fila { padding: .9mm 0; }
.tk-lineas .izq { font-weight: 550; }
.tk-lineas .der { font-weight: 550; }
.tk-lineas .d { font-size: 11px; color: #5b6472; padding-left: 2mm; margin-top: -.6mm; }

/* ------------------------------------------------------------------ totales */

.tk-tot {
    margin: 2mm -6mm 0;
    padding: 2.5mm 6mm;
    background: #f4f6f8;
}

.tk-tot .tk-fila {
    font-size: 17px;
    font-weight: 780;
    letter-spacing: -.02em;
    padding: 0;
}

/* ------------------------------------------------------------------ bloque fiscal */

.tk-doc {
    text-align: center;
    padding: 2.5mm 0;
}

.tk-doc .et {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #5b6472;
}

.tk-doc .num {
    font-size: 15px;
    font-weight: 750;
    letter-spacing: .02em;
}

.tk-doc .cai { font-size: 10.5px; color: #5b6472; word-break: break-all; }

.tk-legal {
    font-size: 9.5px;
    line-height: 1.45;
    color: #5b6472;
    text-align: center;
}

.tk-anulada {
    margin: 3mm 0;
    padding: 2mm;
    border: 1.5px solid #c0392b;
    color: #c0392b;
    text-align: center;
    font-weight: 750;
    letter-spacing: .1em;
}

/* ------------------------------------------------------------------ pie */

.tk-pie {
    text-align: center;
    font-size: 11px;
    color: #5b6472;
    margin-top: 4mm;
}

.tk-pie .gracias { font-size: 12.5px; font-weight: 600; color: #111; }
.tk-pie .web { font-size: 10.5px; margin-top: 1mm; }

/* ------------------------------------------------------------------ botones (pantalla) */

.tk-acciones {
    display: flex;
    justify-content: center;
    gap: .6rem;
    max-width: 80mm;
    margin: 0 auto 1.25rem;
}

/* ------------------------------------------------------------------ impresion */

@media print {
    .tk-acciones,
    .mud-snackbar-container,
    .tk::before,
    .tk::after { display: none !important; }

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

    html, body, .tk-fondo {
        width: 80mm;
        min-height: 0;
        margin: 0;
        padding: 0;
        background: #fff;
    }

    .tk {
        width: 80mm;
        margin: 0;
        padding: 3mm 4mm 6mm;
        box-shadow: none;
        font-size: 12px;
    }

    /* En térmica el gris sale como una mancha sucia: el total se marca con línea, no con fondo. */
    .tk-tot {
        margin: 2mm 0 0;
        padding: 2mm 0 0;
        background: none;
        border-top: 2px solid #000;
    }

    .tk-cab .dato,
    .tk-dato .izq,
    .tk-lineas .d,
    .tk-doc .et,
    .tk-doc .cai,
    .tk-legal,
    .tk-pie { color: #000; }
}
