MANY visitors to Paraguay never get beyond Ciudad del Este, the second-largest city. Brazilian day-trippers cross the Paraná river on the Friendship Bridge, shop in grungy malls and return laden with cheap electronics, Chinese-made blankets and Armani jeans, some of them genuine. The law limits the bargain-hunters to $300-worth of duty-free goods a month; they, and the border guards, ignore it.

Brazil’s recession has dented this tacky trade. “Normally, you couldn’t pass through here because of the crowds,” sighs a taxi driver on Monseñor Rodríguez, the main thoroughfare. Sales at SAX, the city’s swankiest mall, fell 90% last year. Other sources of export earnings are also suffering; the price of soyabeans has halved since 2012. Only electricity, powered by the massive Itaipu dam near Ciudad del Este and sold to Brazil, is doing well.

And yet this landlocked, sparsely populated country is coping better than many in the region. Its GDP grew by 6.2% year-on-year in the second quarter of 2016. It will expand by around 3% this year and next, forecasts the IMF. That would place it in the top tier among South American economies (see chart). A recovery in commodity prices is expected to help, but some of Paraguay’s success comes from adding new activities to its traditional ones. Instead of just farming and flogging cut-price goods to tourists, the country is starting to manufacture things. Its own consumers are shopping more. Though outsiders still think of it (if they think of it at all) as a cheap bazaar and weird haven for fugitive Nazis, Paraguay is becoming a modern country.

At X-Plast, on the southern fringes of Ciudad del Este, room-sized injection moulders extrude plastic toys and garden chairs, one every minute or so, mostly destined for customers in Brazil. The slump there has hurt sales and profits but not obliterated them, says Regina Toyota, the firm’s manager. That is because production costs are low. Itaipu’s electricity powers the machines. Labour is relatively cheap. Non-wage costs add a third to basic pay in Paraguay but double the cost in Brazil, Ms Toyota says. Taxes on sales and incomes are the lowest in Latin America. A dozen maquilas in the suburbs of Ciudad del Este churn out everything from clothing to car parts; five years ago there were none. Across Paraguay investors have set up 70 such firms in the past three years, more than during the previous decade. These ventures are the basis of an industrial sector that could end Paraguay’s reliance on weather-dependent farming and electricity exports, says Gustavo Leite, the industry minister. Brazil imports $70 billion-worth of goods annually from Asia. Mr Leite thinks Paraguay could capture a tenth of that, doubling its industrial production and transforming the country into “Brazil’s China”. That is a worthy, if hyperbolic, goal. To achieve it, Paraguay will have to maintain its sensible economic policies and do far better in providing infrastructure, education and health care. It is reaping the benefits of economic orthodoxy, which was introduced by Alfredo Stroessner, a strongman who also murdered dissidents and promoted smuggling during his long reign from 1954 to 1989. His successors have largely kept to his fiscal philosophy. Budgets have been roughly in balance and public debt is low. The central bank aims for an inflation rate of 4.5% and usually gets close. Commercial banks are healthy (in part because they charge high interest rates and face little competition). Regulation, like the tax code, is business-friendly. Independent trade unions, suppressed under Stroessner, are weak.

Paraguay’s president, Horacio Cartes, who belongs to the Colorado party, once led by Stroessner, has tried to modernise the dictator’s framework. He has replaced political hacks in ministries with Western-educated technocrats (the finance ministry and central bank were already staffed by professionals). He has pushed through a law to limit central-government deficits to 1.5% of GDP but continues to spend money on anti-poverty programmes. Along with steady economic growth and rising wages, these have cut the poverty rate in half, to 20%, between 2003 and 2014.

While Brazilian shoppers are holding back, Paraguayans are spending more. Shopping centres, blocks of flats and hotels are springing up in Asunción, the once-sleepy capital. Its residents are imbibing less tereré, a traditional cold drink made from the yerba mate plant, and more lattes in new European-style cafés. Its streets, unlike those of Ciudad del Este, are congested. But Mr Cartes’s socially sensitive version of laissez-faire has its drawbacks. Matthias Otto, owner of a trendy café in Asunción, likes low taxes but not the crappy public services that go with them. Blackouts are common, he complains.

Mr Cartes, a tobacco magnate, won the presidency in 2013 in part by promising to ramp up spending on public works with cash from the private sector. But turning aspirations into asphalt has been difficult. A new law promotes public-private partnerships (PPPs) but officials lack the expertise to set them up. A tender to build and operate a motorway through the semi-arid Chaco region attracted a single bid (which was accepted). A new transmission line from Itaipu has helped reduce power cuts at X-Plast, says Ms Toyota. But a plan for a second line from the smaller Yacyretá dam down the Paraná river has stalled.

Nor has Mr Cartes reduced much the shadow economy, which employs perhaps two-thirds of workers and pays salaries that are 40% lower than those in the formal sector. Although the unemployment rate is just 6%, the share of workers who are underemployed is twice that. Fujikura, a maker of electrical wiring for cars in Ciudad del Este, tutors workers to make up for their lack of a basic education. In the neglected north a Marxist insurgency simmers (and boiled over in August, when guerrillas killed eight soldiers).

Mr Cartes’s attempt to modernise Stroessner’s model has met resistance from his own Colorado party, which has a majority in congress. A law passed in 2014 allowed citizens to look up salaries of civil servants; it turned out that several were drawing more than one. They were sacked. Party hacks took revenge by blocking Mr Cartes’s initiatives in congress. It stripped the government of its power to sign PPPs without congressional approval. Unable to offer shiny infrastructure projects, the president has seen his popularity slide. His attempt to amend the constitution to let him seek a second term in 2018 looks doomed. If it succeeded, he might lose to Fernando Lugo, a left-wing former bishop who was president until 2012, when he was impeached over allegations of failing to keep order or prevent nepotism. Mr Lugo is now a popular senator.

Paraguay’s next president is unlikely to abandon economic caution. Even Mr Lugo did not run ruinous deficits. The country’s gradual progress is thus likely to continue. It is coming to resemble its more prosperous neighbours: Brazil, Argentina and Uruguay. With that comes a new sense of national self-confidence. “We used to dance tango or samba,” notes Santiago Peña, the finance minister. “Now we dance the polka,” the national dance brought by central European immigrants. Perhaps the Brazilians crossing the Friendship Bridge will take the time to learn a few steps.