How to add class to specific navbar item when post parent category is in specific category

It seems like you should use hierarchies of categories, because it sounds like ‘Tiger’ belongs to the group ‘Animals’.

You can get the parent category with $category->parent so if page category was Tiger, and parent category was Animals, this would then work.

Let me know if that would work for you and if you need more info