.side-nav-sticky {
  background: $color--white;
  margin: 0 -25px;
  padding: 0 25px;
  top: 0;
  z-index: 1;
  position: relative;

  @include viewport--m {
    margin: 0 -50px;
    padding: 0 50px;
  }

  @include viewport--l {
    margin: 0;
    padding: 0;
    top: 40px;
    position: sticky;
  }
}

.side-nav-sticky--is-sticky {
  position: fixed;
  width: 100%;
}

.side-nav-sticky__header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-height: $baseline * 5;
  transition: opacity 0.3s;
  z-index: 1;

  @include viewport--l {
    min-height: $baseline * 3;
    padding-bottom: $spacing--s;
  }

  svg {
    fill: $color-brand--one;
  }

  // Animates the divider
  &:after {
    transition: opacity 0.3s;
    content: '';
    opacity: 0;
  }
}

.side-nav-sticky__list {
  counter-reset: li;
  list-style: none;
  -ms-overflow-style: -ms-autohiding-scrollbar; // edge hide scrollbar
  overflow-y: scroll;
  scrollbar-width: none; // firefox hide scrollbar
  &::-webkit-scrollbar {
    display: none; // chrome, opera, safari hide scrollbar
  }
  z-index: 1;

  &[data-rs-collapsible-content='expanded'] {
    max-height: $baseline * 30 !important;

    @include viewport--l {
      max-height: unset;
    }
  }

  // Animates the gradient
  &:after {
    transition: opacity 0.3s linear;
    content: '';
    opacity: 0;
  }
}

.side-nav-sticky__list-item {
  border-bottom: 1px solid returnColorCSSVar('brand-tertiary-tint-80');
  cursor: pointer;
  counter-increment: li;
  min-height: $baseline * 4;
  padding: 15px 5px 15px 23px;
  @include viewport--l {
    padding: $baseline 5px 9px 27px;
  }
  position: relative;

  &:last-child {
    border-bottom: none;
    margin-bottom: $baseline;
    @include viewport--l {
      margin-bottom: unset;
    }
  }

  &:before {
    color: returnColorCSSVar('brand-primary');
    content: counter(li) '.' ' ';
    display: inline-block;
    left: 0;
    position: absolute;
  }

  a {
    text-decoration: none;
    transition: all 0.3s;
  }

  &:hover {
    a,
    &:before {
      color: returnColorCSSVar('brand-secondary');
      transition: all 0.3s;
    }
  }

  &.is-active {
    a,
    &:before {
      color: returnColorCSSVar('brand-secondary');
      transition: all 0.3s;
    }
  }
}
