.tag {
  align-items: center;
  border-radius: $border-radius--max;
  display: inline-flex;
  height: $baseline * 4;
  opacity: 1;
  overflow: hidden;

  &--s {
    height: $baseline * 2.6;
  }

  &.hide-tag {
    opacity: 0;
    transition: opacity $transition-duration--fast;
  }

  &__text {
    @include text-ellipsis;
  }

  &.tag--remove {
    .tag {
      &__text {
        @include font-style('body--m');
        line-height: $baseline * 2.9;
        margin-bottom: $baseline * 0.2;
        padding: 0 3px 0 15px;
      }

      &__close {
        align-items: center;
        background: transparent;
        border-radius: $border-radius--max;
        cursor: pointer;
        display: flex;
        height: $baseline * 3;
        justify-content: center;
        margin-right: 5px;
        transition: background $transition-duration--fast;
        width: 30px;

        &:hover {
          transition: background $transition-duration--fast;

          .icon svg {
            transition-duration: $transition-duration--faster;
          }
        }

        .icon {
          height: $icon-size--s;
          transition-duration: $transition-duration--faster;
          width: $icon-size--s;

          svg {
            transition-duration: $transition-duration--faster;
          }
        }
      }
    }

    &.tag--s .tag__text {
      padding: 0 5px 0 10px;
    }

    // background mappings
    @include tags-background-mapping;
  }

  // small version
  &.tag--s.tag--remove .tag__close {
    height: $baseline * 2;
    width: $spacing--s;

    .icon {
      height: $icon-size--xs;
      width: $icon-size--xs;
    }
  }

  /// tag with checkbox
  &.tag--add {
    background: transparent;
    transition: $transition-duration--fast ease;

    &:hover:not(.tag__checked-background-color) {
      transition: background $transition-duration--fast;
      @media (hover: none) {
        &:hover:not(.tag__checked-background-color) {
          background: transparent;
        }
      }
    }

    label {
      -webkit-tap-highlight-color: transparent;
      user-select: none;
    }

    .tag {
      &__text {
        @include font-style('body--m');
        line-height: $baseline * 2.9;
        margin-bottom: $baseline * 0.4;
        padding-right: 15px;
      }

      &__checkbox {
        cursor: pointer;
        margin-left: 6px;

        .selection-control {
          &__input {
            align-items: center;
            background: transparent;
            border-radius: $border-radius--max;
            display: flex;
            height: $spacing--m;
            justify-content: center;
            top: $baseline * 0.1;
            transition: $transition-duration--fast ease;
            width: 30px;

            .icon {
              height: $icon-size--s;
              transition: $transition-duration--fast ease;
              width: $icon-size--s;
            }
          }

          &__label {
            margin-left: $spacing--xxs;
          }

          &__control {
            transition: none;
          }
        }
      }
    }

    //set in tags.js
    &.tag__checked-background-color {
      transition: $transition-duration--fast ease;

      &:hover {
        .selection-control__input {
          transition: $transition-duration--fast ease;

          .icon {
            transition: $transition-duration--fast ease;
          }
        }
      }
    }

    @include tags-add-background-mapping;
  }
}

// viewport l
@include viewport--l {
  .tag.tag--remove .tag__text {
    margin-bottom: $baseline * 0.4;
    padding: 0 5px 0 15px;
  }
}
