It depends upon how price is set at the register, IIRC, if it's a rebate that's applied at the time of purchase it's treated like a mail-in-rebate in which case you pay full price taxes and then the rebate is applied (regardless of how the receipt looks which always puts the taxes at the end) if it's simply the store (or manufacturer) selling at a discounted rate then it's not taxed at the full price. Unfortunately since it's the same brand as the Petco sale it's probably treated as the former where the manufacturer is reimbursing the store a part of the sale, but they're not paying the sales tax on that, so you will pay full sales tax.
It's something you normally don't notice because either 1) It's at a supermarket and coupons you use are for food which itself is not taxable, or 2) it's not such a huge discount that most will not stop and do the math on it, where as the 40G version cost about 3x more, so that's 3x more taxes, so your $40 purchase will have about $10 in taxes which is more noticeable and seems like you're being taxed at a rate of 25%.