A 12-year-old boy has lost his fight for life after being mauled by a shark while swimming with friends at a popular beach.