Does the app work per variant or per product?

Will the floating button appear if only one variant of a product goes out of stock and not the entire line?

No. The floating button will only appear if the selected variant of the product is the one that is out of stock. 

If the customer chooses another variant and it is in-stock, no button will pop up even if it is the same product line and the customer can proceed with the purchase normally.