/* ESTILOS GENERALES */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

h1, h2, h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

h1 {
    font-size: 28px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

h2 {
    font-size: 22px;
    margin-top: 30px;
}

h3 {
    font-size: 18px;
    margin: 20px 0 15px;
}

/* FORMULARIOS */
.form-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #e0e6ed;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
}

input, select {
    width: 100%;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 15px;
    transition: all 0.3s;
    background-color: #f8fafc;
}

input:focus, select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    background-color: white;
}

.search-container {
    display: flex;
    gap: 5px;
}

.search-container input {
    flex: 1;
}

/* TABLA */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border: 1px solid #e2e8f0;
}

th {
    background-color: #3498db;
    color: white;
    font-weight: 600;
}

tr:nth-child(even) {
    background-color: #f8fafc;
}

tr:hover {
    background-color: #f0f4f8;
}

/* BOTONES */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn i {
    font-size: 14px;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-add {
    background-color: #2ecc71;
    color: white;
}

.btn-add:hover {
    background-color: #27ae60;
}

.btn-save {
    background-color: #3498db;
    color: white;
}

.btn-update {
    background-color: #f39c12;
    color: white;
}

.btn-icon {
    padding: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.btn-remove {
    background-color: #e74c3c;
    color: white;
}

.btn-remove:hover {
    background-color: #c0392b;
}

.botones-cliente {
    justify-content: flex-end;
    margin-top: 15px;
    gap: 15px;
}

.btn-container {
    text-align: center;
    margin-top: 30px;
}

.table-actions {
    margin-top: 20px;
}

/* ALERTAS */
.alert {
    padding: 10px 15px;
    border-radius: 6px;
    margin-top: 10px;
    font-size: 14px;
    display: none;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* INPUTS TABLA */
#productos-table input[type="text"],
#productos-table input[type="number"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

#productos-table input[readonly] {
    background-color: #f5f5f5;
}

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

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

/* Estilos para el dropdown de productos */
.productos-dropdown {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: #f0f4f8;
}

/* Asegurarse que los inputs en la tabla tengan el z-index correcto */
#productos-table input {
    position: relative;
    z-index: 1;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-group {
        min-width: 100%;
    }
    
    .botones-cliente {
        flex-direction: column;
    }
    
    table {
        font-size: 13px;
    }
    
    th, td {
        padding: 8px 10px;
    }
    
    .productos-dropdown {
        width: 90% !important;
        left: 5% !important;
    }
}

/* Estilos para login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f5f7fa;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

#login-alert {
    margin: 15px 0;
}

/* Estilo para botón de logout */
.btn-danger {
    background-color: #e74c3c;
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* [Todos los estilos anteriores permanecen igual hasta el final] */

/* Estilos para la sección de resultados de productos */
.productos-resultados {
    margin-top: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}

#tabla-resultados {
    width: 100%;
    border-collapse: collapse;
}

#tabla-resultados th {
    background-color: #2ecc71;
    color: white;
    padding: 10px 15px;
    text-align: left;
}

#tabla-resultados td {
    padding: 10px 15px;
    border-bottom: 1px solid #e2e8f0;
}

#tabla-resultados tr:nth-child(even) {

    background-color: #f8fafc;
}

#tabla-resultados tr:hover {
    background-color: #f0f4f8;
}

.btn-agregar {
    background-color: #3498db;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-agregar:hover {
    background-color: #2980b9;
}

.btn-agregar i {
    margin-right: 5px;
}

/* Asegurar que la tabla de resultados sea responsive */
@media (max-width: 768px) {
    #tabla-resultados {
        display: block;
        overflow-x: auto;
    }
    
    #tabla-resultados th, 
    #tabla-resultados td {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .btn-agregar {
        padding: 4px 8px;
        font-size: 12px;
    }
}

/* Estilos específicos para la carga de productos */
body::after {
    display: block;
    background: #4CAF50;
    color: white;
    padding: 10px;
    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 9999;
}
/* Carga de archivos */
#csv-file {
    padding: 10px;
    border: 2px dashed #3498db;
    border-radius: 6px;
    width: 100%;
    background: #f8fafc;
    transition: all 0.3s;
}

#csv-file:hover {
    background: #ebf4ff;
}

.help-text {
    color: #718096;
    font-size: 13px;
    margin-top: 5px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table th {
    background: #3498db;
    color: white;
    padding: 12px;
}

.results-table td {
    padding: 10px;
    border-bottom: 1px solid #e2e8f0;
}




/* este */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    align-items: flex-end;
}

.table-actions {
    display: flex;
    gap: 10px;
    margin-right: 20px;
}

.form-group {
    flex-grow: 1;
    min-width: 200px;
}


/*--------------*/
/* Agrega esto a tu archivo styles.css */
#observaciones {
    width: 100%;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical; /* Permite al usuario redimensionar verticalmente */
    min-height: 80px; /* Altura mínima inicial */
    background-color: #f8fafc;
    transition: all 0.3s;
}

#observaciones:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    background-color: white;
}
/* Estilos para el footer de la tabla */
#productos-table tfoot tr:last-child td {
    padding-top: 15px;
    padding-bottom: 15px;
    background-color: #f8fafc;
}

/* Asegurar que el textarea ocupe el espacio disponible */
#productos-table tfoot .form-group:first-child {
    flex: 1;
    min-width: 0; /* Para evitar problemas de flexbox */
}

/* Estilo específico para el método de pago */
.compact-payment {
    flex-shrink: 0; /* Evita que se reduzca */
    margin-left: 20px;
}

/* ================================
   Quitar spinner de cantidad y precio
   ================================ */

/* Chrome, Safari, Edge, Opera */
input.input-cantidad::-webkit-outer-spin-button,
input.input-cantidad::-webkit-inner-spin-button,
input.input-precio::-webkit-outer-spin-button,
input.input-precio::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input.input-cantidad,
input.input-precio {
  -moz-appearance: textfield;
}