You need to use javascript.
How to do this varies wildly among themes, there are existing forum posts if you search for various themes.
If you need this customization fixed and made dynamic then contact me by mail for services.
ALWAYS please provide context, examples: store url, theme name, post url(s) , or any further detail in ALL correspondence.
Mail contact info in signature.
#1 product.price is not the same as a variant.price so it’s never going to change because a product only gets ONE price. So it doesn’t matter if the variant changes your still only outputting a static value of the products lowest price.
#2 theme liquid does not run in the users browser, even if you reference something like {{product.selected_variant.price }} the liquid will ONLY update when reloading a page and as long as the url updates the selected variant parameter id.
Unless you use javascript to get or change the information without reloads, or advanced css tricks to show hide elements.
You need to use javascript to update content dynamically when the variant changes or force a page reload. In simple case the price data already needs to be in the codes output so also don’t have to learn how to use ajax to fetch it.
Alot of themes will emit an event code can listen for to trigger code but varies by theme.