I understand that there are several situations:
Product A has a complete design patent.
If the entire bottle of product A has applied for a design patent, and you use its design but replace the trademarks on the cap and body, you will still infringe.
The bottle cap trademark of product A is AAA, and the bottle body trademark is AAAA.
In this case, it must be a counterfeit product, which is illegal.