.selector-box {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-$baseline * 0.5);
}

.selector-box--active {
  background: currentColor;
  border-radius: $border-radius--l;
  border: 1px solid;
  color: $color--white;
  margin-top: $baseline * 1.5;
  max-height: $baseline * 18;
  opacity: 1;
  padding: 15px 0;
  pointer-events: auto;
  position: absolute;
  transform: translateY(0);
  transition: opacity $transition-duration--fast,
    visibility $transition-duration--fast, transform $transition-duration--fast;
  width: 100%;
  z-index: 6;

  // Exceptions for the header
  &.selector-box--header {
    @include font-style(
      $header-selector-content-active-font-style,
      $header-selector-content-active-font-style--l
    );
    border: none;
    color: $header-selector-content-active-background-color;
    padding: 20px 0;
    width: 100%;

    .selector-box__pointer {
      border: none;

      &:after {
        content: none;
      }
    }

    @include viewport--l {
      margin-top: $baseline * 2.1;
      max-height: $baseline * 25;

      .selector-box__list {
        max-height: 190px;
        padding: 0 30px;
      }

      .selector-box__item {
        padding: 10px 0;
      }
    }
  }
}

.selector-box__pointer {
  background: currentColor;
  border-radius: $border-radius;
  border: 1px solid;
  display: block;
  height: 26px;
  position: absolute;
  top: $baseline * -0.6;
  transform: rotate(45deg);
  width: 26px;

  &:after {
    background-color: $color--white;
    content: '';
    height: 25px;
    left: -4px;
    position: absolute;
    top: 4px;
    transform: rotate(-45deg);
    width: 40px;
  }
}

.selector-box__list {
  -webkit-overflow-scrolling: touch;
  border-radius: $border-radius;
  max-height: 135px;
  overflow-y: scroll;
  padding: 0 20px;
  transition: max-height 0s ease;
}

.selector-box__item {
  padding: 5px 0;
}

a.selector-box__option {
  text-decoration: none;
  transition: color $transition-duration--fast;

  &:hover {
    text-decoration: none;
  }
}

.selector-box-trigger {
  .icon {
    transition: transform $transition-duration--fast;
    transform-origin: center;
  }
}

.selector__dropdown--active {
  .icon {
    transform: rotate(180deg);
  }
}

@include selector-color-mapping;
