does anyone have a favorite electrolyte replacement they add to their hydration bag(s) for day-long, constant replacement of lost fluids and electrolytes?

got a nasty inner mid-thigh cramp @ lunch with 6 hrs of hiking left. partner gave me magnesium capsule that took the cramp away almost immediately. that - and standing on one leg very still.

ran out of water - 5.5 litres - for the first time - w/almost 2 hours of hiking left.

the high temp surprised even the weather service.

any advice would be greatly appreciated.