Add check if navbar is collapsed for mobile devices