.package-order-badge {
  --package-accent: #f97316;
  position: relative;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  justify-self: start;
  flex: 0 0 auto;
  width: max-content;
  max-width: 100%;
  gap: 3px;
  min-height: 22px;
  padding: 2px 6px;
  border: 1px solid color-mix(in srgb, var(--package-accent) 30%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--package-accent) 9%, white);
  color: #c2410c;
  font: 700 11px/1 Manrope, sans-serif;
  white-space: nowrap;
  cursor: help;
  z-index: 4;
}

.package-order-badge svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--package-accent);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.package-order-badge--compact {
  min-height: 20px;
  padding: 1px 5px;
  font-size: 10px;
}

.package-order-badge--compact svg {
  width: 13px;
  height: 13px;
}

.product-buy {
  position: relative;
}

.product-buy > .package-order-badge,
.product-buy > #product-package-order {
  position: absolute;
  top: -11px;
  left: 4px;
  width: max-content;
  height: 0;
  z-index: 8;
}

.search-result__qty.qty-control,
.variant-qty__control {
  position: relative;
  overflow: visible;
}

.search-result__qty > .package-order-badge,
.variant-qty__control > .package-order-badge {
  position: absolute;
  top: -10px;
  left: 4px;
  width: max-content;
  z-index: 8;
}

.search-result__qty > .package-order-badge {
  color: #c2410c;
}

.variant-qty__control > span.package-order-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  min-height: 20px;
  border: 1px solid color-mix(in srgb, var(--package-accent) 30%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--package-accent) 9%, white);
  color: #c2410c;
  box-shadow: none;
}

.search-result__qty > .package-order-badge > span,
.variant-qty__control > span.package-order-badge > span {
  display: inline;
  width: auto;
  height: auto;
  line-height: 1;
  border: 0;
  background: transparent;
  color: inherit;
  box-shadow: none;
}

.package-order-badge::after {
  content: attr(data-package-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  width: max-content;
  max-width: min(360px, calc(100vw - 32px));
  padding: 10px 12px;
  border-radius: 10px;
  background: #dff0f3;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .18);
  color: #334155;
  font: 500 13px/1.4 Manrope, sans-serif;
  text-align: left;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity .15s ease, transform .15s ease;
}

.package-order-badge:hover::after,
.package-order-badge:focus-visible::after,
.package-order-badge:focus::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 820px) {
  .package-order-badge::after {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 86px;
    width: auto;
    max-width: none;
    transform: translateY(4px);
  }

  .package-order-badge:hover::after,
  .package-order-badge:focus-visible::after,
  .package-order-badge:focus::after {
    transform: translateY(0);
  }
}
