.product-thumb,
.product-thumb .image,
.product-image.thumbnails,
.product-image .image,
.sp-product-image {
  position: relative;
}

.sp-stack {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 70%;
  pointer-events: none;
  font-family: inherit;
  line-height: 1.25;
}

.sp-left {
  align-items: flex-start;
}

.sp-right {
  align-items: flex-end;
}

.sp-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  max-width: 100%;
  overflow-wrap: anywhere;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  min-width: 32px;
  min-height: 24px;
}

/* Raster artwork replaces the CSS shape and determines the badge dimensions. */
.sp-badge.sp-image {
  position: relative;
  display: block;
  flex-shrink: 0;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 0;
  clip-path: none;
  border-radius: 0;
  background-color: transparent !important;
  line-height: 0;
}

.sp-image-art {
  display: block;
  width: auto;
  height: auto;
  max-width: 160px;
}

.sp-image-label {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 5px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

/* Keep the full original 120 x 40 ribbon, including its transparent lower tail. */
.sp-image-ribbon > .sp-image-art {
  width: 160px;
  max-width: 100%;
}

.sp-image-ribbon > .sp-image-label {
  height: 60%;
  padding: 0 6px;
  white-space: nowrap;
  overflow-wrap: normal;
}
