Image copyrightGetty ImagesImage caption
Havaianas are now produced in all colours of the rainbow

It is one of the simplest shoes on the planet: a piece of plastic, roughly the outline of your foot, with a crude strap holding the sole to your toes.

Yet Brazil's Havaianas brand took the humble flip-flop to new heights. The company behind them was sold earlier this week for $1bn (£780m). Selling about 200 million pairs every year, it had produced a domestic and international phenomenon.

Across the country, there are whole shops dedicated to them. Rows and rows, in all colours and styles. There are strappy ones, shiny ones, ones in the colour of your favourite football team, ones with huge platform wedges.

The colourful rubber shoes have become synonymous with Brazil. Many carry a little Brazilian flag on their strap. "Havaianas embodies Brazil's fun, vibrant & spontaneous way of life," claims the company's Twitter account. And it is this strong identity that has helped it hold its own, against cheap versions of what is an easy-to-replicate design.

Image copyrightGetty ImagesImage caption
The company adds embellishments and metallic shines to boost prices and desirability

Overseas, they have also proved a hit, and often sell at highly inflated prices: A pair encrusted with Swarovski crystals currently sells for almost $100 (£80) at Saks Fifth Avenue in New York. They are sold all over the world, from the UK to Australia.

The success is a sure sign that the shoe's status has entirely flip-flopped it itself, from its 1960s origins as a purely functional, working-class footwear.

Back then, they were made only in one blue-and-white design, worn by workers across the country and sold by travelling salesmen out of the back of vans.

The company maintains that the first variation happened by accident in 1969, when one batch turned out green and became a surprise hit.

And that, according to local experts, is the secret of their success: they took a simple design and started experimenting.

Footwear for rich and poor

This really kicked off in the 1990s, according to Daniel Gallas, the BBC's South America Business Correspondent, based in Sao Paulo.

"The company created different prototypes, accepted branding partnerships. With a few tweaks, a product costing 10 reais [£2, $3] could be sold for ten times that amount," he says.

"Brazil's masses could still purchase the old models; rich emerging Brazilians could afford the new, fancy ones. It was a turning point in the company - when it became an international hit and revenues multiplied."

Eduardo Alves, a luxury lifestyle writer based in Rio de Janeiro, calls it one of "the most remarkable upgrades in the history of fashion".

Suddenly they were in vogue.

"It was the opposite when I was kid," a Brazilian friend once told me, of growing up in late-1980s Brasilia. "I was mortified when my mum brought us all pairs to wear to school. They felt so uncool."

Back then, they were so commonplace they were put on a list of fundamental products by the Brazilian government, alongside various household groceries, in its attempts to control inflation.

The dark side of light shoes

But, says Eduardo Alves, there is also a darker side to the success story.

Alpargatas - the company that make the shoes - was owned by the J&F group, which manages the fortune of the billionaire Batista family and which has recently been at the centre of the biggest corruption scandal the country has known.

Image copyrightMatthew EismanImage caption
A customer picks out a pair in a store in the upmarket Hamptons area of New York

In May, news broke that Joesley Batista, chairman of the group's meatpacking business, had secretly taped conversations with President Michel Temer; the pair were allegedly discussing bribes.

The J&F group has since been hit with a record fine of more than $3bn, and the sell-off will pay off some of those debts.

Do Brazilians care? Many have boycotted other products from the J&F group, but not all have made the Havaianas connection.

And now the famous flip-flop is moving on, under the new ownership of three Brazilian banking groups.