@import '../helpers/helpers';

.page_track_your_order {
  .container--track-your-order {
    border: 1px solid $gray;
    padding: 35px;
    margin-top: 30px;
    margin-bottom: 50px;

    .page {
      &-header,
      &-content {
        max-width: 720px;
        margin: 0 auto;
      }

      &-header {
        text-align: center;
        margin-bottom: 2rem;

        p {
          font-size: 1rem;
          margin-bottom: 0;
        }
      }
    }

    .form-track-order {
      max-width: 390px;
      margin: 0 auto;

      .form-row__label {
        display: inline-block;
        vertical-align: top;
        padding: 7px 5px 7px 0;
        width: 140px;
        margin-bottom: 0;
        font-weight: 500;

        &::before {
          display: none;
        }
      }

      > .form-row__label {
        display: block;
        width: 100%;
        color: $warm-grey;
        font-size: .875rem;
        margin-bottom: 5px;
      }

      .tbx {
        // sass-lint:disable no-vendor-prefixes
        &::-webkit-outer-spin-button,
        &::-webkit-inner-spin-button {
          -webkit-appearance: none;
          margin: 0;
        }

        &[type='number'] {
          -moz-appearance: textfield;
        }
      }

      .form-row {
        margin: 0 0 5px;

        &.form-claim__order-num {
          position: relative;
        }
      }

      .form-row__field {
        display: inline-block;
        vertical-align: top;
        max-width: 250px;
        padding: 0;
      }

      .form-row__action {
        .form-row__field {
          display: block;
          max-width: 100%;
        }

        &::before {
          display: none;
        }
      }

      .form-row__error {
        margin-top: 5px;
        font-size: 14px;
        line-height: 1.5;
        color: $red;
        padding-left: 140px;
      }
    }

    &.click-collect,
    &.order-tracking {
      margin-bottom: 0;

      h2 {
        text-align: center;
      }
    }

    &.click-collect {
      display: flex;
      flex-direction: column;
      align-items: center;

      button:not(:last-child) {
        margin-bottom: 10px;
      }

      + .order-tracking {
        h2 {
          display: block;
        }
      }

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

        &:before {
          content: none;
        }

        .form-row__field {
          padding: 0;
        }
      }

      p {
        padding: 0 15%;
        text-align: center;
        margin-bottom: 1.5rem;
      }
    }

    &.order-tracking {
      h2 {
        display: none;
      }
    }
  }

  .icon-info-component {
    font-size: 1.1428rem;
    width: 18px;

    &:hover {
      [data-prefix='fas'] {
        display: inline-block;
      }
    }
  }

  .tooltip {
    z-index: 1;

    .tooltip-inner {
      background: $gray-bg;
      box-shadow: 0 2px 4px 0 $black-transparent30;
      border: 1px solid $warm-grey;
      border-radius: 3px;
      color: $gray-dark;
      font-size: .875rem;
      font-weight: 500;
      text-align: left;
      // sass-lint:disable no-important
      max-width: 230px !important;
      padding: 10px !important;
    }

    .arrow {
      &::after {
        position: absolute;
        content: '';
        border: .4rem solid transparent;
        right: -1px;
        border-left: 0;
        border-right-color: $gray-bg;
      }
    }

    &.bs-tooltip-left {
      .arrow {
        &::after {
          position: absolute;
          content: '';
          border: .4rem solid transparent;
          left: -1px;
          border-right: 0;
          border-left-color: $gray-bg;
        }
      }
    }
  }
}

@include media-breakpoint-up(sm) {
  .page_track_your_order {
    .icon-info-component {
      position: absolute;
      right: -25px;
      top: 20px;
    }
  }
}

@include media-breakpoint-down(sm) {
  .page_track_your_order {
    .container--track-your-order {
      border: 0;
      padding: 20px;
      margin-top: 0;
      margin-bottom: 40px;

      .page-content {
        .form-row {
          padding-left: 0;
          padding-right: 0;
        }
      }
    }
  }
}

@include media-breakpoint-down(xs) {
  .page_track_your_order {
    .container--track-your-order {
      .form-track-order {
        max-width: inherit;

        .form-row__label {
          display: inline-block;
          width: auto;
          padding: 5px 5px 5px 0;
          margin-bottom: 0;
        }

        .form-row__field {
          display: block;
          max-width: 100%;
        }

        .form-row__error {
          padding-left: 0;
        }
      }
    }

    .icon-info-component {
      display: inline-block;
      vertical-align: top;
      position: relative;
      right: auto;
      transform: initial;
      margin-top: 6px;
    }

    .tooltip {
      .tooltip-inner {
        max-width: 155px !important;
        font-size: .875rem;
      }
    }
  }
}
