Structural Change in Exports: From Product to Functional Specialization in Trade