The isoperimetric problem for a class of non-radial weights and applications