Nike (NKE -0.18%) did not score a slam dunk last year. The top maker of athletic gear saw its shares slide almost 30%. Can we blame the bear market for the performance? Maybe a bit. It's true that some investors avoided stocks linked to consumer spending.

But the main reason for Nike's decline was that economic factors have been hurting earnings. Rising inflation, supply chain problems, and negative currency exchanges represented headwinds in 2022. Now, the big question is: Will Nike recover in 2023? Or should we expect this losing streak to continue? Let's find out.

What went wrong last year

First, let's talk about what went wrong for Nike last year. Higher inflation meant Nike paid more for most of its operations last year, such as running its stores and transporting goods.

And speaking of transportation, supply chain problems meant that some inventory arrived later than expected while other items arrived earlier than planned. As a result, Nike struggled with inventory and, at a certain point, found itself with unusually high levels. That meant the company had to discount merchandise to make room for newer seasonal items.

At the same time, the dollar's strength against other currencies hurt the value of sales made internationally.

All of these problems lowered Nike's margins last year and weighed on general earnings growth. And, as mentioned above, investors weren't so ready to join team Nike.

But things might be changing. In Nike's most recent earnings report -- for its second quarter, ended November 30 -- the company reported some positive trends. First, Nike said the inventory peak has passed. Total inventory units have declined in the low double digits. And the business has adjusted its purchases of items for the second half of the year to ensure healthy levels of inventory.

Though Nike had to mark down some items to decrease inventory in recent times, the company also has seen strength in full-price purchases. And Nike even benefited from "strategic pricing increases" for certain innovative footwear products. This helped limit the decrease in gross margin during the quarter.

The loyalty of fans

Finally, the loyalty of Nike's fans boosted its gains in the most recent quarter and should result in growth over time. The second quarter was the strongest ever for member demand. This is important because members of Nike's loyalty program represent about half of demand seen in its stores. And Nike has noticed that the numbers of members who spend more and who make more frequent purchases are increasing in the high double digits.

Nike's brand strength isn't new; it has been a favorite across the world for years. But Nike's efforts to ramp up its digital presence in recent times and to introduce events like sneaker drops on its app have taken things to another level. And the company is likely to further benefit from this once headwinds like rising inflation subside.

Even in today's difficult context, Nike reported double-digit gains in quarterly revenue, Nike Direct sales, and Nike Brand digital sales. And overall growth topped 30% on a currency-neutral basis across North America, Europe, the Middle East, Africa, Asia Pacific, and Latin America.

Starting the year off right

Now, let's get back to our question: Will Nike recover this year? The shares have started the year off right, gaining about 8% so far.

And, as mentioned, Nike has made progress in addressing today's challenges. Of course, a lot depends on what happens with the general economy. If inflation continues to rise, for example, it could keep weighing on the business.

It's impossible to predict the timing of Nike's recovery. But the company is heading in the right direction and has the strength to navigate today's troubled times. The business has already shown signs of improvement. And today, the stock is trading at a very reasonable price: 35 times trailing-12-month earnings. That compares favorably to more than 60 in prepandemic days.

All of this means that whether Nike recovers this year or later, it is still a great long-term stock. And at today's price, now is the perfect moment to get in on this past and future winner.