/* =============================================
   POS Verdulería — Print Styles (Optimizado)
   ============================================= */

@media print {
    /* Suppress browser headers/footers (date, URL, title, page numbers) */
    @page {
        margin: 10mm;
    }

    /* Ocultar todos los elementos excepto el area de impresion */
    body > *:not(.print-area) {
        display: none !important;
    }

    .print-area {
        display: block !important;
        width: 100%;
        margin: 0;
        padding: 0;
    }

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

/* ---- Ticket (80mm) ---- */
.ticket {
    width: 280px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    padding: 10px;
    color: #000;
    background: white;
}

.ticket-header {
    text-align: center;
    border-bottom: 1px dashed #000;
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.ticket-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 4px;
}

.ticket-subtitle {
    font-size: 11px;
}

.ticket-info {
    margin-bottom: 8px;
    font-size: 11px;
}

.ticket-info div {
    margin-bottom: 2px;
}

.ticket-separator {
    border: none;
    border-top: 1px dashed #000;
    margin: 8px 0;
}

.ticket-items {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8px;
}

.ticket-items th {
    font-size: 11px;
    text-align: left;
    border-bottom: 1px solid #000;
    padding: 2px 0;
}

.ticket-items th:last-child,
.ticket-items td:last-child {
    text-align: right;
}

.ticket-items td {
    font-size: 11px;
    padding: 3px 0;
    vertical-align: top;
}

.ticket-total {
    text-align: right;
    font-size: 14px;
    font-weight: bold;
    border-top: 1px dashed #000;
    padding-top: 8px;
    margin-top: 4px;
}

.ticket-footer {
    text-align: center;
    font-size: 10px;
    margin-top: 12px;
    border-top: 1px dashed #000;
    padding-top: 8px;
}

/* ---- Remito (full page - optimizado para 25-30 items) ---- */
.remito-print {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    font-family: var(--font-family);
    padding: 20px;
    color: #000;
    background: white;
}

/* Fecha del remito encima de la línea verde */
.remito-print-date-line {
    font-size: 11px;
    color: #333;
    margin-bottom: 4px;
    text-align: right;
}

.remito-print-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #2D5A3D;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.remito-print-brand {
    font-size: 18px;
    font-weight: bold;
    color: #2D5A3D;
}

.remito-print-brand small {
    display: block;
    font-size: 10px;
    font-weight: normal;
    color: #666;
    margin-top: 2px;
}

.remito-print-number {
    text-align: right;
}

.remito-print-number strong {
    display: block;
    font-size: 16px;
    color: #2D5A3D;
}

.remito-print-number span {
    font-size: 10px;
    color: #666;
}

/* Compact info line */
.remito-print-info-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 11px;
    padding: 5px 10px;
    background: #f8f8f8;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.remito-print-info-compact span {
    white-space: nowrap;
}

.remito-print-info-compact strong {
    color: #333;
}

/* Keep old .remito-print-info for backwards compat but hidden */
.remito-print-info {
    display: none;
}

.remito-print-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
}

.remito-print-table th {
    background: #1a3d2a;
    color: white;
    padding: 5px 8px;
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.remito-print-table th:last-child {
    text-align: right;
}

.remito-print-table td {
    padding: 4px 8px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 11px;
}

.remito-print-table td:last-child {
    text-align: right;
}

.remito-print-table tbody tr:nth-child(even) {
    background: #f8f8f8;
}

.remito-print-total {
    text-align: right;
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 14px;
    color: #2D5A3D;
}

/* ---- Remito Payment Stamps ---- */
.remito-print-stamp {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-25deg);
    font-size: 42px;
    font-weight: 900;
    letter-spacing: 4px;
    padding: 10px 30px;
    border: 5px solid;
    border-radius: 12px;
    opacity: 0.13;
    pointer-events: none;
    z-index: 10;
    white-space: nowrap;
    text-transform: uppercase;
}

.stamp-pagado {
    color: #2D5A3D;
    border-color: #2D5A3D;
}

.stamp-parcial {
    color: #b8860b;
    border-color: #b8860b;
}

.stamp-pendiente {
    color: #c0392b;
    border-color: #c0392b;
}

.stamp-cancelado {
    color: #666;
    border-color: #666;
}

/* ---- Remito Payment Info Section ---- */
.remito-print-payment-info {
    border: 2px solid #ccc;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 11px;
}

.payment-pagado {
    border-color: #2D5A3D;
    background: #f0f8f2;
}

.payment-parcial {
    border-color: #b8860b;
    background: #fdf8ec;
}

.payment-pendiente {
    border-color: #c0392b;
    background: #fdf0ef;
}

.payment-info-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #ddd;
}

.payment-pagado .payment-info-title {
    color: #2D5A3D;
}

.payment-parcial .payment-info-title {
    color: #b8860b;
}

.payment-pendiente .payment-info-title {
    color: #c0392b;
}

.payment-neutral {
    border-color: #333;
    background: #fafafa;
}

.payment-neutral .payment-info-title {
    color: #222;
}

.payment-info-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
}

.payment-saldo {
    font-weight: 800;
    font-size: 13px;
    color: #c0392b;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed #ccc;
}

.payment-saldo-neutral {
    font-weight: 800;
    font-size: 13px;
    color: #222;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed #ccc;
}

.payment-history {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid #ddd;
}

.payment-history-title {
    font-size: 10px;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
}

.payment-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
}

.payment-history-table th {
    background: #f5f0e0;
    padding: 3px 6px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid #ccc;
}

.payment-history-table td {
    padding: 3px 6px;
    border-bottom: 1px solid #eee;
}

.payment-history-table td:last-child,
.payment-history-table th:last-child {
    text-align: right;
}
