Market structure and the effects of trade restrictions with endogenous import quality