﻿/* ================================================================
   ESTILOS PARA IMPRESIÓN DE TICKETS
   Compatible con impresoras térmicas 58mm y 80mm
   ================================================================ */

/* ================================================================
   NOTA: La impresion de tickets se hace en una ventana emergente
   independiente (ver ticket-print.js). Los estilos de impresion
   se inyectan directamente en esa ventana.

   Las reglas @media print aqui solo aplican si el usuario
   intenta imprimir la pagina principal (Ctrl+P).
   ================================================================ */
@media print {
    /* Ocultar los divs de ticket ocultos en la pagina principal */
    #ticket-print-area,
    #ticket-comprobante-print-area,
    #ticket-cierrecaja-print-area,
    #ticket-comision-print-area {
        display: none !important;
    }
}

/* Estilos del ticket */
.ticket-container {
    font-family: 'Courier New', monospace;
    width: 80mm;
    padding: 5mm;
    margin: 0 auto;
    font-size: 12px;
    line-height: 1.4;
    color: #000;
    background: #fff;
}

    /* Para tickets más pequeños (58mm) */
    .ticket-container.ticket-small {
        width: 58mm;
        font-size: 10px;
    }

.ticket-header {
    text-align: center;
    border-bottom: 1px dashed #000;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.ticket-title {
    font-size: 16px;
    font-weight: bold;
    margin: 5px 0;
}

.ticket-subtitle {
    font-size: 10px;
    margin: 2px 0;
}

.ticket-section {
    margin: 10px 0;
    padding: 5px 0;
}

.ticket-section-title {
    font-weight: bold;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.ticket-line {
    margin: 3px 0;
}

    .ticket-line strong {
        display: inline-block;
        min-width: 100px;
    }

.ticket-separator {
    border-top: 1px dashed #000;
    margin: 10px 0;
}

.ticket-separator-double {
    border-top: 2px solid #000;
    margin: 10px 0;
}

.ticket-footer {
    text-align: center;
    border-top: 1px dashed #000;
    padding-top: 10px;
    margin-top: 10px;
    font-size: 10px;
}

.ticket-total {
    font-size: 18px;
    font-weight: bold;
    text-align: right;
    margin: 10px 0;
}

.ticket-center {
    text-align: center;
}

.ticket-right {
    text-align: right;
}

/* Tabla de items */
.ticket-table {
    width: 100%;
    margin: 10px 0;
}

    .ticket-table td {
        padding: 2px 0;
    }

    .ticket-table .item-name {
        text-align: left;
    }

    .ticket-table .item-price {
        text-align: right;
    }

/* Utilidades */
.text-bold {
    font-weight: bold;
}

.text-small {
    font-size: 10px;
}

.mt-10 {
    margin-top: 10px;
}

.mb-10 {
    margin-bottom: 10px;
}

/* Botón de impresión (oculto al imprimir) */
@media print {
    .no-print {
        display: none !important;
    }
}

.print-button-container {
    text-align: center;
    margin: 20px 0;
}

/* ================================================================
   COMENTARIOS PARA IMPLEMENTACIÓN FUTURA CON ESC/POS
   ================================================================
   
   NOTA: Cuando implementes ESC/POS, estos estilos NO se usarán.
   En su lugar, usarás comandos ESC/POS directos:
   
   - ESC @ : Inicializar impresora
   - ESC a 1 : Centrar texto
   - ESC E 1 : Texto en negrita
   - GS ! 0x11 : Doble tamaño
   - ESC d 3 : Salto de 3 líneas
   - GS V 66 0 : Cortar papel
   
   Librerías recomendadas para .NET:
   - ESCPOS.NET (NuGet)
   - Neodynamic.SDK.Printing (comercial)
   
   Ejemplo de implementación ESC/POS:
   
   public class EscPosTicketService : ITicketService
   {
       public async Task ImprimirOrdenLavado(Lavado lavado)
       {
           var printer = new SerialPrinter("COM3", 9600);
           printer.Initialize();
           printer.SetAlignment(Alignment.Center);
           printer.PrintLine("ORDEN DE LAVADO");
           printer.SetAlignment(Alignment.Left);
           printer.PrintLine($"Orden #: {lavado.Id}");
           // ... resto de comandos ESC/POS
           printer.Cut();
       }
   }
   
   ================================================================ */
