/* =============================================================
   ESTILOS PARA BÚSQUEDA DE CABYS EN TIEMPO REAL
   Tema: Oscuro con Verde Neón
   ============================================================= */

/* --- Resultados CABYS Premium SaaS --- */

.cabys-resultados {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow: hidden;
    z-index: 1000;
    margin-top: 10px;
    display: none;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.cabys-header {
    background: var(--primary-light);
    padding: 12px 15px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.cabys-lista {
    max-height: 350px;
    overflow-y: auto;
    padding: 10px;
}

/* Scrollbar personalizado - Tema oscuro */
.cabys-lista::-webkit-scrollbar {
    width: 8px;
}

.cabys-lista::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.cabys-lista::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.cabys-lista::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.cabys-item {
    padding: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    border-bottom: 1px solid hsl(210, 40%, 95%);
}

.cabys-item:last-child {
    border-bottom: none;
}

.cabys-item:hover {
    background: var(--primary-light);
    transform: translateX(5px);
}

.cabys-codigo {
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 0.95rem;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Descripción */
.cabys-descripcion {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Badge de impuesto */
.cabys-impuesto {
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge-impuesto {
    display: inline-block;
    padding: 2px 8px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    margin-top: 5px;
}

/* Estado de carga circular premium */
.cabys-loading {
    padding: 40px;
    text-align: center;
    color: var(--primary);
}

.cabys-loading i {
    font-size: 2rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.cabys-loading span {
    font-size: 14px;
    color: #999;
}

/* Sin resultados */
.cabys-sin-resultados {
    padding: 40px 20px;
    text-align: center;
    color: #666;
}

.cabys-sin-resultados i {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
    opacity: 0.3;
    color: #0f0;
}

.cabys-sin-resultados p {
    font-size: 15px;
    margin-bottom: 8px;
    color: #999;
}

.cabys-sin-resultados small {
    font-size: 13px;
    color: #666;
    display: block;
}

/* Error */
.cabys-error {
    padding: 30px 20px;
    text-align: center;
    color: #ff4444;
}

.cabys-error i {
    font-size: 40px;
    margin-bottom: 12px;
    display: block;
    color: #ff4444;
}

.cabys-error p {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ff4444;
}

.cabys-error small {
    font-size: 12px;
    color: #666;
    display: block;
    margin-top: 5px;
}

/* Posicionamiento relativo para el contenedor de búsqueda */
.cabys-search {
    position: relative;
}

/* Badge inline en el campo de número CABYS */
.cabys-numero-field {
    position: relative;
}

.cabys-badge-inline {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #0f0;
    font-size: 18px;
    pointer-events: none;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

/* Animaciones */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Notificación CABYS */
.notificacion-cabys {
    animation: slideIn 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .cabys-resultados {
        max-height: 300px;
    }
    
    .cabys-lista {
        max-height: 250px;
    }
    
    .cabys-item {
        padding: 10px 12px;
    }
    
    .cabys-codigo {
        font-size: 14px;
    }
    
    .cabys-descripcion {
        font-size: 12px;
    }
}
