Shallow two-component gravity-driven flows with vertical variation