$widget-prefix: 'x-buy-button-widget';
$widget-class: '.' + $widget-prefix;

@import "../functions/class-name";

@import "../mixins/misc";
@import "../mixins/game-logo";
@import "../mixins/payment-button";
@import "../mixins/tips-list";
@import "../mixins/spinner";
@import "../mixins/error-message";
@import "../mixins/payment-method";
@import "../mixins/tether";

#{$widget-class} {
  @include normalize;

  &__light {
    background: #ffffff;
  }

  &__dark {
    background: #000;
  }

  border-radius: 6px;
  overflow: hidden;
  font-size: 18px;
  line-height: 1.3em;
  position: relative;
  z-index: 1;

  .spinner {
    @include spinner;
  }

  .error-message {
    @include error-message;
  }

  &-button-block {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    padding-right: 4px;
    padding-left: 4px;
    padding-bottom: 4px;
    flex-direction: column;

    &__light {
      background-color: #ffffff;
    }

    &__dark {
      background-color: #000;
    }

  }

  &-gradient-block {
    position: absolute;
    left: 0;
    right: 0;
    height: 130px;
    top: -30px;

    &__light {
      background-image: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #fff 22%);
    }

    &__dark {
      background-image: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, #000 25%);
    }
  }

  .formatted-currency {
    white-space: nowrap;

    &-ruble {
      display: inline-block;
      font-size: .75em;
      height: 1em;
      vertical-align: baseline;
      margin-left: .1em;

      svg {
        height: 1em;
        width: 1em;
        fill: currentColor;

        g {
          fill: currentColor;
        }
      }
    }
  }
}

#{$widget-class}#{$widget-class}__tiny {
  #{$widget-class}-game-logo {
    @include game-logo;
  }

  #{$widget-class}-game-name {
    position: relative;
    z-index: 1;
    display: block;
    margin-right: auto;
    margin-left: auto;
    margin-bottom: 4px;

    font-size: 14px;
    max-width: 450px;
    text-align: center;
    font-weight: 700;
    line-height: 20px;
    vertical-align: middle;
    transition: opacity 200ms;
    opacity: 1;

    &__light {
      color: #4a4a4a;
    }

    &__dark {
      color: #ffffff;
    }

    &__moved {
      opacity: 0;
    }
  }

  #{$widget-class}-plus-icon {
    font-size: 110%;
    position: relative;
    top: 0.05em;
  }

  #{$widget-class}-tip {
    position: relative;
    z-index: 1;
    display: flex;
    overflow: hidden;
    height: 26px;
    justify-content: center;
    align-self: center;
    font-size: 12px;
    cursor: pointer;

    transition: transform 200ms;
    transform: translateX(0px) translateY(0px) translateZ(0px);

    &__light {
      color: #6f6f6f;
    }

    &__dark {
      color: #acacac;
    }

    &:hover {
      opacity: 0.65;
    }

    &__moved {
      transform: translateX(0px) translateY(-140px) translateZ(0px);
    }

    &__disable {
      cursor: default;
      &:hover {
        opacity: 1;
      }
    }

    &-txt {
      display: flex;
      justify-content: center;
      align-items: center;
      line-height: 20px;
    }

    &-button, &-img {
      display: inline-block;
    }

    &-plus-icon {
      margin-bottom: 2px;
      vertical-align: middle;
    }

    &-img {
      height: 16px;
      vertical-align: middle;
      text-align: center;
      margin-right: 3px;

      &__light {
        color: #6f6f6f;

        #{$widget-class}-tip-icon {
          fill: #6f6f6f;
        }
      }

      &__dark {
        color: #acacac;

        #{$widget-class}-tip-icon {
          fill: #acacac;
        }
      }

      #{$widget-class}-thank-icon {
        fill: #e96b6b;
      }
    }
  }

  #{$widget-class}-tips-list-block {
    display: flex;
    opacity: 1;
    transition: opacity 200ms;

    &__hide {
      display: none;
      opacity: 0;
    }
  }

  #{$widget-class}-thank {
    color: #6f6f6f;
    font-size: 14px;
    display: inline-block;
    text-align: center;
    cursor: pointer;
    overflow: hidden;
    width: 100%;

    &-text, &-img {
      display: inline-block;
    }
  }

  #{$widget-class}-payment-button {
    @include payment-button;
    height: 44px;
    width: 100%;

    #{$widget-class}-tips-list {
      background-color: #fff;
      height: 48px;
      width: 100%;
      font-size: 14px;
    }

    &:active {
      box-shadow: inset 0 3px 5px rgba(0, 0, 0, .15);
    }
  }

  #{$widget-class}-tips-list {
    @include tips-list;
  }
}

#{$widget-class}#{$widget-class}__tiny {
  width: 220px;
  height: 220px;
}


