.lbaic-settings-multiselect {
  &-holder {
    --lbaic-settings-multiselect-height: 0;
    --lbaic-settings-multiselect-reset-bg: var(--lbaic-settings-multiselect-local-bg, var(--lbaic-settings-multiselect-bg));

    position: relative;
    width: 100%;
    min-width: 0;

    &.opened {
      --lbaic-settings-multiselect-height: 200px;

      .lbaic-settings-multiselect {
        border: 1px solid rgba(var(--lbaic-settings-primary-rgb), 0.3);
        box-shadow: 0 0 0 3px rgba(var(--lbaic-settings-primary-rgb), 0.2);

        &-arrow {
          transform: scaleY(-1);
        }

        &-menu {
          transform: translate3d(0, 2px, 0);
          opacity: 1;
          pointer-events: auto;
        }
      }
    }
  }

  &-in {
    height: 100%;
    display: flex;
    align-items: center;
    padding-inline: var(--lbaic-settings-multiselect-pis, 10px) var(--lbaic-settings-multiselect-pie, 10px);
    padding-block: 8px;
  }

  & {
    position: relative;
    background-color: var(--lbaic-settings-multiselect-local-bg, var(--lbaic-settings-multiselect-bg));
    border: 1px solid var(--lbaic-settings-multiselect-border);
    border-radius: 6px;
    transition: box-shadow 200ms ease-in-out, border-color 200ms ease-in-out;

    &:focus-within {
      border: 1px solid rgba(var(--lbaic-settings-primary-rgb), 0.3);
      box-shadow: 0 0 0 3px rgba(var(--lbaic-settings-primary-rgb), 0.2);
    }
  }

  &-tag {
    &-group {
      width: 100%;
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 4px;
      max-height: 160px;
      min-height: 24px;
      overflow-y: auto;

      .lbaic-settings-tag {
        max-width: 100%;

        &:not(.lbaic-settings-multiselect-tag-counter) {
          --lbaic-settings-tag-flex: 0 1 auto;
        }
      }
    }

    &-counter {
      flex: 0 0 auto;
    }
  }

  &-input {
    width: 100%;
    min-width: 60px;
    padding-inline-end: 14px;
    flex: 1 0 0;
    font-size: var(--lbaic-settings-fs-13);
    font-weight: var(--lbaic-settings-fw-400);
    color: var(--lbaic-settings-multiselect-color);
    line-height: var(--lbaic-settings-lh-24);
    text-align: var(--lbaic-settings-multiselect-align, left);
    min-height: unset;

    &:read-only {
      cursor: pointer;
    }

    &:focus {
      box-shadow: none;
      outline: none;
    }

    &:first-child {
      padding-inline-start: 0;
    }
  }

  &-placeholder {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-block-end: 5px;

    &-in {
      padding-inline: var(--lbaic-settings-multiselect-pi);
      font-size: var(--lbaic-settings-fs-14);
      font-weight: var(--lbaic-settings-fw-500);
      line-height: var(--lbaic-settings-lh-18);
      cursor: pointer;
    }

    &-actions {
      margin-inline-start: auto;
    }

    &-action {
      font-size: var(--lbaic-settings-fs-12);
      line-height: var(--lbaic-settings-lh-18);
      color: var(--lbaic-settings-primary);
      background: none;
      margin-left: auto;
      cursor: pointer;

      &:hover {
        color: rgba(var(--lbaic-settings-primary-rgb), 0.8);
      }
    }
  }

  &-actions {
    display: flex;
  }

  &-arrow {
    width: 24px;
    display: flex;
    transition: transform 180ms ease-in-out;
    cursor: pointer;

    &-in {
      width: 18px;
      height: auto;
      display: block;
      margin-block: auto;
      margin-inline: auto;
      fill: var(--lbaic-settings-multiselect-icon-fill);
    }
  }

  &-h-48 {
    min-height: 48px;
  }

  &-h-42 {
    min-height: 42px;
  }

  &-menu {
    position: fixed;
    top: var(--lbaic-settings-multiselect-holder-top, unset);
    right: var(--lbaic-settings-multiselect-holder-right, unset);
    bottom: var(--lbaic-settings-multiselect-holder-bottom, unset);
    left: var(--lbaic-settings-multiselect-holder-left, unset);
    width: var(--lbaic-settings-multiselect-holder-width, 100%);
    max-height: var(--lbaic-settings-multiselect-height);
    border-radius: 6px;
    box-shadow: var(--lbaic-settings-multiselect-menu-shadow);
    transform: translate3d(0, 2px, 0);
    opacity: 1;
    transition: transform 180ms ease-in-out, opacity 180ms ease-in-out;
    pointer-events: auto;
    overflow: hidden;
    z-index: 301;

    &-in {
      max-height: var(--lbaic-settings-multiselect-height);
      padding-block: 8px;
      padding-inline: 8px;
      background-color: var(--lbaic-settings-multiselect-menu-bg);
      border-radius: 6px;
      box-shadow: var(--lbaic-settings-multiselect-menu-shadow);
    }

    &-item {
      min-height: 36px;
      display: flex;
      align-items: center;
      padding-block: 8px;
      padding-inline: 8px;
      background-color: transparent;
      border-radius: 4px;
      text-align: left;
      transition: background-color 360ms ease-in-out;
      cursor: pointer;

      &:not(:last-child) {
        margin-bottom: 2px;
      }

      &-i {
        width: 20px;
        height: auto;
        display: block;
        flex: 0 0 20px;
      }

      &-label {
        flex: 1 0 0;
        font-size: var(--lbaic-settings-fs-14);
        color: var(--lbaic-settings-multiselect-menu-item-color);
        line-height: var(--lbaic-settings-lh-20);
        white-space: pre-wrap;

        &:not(:first-child) {
          padding-inline-start: 8px;
        }
      }

      &:hover {
        background-color: var(--lbaic-settings-multiselect-menu-item-hover);
      }

      &.active {
        background-color: var(--lbaic-settings-multiselect-menu-item-hover);
        cursor: default;
      }

      &.disabled {
        --lbaic-settings-multiselect-menu-item-color: var(--lbaic-settings-multiselect-menu-item-color-disabled);

        pointer-events: none;
      }

      .lbaic-settings-checkbox-wrapper {
        width: var(--lbaic-settings-multiselect-menu-checkbox-wrapper-width, 100%);
      }
    }

    &-action {
      min-height: 36px;
      display: flex;
      align-items: center;
      background-color: transparent;
      border-radius: 4px;
      text-align: left;
      transition: background-color 360ms ease-in-out;
      cursor: pointer;

      &-i {
        width: 18px;
        height: auto;
        display: block;
        flex: 0 0 18px;
        fill: var(--lbaic-settings-multiselect-menu-item-action-color);
      }

      &-label {
        flex: 1 0 0;
        font-size: var(--lbaic-settings-fs-13);
        color: var(--lbaic-settings-multiselect-menu-item-action-color);
        line-height: var(--lbaic-settings-lh-20);
        white-space: pre-wrap;
      }

      &:hover {
        background-color: var(--lbaic-settings-multiselect-menu-item-action-hover);
      }

      &-in {
        --lbaic-settings-loading-circle-width: 16px;
        --lbaic-settings-button-label-pi-start: 8px;
        --lbaic-settings-loading-circle-width-stroke: var(--lbaic-settings-primary);
        width: 100%;
        padding-block: 8px;
        padding-inline: 8px;
        display: flex;
      }

      &-label {
        &:not(:first-child) {
          padding-inline-start: var(--lbaic-settings-button-label-pi-start);
        }
      }
    }

    &-group {
      &-label {
        margin-block: 8px;
        &-in {
          font-weight: var(--lbaic-settings-fw-500);
        }
      }
    }
  }

  &-has-children {
    --lbaic-settings-multiselect-pis: 44px;

    .lbaic-settings-multiselect-children {
      position: absolute;
      top: 12px;
      bottom: 12px;
      left: 12px;
      display: flex;
      align-items: center;
    }
  }

  &-error {
    --lbaic-settings-multiselect-border: var(--lbaic-settings-input-error);
    --lbaic-settings-multiselect-placeholder-color: var(--lbaic-settings-input-error);

    .lbaic-settings-multiselect {
      &:focus-within {
        --lbaic-settings-multiselect-border: var(--lbaic-settings-input-error);
        --lbaic-settings-multiselect-placeholder-color: var(--lbaic-settings-input-error);
      }
    }

    &-message {
      padding-block-start: 4px;

      &-in {
        font-size: var(--lbaic-settings-fs-12);
        font-weight: var(--lbaic-settings-fw-500);
        color: var(--lbaic-settings-input-error);
        line-height: var(--lbaic-settings-lh-16);
      }
    }
  }

  &-reset {
    width: 24px;
    height: 24px;
    display: flex;
    cursor: pointer;
    border-radius: 6px;
    background-color: var(--lbaic-settings-multiselect-reset-bg);

    &:hover {
      --lbaic-settings-multiselect-reset-bg: var(--lbaic-settings-button-bg-hover);
    }

    &:active {
      --lbaic-settings-multiselect-reset-bg: var(--lbaic-settings-button-bg-active)
    }

    &-i {
      width: 16px;
      height: 16px;
      flex: 0 0 16px;
      margin: auto;
      fill: var(--lbaic-settings-multiselect-icon-fill);
    }
  }

  &-disabled {
    opacity: 0.4;
    pointer-events: none;
  }
}