Initializing Foundation with WordPress is a bit more touchy than with Bootstrap and the web is full of people facing the same issue and asking the question
Here is an easy solution for you,
From your master page, you have the Foundation init included at the bottom of the document
Put this script in an external file in your project folder (for example, create fdinit.js and put it in the js folder)
Then, replace the inline script with the call to the external JS file right after the foundation.js initialization.
Export your theme, from your browser, open the Inspector, have a look at the console. There should be no error message and the Foundation features should work fine.