/*-------------- form-search -----------------*/
.form-search{
  width: 255px;
  position: relative;

  input[type="text"]{
    display: inline-block;
    height: rem(30px);
    width: 100%;
    padding-right: 38px;
    @include font(normal, normal, rem(14px), rem(28px), $color-dark-blue);
    padding: 5px 0 0 24px;
    margin: 0;
    border: 0;
    outline: 0;
    border-bottom: 1px solid $color-grey;
    background: transparent;
  }

  input[type="text"]::placeholder{font-weight: 300; color: $color-grey; opacity: 1;}
  input[type="text"]::-webkit-input-placeholder {font-weight: 300; color: $color-grey; opacity: 1;}
  input[type="text"]:-moz-placeholder {font-weight: 300; color: $color-grey; opacity: 1;}

  input[type="text"]:focus{
    border-color: $color-purple;
  }

  input[type="submit"],
  button{
    display: inline-block;
    width: 16px;
    height: 16px;
    background: transparent;
    position: absolute;
    left: 0;
    @include top-center;
    font-size: 0;
    border: 0;
    outline: 0;
    box-shadow: none;
    padding: 0;
    margin-top: 1px;
    cursor: pointer;
  }

  button .icon{
    width: 100%;
    height: 100%;
    fill: $color-grey;
  }

  &__close{
    width: 7px;
    height: 7px;
    position: absolute;
    right: 0;
    @include top-center;
    text-align: center;
    vertical-align: middle;
    margin-top: 3px;

    .ic-close-small,
    .ic-close{
      width: 100%;
      height: 100%;
      vertical-align: top;
      fill: $color-dark-blue;
    }

    .ic-close{display: none;}
  }

  &__close.active{
    display: inline-block;
    .ic-close-small{display: none;}

    .ic-close{
      display: inline-block;
      vertical-align: top;
    }
  }

  input[type="text"]:focus + button + &__close,
  input[type="text"]:focus + &__close{
    display: inline-block;
  }

  //&_white input[type="text"]::placeholder{color: $color-light-grey}
  //&_white input[type="text"]::-webkit-input-placeholder {color: $color-light-grey}
  //&_white input[type="text"]:-moz-placeholder {color: $color-light-grey}

  &_white input[type="text"]{color: #fff;}

  &_white input[type="text"],
  &_white input[type="text"]:focus{
    border-color: #fff;
  }

  &_white button .icon,
  &_white input[type="text"]:focus+button .icon{
    fill: #fff;
  }

  &_white &__close .ic-close-small{fill: #fff;}

  &_field  input[type="text"]{
    padding: 0 50px 0 20px;
    border: 1px solid $color-light-grey;
    border-radius: 15px;
    background: #fff;
  }

  //&_field input[type="text"]:focus{border-color: $color-light-grey;}

  &_field input[type="submit"],
  &_field button{
    left: auto;
    right: 15px;

    .ic-search{
      transform: scale(-1, 1);
      fill: $color-dark-blue;
    }
  }

  &_field &__close{
    width: 8px;
    height: 8px;
    right: 38px;
    margin-top: 0;
  }

  &_no-loop input[type="text"]{
    padding-left: 15px;
    padding-right: 15px;
  }
}

@media (max-width: 991px) {
  .form-search{
    width: 175px;
  }
}
