@import '../helpers/helpers';
@import '../components/my-account/orders-nav';
@import '../libs/flatpickr';
@import '../components/loader';

.my-orders {
  padding-top: 0;

  .notification {
    &_info-message {
      border: 0;
      text-align: center;
      margin: 0;
      background: $virid-darker;
      color: $white;
      padding: 4px 5px;
      font-size: .75rem;
    }
  }

  &__wrap {
    padding-top: 16px;
  }

  &__title {
    margin-bottom: 0;
    text-align: left;
  }

  .sort-orders {
    margin-top: 16px;

    .form-row {
      padding: 0;
      margin: 0;

      &__label {
        margin-bottom: 8px;
        padding-right: 0;
        padding-left: 0;
      }

      &__field {
        padding-right: 0;
        padding-left: 0;
      }
    }
  }

  .load-more-wrap {
    margin-bottom: 0;
    margin-top: 24px;

    @media (hover: none) {
      .btn-primary {
        &:hover {
          color: $white;
          background-color: $blue;
          border-color: $blue;
        }

        &:focus {
          color: $blue;
          background-color: $white;
          border-color: $blue;
        }
      }
    }
  }

  .active-orders {
    &__item {
      border-radius: 4px;
      border: 1px solid $gray;

      &:first-child {
        margin-top: 0;
      }
    }
  }

  .sort-orders .form-row__field select {
    transition: all .3s;
  }
}

.empty-orders {
  margin-top: 24px;
  padding: 40px 24px;
  background: $ma-white;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  &__title {
    font-size: 20px;
    font-style: normal;
    font-weight: 500;
    line-height: 32px;
    margin-bottom: 0;
  }

  &__image {
    margin-top: 16px;
  }

  &__btn {
    margin-top: 16px;
  }
}

@include media-breakpoint-up(sm) {
  .my-orders {
    &__sorts {
      margin-top: 24px;
      display: flex;
      justify-content: space-between;
      grid-gap: 16px;
    }

    .flatpickr-datepicker,
    .sort-orders {
      margin-top: 0;
    }

    .flatpickr-datepicker {
      width: 65%;
    }

    &__wrap {
      padding-top: 24px;
    }

    .active-orders {
      margin-top: 16px;
    }
  }

  .empty-orders {
    &__title {
      font-size: 24px;
    }
  }
}

@include media-breakpoint-up(md) {
  .my-orders {
    padding-bottom: 70px;

    .flatpickr-datepicker,
    .sort-orders {
      width: 100%;
    }

    &__wrap {
      padding-top: 40px;
    }
  }
}

@include media-breakpoint-up(lg) {
  .my-orders {
    &__sorts {
      max-width: 580px;
    }
  }
}

@include media-breakpoint-up(xl) {
  .my-orders {
    &__header {
      display: grid;
      grid-template-columns: auto 1fr;
      align-items: center;
    }

    &__sorts {
      margin-top: 0;
      width: 100%;
      max-width: 822px;
      justify-content: flex-end;
      margin-left: auto;
    }

    .nav-orders {
      grid-column: span 2;
    }

    .flatpickr-datepicker__label {
      flex-wrap: nowrap;
      display: flex;
      white-space: nowrap;
      margin-bottom: 0;
      margin-right: 16px;
    }

    .flatpickr-datepicker,
    .sort-orders .form-row {
      display: flex;
      align-items: center;
      flex-wrap: nowrap;
      justify-content: flex-end;
    }

    .sort-orders {
      flex: 80%;

      .form-row__label {
        width: auto;
        white-space: nowrap;
        margin-bottom: 0;
        margin-right: 16px;
      }
    }

    .flatpickr-datepicker__field,
    .form-row__field {
      width: 100%;
      max-width: 282px;
    }
  }

  .empty-orders {
    margin-top: 40px;
  }
}
