Grouped bar chart, categorical multi-index

Pandas dataframe with a segment, a variable of that segment, and a value. If i have 4 segments, each with different amount of variables in that segment, how would I group the data into the 4 segments?

The dataframe
Screenshot 2023-08-06 6.24.38 PM

And ignoring color, here is the plot:

How would I group this into 4 categories [read: a grouped chart, rather than stacked]? Is this even possible in Plotly?