/**
 * CONCESPACIO - Estilos de Impresión para Tickets
 * Optimizado para impresoras térmicas de 80mm
 */

@media print {

    /* Ocultar todo excepto el ticket */
    body * {
        visibility: hidden;
    }

    #ticket-print-area,
    #ticket-print-area * {
        visibility: visible;
    }

    #ticket-print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 80mm;
        padding: 5mm;
    }

    /* Sin márgenes de página */
    @page {
        margin: 0;
        size: 80mm auto;
    }
}

/* Estilos del Ticket (visible en modal y en impresión) */
.ticket-container {
    font-family: 'Courier New', monospace;
    width: 80mm;
    max-width: 100%;
    margin: 0 auto;
    padding: 10px;
    background: white;
    color: #000;
    font-size: 12px;
    line-height: 1.4;
}

.ticket-header {
    text-align: center;
    border-bottom: 2px dashed #000;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.ticket-logo {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
}

.ticket-business-info {
    font-size: 10px;
    color: #333;
}

.ticket-title {
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    margin: 10px 0;
    text-transform: uppercase;
}

.ticket-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    margin: 3px 0;
}

.ticket-divider {
    border-top: 1px dashed #000;
    margin: 10px 0;
}

.ticket-items {
    margin: 10px 0;
}

.ticket-item {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
    font-size: 11px;
}

.ticket-item-name {
    flex: 1;
    padding-right: 10px;
}

.ticket-item-qty {
    width: 30px;
    text-align: center;
}

.ticket-item-price {
    width: 70px;
    text-align: right;
    font-weight: bold;
}

.ticket-totals {
    border-top: 2px dashed #000;
    padding-top: 10px;
    margin-top: 10px;
}

.ticket-total-row {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
    font-size: 12px;
}

.ticket-total-row.grand-total {
    font-size: 16px;
    font-weight: bold;
    border-top: 1px solid #000;
    padding-top: 5px;
    margin-top: 5px;
}

.ticket-payment-info {
    margin-top: 10px;
    padding: 8px;
    background: #f5f5f5;
    border-radius: 4px;
}

.ticket-footer {
    text-align: center;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 2px dashed #000;
    font-size: 10px;
}

.ticket-barcode {
    text-align: center;
    font-size: 10px;
    letter-spacing: 3px;
    margin: 10px 0;
}

.ticket-thanks {
    font-size: 12px;
    font-weight: bold;
    margin-top: 10px;
}

/* Modal del Ticket */
.ticket-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.ticket-modal-content {
    background: white;
    border-radius: 12px;
    padding: 20px;
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.ticket-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.ticket-modal-actions button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-print {
    background: #671f2f;
    color: white;
}

.btn-print:hover {
    background: #4a1520;
}

.btn-close-ticket {
    background: #f0f0f0;
    color: #333;
}

.btn-close-ticket:hover {
    background: #e0e0e0;
}

.btn-whatsapp {
    background: #25D366;
    color: white;
}

.btn-whatsapp:hover {
    background: #1da851;
}