[1] The capital has super strict emission verification requirements on account of being in a former lake basin surrounded by mountains and boasting a 20-30 million population depending how you count...
But long after the original rear-engine design was discontinued in the US, they made them in Mexico for the domestic market there. They wouldn't pass crash standards and thus were illegal to import into the US (although people periodically tried, and I suspect if you were even slightly cagey about it, you could have made it work using an old hulk's VIN; there are certainly enough of them around in junkyards).
The last ones were made in late 2003, so they actually overlapped the production of the "New Beetle" by several years.
Interestingly, a decree prohibiting the issuance of taxi permits to 2-door vehicles reportedly contributed to the decline in sales, which shows you the role of government in killing off older products. They might still be made if not for that, just for the Mexico City taxi market.
Now, the current market share of electric cars for new cars in the US is 0.62% (it is 0.08% in China). By 2040, in terms of new car sales, the market share is expected to be 35% worlwide [1]. That is a 6 orders of magnitude increase (at 2x each time) in 24 years, using the US number. So, extrapolating and saying the market share doubles every 4 years (24/6), you'd be reaching 70% electric in new cars by 2044 without regulation. With regulation banning non-electric cars as soon as it make sense for each country, I expect it to go 50% of all new cars electric one year, 100% the next.
Either way, by 2048 the number of new gasoline cars will be negligible, but the existing stock of cars already sold might take a few more decades to dwindle.
[1] http://www.bloomberg.com/features/2016-ev-oil-crisis/