My way of eating doesn’t allow for socialization

I am realizing my mindset around food isn’t creating the results that I want. I eat in a more structured way because my body feels good when I do. This isn’t a problem until I get invited to social situations where there will be food. I am not always able to eat in the way I would like to at these social settings and then my digestive system gets dysregulated (sometimes). I have a lot of anxiety about my digestive system getting dysregulated, mostly because it just doesn’t feel good and it takes a few days to get back on track. But I also don’t want to not go to these social interactions. A lot of times I end up saying no or avoiding the social things because it feels easier than dealing with the anxiety and the dysregulated digestive system. I wonder if I am too fixated on the food components of health and neglecting the other areas such as connection. Letting go of the structure with my eating for these events feels scary and unsafe (at least to that part of my brain). I am not sure where to start as I try to create a way of eating that would allow for more flexibility and socialization. Do I just need to accept that I will feel physically uncomfortable and that’s the cost of going to these things? And work on creating more peace that these sensations are ok?