/*------------------- 3.1. Preloader -------------------*/
.preloader {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 999;
  background-color: $title-color;
}

.preloader-inner {
  width: 40px;
  height: 40px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.loader {
  width: 150px;
  height: 150px;
  border: 1px #fff solid;
  position: absolute;
  left: 50%;
  top: 50%;
  margin: -75px 0 0 -75px;
  border-radius: 50%;

  &.custom-loader {
    border: medium none;
    left: 0;
    margin: 0 auto;
    right: 0;
  }

  .loading {
    font-size: 10px;
    position: absolute;
    width: 100%;
    text-align: center;
    line-height: 14px;
    font-family: $title-font;
    left: 0;
    top: 50%;
    margin-top: 20px;
    color: #fff;
    font-weight: bold;
    text-transform: uppercase;
  }

  .line {
    width: 10px;
    height: 2px;
    background: #fff;
    position: absolute;

    &:nth-child(1) {
      left: 16px;
      top: 50%;
      margin-top: -1px;
    }

    &:nth-child(2) {
      transform: rotate(45deg);
      left: 33px;
      top: 33px;
    }

    &:nth-child(3) { 
      top: 16px;
      left: 50%;
      width: 2px; 
      height: 10px;
    }

    &:nth-child(4) {
      transform: rotate(135deg);
      right: 33px;
      top: 33px;
    }

    &:nth-child(5) {
      right: 16px;
      top: 50%;
      margin-top: -1px;
    }
    &:nth-child(6) {
      transform: rotate(45deg);
      right: 33px;
      bottom: 33px;
      background: $theme-color;
    }
  }
}



.loader-circle-1 {
  width: 138px;
  height: 138px;
  left: 5px;
  top: 5px;
  border: 1px #fff solid;
  border-radius: 50%;
  position: absolute;
  border-right-color: transparent;
  animation: spin 3s linear infinite;
}

.loader-circle-2 {
  width: 126px;
  height: 126px;
  left: 5px;
  top: 5px;
  border: 1px transparent solid;
  border-radius: 50%;
  position: absolute;
  border-right-color: $theme-color;
  animation: spin 5s linear infinite;
}

.loader .subline {
  position: absolute;
  width: 3px;
  height: 2px;
  background: #fff;
}

.loader .subline:nth-child(7) { 
  transform: rotate(22.5deg);
  left: 21px;
  top: 50px;
}

.loader .subline:nth-child(8) {
  transform: rotate(67.5deg);
  left: 50px;
  top: 21px;
}

.loader .subline:nth-child(9) {
  transform: rotate(112.5deg);
  right: 50px;
  top: 21px;
}

.loader .subline:nth-child(10) {
  transform: rotate(157.5deg);
  right: 21px;
  top: 50px;
}

.loader .subline:nth-child(11) {
  transform: rotate(22.5deg);
  right: 20px;
  bottom: 49px;
  background: $theme-color;
}

.loader .needle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px #fff solid;
  position: absolute;
  left: 50%;
  top: 50%;
  margin: -8px 0 0 -8px;
  z-index: 1;
  animation: pegIt 3s infinite ease-in-out; 
}

.loader .needle:before {
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 3.5px 50px 3.5px 0;
  border-color: red;
  position: absolute;
  right: 50%;
  top: 50%;
  margin: -3.5px 0 0 0;
  border-radius: 0 50% 50% 0;
}

@keyframes pegIt {
  0% {
    transform: rotate(0deg);
  }

  16% {
    transform: rotate(75deg);
  }

  25% {
    transform: rotate(55deg);
  }

  30% {
    transform: rotate(90deg);
  }

  36% {
    transform: rotate(170deg);
  }

  42% {
    transform: rotate(150deg);
  }

  50% {
    transform: rotate(227deg);
  }

  100% {
    transform: rotate(0deg);
  }
}

@-webkit-keyframes pegIt {
  0% {
    -webkit-transform: rotate(0deg);
  }

  16% {
    -webkit-transform: rotate(75deg);
  }

  25% {
    -webkit-transform: rotate(55deg);
  }

  30% {
    -webkit-transform: rotate(90deg);
  }

  36% {
    -webkit-transform: rotate(170deg);
  }

  42% {
    -webkit-transform: rotate(150deg);
  }

  50% {
    -webkit-transform: rotate(227deg);
  }

  100% {
    -webkit-transform: rotate(0deg);
  }
}


@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}