It's in the bag -- idiom or phrase?

Are these expressions idioms or phrases?
(1) ‘It’s in the bag’.
(2) ‘Going purple in the face’.

I think they are idioms because we use them even when they are not literally true. You can say “it’s in the bag” when you don’t even have a bag. And few people’s faces actually turn purple. A dark red is the most I have seen.

Although “It’s in the bag” can be used as a normal clause and not an idiom:

Where is the butter you bought?
It’s in the bag on the table.

I’m thankful to Luschen.