The three building blocks
Product cost has three parts. Direct materials are the inputs that end up in the product: timber, resin, flour, cartons. Direct labour is the time of people who make it, at their full cost to the business, not just basic salary. Production overhead is everything else the factory needs to run: rent, power, machine depreciation, supervisors, maintenance.
Selling and admin costs, such as sales staff and the head office, are not part of product cost under IAS 2. Keep them out of the unit cost used for stock valuation, though you will still need them when setting prices.