Geometric phase from Aharonov–Bohm to Pancharatnam–Berry and beyond