/*
 * https://github.com/morethanwords/tweb
 * Copyright (C) 2019-2021 Eduard Kuzmenko
 * https://github.com/morethanwords/tweb/blob/master/LICENSE
 */

.popup-payment {
  $parent: ".popup";

  #{$parent} {
    &-container {
      padding: 0;
      width: 26.25rem;
      max-width: 26.25rem;
      
      max-height: unquote('min(100%, 43.5rem)');
      border-radius: $border-radius-huge;
    }

    &-header {
      height: 3.5rem;
      margin: 0;
      padding: 0 1rem;
    }
  }

  &.is-loading .popup-container {
    min-height: 26.25rem;
  }

  .scrollable {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
  }

  hr {
    display: block !important;
    margin: .5rem 0 !important;
    padding: 0 !important;
  }

  .input-field {
    --height: 3rem;
    margin: .75rem .5rem 0;

    &-input {
      --padding: .75rem;
    }
  }

  .input-fields-row .input-field {
    margin-top: 1.25rem;
  }

  .sidebar-left-section {
    padding: 0 !important;

    &-name + .input-field,
    &-name + .input-fields-row .input-field {
      margin-top: .75rem;
    }

    .row {
      margin-top: .5rem;
    }

    &-content {
      margin: 0 .5rem !important;
    }

    // &-container {
    //   &:last-child .sidebar-left-section {
    //     margin-bottom: 0;
    //   }
    // }
  }

  .select-wrapper {
    max-height: 10rem;
    box-shadow: var(--menu-box-shadow);

    li {
      grid-template-columns: calc(26px + 2rem) 1fr;
      height: 3rem;
    }
  }

  .payment-verification {
    width: 100%;
    height: 40rem;
    max-height: 100%;
    border: none;
    flex: 1 1 auto;
  }

  .row {
    border-radius: $row-border-radius;
  }
}

.payment-item {
  width: 100%;
  padding: 0 1.25rem;

  &-details {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    // height: 6.25rem;

    // max-height: 100px;
    overflow: hidden;
    flex: 0 0 auto;

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

    &-photo {
      width: 6.25rem;
      height: 6.25rem;
      flex: 0 0 auto;
      border-radius: $border-radius-medium;
      margin-right: 1rem;
      // background-color: var(--secondary-color);

      .media-photo {
        border-radius: inherit;
      }
    }

    &-lines {
      flex: 1 1 auto;
      display: flex;
      flex-direction: column;

      &-title {
        font-weight: var(--font-weight-bold);
        // font-size: var(--font-size-20);
        // line-height: var(--line-height-20);
        // margin: 5px 0;

        font-size: var(--font-size-16);
        line-height: var(--line-height-16);
      }

      &-description,
      &-bot-name {
        // flex: 1 1 auto;
        font-size: var(--font-size-14);
        line-height: 1.25rem;
        // color: var(--secondary-text-color);

        // @include text-overflow(false);
      }

      &-bot-name {
        color: var(--secondary-text-color);
        // flex: 0 0 auto;
      }
    }
  }

  &-prices {
    display: flex;
    flex-direction: column;
    margin: 1rem .25rem .5rem;

    &-price {
      color: var(--secondary-text-color);
      font-weight: 500;
      display: flex;
      justify-content: space-between;
      line-height: 1.1875rem;

      & + & {
        margin-top: 1.5rem;
      }

      &.is-total {
        color: var(--primary-text-color);
      }
    }
  }

  &-tips {
    display: flex;
    justify-content: space-between;
    margin: .75rem -.5rem 1.5rem;

    &-tip {
      --background-intensity: .1;
      flex: 1 1 auto;
      text-align: center;
      height: 2.5rem;
      border-radius: 1.25rem;
      background-color: rgba(84, 190, 97, var(--background-intensity));
      color: #3ba748;
      font-weight: var(--font-weight-bold);
      font-size: var(--font-size-16);
      line-height: 2.5rem;

      @include animation-level(2) {
        transition: color .1s ease-in-out, background-color .1s ease-in-out;
      }

      & + & {
        margin-left: .5rem;
      }

      &:not(.active) {
        @include hover() {
          --background-intensity: .3;
        }
      }

      &.active {
        --background-intensity: 1;
        color: #fff;
      }
    }

    &-input {
      color: inherit !important;
      font-weight: inherit !important;
      // text-align: right;
      display: inline;
    }
  }

  &-row {
    margin: 0 .5rem;
    padding-top: 0;
    padding-bottom: 0;
  }

  &-method-row {
    .media-photo {
      border-radius: $border-radius-medium;
    }
  }

  &-pay {
    flex: 0 0 auto;
    width: auto;
    height: 3rem;
    margin: 1rem;
    text-transform: uppercase;
  }

  &-preloader-container {
    position: relative;
    flex: 1 1 auto;
  }
}
