You can add a padding-left: 15px;
to the .detail .item.active {}
to ensure that the item will not be overlapped by text. Then I made the .detail_swatch
to be positioned absolute instead of float: right;
so it overlaps the padding I added.
Here is the changed css:
.detail .item.active {
opacity: 1;
background: rgba(0, 0, 0, 0.8);
padding-right: 15px;
}
.detail_swatch {
display: inline-block;
position: absolute;
right: 2px;
height: 10px;
margin: 0 4px 10px 10px;
width: 10px;
}
Finally, a fiddle: Demo
Fiddle with very very long text: Demo