.table {
  border: 1px solid $gray;
  padding-top: 20px;
  padding-left: 20px;

  & + & {
    margin-top: 20px;
  }

  &__content {
    font-size: 1rem;
  }

  &__content-heading {
    @include heading-4;
    display: block;
    margin-bottom: 10px;
  }

  &__actions {
    .btn-secondary {
      display: block;
    }

    .btn-secondary + .btn-secondary {
      margin-top: 20px;
    }

    .btn-secondary + .rbn {
      margin-top: 35px;
    }
  }

  &_payment {
    .btn-secondary + .rbn {
      margin-top: 35px;
    }
  }
}

.order-history-table {
  border: 1px solid $gray;
  display: flex;
  flex-wrap: wrap;

  & + & {
    margin-top: 20px;
  }

  &__content {
    font-size: 1rem;
    padding-top: 20px;
    padding-left: 20px;
  }

  &__actions {
    display: flex;
    flex-direction: column;
    padding-right: 20px;

    .btn {
      margin-bottom: 30px;

      &:last-child {
        margin-bottom: 0;
      }
    }
  }

  &__transactions {
    padding: 0 20px 20px;
    margin-top: -20px;
  }

  &__footer {
    border-top: 1px solid $gray;
    width: 100%;

    .table__content-heading {
      margin: 0 30px 0 0;
    }
  }

  &__total {
    background: $gray-light;
    display: flex;
    align-items: center;
    padding: 10px 20px;

    &-price {
      color: $blue-dark;
      font-size: 1.5rem;
      font-weight: 600;
    }
  }
}

.order-details-table {
  .order-history-table__content {
    &_header-section {
      font-size: 1rem;
    }
  }

  & + & {
    border-top: 0 none;
    margin-top: 0;
  }
}

@include media-breakpoint-down(sm) {
  .table {
    padding-right: 20px;

    &__content {
      .col {
        @include make-col(12);
        margin-bottom: 20px;
      }
    }

    &__actions {
      border-top: 1px solid $gray;
      padding: 30px 0;
      text-align: center;

      .btn-secondary {
        @include button-full;
      }
    }
  }

  .order-history-table {
    &__content {
      width: 100%;
      padding-right: 20px;

      .col {
        @include make-col(12);
        margin-bottom: 20px;
      }
    }

    &__actions {
      order: 2;
      padding-top: 30px;
      padding-bottom: 30px;
      padding-left: 20px;
      width: 100%;

      .btn {
        @include button-full;
      }
    }

    &__transactions {
      margin-top: 0;
    }

    &__footer {
      border-bottom: 1px solid $gray;
    }
  }

  .order-details-table {
    &__col_empty {
      display: none;
    }
  }
}

@include media-breakpoint-up(md) {
  .table {
    display: flex;
    flex-wrap: wrap;
    padding-bottom: 20px;

    &__content {
      // keep '%' as workaround for IE11 bug - https://github.com/philipwalton/flexbugs#flexbug-4
      flex: 1 0 0%;
      min-width: 0;
    }

    &__actions {
      border-left: 1px solid $gray;
      padding: 0 30px;
      display: flex;
      flex-direction: column;
      justify-content: center;
    }

    &_payment {
      .btn-secondary {
        min-width: 130px;
      }
    }
  }

  .order-history-table {
    &__content {
      flex: 1 0 0%;
      padding-bottom: 20px;

      .table__content {

        &-date {
          white-space: nowrap;
        }

        &-time {
          display: block;
        }
      }
    }

    &__actions {
      padding-top: 20px;
      padding-bottom: 20px;
    }
  }

  .order-details-table {
    .order-history-table__content {
      font-size: .875rem;
      padding-right: 20px;
    }
  }
}

@include media-breakpoint-only(md) {
  .table {
    &_profile {
      .btn-secondary {
        min-width: 195px;
      }
    }
  }

  .order-history-table {
    &__actions {
      .btn {
        width: 164px;
      }
    }
  }
}

@include media-breakpoint-up(lg) {
  .table {
    &_profile {
      .btn-secondary {
        min-width: 225px;
      }
    }
  }

  .order-history-table {
    &__actions {
      .btn {
        width: 186px;
      }
    }
  }
}

@include media-breakpoint-down(md) {
  .order-history-table {
    &__actions {
      .btn {
        margin-bottom: 20px;
      }
    }
  }
}
