.nut-numberkeyboard {
  &-close-icon {
    width: $icon-size-18;
    height: $icon-size-18;
  }

  &-delete-icon {
    width: scale-px(28px);
    height: scale-px(28px);
  }

  width: 100%;
  padding: $numberkeyboard-padding;
  user-select: none;
  background-color: $numberkeyboard-background-color;

  &-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    /* #ifndef dynamic*/
    box-sizing: content-box;
    /* #endif */
    padding: $popup-title-padding;
    color: $color-title;
    font-size: $popup-title-font-size;

    &-title {
      color: $color-title;
      display: inline-block;
      font-size: $popup-title-font-size;
    }

    &-close {
      position: absolute;
      display: block;
      right: 0;
      top: 50%;
      transform: translateY(-50%);
      padding: $numberkeyboard-header-close-padding;
      color: $numberkeyboard-header-close-color;
      font-size: $numberkeyboard-header-close-font-size;
      background-color: $numberkeyboard-header-close-background-color;
      border: none;
      cursor: pointer;
    }
  }

  &-body {
    display: flex;
    padding: scale-px(6px) 0 0 scale-px(6px);

    &-keys {
      display: flex;
      flex: 3;
      flex-wrap: wrap;
    }

    &-wrapper {
      position: relative;
      flex: 1;
      /* #ifdef harmony dynamic*/
      width: 33%;
      /* #endif */
      /* #ifndef harmony dynamic*/
      flex-basis: 33%;
      /* #endif */
      box-sizing: border-box;
      padding: 0 scale-px(6px) scale-px(6px) 0;
      background-color: $numberkeyboard-wrapper-background-color;

      .key {
        display: flex;
        align-items: center;
        justify-content: center;
        height: $numberkeyboard-key-height;
        font-size: $numberkeyboard-key-font-size;
        line-height: $numberkeyboard-key-line-height;
        background-color: $numberkeyboard-key-background-color;
        color: $numberkeyboard-key-color;
        border-radius: $numberkeyboard-key-border-radius;
        border: $numberkeyboard-key-border;
        font-weight: $font-weight-bold;
        cursor: pointer;

        &.active {
          background-color: $numberkeyboard-key-active-background-color;
        }
      }
    }
  }

  &-sidebar {
    display: flex;
    flex: 1;
    flex-basis: 33%;
    flex-direction: column;
    .nut-numberkeyboard-body-wrapper {
      width: 100%;
      .key {
        position: absolute;
        top: 0;
        right: scale-px(6px);
        bottom: scale-px(6px);
        left: 0;
        height: auto;
      }

      .confirm {
        font-size: $numberkeyboard-key-confirm-font-size;
        color: $numberkeyboard-key-confirm-color;
        background-color: $numberkeyboard-key-confirm-background-color;

        &.active {
          background-color: rgba(255, 0, 0, 0.7);
        }
      }
    }
  }
}

[dir='rtl'] .nut-popup,
.nut-rtl .nut-popup {
  .nut-numberkeyboard {
    &-header {
      &-close {
        right: auto;
        left: 0;
      }
    }

    &-body {
      padding: scale-px(6px) scale-px(6px) 0 0;
      &-wrapper {
        padding: 0 0 scale-px(6px) scale-px(6px);
        .delete {
          transform: rotate(-180deg);
        }
      }
    }

    &-sidebar {
      .nut-numberkeyboard-body-wrapper {
        .key {
          left: scale-px(6px);
          right: 0;
          &.delete {
            transform: rotate(-180deg);
          }
        }
      }
    }
  }
}
