3 Month Old with Bad Latch

Sarah
My three-almost-four month old has suddenly decided to not latch well anymore. Her latch was always a little shallow, but it rarely hurt and she has been growing just fine so I didn't worry about. But now her latch is super shallow, almost like she is biting/gumming me while she nurses, and it's soooooo painful. And even at times when she does latch well, half way through its like she gives up on the good latch and it's painful again! I don't know what to do to encourage her to latch well again. Any advice?