Hide on Shooping Cart Icon not working

I am trying to implement a header that contains a shopping cart icon and that is hidden in specific situations. For example at the top of each page I want it to be hidden since I have a separate menu with a second shopping cart icon there. Only on scroll down it should then become visible.

My solution works for the whole header (it gets hidden) except for the shopping cart icon that apparently does not hide. Apparently it is not possible to hide this icon yet? Is there a way to hide the shopping cart icon or just activate one of my two shopping cart icons in each situations?

That is really a limitation to me.

I wanted something similar, the cart icon wouldn’t hide, but it will collapse!

https://www.wix.com/corvid/forum/community-discussion/problem-with-shopping-cart