BASF sells coatings unit for €7.7 billion, retains 40% stake