Factories face soaring costs as war causes supply shocks