Mazda won itself a lot of fans over the years with the sharp styling and attention to detail of its engaging-to-drive vehicles. But in recent years its cars have been left behind by rivals when it comes to fuel efficiency. As a small automaker facing daunting development costs, it decided to partner with Toyota on advanced technologies, including a battery electric vehicle due by 2027.