Food offered to idols - what does the Old Testament say?

I cannot find any Old Testament statement that eating food offered to idols (perhaps bought in the market and eaten away from the idol) was prohibited.

Does anyone know of an OT refrence to this?

I know Daniel refused the King’s meat - ostensibly that reason…

Discussion

At least four OT passages speak of the sinfulness of eating things sacrificed to idols:
Exod. 32:6 And they rose up early on the morrow, and offered burnt offerings, and brought peace offerings; and the people sat down to eat and to drink, and rose up to play.
Exod. 34:15 Lest thou make a covenant with the inhabitants of the land, and they go a whoring after their gods, and do sacrifice unto their gods, and one call thee, and thou eat of his sacrifice;

Num. 25:1-3 And Israel abode in Shittim, and the people began to commit whoredom with the daughters of Moab. 2 And they called the people unto the sacrifices of their gods: and the people did eat, and bowed down to their gods. 3 And Israel joined himself unto Baalpeor: and the anger of the LORD was kindled against Israel.
Ps. 106:28-29 They joined themselves also unto Baalpeor, and ate the sacrifices of the dead. 29 Thus they provoked him to anger with their inventions: and the plague brake in upon them.

The NT shows that it was sinful for the Israelites to eat meat offered to an idol:
1 Cor. 10:7 Neither be ye idolaters, as were some of them; as it is written, The people sat down to eat and drink, and rose up to play.
The NT also speaks explicitly of Balaam’s wicked influence on the Israelites in teaching them to eat things sacrificed unto idols:
Rev. 2:14 But I have a few things against thee, because thou hast there them that hold the doctrine of Balaam, who taught Balac to cast a stumblingblock before the children of Israel, to eat things sacrificed unto idols, and to commit fornication.

All those state or are consistent with idol-meat eaten in conjunction with the sacrifice to the idol.

Josephus writes that Jews living in foreign cities were vegetarian, avoiding eating market-bought meat that was sometimes tainted with idolatry. Romans seems to reflect this. I’m wondering if there was an OT basis for that application.

Concerning Peter’s interactions with Cornelius and those of his household, we read,
Acts 10:28 And he said unto them, Ye know how that it is an unlawful thing for a man that is a Jew to keep company, or come unto one of another nation; but God hath shewed me that I should not call any man common or unclean.

Acts 11:3 Saying, Thou wentest in to men uncircumcised, and didst eat with them.
These verses may implicitly pertain to what you are searching for; no explicit OT teaching comes to mind about what Jews were or were not to eat in/from the market.