Shia LaBeouf says he totally got down with Megan Fox before she was fired off the "Transformers" franchise ... there's only one little catch -- she may have been dating Brian Austin Green at the time.
LaBeouf gave a tell-all, no-holds barred interview to Details.com, in which the interviewer asked point blank if Shia ever hooked up with Fox ... and according to the article, "LaBeouf nods affirmatively."
LaBeouf explained, "Look, you're on the set for six months, with someone who's rooting to be attracted to you, and you're rooting to be attracted to them."
"I never understood the separation of work and life in that situation. But the time I spent with Megan was our own thing, and I think you can see the chemistry onscreen."
But here's the CRAZY part -- the interviewer says he asked if Megan was dating B.A.G. during their hookup ... and LaBeouf replied, "I don't know, man. I don't know. I don't know. I don't know. . . ." repeating the phrase exactly 12 times with various intonations, as if trying to get it just right.
LaBeouf eventually said, "It was what it was."
A rep for Megan Fox tells TMZ, "We have no comment."