How can I prevent a shortcode div from extending beyond its boundaries?

I have a shortcode for user-defined social media buttons that works well, except for the fact that the div extends beyond its boundaries, meaning that if this shortcode is called in a widget, the following widgets are also encompassed within the shortcode’s div & shortcode-specific styling impacts the following widgets. I think what’s happening is probably akin to this thread but I’m not sure where I’ve gone awry because I’m not echoing anything in this code.

If the shortcode is placed last, it works perfectly but that’s not exactly good UX, is it?

Here is my code:

Yes, I realize that adding shortcodes to a theme isn’t necessarily sanctioned by the poobas but the potential for a conflict here is incredibly low.