$jsmultisets-iteration-left: 5px !default;
$jsmultisets-iteration-border-radius: 50% !default;
$jsmultisets-selected-item-title-bg: $brand-ctr !default;
$jsmultisets-selected-item-image-size: 77px !default;
$jsmultisets-item-border-radius: 10px;
$jsmultisets-item-title-border-radius: 4px;

.jsmultisets-selected-wrapper {
   display: block;
   margin-bottom: 1rem;

   .title {
      font-size: 18px;
      font-weight: $font-weight-bold;
   }
}

.jsmultisets-selected {
   display: flex;
   flex-wrap: wrap;
   align-items: center;

   .category-name {
      color: $text-muted;
      font-size: $font-size-smaller;
      margin-top: 4px;
   }

   .item-wrapper {
      position: relative;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      margin-bottom: 1rem;

      &:not(:last-of-type) {
         padding-right: 30px;

         .item::after {
            content: "+";
            position: absolute;
            left: calc(100% + 15px);
            top: 50%;
            transform: translate(-50%, -50%);
         }
      }
   }

   .item {
      //@include underline-never;

      border: 1px solid $border-color;
      position: relative;
      padding: 10px;
      transition: all $transition-speed;
      border-radius: $jsmultisets-item-border-radius;

      figure {
         margin-bottom: 0;
      }

      img {
         margin: auto;
      }

      .item-iteration {
         position: absolute;
         width: 20px;
         height: 20px;
         font-size: 12px;
         background-color: $border-color;
         color: $text-dark;
         z-index: 1;
         top: -10px;
         left: $jsmultisets-iteration-left;
         border-radius: $jsmultisets-iteration-border-radius;
         display: flex;
         align-items: center;
         justify-content: center;
         transition: all $transition-speed;
         font-weight: $font-weight-bold;
      }

      //@include haf {
      //   border-color: $brand-primary;
      //
      //   .item-iteration {
      //      background-color: $brand-primary;
      //      color: $white;
      //   }
      //}

      &:not(.item-selected) {
         img {
            filter: grayscale(100%);
         }
      }

      &.item-selected {
         border-color: $brand-primary;

         .item-iteration {
            background-color: $brand-primary;
            color: $white;
         }
      }

      @media screen and (min-width: $xs) {
         figure {
            width: $jsmultisets-selected-item-image-size;
         }

         img {
            max-width: $jsmultisets-selected-item-image-size;
            max-height: $jsmultisets-selected-item-image-size;
         }
      }
   }

   .item-title {
      line-height: 1;
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      background-color: $body-bg-alt;
      color: $black;
      padding: 12px;
      font-size: $font-size-smaller;
      border: 1px solid $border-color;
      border-radius: $jsmultisets-item-title-border-radius;
      font-weight: 600;

      &.icon {
         color: $white;
         padding: 6px;
         font-size: 18px;
         background-color: $jsmultisets-selected-item-title-bg;
         border-color: $jsmultisets-selected-item-title-bg;

         svg * {
            fill: currentColor;
         }
      }
   }
}

@media screen and (max-width: $xs - 1) {
   .jsmultisets-selected {
      justify-content: space-between;

      .item-wrapper {
         width: calc(50% - 15px);

         &:not(:last-of-type) {
            padding-right: 0;

            .item::after {
               content: "+";
               position: absolute;
               left: calc(100% + 15px);
               top: 50%;
               transform: translate(-50%, -50%);
            }
         }

         &:nth-child(even) .item {
            //@include delete-after;
         }
      }

      .item {
         img {
            width: 100%;
         }
      }
   }
}
