President Trump threw the financial markets into chaos last week, announcing that the U.S. would impose tariffs on steel and aluminum imports to protect American jobs. While nothing is set in stone yet, the proposed tariffs are 25% for steel and 10% for aluminum.

Shares of U.S. automakers General Motors (GM -0.94%) and Ford Motor (F -0.58%) were particularly hard hit by this news. But while it's true that both automakers consume lots of steel and aluminum, the proposed tariffs probably won't hurt them as much as investors expect -- especially in the long run. Thus, the recent declines in auto stocks could make for a great buying opportunity.

GM Chart

General Motors vs. Ford stock performance, data by YCharts.

How much will this affect production costs?

Automakers use lots of steel and aluminum in their operations. Nevertheless, the vast majority of production costs come from the process of turning those raw materials into components and then assembling those components into full vehicles.

In recent years, the cost of raw materials for a single vehicle has bounced around in the area of $1,500-$2,000, according to AlixPartners. For comparison, average transaction prices for vehicles sold in the U.S. surpassed $36,000 by the end of 2017. Thus, even if the total cost of raw materials were to rise by 15%-20%, a 1% price boost would cover the cost increase.

It's also not clear what level of cost increases automakers would face, if any. Steel prices are already higher in the U.S. than in other countries, so a 25% tariff wouldn't necessarily increase domestic steel prices by the same amount. There would also be historical precedent for the U.S. to exempt automakers from tariffs on imported steel to maintain their competitiveness -- or for steel exporters such as China to provide additional subsidies to steel producers to offset the tariffs.

Can automakers pass higher costs through to customers?

Assuming that steel and aluminum tariffs will add $300-$400 to the cost of a vehicle, investors might wonder what would happen if General Motors and Ford try to pass that cost through to customers. After all, Ford has already warned that rising raw material prices will severely affect its profitability in 2018.

A front view of a black Ford F-150 pickup

Ford has already complained about rising raw material costs. Image source: Ford Motor Company.

One worry seems to be that higher steel costs in the U.S. will give foreign automakers a leg up in the U.S. market. However, GM, Ford, and Fiat Chrysler collectively account for less than half of U.S. auto production today -- roughly in line with their combined domestic market share -- as a lot of foreign automakers have moved production here in recent years. Thus, there's no reason for the Detroit Three to be disproportionately affected.

A second concern is that higher prices would dent U.S. auto sales, which are already declining on a year-over-year basis. However, consumers have willingly chosen ever more expensive vehicles in recent years. For example, General Motors reported that ATPs increased by about $750 last month, while Ford saw a massive increase of around $2,100.

The "secret" to driving sales and ATP growth is having a broad stable of desirable products. GM is in very good shape in this respect, which is why it expects profitability to remain stable in 2018 despite higher raw material prices and costly downtime for its full-size truck plants.

Ford faces more challenges. Its lucrative F-Series trucks and all-new versions of the Ford Expedition and Lincoln Navigator SUVs are driving big ATP gains, but the company needs to refresh the rest of its crossover/truck portfolio to reinvigorate sales. The EcoSport subcompact crossover, which hit the market in January, is just the first of many new and redesigned models that Ford is bringing to its home market as it looks to bounce back.

There are risks -- but these stocks are cheap

As mentioned, investors and the financial media have probably exaggerated the likelihood of a sharp tariff-related downturn in domestic auto sales or profitability. Still, there will surely be some price-sensitive buyers who put off purchases or choose a used car to save money.

The biggest risk to General Motors and Ford from steel and aluminum tariffs might not come in the U.S. at all. Backlash against the tariffs in China could cause sharp sales declines in that key market, as the Chinese media has a tendency to whip up nationalist sentiment. For example, Japanese automakers were hit hard in late 2012 by a brewing geopolitical dispute.

That said, this boycott campaign fizzled within a couple of years, after which Japanese brands quickly reached new heights in China. Thus, any tariff-related disruption borne by GM and Ford in China could be short-lived.

After a weak start to 2018, shares of General Motors and Ford both trade for around six to seven times earnings now. That provides an ample margin of safety for investors, even if the Trump administration does follow through with tariffs on steel and aluminum.