/**
 * Smart product badges — storefront layout (CSS-first, limit layout shift).
 * @see docs/technical-notes.md
 */
.mktspb-slot {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  align-content: flex-start;
  min-height: 1.25rem;
  max-width: 100%;
  vertical-align: middle;
}

.mktspb-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  line-height: 1.2;
  border-radius: 3px;
  white-space: nowrap;
  font-weight: 600;
  border: 1px solid transparent;
}

.mktspb-badge--text,
.mktspb-badge--css,
.mktspb-badge--discount_percent,
.mktspb-badge--discount_amount,
.mktspb-badge--discount_countdown {
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.mktspb-badge--discount_countdown {
  font-variant-numeric: tabular-nums;
}

.mktspb-badge--image {
  padding: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  line-height: 0;
}

.mktspb-badge--image .mktspb-badge-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 4.5rem;
  max-height: 4.5rem;
}

.mktspb-slot--listing_price .mktspb-badge--image .mktspb-badge-img,
.mktspb-slot--listing .mktspb-badge--image .mktspb-badge-img {
  max-width: 3rem;
  max-height: 3rem;
}

/* Overlay slots (product cover + listing thumbnails) */
.product-cover {
  position: relative;
}

.product-cover .mktspb-slot--product_cover,
.product-miniature .thumbnail-top .mktspb-slot--listing_price,
.product-miniature .thumbnail-top .mktspb-slot--listing,
.product-miniature .thumbnail-container > .mktspb-slot--listing_price,
.product-miniature .thumbnail-container > .mktspb-slot--listing {
  position: absolute;
  inset: 0;
  z-index: 6;
  margin: 0;
  max-width: none;
  min-height: 0;
  display: block;
  pointer-events: none;
}

.mktspb-corner {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: calc(100% - 1rem);
  pointer-events: none;
  z-index: 6;
}

.mktspb-corner .mktspb-badge {
  position: relative;
  pointer-events: auto;
  max-width: 100%;
}

.mktspb-corner--top_left,
.mktspb-corner--near_title {
  top: 0.5rem;
  left: 0.5rem;
  align-items: flex-start;
}

.mktspb-corner--top_center {
  top: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  align-items: center;
}

.mktspb-corner--top_right {
  top: 0.5rem;
  right: 0.5rem;
  left: auto;
  align-items: flex-end;
}

.mktspb-corner--middle_left {
  top: 50%;
  left: 0.5rem;
  transform: translateY(-50%);
  align-items: flex-start;
}

.mktspb-corner--center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  align-items: center;
}

.mktspb-corner--middle_right {
  top: 50%;
  right: 0.5rem;
  left: auto;
  transform: translateY(-50%);
  align-items: flex-end;
}

.mktspb-corner--bottom_left,
.mktspb-corner--near_price {
  bottom: 0.5rem;
  left: 0.5rem;
  top: auto;
  align-items: flex-start;
}

.mktspb-corner--bottom_center {
  bottom: 0.5rem;
  left: 50%;
  top: auto;
  transform: translateX(-50%);
  align-items: center;
}

.mktspb-corner--bottom_right {
  bottom: 0.5rem;
  right: 0.5rem;
  top: auto;
  left: auto;
  align-items: flex-end;
}

.mktspb-slot--product_flags,
.mktspb-slot--product_body {
  margin: 0.15rem 0;
}

.mktspb-slot--product_cover {
  margin: 0;
}

.mktspb-slot--product_price,
.mktspb-slot--listing,
.mktspb-slot--listing_price {
  margin: 0.1rem 0;
}

.product-miniature .thumbnail-top,
.product-miniature .thumbnail-container {
  position: relative;
}

/* —— Graphic stickers (CSS shapes; keep labels translatable) —— */
.mktspb-badge.mktspb-shape--heart,
.mktspb-badge.mktspb-shape--tag,
.mktspb-badge.mktspb-shape--seal,
.mktspb-badge.mktspb-shape--ribbon {
  box-shadow: none;
  border-style: none;
}

.mktspb-badge.mktspb-shape--heart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: normal;
  max-width: 5.6rem;
  min-width: 4.4rem;
  min-height: 4rem;
  padding: 0.95rem 0.5rem 0.65rem;
  line-height: 1.1;
  border-radius: 0 !important;
  clip-path: polygon(
    50% 92%,
    8% 55%,
    0% 30%,
    8% 8%,
    28% 0%,
    50% 18%,
    72% 0%,
    92% 8%,
    100% 30%,
    92% 55%
  );
}

.mktspb-badge.mktspb-shape--tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 1.15rem 0.35rem 0.7rem;
  border-radius: 0.2rem 0 0 0.2rem !important;
  clip-path: polygon(0 0, 78% 0, 100% 50%, 78% 100%, 0 100%);
  position: relative;
}

.mktspb-badge.mktspb-shape--tag::before {
  content: '';
  position: absolute;
  left: 0.35rem;
  top: 50%;
  width: 0.35rem;
  height: 0.35rem;
  margin-top: -0.175rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.mktspb-badge.mktspb-shape--seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: normal;
  width: 4.25rem;
  height: 4.25rem;
  min-width: 4.25rem;
  padding: 0.45rem;
  line-height: 1.1;
  border-radius: 50% !important;
  border: 2px dashed currentColor !important;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

.mktspb-badge.mktspb-shape--ribbon {
  display: inline-block;
  transform: rotate(-12deg);
  transform-origin: center center;
  border-radius: 0.15rem !important;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.12);
  padding: 0.3rem 0.65rem;
}
