Hi Eric,
Not quite the text card. You can do custom embedded styles within the text card if you want to style other elements of the homepage or stand alone pages, but if you want the mega menu in your Header, you'll want to open Header from the Customize Pane in the Site Editor and choose the Custom HTML/CSS radio from the Appearance accordion. Once you've selected that, you can put your custom header Bootstrap in the HTML block and put the CSS you're using to control the mega menu in the CSS block. The HTML and CSS blocks for the Header will remain scoped to the Header, so you it'll only affect that component.