Product Section That Only Shows Up When Variants Are Out of Stock

I’m looking to have a product page section that shows up whenever a variant is out of stock.

For example, if a shirt with multiple sizes has the Medium sold out, I’d like some text like “Don’t see what you need? Contact us for availability.” to show up right under the variants.

I currently have it on certain product templates but would like to have it automatically add to all products with out of stock variants.

Thank you!