@import '../helpers/helpers';
@import '../components/download-buttons';
@import '../components/barcode';

.page_tradePro-discount {
  .page-header {
    margin-bottom: 1rem;

    &__intro {
      margin-top: 0;
      margin-bottom: 15px;
    }
  }

  .rewards-counter {
    position: inherit;
    margin-left: 10px;
  }

  .page-footer {
    width: 50%;
    margin: 0 auto 10px;
    display: block;

    &__title {
      margin: 30px 0;
    }

    &__actions {
      justify-content: flex-end;
      display: flex;

      .btn,
      .page-footer__copy {
        width: 50%;
      }

      .page-footer__copy {
        font-size: 1.125rem;
        text-align: center;
        align-self: center;

        .icon {
          color: $blue;
        }

        &:hover {
          cursor: pointer;

          .icon {
            svg {
              color: $blue-dark;
            }
          }
        }
      }
    }

    &__warning {
      @include heading-4;
      color: $warm-grey;
      padding-top: 20px;
      text-align: center;
    }

    .tradepro-frame {
      display: inline-block;
      font-weight: 500;
      text-align: center;
      white-space: nowrap;
      vertical-align: middle;
      border: 1px solid $gray;
      padding: 8px 15px;
      font-size: .875rem;
      line-height: 1.57143;
      border-radius: 3px;
      color: $gray-dark;
      width: 50%;

      &[disabled] {
        background: $white;
        color: $gray-dark;
        opacity: 1;
      }
    }
  }

  .already-installed {
    border-top: 1px solid $gray;
    padding-top: 30px;
    text-align: center;
  }

  .terms {
    border-bottom: 1px solid $gray;
    padding: 0;

    &__btn-accordion {
      @include primary-text;

      padding: 20px 0;
      color: $blue;
      cursor: pointer;

      .icon {
        margin-right: 10px;

        .fa-angle-down {
          .terms_expanded & {
            transform: rotate(180deg);
          }
        }
      }
    }

    &__btn-toggle {
      cursor: pointer;

      .terms:not(.terms_expanded) & {
        display: inline-block;
        padding-top: 4px;
      }
    }

    &__content {
      padding-bottom: 20px;

      .terms_expanded & {
        display: block;
        height: auto;
        padding-right: 8px;
      }
    }

    .terms__content {
      display: none;
    }

    &_expanded {
      .terms__content {
        display: block;
      }
    }
  }

  .download-section {
    padding-bottom: 30px;
  }

  .barcode {
    &-wrap {
      padding-top: 2.325rem;
    }

    &__header {
      text-align: center;

      &-user-name {
        padding-top: 15px;
      }

      &-title {
        padding-top: 10px;

        .barcode {
          &__header_name {
            text-transform: inherit;
          }
        }
      }
    }

    &__container {
      padding: 10px 0;

      svg {
        height: 100%;
      }
    }
  }
}

.copy-barcode_notification {
  & .notification {
    margin-bottom: 0;
    margin-top: 20px;
  }
}

@include media-breakpoint-down(sm) {
  .page_tradePro-discount {
    .page-footer {
      &__title {
        margin: 20px 0 10px;
      }

      &__actions {
        display: block;

        .page-footer__copy {
          width: 100%;
          text-align: center;
        }
      }

      &__warning {
        @include heading-6;
      }

      .tradepro-frame {
        width: 100%;
        margin-bottom: 15px;
      }
    }

    .barcode-wrap,
    .page-footer {
      width: 100%;
    }

    .already-installed {
      padding-top: 0;

      .btn {
        width: 100%;
      }
    }
  }
}

@include media-breakpoint-up(sm) {
  .page_tradePro-discount {
    .terms {
      &__btn-accordion {
        display: block;
      }
    }
  }
}

@include media-breakpoint-up(md) {
  .page_tradePro-discount {
    .barcode-wrap {
      width: 55%;
    }

    &.modal-open {
      .barcode-wrap {
        width: 100%;
      }
    }

    .already-installed {
      padding-top: 0;

      .page-footer {
        &__title {
          margin-bottom: 10px;
        }

        &__actions {
          display: block;

          .btn {
            width: 160px;
          }
        }
      }
    }
  }
}

@include media-breakpoint-up(xl) {
  .page_tradePro-discount {
    .already-installed {
      display: none;
    }
  }
}

