.navds-chips {
  display: flex;
  gap: var(--ax-spacing-2);
  margin: 0;
  padding: 0;
  list-style: none;
  flex-wrap: wrap;
}

.navds-chips li {
  margin: 0;
  padding: 0;
  list-style: none;
  display: block;
}

.navds-chips__chip {
  all: unset;
  display: flex;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: var(--ax-spacing-05);
  margin: 0;
  padding: 0 var(--ax-spacing-3);
  text-decoration: none;
  border-radius: var(--ax-border-radius-full);
  min-height: 2rem;

  &:focus-visible {
    outline: 2px solid var(--ax-border-focus);
    outline-offset: 2px;
  }
}

.navds-chips--readonly {
  .navds-chips__chip {
    background-color: var(--ax-bg-neutral-moderateA);
  }
}

.navds-chips--small {
  .navds-chips__chip {
    min-height: 1.5rem;
    padding: 0 var(--ax-spacing-2);
  }

  .navds-chips__toggle-icon {
    width: 1rem;
    height: 1rem;
  }

  .navds-chips__toggle--with-checkmark {
    padding-left: var(--ax-spacing-1);
  }

  .navds-chips__removable-icon {
    width: 1.25rem;
    height: 1.25rem;
  }

  .navds-chips__removable-icon > svg {
    width: 1rem;
  }

  .navds-chips--icon-right {
    padding-right: var(--ax-spacing-05);
  }
}

/* ------------------------------ Chips Toggle ------------------------------ */
.navds-chips__toggle--action {
  box-shadow: inset 0 0 0 1px var(--ax-border-accent-subtleA);
  background-color: var(--ax-bg-accent-moderate);
  color: var(--ax-text-default);

  &:hover {
    background-color: var(--ax-bg-accent-moderate-hover);
  }

  &[data-pressed="true"] {
    box-shadow: none;
    background-color: var(--ax-bg-accent-strong-pressed);
    color: var(--ax-text-accent-contrast);

    &:hover {
      background-color: var(--ax-bg-accent-strong-hover);
    }
  }
}

.navds-chips__toggle--neutral {
  box-shadow: inset 0 0 0 1px var(--ax-border-neutral-subtleA);
  background-color: var(--ax-bg-neutral-moderate);
  color: var(--ax-text-default);

  &:hover {
    background-color: var(--ax-bg-neutral-moderate-hover);
  }

  &[data-pressed="true"] {
    box-shadow: none;
    background-color: var(--ax-bg-neutral-strong-pressed);
    color: var(--ax-text-neutral-contrast);

    &:hover {
      background-color: var(--ax-bg-neutral-strong-hover);
    }
  }
}

.navds-chips--medium .navds-chips__toggle--with-checkmark {
  padding-left: var(--ax-spacing-1-alt);
}

/* -------------------------- start old CSS --------------------------  */

/* ----------------------------- Chips removable ---------------------------- */
.navds-chips__removable {
  gap: 0;
}

.navds-chips__removable--action {
  background: var(--ax-bg-accent-strong-pressed);
  color: var(--ax-text-accent-contrast);

  &:hover {
    background: var(--ax-bg-accent-strong-hover);
  }
}

.navds-chips__removable--neutral {
  background: var(--ax-bg-neutral-strong-pressed);
  color: var(--ax-text-neutral-contrast);

  &:hover {
    background: var(--ax-bg-neutral-strong-hover);
  }
}

.navds-chips__removable-icon {
  width: 1.5rem;
  height: 1.5rem;
  font-size: 1.25rem;
  display: grid;
  place-items: center;
  border-radius: var(--ax-border-radius-full);
}

.navds-chips--icon-left {
  padding-left: var(--ax-spacing-1-alt);
}

.navds-chips--icon-right {
  padding-right: var(--ax-spacing-1-alt);
}

@media (forced-colors: active) {
  .navds-chips__chip {
    border: 1px solid transparent;

    &:hover {
      background-color: highlighttext;
      color: highlight;
    }
  }

  .navds-chips__chip:where([data-pressed="true"], :active, :hover) > span {
    forced-color-adjust: none;
  }

  .navds-chips__toggle[data-pressed="true"] {
    background-color: selecteditem;
    color: selecteditemtext;
    border: 1px solid selecteditem;

    &:hover {
      background-color: selecteditemtext;
      color: selecteditem;
    }
  }
}
