A firm or country has a comparative advantage in the production of good X in the opportunity cost of producing a unit of X, in terms of other goods foregone, is lower, in that country compared with another country, or in that firm compared with another firm.