A trade deficit occurs when a country imports more than it exports .