Upvote:8
The VWP component (90 day period) doesn't reset if you go to Mexico or Canada, you have to leave farther afield for it to reset again.
So 90 days from your first entrance into the US, you cannot be in the US any more, unless you went, say, to Guatemala.
If you do that, the counter resets again. Entering Mexico does not start it again, as you've not arrived in the US. It'd restart once more when you cross the border into the US.
Note that on this second trip, entering Canada, your 90 days continues. This is fine, but if you want to fly out to somewhere else - transiting in the US could potentially be an issue.