MSPs have backed the principle of tackling period poverty by making sanitary products available to all free of charge.
All parties backed a bill put forward by Labour's Monica Lennon in its first test in the Holyrood chamber.
However some warned there was a "huge amount of work to do" to amend the bill to make it deliverable and affordable.
Ministers had originally opposed the plans but changed their position after coming under pressure from campaigners.
The government is expected to put forward a raft of amendments to address their "significant" concerns about the legislation, including the estimated £24m annual cost of implementing it.
The Period Products (Free Provision) (Scotland) Bill would create a legal duty on the Scottish government to ensure that period products are available free of charge "for anyone who needs them".
Ms Lennon said she was "thrilled" to have support "from right across civic Scotland, from girl guides, trade unions, anti-poverty charities and many individuals who have had their own lived experience of period poverty and know what it is like not to have access to products when they need them".
She told MSPs that "access to period products should be a right and available to all", and pledged to work with other parties to make sure the proposals are deliverable.
Communities Secretary Aileen Campbell said the proposed costs of the scheme had been dramatically underestimated, saying it would take "a whole lot of hard work and endeavour to make sure we can get something that is fit for purpose".
She added: "Parliament will now need to pull out all the stops and work hard collectively and collaboratively."
This was echoed by Tory MSP Graham Simpson, who said there was a "huge amount of work to do" to knock the bill into shape.
At present tampons, pads and some reusable products are funded in schools, colleges and universities.
The Scottish government provided £5.2m funding to support this. Another £4m was made available to councils so the roll-out could be expanded to other other public places, and another £50,000 for free provision in sports clubs.
Tackling period poverty in schools
At St Paul's High School in Glasgow, there is a scheme where older pupils have been trained to talk to girls in S1 about periods and period poverty.
"Period poverty means that girls can't afford to buy period products," one pupil, Caitlin, told BBC Scotland.
With average periods lasting about five days, it can cost up to £8 a month for tampons and pads.
Xena said the expense meant some girls have to use items like tissues or socks instead.
"This means that some girls are feart to come to school and don't want to leave the house at all," said another pupil, Amy.
Like all schools in Scotland, free period products have been available in the toilets at St Paul's High School since the 2018/19 academic year.
The move came after a survey of more than 2,000 people by Young Scot found that about one in four respondents at school, college or university in Scotland had struggled to access period products.
Meanwhile about 12% of respondents to research by Plan International said they have had to "improvise sanitary wear".
"It's a right that every woman should have that they should be able to access free sanitary products," Amy said.
"It's not like it is a luxury item or anything. We need them."