.medicine-status-badges {
  position: absolute;
  inset: 8px auto auto 8px;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  width: fit-content;
  max-width: calc(100% - 16px);
  border-radius: 6px;
  color: #253135;
  row-gap: 3px;
}
.product-dialog .medicine-status-badges {
  max-width: calc(100% - 68px);
}
.medicine-status-badges:empty {
  display: none;
}
.medicine-status-badges > :is(span, a, button) {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 3px 8px;
  border: 0;
  border-radius: 0;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  color: inherit;
  text-decoration: none;
}
.medicine-status-badges > span {
  border-radius: 6px;
  background: var(--ink, var(--company-primary, #24313a));
  color: var(--on-ink, var(--company-on-primary, white));
}
.medicine-status-badges > a {
  border-radius: 6px;
  background: #fffdf8;
}
.medicine-status-badges > span:has(+ a) {
  border-start-end-radius: 0;
  border-end-end-radius: 0;
}
.medicine-status-badges > span + a {
  border-start-start-radius: 0;
  border-end-start-radius: 0;
}
.medicine-status-badges > a::after {
  content: '';
  width: 7px;
  height: 7px;
  background: currentColor;
  clip-path: polygon(15% 0, 100% 0, 100% 85%, 81% 85%, 81% 33%, 14% 100%, 0 86%, 67% 19%, 15% 19%);
}
.medicine-status-badges > button {
  cursor: pointer;
  margin-inline-start: 8px;
  border-radius: 6px;
  background: #ffce7d;
  color: #352a1c;
}
.medicine-status-badges :is(a, button):focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}
.expense-explanation:popover-open {
  position: fixed;
  inset: 0;
  width: min(32ch, calc(100vw - 4rem));
  height: fit-content;
  margin: auto;
  padding: 16px;
  border: 1px solid #b9bab3;
  border-radius: 8px;
  background: #fffdf8;
  color: #253135;
  font:
    400 15px/1.5 system-ui,
    sans-serif;
  box-shadow: 0 4px 18px rgb(0 0 0 / 14%);
}
.gallery-product:has(.medicine-status-badges) .image-pill {
  top: max(48px, 11%);
}

/* Lift the printed label with its bottle. The floor and the badge controls stay in place. */
@media (hover: hover) and (pointer: fine) {
  #options .catalog-picture.catalog-studio {
    transition: box-shadow 200ms ease;
  }
  #options .catalog-card:hover .catalog-picture.catalog-studio,
  #options
    .catalog-card:has(.catalog-product:focus-visible, .catalog-funnel:focus-visible)
    .catalog-picture.catalog-studio {
    box-shadow:
      inset 0 0 0 100vmax rgb(27 31 34 / 5%),
      0 5px 10px -6px rgb(25 31 34 / 32%);
  }
  #options .catalog-card:hover .catalog-studio::before {
    filter: grayscale(1) brightness(0.95);
  }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  #options .catalog-studio > :is(.licensee-packshot, .licensee-product-label, img) {
    transition: translate 210ms ease-out;
  }
  #options
    .catalog-card:is(:hover, :has(.catalog-product:focus-visible, .catalog-funnel:focus-visible))
    .catalog-studio:not(.reference-photo)
    > :is(.licensee-packshot, .licensee-product-label, img) {
    translate: 0 -5px;
  }
  #options .catalog-card:hover .catalog-studio .licensee-packshot img {
    transform: none;
  }
  #options
    .catalog-card:is(:hover, :has(.catalog-product:focus-visible, .catalog-funnel:focus-visible))
    .catalog-studio:not(.reference-photo)::after {
    background: rgb(25 30 33 / 35%);
    filter: blur(5px);
  }
  /* These photos already include the entire studio backdrop. Lift the frame as one image. */
  #options .catalog-picture.reference-photo {
    transition:
      translate 210ms ease-out,
      box-shadow 210ms ease-out;
  }
  #options
    .catalog-card:is(:hover, :has(.catalog-product:focus-visible, .catalog-funnel:focus-visible))
    .catalog-picture.reference-photo {
    translate: 0 -3px;
    filter: brightness(0.98);
  }
}
@media (prefers-reduced-motion: reduce) {
  #options .catalog-card .catalog-picture.catalog-studio,
  #options .catalog-card .catalog-studio img {
    transition: none;
    animation: none;
  }
}
