Spain’s inflation almost halves to 3.1% as European energy prices slide