/* ===== RESET Y GENERALES ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: #f4f6f9; color: #333; }
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }

/* ===== HEADER ===== */
.header { background: #1a237e; color: #fff; padding: 15px 0; box-shadow: 0 2px 10px rgba(0,0,0,0.3); }
.header .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.header .logo h1 { font-size: 24px; font-weight: 700; }
.header .logo small { font-size: 12px; opacity: 0.8; }
.header .nav a { color: #fff; text-decoration: none; margin-left: 20px; font-size: 14px; transition: opacity 0.3s; }
.header .nav a:hover { opacity: 0.7; }
.header .nav .carrito-link { background: #ff6f00; padding: 8px 15px; border-radius: 20px; font-weight: bold; }
.header .nav .carrito-link:hover { background: #e65100; opacity: 1; }

/* ===== BANNER ===== */
.banner { background: linear-gradient(135deg, #1a237e 0%, #0d47a1 100%); color: #fff; padding: 40px; border-radius: 12px; text-align: center; margin-bottom: 30px; }
.banner h1 { font-size: 36px; margin-bottom: 10px; }
.banner p { font-size: 18px; opacity: 0.9; }
.banner-oferta { margin-top: 15px; background: rgba(255,255,255,0.15); padding: 10px 20px; border-radius: 30px; display: inline-block; }

/* ===== FILTROS Y BÚSQUEDA ===== */
.filtros-busqueda { display: flex; flex-wrap: wrap; gap: 15px; margin-bottom: 30px; background: #fff; padding: 20px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.filtros-busqueda .busqueda { flex: 2; display: flex; gap: 10px; }
.filtros-busqueda .busqueda input { flex: 1; padding: 10px 15px; border: 2px solid #ddd; border-radius: 8px; font-size: 14px; }
.filtros-busqueda .busqueda button { padding: 10px 25px; background: #1a237e; color: #fff; border: none; border-radius: 8px; cursor: pointer; }
.filtros-busqueda .categorias { flex: 3; display: flex; flex-wrap: wrap; gap: 8px; }
.filtros-busqueda .categoria-btn { padding: 8px 16px; background: #e8eaf6; border-radius: 20px; text-decoration: none; color: #333; font-size: 13px; transition: 0.3s; }
.filtros-busqueda .categoria-btn:hover { background: #c5cae9; }
.filtros-busqueda .categoria-btn.activo { background: #1a237e; color: #fff; }

/* ===== PRODUCTOS GRID ===== */
.productos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 25px; }
.producto-card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.1); transition: transform 0.3s; }
.producto-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0,0,0,0.15); }
.producto-imagen { position: relative; height: 180px; background: #f5f5f5; display: flex; align-items: center; justify-content: center; }
.producto-imagen img { max-height: 150px; max-width: 100%; object-fit: contain; }
.producto-categoria { position: absolute; top: 10px; left: 10px; background: #1a237e; color: #fff; padding: 4px 12px; border-radius: 15px; font-size: 11px; }
.producto-info { padding: 15px; }
.producto-codigo { font-size: 12px; color: #888; font-weight: bold; background: #f5f5f5; display: inline-block; padding: 2px 10px; border-radius: 10px; }
.producto-descripcion { font-size: 14px; margin: 8px 0; height: 40px; overflow: hidden; }
.producto-aplicacion { font-size: 12px; color: #666; height: 20px; overflow: hidden; }
.producto-precio { margin: 10px 0; }
.producto-precio .precio { font-size: 22px; font-weight: 700; color: #1a237e; }
.producto-descuentos small { color: #888; font-size: 11px; }
.producto-acciones { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.producto-acciones input { width: 50px; padding: 6px; border: 1px solid #ddd; border-radius: 6px; text-align: center; }
.producto-acciones .btn-agregar { flex: 1; padding: 8px; background: #1a237e; color: #fff; border: none; border-radius: 6px; cursor: pointer; font-weight: bold; transition: 0.3s; }
.producto-acciones .btn-agregar:hover { background: #0d47a1; }
.producto-acciones .btn-ver { padding: 8px 12px; background: #e8eaf6; color: #333; border: none; border-radius: 6px; text-decoration: none; font-size: 13px; }
.producto-stock { margin-top: 8px; font-size: 12px; }
.stock-disponible { color: #2e7d32; }
.stock-bajo { color: #c62828; font-weight: bold; }

/* ===== CARRITO FLOTANTE ===== */
.carrito-flotante { position: fixed; bottom: 30px; right: 30px; background: #1a237e; color: #fff; width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28px; cursor: pointer; box-shadow: 0 4px 15px rgba(0,0,0,0.3); transition: 0.3s; z-index: 100; }
.carrito-flotante:hover { transform: scale(1.1); background: #0d47a1; }
.carrito-count { position: absolute; top: -5px; right: -5px; background: #ff6f00; color: #fff; font-size: 12px; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; }

/* ===== CARRITO ===== */
.carrito-tabla { overflow-x: auto; background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.carrito-tabla table { width: 100%; border-collapse: collapse; }
.carrito-tabla th { background: #f5f5f5; padding: 12px; text-align: left; font-size: 13px; }
.carrito-tabla td { padding: 12px; border-bottom: 1px solid #eee; font-size: 14px; }
.carrito-tabla .fila-total td { font-size: 18px; border-top: 2px solid #1a237e; }
.carrito-tabla .fila-descuento td { color: #c62828; }
.carrito-acciones { display: flex; justify-content: space-between; margin-top: 20px; flex-wrap: wrap; gap: 10px; }
.btn-continuar { padding: 12px 25px; background: #e8eaf6; color: #333; text-decoration: none; border-radius: 8px; }
.btn-finalizar { padding: 12px 30px; background: #1a237e; color: #fff; border: none; border-radius: 8px; cursor: pointer; font-size: 16px; font-weight: bold; }
.btn-finalizar:hover { background: #0d47a1; }
.btn-eliminar { background: none; border: none; cursor: pointer; font-size: 18px; }

/* ===== LOGIN ===== */
.login-page { background: linear-gradient(135deg, #1a237e 0%, #0d47a1 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-container { width: 100%; max-width: 400px; padding: 20px; }
.login-box { background: #fff; padding: 40px; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.3); }
.login-box h1 { text-align: center; color: #1a237e; font-size: 24px; margin-bottom: 5px; }
.login-box h2 { text-align: center; color: #666; font-size: 16px; font-weight: normal; margin-bottom: 25px; }
.login-box .campo { margin-bottom: 15px; }
.login-box .campo label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 5px; }
.login-box .campo input { width: 100%; padding: 10px; border: 2px solid #ddd; border-radius: 8px; font-size: 14px; }
.btn-login { width: 100%; padding: 12px; background: #1a237e; color: #fff; border: none; border-radius: 8px; font-size: 16px; font-weight: bold; cursor: pointer; transition: 0.3s; }
.btn-login:hover { background: #0d47a1; }
.login-links { display: flex; justify-content: space-between; margin-top: 15px; font-size: 14px; }
.login-links a { color: #1a237e; text-decoration: none; }
.login-links a:hover { text-decoration: underline; }

/* ===== ADMIN ===== */
.admin-body { background: #f4f6f9; }
.admin-container { display: flex; min-height: 100vh; }
.admin-sidebar { width: 260px; background: #1a237e; color: #fff; padding: 20px; min-height: 100vh; }
.admin-sidebar .logo { font-size: 20px; font-weight: bold; padding-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,0.2); margin-bottom: 20px; }
.admin-sidebar .logo small { display: block; font-size: 12px; font-weight: normal; opacity: 0.8; }
.admin-sidebar .menu { list-style: none; }
.admin-sidebar .menu li { margin-bottom: 5px; }
.admin-sidebar .menu a { display: block; padding: 10px 15px; color: rgba(255,255,255,0.8); text-decoration: none; border-radius: 8px; transition: 0.3s; }
.admin-sidebar .menu a:hover { background: rgba(255,255,255,0.1); color: #fff; }
.admin-sidebar .menu a.activo { background: rgba(255,255,255,0.15); color: #fff; }
.admin-main { flex: 1; padding: 25px; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; background: #fff; padding: 15px 20px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.admin-user { display: flex; align-items: center; gap: 15px; }
.btn-logout { padding: 6px 15px; background: #c62828; color: #fff; border: none; border-radius: 6px; text-decoration: none; font-size: 13px; }

/* Dashboard Cards */
.dashboard-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; margin-bottom: 30px; }
.dashboard-cards .card { background: #fff; padding: 20px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); display: flex; align-items: center; gap: 15px; }
.dashboard-cards .card.card-warning { border-left: 4px solid #ff6f00; }
.dashboard-cards .card .card-icon { font-size: 32px; }
.dashboard-cards .card .card-info h3 { font-size: 24px; margin: 0; }
.dashboard-cards .card .card-info p { color: #666; font-size: 13px; margin: 0; }

/* Tablas Admin */
.dashboard-ultimos { background: #fff; padding: 20px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.dashboard-ultimos h2 { margin-bottom: 15px; font-size: 18px; }
.dashboard-ultimos table { width: 100%; border-collapse: collapse; font-size: 14px; }
.dashboard-ultimos th { background: #f5f5f5; padding: 10px; text-align: left; }
.dashboard-ultimos td { padding: 10px; border-bottom: 1px solid #eee; }
.estado { padding: 4px 12px; border-radius: 15px; font-size: 12px; font-weight: bold; }
.estado-pendiente { background: #fff3e0; color: #e65100; }
.estado-procesando { background: #e3f2fd; color: #0d47a1; }
.estado-despachado { background: #e8f5e9; color: #2e7d32; }
.estado-entregado { background: #e8f5e9; color: #1b5e20; }
.estado-cancelado { background: #ffebee; color: #c62828; }
.btn-small { padding: 4px 10px; background: #e8eaf6; color: #333; text-decoration: none; border-radius: 4px; font-size: 12px; }

/* ===== FORMULARIOS ===== */
.campo { margin-bottom: 15px; }
.campo label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 14px; }
.campo input, .campo select, .campo textarea { width: 100%; padding: 10px; border: 2px solid #ddd; border-radius: 8px; font-size: 14px; }
.campo textarea { min-height: 80px; resize: vertical; }
.alert { padding: 12px 20px; border-radius: 8px; margin-bottom: 15px; }
.alert-error { background: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .header .container { flex-direction: column; gap: 10px; text-align: center; }
    .header .nav a { margin: 0 10px; }
    .banner h1 { font-size: 26px; }
    .dashboard-cards { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .admin-sidebar { width: 200px; }
    .productos-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}
@media (max-width: 480px) {
    .admin-container { flex-direction: column; }
    .admin-sidebar { width: 100%; min-height: auto; padding: 10px; }
    .admin-sidebar .menu { display: flex; flex-wrap: wrap; gap: 5px; }
    .admin-sidebar .menu a { padding: 6px 12px; font-size: 13px; }
    .productos-grid { grid-template-columns: 1fr; }
}