If maximum page width differs from alternate page width (blank to disable), the main navigation won't stretch the entire length of maximum page length. They must match, if using percentages, e.g. 98%--though this looks bad on mobile, where it should be 100%.
The above code is not needed to hide it if you set the maximum to 100% and a blank alternative.
I'm not sure I follow, if you want the toggle feature to be gone you can just remove the alternate page width. The width of the navigation would adjust with that if the user chose to toggle the width... so I'm a bit confused on what you're trying to achieve, sorry about that!