/**
 * ============================================================================
 * XOEY - Estilos para Impresión de Pedidos
 * ============================================================================
 * 
 * CSS dedicado para la vista de impresión de pedidos (orders/actions/print.php)
 * Optimizado para impresión en papel A4 con vista previa responsive
 * 
 * @version 1.0.0
 * @author Xoey Team
 */

/* ============================================================================
   Reset y Estilos Generales
============================================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-size: 12pt;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
    padding: 10px;
}

.xoey-print-container {
    font-family: "Roboto Mono", "Courier New", Courier, monospace;
    max-width: 210mm;
    margin: 0 auto;
    background: white;
    padding: 15px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* ============================================================================
   Header de Impresión
============================================================================ */
.xoey-print-header {
    border-bottom: 3px solid #aa5e85;
    padding-bottom: 12px;
    margin-bottom: 15px;
}

.xoey-print-header h1 {
    font-size: 24pt;
    color: #aa5e85;
    margin-bottom: 5px;
}

.xoey-print-header .xoey-order-code {
    font-size: 14pt;
    color: #666;
    font-weight: normal;
}

.xoey-print-header .xoey-order-date {
    font-size: 11pt;
    color: #888;
    margin-top: 5px;
}

/* ============================================================================
   Secciones
============================================================================ */
.xoey-print-section {
    margin-bottom: 15px;
    page-break-inside: avoid;
}

.xoey-print-section h2 {
    font-family: "Roboto Mono", "Courier New", Courier, monospace;
    font-size: 13pt;
    font-weight: 700;
    color: #8b4a6b;
    border-bottom: 3px solid #aa5e85;
    padding-bottom: 6px;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.xoey-print-section .xoey-section-content {
    padding-left: 8px;
}

/* ============================================================================
   Tabla de Items
============================================================================ */
.xoey-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.xoey-items-table th {
    background: #f8f9fa;
    padding: 6px 10px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

.xoey-items-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #e9ecef;
}

.xoey-items-table tr:last-child td {
    border-bottom: none;
}

.xoey-text-right {
    text-align: right;
}

.xoey-text-center {
    text-align: center;
}

/* ============================================================================
   Totales
============================================================================ */
.xoey-totals-section {
    margin-top: 20px;
    border-top: 2px solid #dee2e6;
    padding-top: 10px;
}

.xoey-totals-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 11pt;
}

.xoey-totals-row.xoey-total-final {
    font-size: 14pt;
    font-weight: bold;
    border-top: 2px solid #aa5e85;
    padding-top: 8px;
    margin-top: 4px;
    color: #aa5e85;
}

/* ============================================================================
   Información del Cliente
============================================================================ */
.xoey-two-columns-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 15px;
    page-break-inside: avoid;
}

.xoey-two-columns-section .xoey-print-section {
    margin-bottom: 0;
}

.xoey-info-item {
    margin-bottom: 4px;
}

.xoey-info-label {
    font-family: "Roboto Mono", "Courier New", Courier, monospace;
    font-weight: 700;
    color: #8b4a6b;
    font-size: 11pt;
    margin-bottom: 2px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.xoey-info-value {
    color: #333;
    font-size: 11pt;
    margin-top: 0;
    margin-bottom: 0;
}

.xoey-document-inline {
    margin-bottom: 4px;
}

.xoey-document-type {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.xoey-document-type .xoey-info-label {
    margin-bottom: 0;
    margin-right: 0;
    flex-shrink: 0;
}

.xoey-document-type .xoey-info-value {
    margin-top: 0;
}

.xoey-document-type .xoey-info-label + .xoey-info-value {
    margin-right: 15px;
}

/* ============================================================================
   Botones de Acción (solo en pantalla)
============================================================================ */
.xoey-action-buttons {
    text-align: center;
    margin-bottom: 20px;
}

.xoey-action-buttons .btn {
    margin: 0 5px;
    padding: 10px 20px;
    font-size: 14px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.xoey-btn-primary {
    background: #aa5e85;
    color: white;
}

.xoey-btn-primary:hover {
    background: #8b4a6b;
}

.xoey-btn-secondary {
    background: #6c757d;
    color: white;
}

.xoey-btn-secondary:hover {
    background: #545b62;
}

/* ============================================================================
   Tabla de Resumen de Items (Picking)
============================================================================ */
.xoey-summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 10pt;
}

.xoey-summary-table th {
    background: #f8f9fa;
    padding: 8px 6px;
    text-align: center;
    font-weight: 600;
    border: 1px solid #dee2e6;
    font-size: 9pt;
}

.xoey-summary-table td {
    padding: 8px 6px;
    text-align: center;
    border: 1px solid #dee2e6;
}

.xoey-summary-table td:first-child,
.xoey-summary-table td:nth-child(2) {
    text-align: left;
    font-weight: 600;
}

/* ============================================================================
   Estilos para Impresión
============================================================================ */
@media print {
    body {
        margin: 0;
        padding: 5px;
    }

    .xoey-print-container {
        padding: 10px;
        max-width: 100%;
    }

    .xoey-no-print {
        display: none !important;
    }

    /* Forzar dos columnas en impresión */
    .xoey-two-columns-section {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 20px !important;
    }

    @page {
        margin: 0.5cm;
    }
}

/* ============================================================================
   Responsive
============================================================================ */
@media (max-width: 768px) {
    .xoey-two-columns-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .xoey-print-container {
        padding: 15px;
    }

    .xoey-summary-table {
        font-size: 8pt;
    }

    .xoey-summary-table th,
    .xoey-summary-table td {
        padding: 6px 4px;
    }
}
