.elementor-widget-neuron-table-of-contents {
  &.m-neuron-toc--collapsed {
    .m-neuron-toc__toggle-button--collapse {
      display: none;
    }
  }

  &:not(.m-neuron-toc--collapsed) {
    .m-neuron-toc__toggle-button--expand {
      display: none;
    }
  }

  .elementor-widget-container {
    min-height: var(--box-min-height);
    border: var(--box-border-width, 1px) solid var(--box-border-color, #a4afb7);
    border-radius: var(--box-border-radius, 3px);
    background-color: var(--box-background-color);
    transition: min-height 0.4s;
    overflow: hidden;
  }

  .m-neuron-toc {
    &__header-title {
      font-size: 18px;
      margin: 0;
      color: var(--header-color);
    }

    &__header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: var(--box-padding, 20px);
      background-color: var(--header-background-color);
      border-bottom: var(--separator-width, 1px) solid
        var(--box-border-color, #a4afb7);
    }

    &__toggle-button {
      cursor: pointer;
      display: inline-flex;

      i {
        color: var(--toggle-button-color);
      }

      svg {
        height: 1em;
        width: 1em;
      }
    }

    &__spinner-container {
      text-align: center;
    }

    &__spinner {
      font-size: 2em;
    }

    &__body {
      padding: var(--box-padding, 20px);
    }

    &__list-wrapper {
      list-style: none;
      padding: 0;
      margin-bottom: 0;
    }

    &__list-item {
      margin-bottom: 0.5em;

      &.elementor-item-active {
        font-weight: bold;
      }

      .m-neuron-toc__list-wrapper {
        margin-top: 0.5em;
        margin-left: var(--nested-list-indent, 1em);
      }
    }

    &__list-item-text:hover {
      color: var(--item-text-hover-color);
      text-decoration: var(--item-text-hover-decoration);
    }

    &__list-item-text.elementor-item-active {
      color: var(--item-text-active-color);
      text-decoration: var(--item-text-active-decoration);
    }

    &__list-item-text-wrapper {
      display: flex;
      align-items: center;
    }

    &__list-item-text-wrapper i,
    &__list-item-text-wrapper:before {
      margin-right: 8px;
      color: var(--marker-color);
    }

    &__list-item-text-wrapper {
      i {
        font-size: var(--marker-size, 0.5em);
      }

      &:before {
        font-size: var(--marker-size, 1em);
      }
    }

    &--content-ellipsis .m-neuron-toc__list-item-text {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    &__list-items--collapsible
      > .m-neuron-toc__list-wrapper
      > .m-neuron-toc__list-item
      > .m-neuron-toc__list-wrapper {
      display: none;
    }

    &__heading-anchor {
      position: absolute;
    }

    &__body .m-neuron-toc__list-item-text {
      color: var(--item-text-color);
      text-decoration: var(--item-text-decoration);

      &:hover {
        color: var(--item-text-hover-color);
        text-decoration: var(--item-text-hover-decoration);
      }

      &.elementor-item-active {
        color: var(--item-text-active-color);
        text-decoration: var(--item-text-active-decoration);
      }
    }
  }
}

ol.m-neuron-toc__list-wrapper {
  counter-reset: item;

  .m-neuron-toc__list-item {
    counter-increment: item;
  }

  .m-neuron-toc__list-item-text-wrapper:before {
    content: counters(item, ".") ". ";
  }
}

@media only screen and (max-width: $screen-md-max) {
  .m-neuron-toc--minimized-on-tablet .m-neuron-toc__body {
    display: none;
  }
}

@media only screen and (max-width: $screen-sm-max) {
  .m-neuron-toc--minimized-on-mobile .m-neuron-toc__body {
    display: none;
  }
}
