body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
}

.header {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 8px 20px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-section,
.invoice-search-section,
.invoice-receipt-section {
    flex: 1 0 auto;
    padding-top: 40px;
    padding-bottom: 40px;
}

.footer {
    flex-shrink: 0;
    margin-top: auto;
    background: #1e293b;
    border-top: 2px solid #1e293b;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.invoice-modal {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    transition: color 0.2s;
    z-index: 10;
}

.close-btn:hover {
    color: #333;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20%;
    transition: background-color 0.3s;
}

.icon-btn:hover {
    background-color: rgba(16, 150, 157, 0.1);
}

.icon-btn svg {
    color: #1e293b;
}

.invoice-search-section {
    background: #f8f9fa;
    padding: 40px 20px;
    border-bottom: 2px solid #e0e0e0;
    min-height: 300px;
}

.search-form {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #10969d;
    box-shadow: 0 0 0 3px rgba(16, 150, 157, 0.1);
}

.invoice-header {
    background: linear-gradient(135deg, #10969d 0%, #0d7a80 100%);
    color: white;
    padding: 30px;
    border-radius: 12px 12px 0 0;
    text-align: center;
}

.invoice-header h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.invoice-success {
    margin: 0;
    font-size: 16px;
    opacity: 0.95;
}

.invoice-body {
    padding: 30px;
}

.invoice-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.invoice-section:last-of-type {
    border-bottom: none;
}

.invoice-section h3 {
    color: #10969d;
    font-size: 18px;
    margin: 0 0 15px 0;
    font-weight: 600;
}

.invoice-section p {
    margin: 8px 0;
    color: #333;
    font-size: 14px;
}

.invoice-section strong {
    color: #555;
    font-weight: 600;
    display: inline-block;
    min-width: 120px;
}

.invoice-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.invoice-item:last-child {
    margin-bottom: 0;
}

.item-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.item-info strong {
    color: #333;
    font-size: 15px;
}

.item-category {
    background: #10969d;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
}

.item-details {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #666;
}

.item-total {
    font-weight: 600;
    color: #10969d;
}

.invoice-totals {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 15px;
    color: #555;
}

.total-final {
    border-top: 2px solid #10969d;
    padding-top: 15px;
    margin-top: 10px;
    font-size: 20px;
    font-weight: 700;
    color: #10969d;
}

.referencias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.referencia-item {
    background: #f0f8f9;
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid #10969d;
}

.referencia-item strong {
    display: block;
    color: #10969d;
    margin-bottom: 5px;
    font-size: 13px;
}

.referencia-item span {
    font-family: "Courier New", monospace;
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

.invoice-footer {
    text-align: center;
    padding-top: 15px;
    border-top: 2px dashed #ddd;
}

.invoice-number {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 5px 0;
}

.invoice-date {
    font-size: 14px;
    color: #666;
    margin: 5px 0;
}

.invoice-actions {
    padding: 20px 30px 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.invoice-actions button {
    padding: 12px 30px;
    font-size: 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    font-weight: 600;
}

.invoice-actions .btn-primary {
    background: #10969d;
    color: white;
}

.invoice-actions .btn-primary:hover {
    background: #0d7a80;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 150, 157, 0.3);
}

.invoice-actions .btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.invoice-actions .btn-secondary:hover {
    background: #d0d0d0;
}

.invoice-receipt-section {
    background: #f5f5f5;
    padding: 50px 20px;
    min-height: calc(100vh - 200px);
}

.receipt-container {
    max-width: 850px;
    margin: 0 auto;
    background: white;
    border: 2px solid #10969d;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.receipt-header {
    background: linear-gradient(135deg, #10969d 0%, #0d7a80 100%);
    color: white;
    padding: 35px 30px;
    text-align: center;
}

.receipt-header h1 {
    margin: 0 0 10px 0;
    font-size: 32px;
    font-weight: 700;
}

.receipt-body {
    padding: 35px 30px;
}

.receipt-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 2px dashed #ddd;
}

.receipt-section {
    margin-bottom: 30px;
}

.receipt-section h3 {
    color: #10969d;
    font-size: 18px;
    margin: 0 0 15px 0;
    border-bottom: 2px solid #10969d;
    padding-bottom: 10px;
    font-weight: 600;
}

.receipt-section p {
    margin: 10px 0;
    color: #333;
    font-size: 14px;
    line-height: 1.6;
}

.receipt-section strong {
    color: #555;
    font-weight: 600;
}

.receipt-totals {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.receipt-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 35px;
    padding-top: 25px;
    border-top: 2px dashed #ddd;
}

.receipt-actions button {
    padding: 14px 35px;
    font-size: 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    font-weight: 600;
}

/* Estilos generales de tabla */
.receipt-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.receipt-items-table th {
    text-align: left;
    padding: 12px 15px;
    background-color: #f8f9fa;
    border-bottom: 2px solid #10969d;
    font-weight: 700;
}

.receipt-items-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

/* Alineación específica para columnas */
.receipt-items-table th:nth-of-type(1),
.receipt-items-table td:nth-of-type(1) {
    text-align: left; 
}

.receipt-items-table th:nth-of-type(n+2),
.receipt-items-table td:nth-of-type(n+2) {
    text-align: right; 
}

/* Responsive */
@media (max-width: 768px) {
    
    .header {
        height: 60px; 
        padding: 8px 15px;
    }

    .nav-desktop, 
    .search-bar, 
    .sistema-reserva-text { 
        display: none; 
    }

    .header-content {
        justify-content: space-between; 
    }

    .header-tools-and-actions {
        display: flex;
        align-items: center;
        gap: 5px; 
    }

    .header-actions {
        display: flex;
        gap: 5px; 
        align-items: center;
    }

    .cart-count {
        position: absolute;
        top: 2px;
        right: 2px;
        font-size: 10px;
        padding: 2px 5px;
        border-radius: 50%;
    }

    .invoice-modal {
        max-width: 95%;
        margin: 10px;
    }

    .invoice-header {
        padding: 20px;
    }

    .invoice-header h2 {
        font-size: 22px;
    }

    .invoice-body {
        padding: 20px;
    }

    .referencias-grid {
        grid-template-columns: 1fr;
    }

    .invoice-actions {
        flex-direction: column;
    }

    .invoice-actions button {
        width: 100%;
    }

    .item-details {
        flex-direction: column;
        gap: 5px;
    }

    .receipt-info-grid {
        grid-template-columns: 1fr;
    }

    .receipt-body {
        padding: 25px 20px;
    }

    .receipt-header {
        padding: 25px 20px;
    }

    .receipt-header h1 {
        font-size: 24px;
    }

    .receipt-actions {
        flex-direction: column;
    }

    .receipt-actions button {
        width: 100%;
    }

    .search-form {
        padding: 20px;
    }

    .invoice-search-section {
        padding: 30px 15px;
    }

    .invoice-receipt-section {
        padding: 30px 10px; 
    }
    
    /* --- CÓDIGO DE LA TABLA DE ITEMS DEL RECIBO EN VISTA MÓVIL --- */
    
    .receipt-items-table thead {
        display: none; 
    }

    .receipt-items-table tbody, 
    .receipt-items-table tr {
        display: block; 
        width: 100%;
    }

    .receipt-items-table tr {
        margin-bottom: 10px;
        border: 1px solid #e0e0e0;
        border-radius: 6px;
    }
    
    .receipt-items-table td {
        display: block; /* Convertir celda en bloque */
        text-align: right;
        padding-left: 50%; 
        position: relative;
        border: none;
        padding: 8px 15px;
        border-bottom: 1px dashed #eee;
    }
    
    .receipt-items-table td:last-child {
        border-bottom: 0;
        font-weight: 700;
        color: #10969d;
    }
    
    /* Reglas específicas para el campo de la Descripción (primera columna) */
    .receipt-items-table td:nth-of-type(1) {
        padding-left: 15px; 
        text-align: left; 
        font-weight: 600;
        color: #1e293b;
    }

    /* Etiqueta que aparecerá en móvil */
    .receipt-items-table td:before {
        position: absolute;
        left: 15px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: 600;
        color: #333;
    }

    .receipt-items-table td:nth-of-type(1):before {
        content: ""; 
    }
    .receipt-items-table td:nth-of-type(2):before {
        content: "Cantidad:"; 
    }
    .receipt-items-table td:nth-of-type(3):before {
        content: "P. Unitario:"; 
    }
    .receipt-items-table td:nth-of-type(4):before {
        content: "Total:";
    }
    
}