I have applied the code to fix the header you provided below and it works fine. My problem is that my primary navigation (below header) disappears when I add the css. I want to have a sticky header and the primary menu navigation still appear. When you scroll down, I only want the header to remain fixed, the menu can go away.
I have GP Premium and use a child theme.
I removed my css and used yours. Instead of using hooks, I hard coded it into the header.php file in my child theme (easier for me to remember that way).