Bam Margera's wife says a specific incident triggered her to file for separation ... and we're told it was Bam spending time with their son while, she believes, he was under the influence.
Nikki Margera's attorney David Glass tells TMZ ... her recent filing came after the 'Jackass' star visited their 5-year-old, Phoenix, while Nikki was present.
We're told she thinks Bam wasn't sober -- despite him claiming he was -- and she says he was acting inappropriately.
David says after the visit she made the hard choice, after years of trying to help Bam, that she needed to protect herself and their son.
TMZ broke the story ... Nicole filed Wednesday, citing irreconcilable differences. She's asking for legal and physical custody over Phoenix, as well as spousal support.
As you know, Bam's been publicly battling substance abuse ... with Steve-O, his friend and 'Jackass' castmate, bracing for his death.
Bam also caused some controversy after claiming Priscilla Presley gifted him items from Elvis' wardrobe -- something Priscilla's denying.
We reached out to Bam's attorneys for comment ... so far, no word back.