While the EU does impose a lot of regulations on trade (thankfully I might add), foreign policy in general is still up to each member state. It's how we had Orban for years licking Putin's asshole.
I am very much in favor of a more integrated EU, including to a sort of federalization. Only with more integration we can stand up to other great powers.