.product-card-tags {
  --product-card-tag-max: 112px;
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: center;
  gap: 5px;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.product-card-tags::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.product-card-tags.is-fit {
  justify-content: center;
  overflow: hidden;
  scroll-snap-type: none;
}

.product-card-tags.is-overflowing {
  cursor: grab;
  touch-action: pan-x;
  -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 16px), transparent);
  mask-image: linear-gradient(to left, #000 calc(100% - 16px), transparent);
}

html[dir="ltr"] .product-card-tags.is-overflowing {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 16px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 16px), transparent);
}

.product-card-tags.is-overflowing.is-tags-end,
html[dir="ltr"] .product-card-tags.is-overflowing.is-tags-end {
  -webkit-mask-image: none;
  mask-image: none;
}

.product-card-tags.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  user-select: none;
}

.product-card-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: max-content;
  max-width: var(--product-card-tag-max);
  min-width: 0;
  flex: 0 0 auto;
  height: 22px;
  padding: 0 5px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  scroll-snap-align: start;
  background-color: #efeeee;
  color: #3e3e3e;
}

.product-card-tag.is-scrolling {
  width: var(--product-card-tag-max);
  max-width: var(--product-card-tag-max);
  flex-basis: var(--product-card-tag-max);
}

.product-card-tag__icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  background-color: currentColor;
  -webkit-mask-image: var(--product-card-tag-icon);
  mask-image: var(--product-card-tag-icon);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

.product-card-tag__icon--image {
  width: 16px;
  height: 16px;
  background-color: transparent;
  -webkit-mask-image: none;
  mask-image: none;
  background-image: var(--product-card-tag-icon);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.product-card-tag__text {
  white-space: nowrap;
}

.product-card-tag__scroll {
  display: block;
  min-width: 0;
  overflow: hidden;
}

.product-card-tag__scroll-track {
  display: inline-flex;
  width: max-content;
  white-space: nowrap;
}

.product-card-tag__scroll-track > span {
  display: inline-flex;
  align-items: center;
  padding-inline-end: 10px;
  animation: product-card-tag-scroll var(--product-card-tag-speed, 6s) linear infinite;
  white-space: nowrap;
}

html[dir="ltr"] .product-card-tag__scroll-track > span {
  animation-name: product-card-tag-scroll-ltr;
}

@keyframes product-card-tag-scroll {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(100%, 0, 0); }
}

@keyframes product-card-tag-scroll-ltr {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-100%, 0, 0); }
}

@media (max-width: 375px) {
  .product-card-tags {
    --product-card-tag-max: 96px;
  }

  .product-card-tag {
    font-size: 9px;
    padding: 0 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-card-tag__scroll-track > span {
    animation: none;
  }
}
