This is an issue when you use optgroup for both firefox and safari unfortunately, there are very less options we can try for select so here is one of the alternative option you can use, in-case if this is not an issue.
This will remain same for all browsers.
span {
display: inline-block;
vertical-align: top;
}
select {
height: 200px
}
span:before {
content: attr(label);
}
.Header {
font-weight: bold;
color: black;
}
<select id="cars" multiple>
<!-- you can use this as header -->
<option class="Header" disabled>Swedish Cars</option>
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<!-- you can use this as header -->
<option class="Header" disabled>German Cars</option>
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</select>
<span label='I am span content'></span>