/*------------- #OVERLAY-MENU --------------*/

body {
  &:before {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    background: rgba(47, 44, 44, .85);
    opacity: 0;
    transition: opacity .3s ease;
    z-index: -999;
  }

  &.overlay-enable:before {
    opacity: .8;
    z-index: 500;
  }
}

#overlay {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  display: none;
  background: rgba(47, 44, 44, .85);
  opacity: .8;
  z-index: 25;
}

.overlay_search {
  z-index: 100;
  position: fixed;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  overflow: hidden;
  display: flex;

  &:before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    margin: auto;
    background: rgba(37, 35, 35, 0.97);
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    border-radius: 100%;
    -webkit-transform: scale(0.04) translateY(9999px);
    transform: scale(0.04) translateY(9999px);
    overflow: hidden;
  }

  .form_search-wrap {
    width: 75%;
    opacity: 0;
    margin: auto;

    @media (max-width: 1024px) {
      padding: 0 15px;
    }

    @media (max-width: 768px) {
      width: 90%;
    }

    form {
      position: relative;
      transition: all .3s ease;

      .overlay_search-input {
        background-color: transparent;
        padding: 0 0 25px;
        border: none;
        border-bottom: 2px solid #707070;
        color: #707070;
        font-size: 24px;
        transition: all .3s ease;
        width: 100%;
        border-radius: 0;

        &:hover {
          border-bottom: 2px solid #fff;
          color: $font-color;

          & + .overlay_search-close {

            span {
              background: $font-color;
            }
          }

        }

        &:focus {
          border-bottom: 2px solid var(--primary-accent-color);
          color: $white-color;
          box-shadow: none;

          & + .overlay_search-close span {
            background-color: var(--primary-accent-color);
          }
        }

      }

      .overlay_search-close {
        width: 30px;
        height: 30px;
        position: absolute;
        display: block;
        right: -5px;
        top: 0;

        span {
          display: block;
          height: 2px;
          background: #707070;
          border-radius: 10px;
          margin: auto;
          width: 100%;
          transition: all .3s ease;
          top: 50%;
          position: absolute;

          &:first-of-type {
            -webkit-transform: rotate(-45deg);
            -moz-transform: rotate(-45deg);
            -o-transform: rotate(-45deg);
          }

          &:last-of-type {
            -webkit-transform: rotate(45deg);
            -moz-transform: rotate(45deg);
            -o-transform: rotate(45deg);
          }
        }
      }

    }
  }
}

.open .overlay_search {
  top: 0;

  &:before {
    -webkit-animation: menu-animation 0.8s ease-out forwards;
    animation: menu-animation 0.8s ease-out forwards;
  }

  .form_search-wrap {
    opacity: 1;
    -webkit-transform: translate3d(0, -100%, 0);
    transform: translate3d(0, -100%, 0);
    -webkit-transition: opacity 3s ease-out, -webkit-transform 1s ease-out;
    transition: opacity 1s ease-out, -webkit-transform .5s ease-out;
    transition: transform .5s ease-out, opacity 1s ease-out;
    transition: transform .5s ease-out, opacity 1s ease-out, -webkit-transform .5s ease-out;
    transition-delay: .5s;
  }
}

@-webkit-keyframes menu-animation {
  0% {
    opacity: 0;
    -webkit-transform: scale(0.04) translateY(300%);
    transform: scale(0.04) translateY(300%);
  }
  40% {
    -webkit-transform: scale(0.04) translateY(0);
    transform: scale(0.04) translateY(0);
    -webkit-transition: ease-out;
    transition: ease-out;
  }
  40% {
    -webkit-transform: scale(0.04) translateY(0);
    transform: scale(0.04) translateY(0);
  }
  60% {
    opacity: 1;
    -webkit-transform: scale(0.02) translateY(0px);
    transform: scale(0.02) translateY(0px);
  }
  61% {
    -webkit-transform: scale(0.04);
    transform: scale(0.04);
  }
  99.9% {
    height: 0;
    padding-bottom: 100%;
    border-radius: 100%;
  }
  100% {
    -webkit-transform: scale(2);
    transform: scale(2);
    height: 100%;
    padding-bottom: 0;
    border-radius: 0;
  }
}

@keyframes menu-animation {
  0% {
    opacity: 0;
    -webkit-transform: scale(0.04) translateY(300%);
    transform: scale(0.04) translateY(300%);
  }
  40% {
    -webkit-transform: scale(0.04) translateY(0);
    transform: scale(0.04) translateY(0);
    -webkit-transition: ease-out;
    transition: ease-out;
  }
  40% {
    -webkit-transform: scale(0.04) translateY(0);
    transform: scale(0.04) translateY(0);
  }
  60% {
    opacity: 1;
    -webkit-transform: scale(0.02) translateY(0px);
    transform: scale(0.02) translateY(0px);
  }
  61% {
    -webkit-transform: scale(0.04);
    transform: scale(0.04);
  }
  99.9% {
    height: 0;
    padding-bottom: 100%;
    border-radius: 100%;
  }
  100% {
    -webkit-transform: scale(2);
    transform: scale(2);
    height: 100%;
    padding-bottom: 0;
    border-radius: 0;
  }
}

.right-menu {
  position: fixed;
  right: 0;
  top: 0;
  max-width: 500px;
  height: 100%;
  z-index: 555;
  transition: all .4s ease;
  transform: translateX(100%);
  will-change: transform;
  background-color: $white-color;

  @media (max-width: 768px) {
    text-align: center;
  }

  @media (max-width: 570px) {
    max-width: 100%;
  }

  .ps {
    max-height: 100%;
  }

  .logo {
	@media (max-width: 570px) {
	  flex-direction: column;
	  text-align: center;
	}

	img {
	  @media (max-width: 570px) {
		margin-right: 0;
        margin-bottom: 15px;
	  }
	}
  }

  .login-btn-wrap .btn {
    @media (max-width: 570px) {
      float: none;
    }
  }

  .remember-wrap {
    @media (max-width: 570px) {
      display: block;
      margin-top: 20px;
    }
  }

  &.opened {
    transform: translateX(0%);

    .right-menu-wrap {
      .user-menu-close {
        transform: scale(1);
        opacity: 1;
      }
    }
  }

  .right-menu-wrap {
    padding: 80px 75px 30px;
    background-color: $white-color;

    @media (max-width: 570px) {
      padding: 30px 30px 15px;
    }
  }

  .user-menu-close {
    position: absolute;
    left: -36px;
    top: 83px;
    width: 70px;
    height: 70px;
    border: 3px solid #2f2c2c;
    border-radius: 50%;
    z-index: 35;
    transform: scale(0);
    opacity: 0;
    transition: all .3s ease;
    transition-delay: .3s;

    @media (max-width: 768px) {
      width: 50px;
      height: 50px;
      border-width: 3px;
      left: auto;
      right: 15px;
      top: 15px;
    }
  }

  .user-menu-content {
    width: 64px;
    height: 64px;
    border: 4px solid $white-color;
    border-radius: 50%;
    position: relative;
    display: block;
    background-color: var(--secondary-accent-color);

    @media (max-width: 768px) {
      width: 44px;
      height: 44px;
      border-width: 2px;
    }

    span {
      display: block;
      height: 3px;
      background: $white-color;
      border-radius: 10px;
      margin: auto;
      width: 50%;
      transition: all .3s ease;
      left: 25%;
      top: 46%;
      position: absolute;

      &:first-of-type {
        -webkit-transform: rotate(-45deg);
        -moz-transform: rotate(-45deg);
        -o-transform: rotate(-45deg);
      }

      &:last-of-type {
        -webkit-transform: rotate(45deg);
        -moz-transform: rotate(45deg);
        -o-transform: rotate(45deg);
      }
    }

  }

  .text {
    margin-bottom: 0;
  }

  .mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar,
  .mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,
  .mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar,
  .mCSB_scrollTools .mCSB_draggerRail,
  .mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar {
    background-color: var(--primary-accent-color);
  }

  .mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar {
    opacity: .85;
  }

  .mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,
  .mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar {
    opacity: .9;
  }

  .mCSB_scrollTools .mCSB_draggerRail {
    opacity: .5;
  }

  .widget {
    padding: 30px 75px 40px;
    margin-bottom: 0;

    @media (max-width: 570px) {
      padding: 15px 30px;
    }

    &:nth-child(even) {
      background-color: transparent;
    }

    &:nth-child(odd) {
      background-color: $border-color;
    }
  }

  .ps > .ps__scrollbar-y-rail > .ps__scrollbar-y {
    background-color: var(--primary-accent-color);
  }
}
