$overlay-height: 150px;

@keyframes searchAnimation {
  0% {
    display: none;
    opacity: 0;
  }
  1% {
    opacity: 0.3;
    display: block;
    top: 13px;
    height: 58px;
    left: calc(100% - 302px);
    right: 302px;
  }
  100% {
    opacity: 1;
    height: $overlay-height;
    top: 0;
    left: 0;
    right: 0;
  }
}

@keyframes closeButton {
  0% {
    opacity: 0;
  }

  70% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

.c-search-overlay {
  z-index: 1000;
  height: $overlay-height;
  background: $brand-grey--lighter;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;

  display: flex;
  justify-content: space-between;
  align-items: center;

  &-enter {
    opacity: 0.3;
    top: 13px;
    height: 58px;
    left: calc(100% - 302px);
    right: 302px;

    transition: all 0.3s ease;

    &-active {
      opacity: 1;
      height: $overlay-height;
      top: 0;
      left: 0;
      right: 0;
    }
  }

  &-exit {
    transition: all 0.3s ease;

    &-active {
      @extend .c-search-overlay-enter;
      opacity: 0;
    }
  }

  &__container {
    padding: 0;
    position: relative;
  }

  &__close-button {
    position: absolute;
    top: $spacing--small;
    right: -($spacing--large + 36px);
    width: 36px;
    height: 36px;
    color: $brand-color--dark;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;

    animation: closeButton 0.7s;

    .c-icon {
      width: 100%;
      height: 100%;
    }
  }
}
