Go to see a doc.
I'd say it's something neurological if you have problems peeing outside home and maybe bad blood circulation when you feel that mini blackout.
My advice is that you have to start drinking more water and consuming less sugars and carbohydrates even more if you're a sedentary person (maybe not your case cuz u go to the gym, but try this).