Foreign trade in the face of footloose capital and restricted labor mobility