/* BARRA SUPERIOR */
.fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #2c3e50;
    color: white;
    padding: 4px 5%;
    text-align: right;
    font-weight: bold;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 18px;
    margin: 0;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    box-sizing: border-box;
}

/* ESTILOS GENERALES */
html, body {
    overflow-x: hidden;
    width: 100%;
    margin: 0;
    padding: 6px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    box-sizing: border-box;
}

.container {
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 20px;
}

h1 {
    font-size: 18px;
    text-align: center;
    color: #2c3e50;
    margin: 2px 0;
    padding-bottom: 2px;
}

h2 {
    font-size: 16px;
    color: #333;
    margin: 5px 0 3px 0;
}

.card {
    background: white;
    border-radius: 6px;
    padding: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* LISTAS */
#listaProductos, 
#carrito {
    list-style: none;
    padding: 0;
    margin: 4px 0;
}

#listaProductos li, 
#carrito li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 4px;
    margin: 4px 0;
    border-radius: 4px;
}

#listaProductos li span, 
#carrito li span {
    flex: 1;
    padding-left: 0;
    margin-left: 0;
    font-weight: bold;
    color: rgb(37, 36, 64);
}

#listaProductos li:nth-child(even) {
    background: #f0f0f0;
}

#listaProductos li:nth-child(odd) {
    background: #f9f9f9;
}

/* CARRITO */
.carrito-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.carrito-footer {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

#total-carrito {
    font-weight: bold;
    color: #2c3e50;
    font-size: 15px;
}

.total-articulos {
    font-weight: bold;
    color: #2c3e50;
}

/* BOTONES */
.btn-agregar {
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 7px 9px;
    font-weight: bold;
    cursor: pointer;
    min-width: 36px;
    font-size: 14px;
    transition: all 0.2s;
    width: 36px;
}

.delete {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 10px;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.vaciar-btn {
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-calcular {
    background: #3498db;
    color: white;
    width: 36px;
    padding: 7px 0;
    text-align: center;
    font-weight: bold;
    font-size: 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-finalizar {
    background: #e67e22;
    color: white;
    padding: 7px 10px;
    font-weight: bold;
    font-size: 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

/* EFECTOS BOTONES */
.btn-calcular:hover, .btn-finalizar:hover {
    opacity: 0.9;
}

.btn-calcular:active {
    background: #2980b9;
}

.btn-finalizar:active {
    background: #d35400;
}

.btn-agregar:active {
    background: #f39c12;
    transform: scale(0.95);
}

.delete:active {
    background: #c0392b;
}

/* INPUTS */
input {
    flex: 1;
    min-width: 50px;
    padding: 7px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.peso-input {
    width: 60px;
    text-align: center;
    margin-left: 4px;
}

/* CONTENEDORES */
.manual-inputs, 
.agregar-container, 
.pago-container {
    display: flex;
    gap: 4px;
    width: 100%;
    flex-wrap: wrap;
    align-items: center;
}

/* TEXTO DE CAMBIO */
#cambio {
    text-align: center;
    font-weight: bold;
    margin: 8px 0;
    padding: 8px;
    font-size: 16px;
    border-radius: 4px;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    color: #2c3e50;
    text-transform: uppercase;
}

#cambio[style*="color:#e74c3c"] {
    background-color: #fdecea;
    border-color: #f5c2c7;
}

#cambio[style*="color:#27ae60"] {
    background-color: #e8f5e9;
    border-color: #c3e6cb;
}

/* ADMINISTRACIÓN */
.btn-admin, .btn-volver {
    display: block;
    padding: 10px;
    text-align: center;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.btn-admin {
    background: #2c3e50;
    color: white;
}

.btn-admin:hover {
    background: #34495e;
    transform: translateY(-2px);
}

.btn-volver {
    background: #7f8c8d;
    color: white;
}

.btn-volver:hover {
    background: #95a5a6;
}

/* LISTA ADMIN */
#listaAdminProductos {
    list-style: none;
    padding: 0;
    margin: 4px 0;
}

#listaAdminProductos li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    margin: 3px 0;
    border-radius: 4px;
}

#listaAdminProductos li:nth-child(even) {
    background: #f0f0f0;
}

#listaAdminProductos li:nth-child(odd) {
    background: #f9f9f9;
}

#listaAdminProductos li span {
    flex: 1;
    font-weight: bold;
}

.admin-controls {
    display: flex;
    gap: 6px;
    align-items: center;
}

.simbolo-precio {
    color: #2c3e50;
    font-weight: bold;
    margin-right: -5px;
}

.precio-edit {
    width: 70px;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: right;
    font-size: 14px;
}

.btn-actualizar {
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 8px;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* CARRITO */
#carrito li:nth-child(even) {
    background: #f0f0f0;
}

#carrito li:nth-child(odd) {
    background: #f9f9f9;
}

/* BUSCADOR */
.buscador-container {
    padding: 0 10px;
    margin-bottom: 10px;
}

.buscador {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    margin-bottom: 5px;
}

.buscador:focus {
    border-color: #3498db;
    outline: none;
}

/* BACKUP */
.btn-backup {
    flex: 1;
    min-width: 120px;
    white-space: nowrap;
    text-align: center;
    padding: 12px 8px;
    margin: 0 5px;
    border-radius: 6px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    border: none;
    color: #000 !important;
}

.btn-export {
    background: #27ae60;
    border: 2px solid #219653 !important;
}

.btn-export:hover {
    background: #219653;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.2);
}

.btn-import {
    background: #3498db;
    border: 2px solid #2980b9 !important;
}

.btn-import:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.2);
}

.backup-section h2 {
    color: #2c3e50;
    font-size: 16px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.backup-section h2::before {
    content: "🔁";
    font-size: 18px;
}

/* MODALES PARA COPIAR/PEGAR MANUALMENTE */
.modal-backup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
    box-sizing: border-box;
}

.backup-preview {
    background: white;
    padding: 20px;
    border-radius: 10px;
    width: calc(100% - 40px);
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.backup-preview h3 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
}

.json-textarea {
    width: calc(100% - 20px);
    height: 200px;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
    resize: none;
    background-color: #f8f9fa;
    box-sizing: border-box;
}

.json-textarea:focus {
    outline: none;
    border-color: #3498db;
}

/* BOTONES DE MODAL */
.preview-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    position: sticky;
    bottom: 0;
    background: white;
    z-index: 10;
}

.btn-confirm {
    background: #27ae60 !important;
    color: white !important;
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-confirm:hover {
    background: #219653 !important;
}

.btn-cancel {
    background: #e74c3c !important;
    color: white !important;
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: #c0392b !important;
}

/* VISTA PREVIA DE IMPORTACIÓN */
.productos-lista-container {
    max-height: calc(70vh - 200px);
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 4px;
    margin: 10px 0;
    padding: 5px;
    flex-grow: 1;
}

.productos-lista {
    min-height: min-content;
}

.producto-preview {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.producto-preview:last-child {
    border-bottom: none;
}

.producto-preview span:first-child {
    font-weight: bold;
    color: #2c3e50;
}

.producto-preview span:last-child {
    color: #27ae60;
    font-weight: bold;
}

/* Encabezado de lista con botón */
.lista-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

/* Botón Eliminar Todos */
.btn-eliminar-todos {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    margin-left: 10px;
}

.btn-eliminar-todos:hover {
    background: #c0392b;
}

.btn-eliminar-todos:active {
    transform: scale(0.95);
}

/* NOTIFICACIONES UNIFICADAS (funciona para ambas páginas) */
.notificacion, 
.notificacion-admin {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #27ae60;
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    z-index: 2000;
    transition: all 0.3s ease;
    font-weight: bold;
    max-width: 80%;
    text-align: center;
    opacity: 0;
    font-size: 14px; /* Añadido para consistencia */
}

.notificacion.mostrar, 
.notificacion-admin.mostrar {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Estados compartidos */
.notificacion.error,
.notificacion-admin.error {
    background: #e74c3c;
}

.notificacion.info,
.notificacion-admin.info {
    background: #3498db;
}

/* Estado adicional solo para index.html */
.notificacion.warning {
    background: #f39c12;
}

/* Ajustar tamaño del total del carrito*/
#total-carrito span {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
}

/* Ajustes para móviles */
@media (max-width: 480px) {
    .lista-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .btn-eliminar-todos {
        margin-left: 0;
        margin-top: 5px;
        align-self: flex-end;
    }
    
    .backup-preview {
        padding: 15px;
    }
    
    .json-textarea {
        height: 150px;
    }
    
    .productos-lista-container {
        max-height: calc(60vh - 150px);
    }
    
    .preview-buttons {
        flex-direction: column;
    }

/* Ajustar el total del tamaño del carrito en moviles */
    #total-carrito span {
        font-size: 16px;
    }
}

