.category-menu-bar {
  background: #000;
}

.category-menu-bar__list {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
  user-select: none;
}

.category-menu-bar__list.is-dragging {
  cursor: grabbing;
}

.category-menu-bar__list.is-dragging a {
  pointer-events: none;
}

.category-menu-bar__list::-webkit-scrollbar {
  display: none;
}

.category-menu-bar__list li {
  flex: 0 0 auto;
}

.category-menu-bar__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: #fff;
  white-space: nowrap;
  transition: opacity .15s, background-color .15s;
}

.category-menu-bar__list li:first-child .category-menu-bar__link {
  padding-left: 0;
}

.category-menu-bar__icon {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  object-fit: contain;
  /* icons are red drawings on white JPG: white background -> black (merges with the bar), drawing -> white */
  filter: grayscale(1) invert(1) brightness(1.3);
  /* black background becomes transparent on any dark background (mobile pills) */
  mix-blend-mode: screen;
}

.category-menu-bar__link::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 2px;
  background: var(--main-color-red, #ed0000);
  border-radius: 2px 2px 0 0;
  transform: scaleX(0);
  transition: transform .2s;
}

.category-menu-bar__list li:first-child .category-menu-bar__link::after {
  left: 0;
}

.category-menu-bar__link:hover,
.category-menu-bar__link:focus-visible {
  color: #fff;
  text-decoration: none;
}

.category-menu-bar__link:hover::after,
.category-menu-bar__link:focus-visible::after {
  transform: scaleX(1);
}

/* Desktop: arrows over list edges, shown by JS only when there is something to scroll */
.category-menu-bar__scroller {
  position: relative;
}

.category-menu-bar__arrow {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  width: 56px;
  padding: 0;
  border: 0;
  cursor: pointer;
}

.category-menu-bar__arrow[hidden] {
  display: none;
}

.category-menu-bar__arrow--prev {
  left: 0;
  background: linear-gradient(to right, #000 55%, rgba(0, 0, 0, 0));
}

.category-menu-bar__arrow--next {
  right: 0;
  background: linear-gradient(to left, #000 55%, rgba(0, 0, 0, 0));
}

.category-menu-bar__arrow::before {
  content: '';
  position: absolute;
  top: 50%;
  width: 9px;
  height: 9px;
  border-top: 2px solid #fff;
  border-right: 2px solid #fff;
}

.category-menu-bar__arrow--prev::before {
  left: 10px;
  transform: translateY(-50%) rotate(-135deg);
}

.category-menu-bar__arrow--next::before {
  right: 10px;
  transform: translateY(-50%) rotate(45deg);
}

.category-menu-bar__arrow:hover::before {
  border-color: var(--main-color-red, #ed0000);
}

@media (max-width: 959px) {
  /* mobile: swipe, the cut last category is the hint */
  .category-menu-bar__arrow,
  .category-menu-bar__arrow[hidden] {
    display: none;
  }

  .category-menu-bar .wrapper {
    padding-right: 0;
  }

  .category-menu-bar__list {
    gap: 8px;
    padding: 10px 16px 10px 0;
  }

  .category-menu-bar__link,
  .category-menu-bar__list li:first-child .category-menu-bar__link {
    gap: 6px;
    padding: 6px 14px;
    font-size: 13px;
    background: #1f1f1f;
    border-radius: 18px;
  }

  .category-menu-bar__link:hover,
  .category-menu-bar__link:focus-visible {
    background: #333;
  }

  .category-menu-bar__link::after {
    display: none;
  }

  .category-menu-bar__icon {
    flex-basis: 20px;
    width: 20px;
    height: 20px;
  }
}
