/* ===========================================================
   STYLES.CSS - KESO SYSTEM V3.1 (LOGO GRANDE + FIX BUSCADOR)
   =========================================================== */

/* 1. VARIABLES Y BASE */
:root {
    --color-principal-azul: #0047c0;      
    --color-fondo-blanco: #F4F6F8;        
    --color-secundario-blanco: #FFFFFF;   
    --color-acento-amarillo: #FFC107;     
    --color-texto-oscuro: #333333;
    --color-logout: #D32F2F;              
    --color-borde: #E0E0E0;
    --color-hover-table: #f9f9f9;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--color-fondo-blanco);
    color: var(--color-texto-oscuro);
    height: 100vh;
    display: flex; justify-content: center; align-items: center;
}

/* ===========================================================
   2. DISEÑO LOGIN & REGISTRO (CON ANIMACIONES)
   =========================================================== */
.auth-body { margin: 0; padding: 0; height: 100vh; width: 100%; display: flex; background: white; }
.auth-container { display: grid; grid-template-columns: 1fr 1fr; width: 100%; height: 100%; }

.auth-brand {
    /* Fondo animado */
    background: linear-gradient(-45deg, var(--color-principal-azul), #00296b, #001f52, #0047c0);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite; /* Movimiento del color de fondo */
    
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    color: white; padding: 40px; text-align: center; position: relative; overflow: hidden;
}

/* Bola Superior Izquierda */
.auth-brand::before { 
    content: ''; position: absolute; top: -10%; left: -10%; width: 300px; height: 300px; 
    background: rgba(255, 255, 255, 0.05); border-radius: 50%; 
    animation: floatOrb1 12s ease-in-out infinite; /* Animación de flotar */
}

/* Bola Inferior Derecha */
.auth-brand::after { 
    content: ''; position: absolute; bottom: -10%; right: -10%; width: 400px; height: 400px; 
    background: rgba(255, 255, 255, 0.05); border-radius: 50%; 
    animation: floatOrb2 16s ease-in-out infinite; /* Animación de flotar */
}

.auth-brand h1 { font-size: 3em; margin: 20px 0 10px 0; font-weight: 800; letter-spacing: 2px; position: relative; z-index: 2; }
.auth-brand p { font-size: 1.2em; opacity: 0.8; max-width: 400px; line-height: 1.5; position: relative; z-index: 2; }

.brand-logo-big { 
    width: 240px; 
    filter: drop-shadow(0 10px 10px rgba(0,0,0,0.3)); 
    position: relative; z-index: 2;
    animation: logoFloat 6s ease-in-out infinite; /* Sutil flotación del logo */
}

.auth-form-wrapper { display: flex; justify-content: center; align-items: center; background: white; padding: 40px; }
.auth-form-content { width: 100%; max-width: 400px; animation: slideIn 0.5s ease-out; }
.auth-title { font-size: 2em; color: var(--color-principal-azul); margin-bottom: 10px; font-weight: 700; }
.auth-subtitle { color: #666; margin-bottom: 40px; }

.modern-input {
    width: 100%; padding: 15px; margin-bottom: 20px; border: 1px solid #ddd;
    border-radius: 8px; font-size: 1em; background-color: #f9f9f9; transition: 0.3s;
}
.modern-input:focus { background-color: white; border-color: var(--color-principal-azul); box-shadow: 0 0 0 4px rgba(0, 71, 192, 0.1); outline: none; }
.input-label { display: block; margin-bottom: 8px; color: #333; font-weight: 600; font-size: 0.9em; }
.auth-link { color: var(--color-principal-azul); text-decoration: none; font-weight: 600; transition: 0.2s; }
.auth-link:hover { text-decoration: underline; color: #00296b; }

.btn-auth {
    width: 100%; padding: 16px; background-color: var(--color-principal-azul); color: white;
    border: none; border-radius: 8px; font-size: 1.1em; font-weight: bold; cursor: pointer;
    transition: 0.3s; margin-top: 10px;
}
.btn-auth:hover { background-color: #003580; transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0, 71, 192, 0.3); }

/* ===========================================================
   ANIMACIONES (KEYFRAMES)
   =========================================================== */

/* Entrada del formulario */
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* Movimiento suave del fondo azul */
@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Movimiento de la bola 1 (Superior) */
@keyframes floatOrb1 {
    0% { transform: translate(0, 0); }
    50% { transform: translate(30px, 50px); }
    100% { transform: translate(0, 0); }
}

/* Movimiento de la bola 2 (Inferior) */
@keyframes floatOrb2 {
    0% { transform: translate(0, 0); }
    50% { transform: translate(-40px, -60px); }
    100% { transform: translate(0, 0); }
}

/* Movimiento sutil del logo */
@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
/* ===========================================================
   3. LAYOUT DEL SISTEMA (DASHBOARD)
   =========================================================== */
.dashboard-body { display: block; background-image: none !important; background-color: var(--color-fondo-blanco); height: 100vh; overflow: hidden; }
.dashboard-container { display: grid; grid-template-columns: 260px 1fr; height: 100vh; }

.sidebar {
    background-color: var(--color-principal-azul); color: white; display: flex; flex-direction: column;
    padding: 25px 15px; box-shadow: 4px 0 15px rgba(0,0,0,0.1); z-index: 10;
}
.sidebar .logo-area { text-align: center; margin-bottom: 40px; padding-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-menu { display: flex; flex-direction: column; gap: 8px; }
.menu-item {
    display: flex; align-items: center; gap: 12px; padding: 12px 15px; color: rgba(255,255,255,0.8);
    text-decoration: none; font-size: 1.05em; border-radius: 8px; transition: all 0.3s ease;
}
.menu-item:hover, .menu-item.active { background-color: rgba(255, 255, 255, 0.15); color: white; border-left: 4px solid var(--color-acento-amarillo); }
.menu-item i { width: 20px; text-align: center; }

.main-content { padding: 30px; overflow-y: auto; }
.header-tools { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.panel { background: white; border-radius: 12px; padding: 25px; box-shadow: 0 4px 6px rgba(0,0,0,0.02); border: 1px solid rgba(0,0,0,0.05); margin-bottom: 25px; }

/* ===========================================================
   4. COMPONENTES GLOBALES
   =========================================================== */
.input-group { margin-bottom: 15px; text-align: left; }
.panel .input-group label { color: #555; font-weight: 600; margin-bottom: 5px; display: block; }
.input-group input, .input-group select {
    width: 100%; padding: 12px 15px; border: 1px solid var(--color-borde); border-radius: 8px;
    font-size: 14px; background-color: white; transition: 0.3s;
}
.input-group input:focus, .input-group select:focus { outline: none; border-color: var(--color-acento-amarillo); box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.2); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }

.btn {
    width: 100%; padding: 12px 20px; border: none; border-radius: 8px; font-weight: 700; cursor: pointer;
    text-transform: uppercase; font-size: 0.9em; display: inline-flex; justify-content: center; align-items: center; gap: 8px; transition: 0.3s;
}
.btn-principal { background-color: var(--color-acento-amarillo); color: var(--color-principal-azul); }
.btn-principal:hover { background-color: #FFD54F; transform: translateY(-2px); }
.btn-acento-secundario { background-color: white; color: var(--color-principal-azul); border: 1px solid #ddd; }
.btn-acento-secundario:hover { background-color: #f0f0f0; }
.btn-logout { background-color: var(--color-logout); color: white; }
.btn-logout:hover { background-color: #b71c1c; }

.full-table { width: 100%; border-collapse: collapse; font-size: 0.95em; }
.full-table th { background-color: #f8f9fa; color: #666; font-weight: 700; text-transform: uppercase; font-size: 0.85em; padding: 15px; text-align: left; border-bottom: 2px solid var(--color-borde); }
.full-table td { padding: 15px; border-bottom: 1px solid #eee; color: #333; vertical-align: middle; }
.full-table tr:hover { background-color: var(--color-hover-table); }
.product-thumb { width: 45px; height: 45px; object-fit: cover; border-radius: 8px; border: 1px solid #ddd; background: white; }

.badge { padding: 6px 12px; border-radius: 50px; font-size: 0.8em; font-weight: 700; text-transform: uppercase; }
.cat-quesos { background: #FFF3E0; color: #EF6C00; }
.cat-charcuteria { background: #FFEBEE; color: #C62828; }
.cat-lacteos { background: #E3F2FD; color: #1565C0; }
.cat-otros { background: #F3E5F5; color: #7B1FA2; }
.order-badge { background: #e3f2fd; color: var(--color-principal-azul); padding: 3px 8px; border-radius: 4px; font-weight: bold; font-size: 0.85em; }

/* ===========================================================
   5. MÓDULOS ESPECÍFICOS (DASHBOARD PRETTY & CLEAN)
   =========================================================== */
.welcome-banner {
    background-color: #0033a0; 
    background-image: linear-gradient(135deg, #0047c0 0%, #00205b 100%);
    color: white; padding: 30px 40px; border-radius: 12px; margin-bottom: 30px;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 4px 15px rgba(0, 71, 192, 0.2);
}
.welcome-text h2 { margin: 0; font-size: 1.8em; font-weight: 800; }
.welcome-text p { margin: 5px 0 0 0; opacity: 0.9; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 40px; }

.stat-card {
    background: white; padding: 25px; border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.04); border: 1px solid #eee;
    display: flex; align-items: center; gap: 20px; transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 15px rgba(0,0,0,0.08); }

.stat-icon { width: 60px; height: 60px; border-radius: 12px; display: flex; justify-content: center; align-items: center; font-size: 24px; }
.card-blue .stat-icon { background-color: #e3f2fd; color: #1565c0; }
.card-orange .stat-icon { background-color: #fff3e0; color: #e65100; }
.card-green .stat-icon { background-color: #e8f5e9; color: #2e7d32; }
.card-purple .stat-icon { background-color: #f3e5f5; color: #7b1fa2; }

.stat-info h4 { margin: 0; color: #888; font-size: 0.8em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-info p { margin: 5px 0 0 0; font-size: 1.8em; font-weight: 800; color: #333; }

.actions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.action-btn {
    background: white; border: 1px solid #eee; padding: 25px; border-radius: 12px;
    text-align: center; cursor: pointer; text-decoration: none; color: #555;
    display: flex; flex-direction: column; align-items: center; gap: 15px; font-weight: 600; transition: 0.3s;
}
.action-btn i { font-size: 32px; color: var(--color-principal-azul); }
.action-btn:hover { border-color: var(--color-principal-azul); box-shadow: 0 5px 15px rgba(0,0,0,0.05); color: var(--color-principal-azul); }

/* ===========================================================
   6. MODALES, TOASTS Y ACTUALIZACIONES
   =========================================================== */
#toast-container { 
    position: fixed; top: 30px; left: 50%; transform: translateX(-50%); 
    z-index: 99999; display: flex; flex-direction: column; gap: 15px; 
}
.toast {
    min-width: 380px; padding: 18px 25px; border-radius: 50px; background: rgba(28, 28, 30, 0.85); 
    backdrop-filter: blur(25px) saturate(180%); color: white; font-size: 15px; font-weight: 500;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25); border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex; align-items: center; justify-content: center; gap: 15px;
    opacity: 0; transform: translateY(-50px) scale(0.9); transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.toast.show { opacity: 1; transform: translateY(0) scale(1); }
.toast i { font-size: 1.3em; filter: drop-shadow(0 0 8px rgba(255,255,255,0.3)); }
.toast-success i { color: #32D74B; }
.toast-error i { color: #FF453A; }
.toast-warning i { color: #FFD60A; }

#update-notification {
    background: rgba(255, 255, 255, 0.7) !important; backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important; border-radius: 20px !important;
    padding: 20px !important; margin-top: 25px !important; box-shadow: 0 15px 35px rgba(0, 71, 192, 0.15) !important;
    color: #333 !important;
}
#update-message { font-weight: 700 !important; color: #0047c0 !important; }
#update-bar {
    background: linear-gradient(90deg, #0047c0, #00C6FF) !important; border-radius: 10px !important;
    box-shadow: 0 0 10px rgba(0, 198, 255, 0.5); height: 100% !important; transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 41, 107, 0.4); 
    backdrop-filter: blur(8px); z-index: 20000; display: none; justify-content: center; align-items: center;
}
.modal-overlay.show { display: flex; animation: fadeInGlass 0.3s forwards; }
.modal-content {
    background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(25px); width: 90%; max-width: 400px; 
    border-radius: 24px; box-shadow: 0 25px 50px rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.6);
    overflow: hidden; animation: zoomInGlass 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-header {
    background: rgba(0, 71, 192, 0.1); color: #0047c0; padding: 20px; font-weight: 800; font-size: 1.1em;
    display: flex; gap: 10px; align-items: center; border-bottom: 1px solid rgba(0,0,0,0.05);
}
.modal-body { padding: 30px 20px; font-size: 1.1em; color: #333; text-align: center; }
.modal-footer { padding: 20px; background: transparent; display: flex; justify-content: center; gap: 15px; }
.btn-modal { padding: 12px 25px; border-radius: 12px; border: none; font-weight: bold; cursor: pointer; transition: 0.2s; }
.btn-confirm { background: linear-gradient(135deg, #0047c0, #0066ff); color: white; box-shadow: 0 5px 15px rgba(0, 71, 192, 0.3); }
.btn-cancel { background: #f0f0f0; color: #555; }
.btn-confirm:hover { transform: scale(1.05); }

.loader-spinner {
    width: 20px; height: 20px; border: 3px solid rgba(255, 255, 255, 0.3); border-radius: 50%; border-top-color: #fff;
    animation: spin 1s ease-in-out infinite; display: inline-block; vertical-align: middle; margin-right: 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeInGlass { from { opacity: 0; backdrop-filter: blur(0px); } to { opacity: 1; backdrop-filter: blur(8px); } }
@keyframes zoomInGlass { from { opacity: 0; transform: scale(0.8) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.btn-auth:disabled { background-color: #ccc; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ===========================================================
   7. BUSCADOR Y RESULTADOS (FIX VISUAL FINAL)
   =========================================================== */

/* Esto es lo que me pediste */
.search-container {
    position: relative;
}

/* El desplegable flotante */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    z-index: 1000;
    display: none;
}

.search-results-dropdown.active {
    display: block;
}

/* La fila de cada producto */
.search-item {
    display: flex;              /* FLEXBOX ES CLAVE PARA ALINEAR */
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    background: white;
    transition: background 0.2s;
}

.search-item:hover {
    background-color: #f0f8ff;
}

/* === AQUÍ ESTÁ EL ARREGLO DE LA IMAGEN GIGANTE === */
.search-thumb {
    width: 50px !important;     /* FUERZA EL TAMAÑO */
    height: 50px !important;    /* FUERZA EL TAMAÑO */
    object-fit: cover;
    border-radius: 6px;
    margin-right: 15px;
    border: 1px solid #eee;
    flex-shrink: 0;             /* EVITA QUE SE APLASTE */
}
/* ================================================= */

.search-info { flex: 1; }
.search-info h4 { margin: 0; font-size: 15px; font-weight: 700; color: #333; }
.search-info p { margin: 2px 0 0 0; font-size: 12px; color: #666; }
.search-price { font-weight: bold; color: var(--color-principal-azul); }
.no-results { padding: 15px; text-align: center; color: #999; }