Profitability soared at Mexican budget airline Volaris (VLRS -3.80%) during 2015 and the first half of 2016. However, the carrier has run into significant headwinds recently, largely driven by Donald Trump's surprising success during the 2016 U.S. presidential campaign, culminating in his victory last November.

President Trump's anti-NAFTA (North American Free Trade Agreement) rhetoric has caused a sharp decline in the value of the Mexican peso, driving up Volaris' unit costs. Meanwhile, uncertainty about the recent U.S. immigration crackdown has depressed demand for transborder travel. As a result, Volaris will face a tough operating environment in 2017.

Volaris' earnings momentum cools

In 2015, Volaris' operating margin soared to 13.8%, up from a paltry 1.5% in 2014. A sharp drop in fuel prices was the main factor driving this earnings improvement, more than offsetting the negative impact of the strong dollar.

This earnings momentum continued into 2016, as fuel prices fell even further. In the first half of last year, Volaris' operating margin expanded by more than 3 percentage points.

A Volaris plane.

Volaris posted strong earnings growth in 2015 and early 2016. Image source: The Motley Fool.

However, as the year progressed, the peso continued to decline. Furthermore, fuel prices bottomed out a year ago and have started rising again. Despite its efforts to reduce its costs and grow unit revenue, Volaris hasn't been able to offset these severe earnings headwinds lately.

Thus, Volaris reported last week that its operating margin for the fourth quarter of 2016 plunged to 7.3% from 14.4% a year earlier. In peso-denominated terms, fuel and aircraft rent expense -- which together account for the majority of Volaris' costs -- surged more than 50% year over year on 18.3% capacity growth, due to the strong dollar.

More trouble in the pipeline

Unfortunately, the worst isn't over for Volaris. During the second half of 2016, the company at least had the benefit of strong demand as it worked to mitigate its rising costs. However, during the fourth-quarter earnings call, management disclosed that demand has softened in early 2017.

There are two main issues. First, the peso has now weakened by about 50% against the dollar since 2014. This has reduced Mexican consumers' demand for leisure travel to the U.S. Second, uncertainty related to tighter U.S. immigration enforcement has also cut into demand for transborder travel in the past month or so.

Between this dip in demand, cost pressures related to the weak peso, and a change in the timing of Easter, Volaris offered a very weak Q1 forecast. Management's guidance implies that Volaris will post an operating loss this quarter compared to a 16.1% operating margin a year ago.

Not surprisingly, investors were dismayed by this forecast. Volaris shares plunged to around $12.50 as of the early afternoon on Tuesday, down from $14.75 as recently as last week.

VLRS Chart

Volaris YTD Stock Performance, data by YCharts.

Can Volaris recover?

Volaris' earnings declines are likely to continue for most, if not all, of 2017. The combination of a weak peso and rising fuel prices is simply too much to overcome, especially if transborder travel demand remains soft.

That said, Volaris' current troubles make this a good time for long-term investors to buy Volaris stock. First, with the lowest costs of any airline in Mexico, Volaris is better able to weather the current storm than its rivals. (Indeed, it is now one of the five lowest-cost airlines in the world.) If competitors are forced to cut capacity, Volaris will be in a stronger position when the market eventually recovers.

Second, a recent change in regulations will allow Volaris to start charging for the first checked bag on Mexico-U.S. flights next month. That will boost its ancillary revenue, allowing Volaris to reduce its base fares and stimulate demand. This change could help offset some of the recent transborder demand weakness.

Third, Volaris has significant opportunities to diversify its revenue away from tickets sold in Mexico. The weak peso is making vacations to Mexico cheaper for American tourists, and Volaris may be able to capture some of that demand with new transborder routes. The airline also recently launched a Costa Rica-based subsidiary, creating further geographical diversification.

Thus, Volaris has a number of potential levers that it can use to ensure that it remains profitable on a full-year basis. At some point, the peso will stabilize (or even recover) relative to the dollar. When that happens, Volaris is likely to return to strong earnings growth, driving a recovery in its stock price.