.vd-badge {
  display: inline-block;
  vertical-align: middle;
  box-sizing: border-box;
  background: var(--vd-badge-bg, #f5c518);
  color: var(--vd-badge-fg, #2a2100);
  font-size: var(--vd-badge-size, 14px);
  font-weight: var(--vd-badge-weight, 700);
  line-height: 1.1;
  white-space: nowrap;
}
.vd-badge--pill {
  border-radius: var(--vd-badge-radius, 3px);
  padding: var(--vd-badge-pad, 5px) calc(var(--vd-badge-pad, 5px) * 2);
}
.vd-badge--tag {
  border-radius: var(--vd-badge-radius, 3px);
  padding: var(--vd-badge-pad, 5px) calc(var(--vd-badge-pad, 5px) * 2) var(--vd-badge-pad, 5px)
    calc(var(--vd-badge-pad, 5px) * 3);
  clip-path: polygon(0.6em 0, 100% 0, 100% 100%, 0.6em 100%, 0 50%);
}
.vd-badge--circle {
  width: calc(3.6em + var(--vd-badge-pad, 5px) * 2);
  height: calc(3.6em + var(--vd-badge-pad, 5px) * 2);
  padding: 0;
  border-radius: 50%;
  text-align: center;
  display: inline-grid;
  place-items: center;
}
.vd-badge--ribbon {
  padding: var(--vd-badge-pad, 5px) 2.6em;
  text-align: center;
}
.vd-badge--on-image {
  position: absolute;
  z-index: 9;
}
.vd-badge--tl {
  top: 10px;
  left: 10px;
}
.vd-badge--tr {
  top: 10px;
  right: 10px;
}
.vd-badge--bl {
  bottom: 10px;
  left: 10px;
}
.vd-badge--br {
  bottom: 10px;
  right: 10px;
}
.vd-badge--ribbon.vd-badge--tl {
  top: 1.1em;
  left: -2.4em;
  transform: rotate(-45deg);
}
.vd-badge--ribbon.vd-badge--tr {
  top: 1.1em;
  right: -2.4em;
  transform: rotate(45deg);
}
.vd-badge--ribbon.vd-badge--bl {
  bottom: 1.1em;
  left: -2.4em;
  transform: rotate(45deg);
}
.vd-badge--ribbon.vd-badge--br {
  bottom: 1.1em;
  right: -2.4em;
  transform: rotate(-45deg);
}
.vd-badge--inline {
  margin-inline: 0.35em;
}
.vd-badge-slot {
  display: contents;
}
.vd-badge-host,
.woocommerce-product-gallery__image:has(> .vd-badge, > .vd-badge-slot),
.woocommerce-product-gallery__image--placeholder:has(> .vd-badge, > .vd-badge-slot),
.wc-block-components-product-image:has(> .vd-badge, > .vd-badge-slot) {
  display: block;
  position: relative;
}
.vd-badge-host:has(> .vd-badge--ribbon, > .vd-badge-slot > .vd-badge--ribbon),
.wc-block-components-product-image:has(> .vd-badge--ribbon, > .vd-badge-slot > .vd-badge--ribbon),
.woocommerce-product-gallery__image:has(> .vd-badge--ribbon, > .vd-badge-slot > .vd-badge--ribbon),
.woocommerce-product-gallery__image--placeholder:has(
  > .vd-badge--ribbon,
  > .vd-badge-slot > .vd-badge--ribbon
) {
  overflow: hidden;
}
.wp-block-woocommerce-product-price:has(> .vd-badge, > .vd-badge-slot)
  > .wc-block-components-product-price {
  display: inline-block;
}

/* On its own in a block theme's content (a Shortcode block, or the badge block outside a paragraph), the constrained
   layout lines its direct children up with the text column. An inline element cannot take that width and would sit
   at the page's left edge, so the holder becomes a block there; inside text it stays inline. */
.is-layout-constrained > .vd-badge-shortcode,
.is-layout-constrained > .wp-block-vdisain-discount-badge {
  display: block;
}
