The code provided here for hiding the cart when empty, doesn’t work (even with !important
added).
I believe that’s because, at least in my case or in the latest GP versions, showing the cart from the Customizer, adds a div with a class of menu-bar-items
outside the menu markup. I found that the correct CSS to hide it now is the following:
.mobile-bar-items.wc-mobile-cart-items:not(.has-items),
.main-navigation .wc-menu-item:not(.has-items) {
display: none;
}
I haven’t checked the mobile bar functionality.
Is that a recent change?