Have is a word in English that has many different meanings. One of those and probably the most common is "to possess".
Another meaning is "to experience" or "to undergo" in the sense of some situation or effect materializing around you - whether it starts outside of you (I'm having trouble, a problem, a situation) or inside of you (I'm having pain in my arm, a fever, a panic attack).
these are all mental and they are not physical
I think it is not whether X is mental or physical, but rather whether the source of X is something that "comes out of nowhere." For example:
My arm hurts.
There's a specific spot on your arm that hurts, and you probably know what made it hurt.
I'm having pain in my arm.
The pain is coming from inside your arm and you may not know the specific cause.
Ideas can fall in this same category.