Spending a penny in public toilets is often more complex than parting with loose change - there's etiquette to follow.

Out of respect for fellow patrons, you feel compelled to leave a socially acceptable distance between cubicles or urinals. You give a subtle warning when there's no loo roll. You never hog the hand dryer.

These unspoken laws are woven into the fabric of society, enabling people to go about their business in comfort and crucially, silence. But more and more Scots are shouting about the declining state of public toilets across Scotland, as facilities close, are sold or fall into disrepair.

In Glasgow, where the population is nearly 600,000, there are seven outdoor public toilets paid for by the council. They are located mostly in the city centre and west end, with one in the south side at Hampden Park. Four out of seven charge 20p per use.

Additionally, there are 11 facilities people can use for free in buildings such as the Kelvingrove Art Gallery and Museum, the Mitchell Library and the Glasgow Royal Concert Hall.

Perth currently has two, Aberdeen has nine and Dundee has six, the maintenance of which can be costly to councils.

Perth and Kinross Council pays approximately £50,000 per year per facility, while Dundee City Council paid £8 every time a person visited its Queen Street facilities - a price that provided context for their closure in 2011.

Edinburgh currently has 18 operational public toilets for a population of nearly 500,000 - a figure that fell from 29 facilities in 1996.

Before facilities closed in the capital, the council set up a community toilet scheme where businesses were given an annual fee of £500 to allow people to use their toilets.

Some of Edinburgh's public toilets are in the process of being sold, such as London Road or Canonmills, while others such as Granton Square are being considered for community ownership schemes. But new owners also need to take responsibility for maintenance and cleaning, an undesirable task when public toilets become the setting for drug use.

Over 500 syringes were found in two of Glasgow's toilets, on St Vincent Street and Stevenson Street next to the Barras market, all within the space of five months in 2015.

Bizarrely, there is an area in Scotland where the public toilets are not only a historical landmark, but a central attraction.

Rothesay's ornate Victorian toilet were commissioned by the Rothesay Harbour Trust in 1899 and is now so popular it has gleaming reviews on TripAdvisor.

But for Scots with chronic bladder and bowel conditions, access to a nearby toilet is crucial and some say a lack of facilities would prevent them from going outdoors.

This coupled with a lack of knowledge on public toilets was the inspiration behind the Great British Public Toilet Map, an online service which launched in 2014 detailing locations and opening hours.

Access to public toilets is also crucial for small communities where tourism is the main source of revenue.

Billy Lamb, head of the Irvine branch of UK charity Coastwatch, said the closure of one of the seaside town's public toilets would "drastically affect the community".

After one of the public toilets on Irvine beach was threatened with closure, Coastwatch decided to take on the unit in an asset transfer agreement with North Ayrshire Council.

The charity would use the building as a base for its own work, while keeping the toilets open to the public, plans that require a further £15,000 in funding before they can go ahead.

Mr Lamb said: "Once you leave the last cafe in Irvine and head towards the beach, there's at least a quarter of a mile until you hit the toilets at the beach. If you closed them, then there would be nothing for the general public.

"We do a lot of community work such as first aid, and part of the idea was to have a first aid room. During the summer we operate from a caravan, tending to children with cut feet and bruised knees, people thrown from horses, and dog bites.

"Toilets are there for the public use. A couple of older people have said to me they can't afford to walk too far away from toilets. If they go for a walk they need to have use of a toilet somewhere or they have to think they can only walk in certain areas if the toilets are shut.

"I think closure would drastically affect the community. All the organisations and residents in the Irvine Harbour side are trying to regenerate the area and bring more people in - it's a fantastic place. It's nice and flat for people to walk on, there's a fantastic beach, there's a big park for cycling and taking your kids and play football. If you don't have any facilities then people will go elsewhere."

While North Ayrshire Council acknowledged the closure of the beach public toilets could affect tourism in the area, the decision was made "to balance reduced resources".

Audrey Sutton, head of connected communities in North Ayrshire council, said: "The council made the decision to close these public toilets but, in common with other local authorities, we're trying to balance reduced resources with increasing demand for council services. Difficult decisions have to be taken.

"I think closures definitely affect tourism, which is why it's very important to find new and innovative ways of providing the right services both for our residents and tourists."