In general, economists define the "opportunity cost" of any good or service as the value of all the other goods or services that we must give up in order to produce it.
The idea is that, in order to increase the production of gadgets, we must use up resources that could otherwise be used to produce food. We give up the opportunity to produce a relatively large amount of food. The opportunity cost of any decision consists of everything we must give up in order to carry out that decision (as, the opportunity cost of the decision to increase the output of gadgets in the model economy consists of the food the model economy must give up as a result).