The invention of the cotton gin, being one of the most significant developments of the nineteenth century, had turned cotton cloth into an affordable commodity; it was costly before that
Correct Answer Option (D) is below
one of the most significant developments of the nineteenth century, turned cotton cloth into an affordable commodity, whereas it had previously been costly
My question is, here use of "it" - is it not ambiguous? Does "it" refer to "The Invention" or "Cotton Cloth"? Can someone please explain?