Structure and phase transitions in M3H(SeO4)2-type crystals