Learning to Adapt: Bio-Inspired Gait Strategies for Versatile Quadruped Locomotion