Recursive item production cost (first draft)