I explained this at the beginning of this post. By bloating a page with html and then hiding with css is cloaking and slows down rendering. Google is getting better at detecting this.
When I hide the secondary nav with css:
On desktop Google PageSpeed Insights drops my score from 100 to 93 for a Cumulative Layout Shift (CLS) greater than 1. While the mobile version still scores 100.
Because of this WordPress has made a function wp_is_mobile so that you do not have to include all the extra html that you are going to hide with css (cloaking). And caching plugins like WP Rocket enable two versions of your website to be served.
https://docs.wp-rocket.me/article/708-mobile-caching