We propose a semiconductor-superconductor hybrid device for realizing topological superconductivity and Majorana zero modes consisting of a planar Josephson junction structure with periodically modulated junction width. By performing a numerical analysis of the effective model describing the low-energy physics of the hybrid structure, we demonstrate that the modulation of the junction width results in a substantial enhancement of the topological gap and, consequently, of the robustness of the topological superconducting phase and associated Majorana zero modes. This enhancement is due to the formation of minibands with strongly renormalized effective parameters, including stronger spin-orbit coupling, generated by the effective periodic potential induced by the modulated structure. In addition to a larger topological gap, the proposed device supports a topological superconducting phase that covers a significant fraction of the parameter space, including the low Zeeman field regime, in the absence of a superconducting phase difference across the junction. Furthermore, the optimal regime for operating the device can be conveniently accessed by tuning the potential in the junction region using, for example, a top gate.