//Number input
smart-number-input {
  --smart-outline: var(--smart-primary);
  display: inline-block;
  width: var(--smart-text-box-default-width);
  height: var(--smart-text-box-default-height);
  overflow: visible;
  background: var(--smart-background);
  border: 1px solid var(--smart-border);
  border-top-left-radius: var(--smart-border-top-left-radius);
  border-top-right-radius: var(--smart-border-top-right-radius);
  border-bottom-left-radius: var(--smart-border-bottom-left-radius);
  border-bottom-right-radius: var(--smart-border-bottom-right-radius);
  text-align: right;

  >.smart-container {
    display: flex;
  }

  &.smart-element {
    background: var(--smart-background);
  }

  input {
    &.smart-input {
      border: none;
      text-overflow: ellipsis;
    }
  }

  &[drop-down-button-position="right"] {
    .smart-input {
      width: calc(100% - var(--smart-editor-addon-width));
    }
  }
}

.smart-number-input[hide-spin-buttons] {
  .nav {
    display: none;
  }

  .smart-input {
    width: 100%;
    border-top-right-radius: var(--smart-border-top-right-radius);
    border-bottom-right-radius: var(--smart-border-bottom-right-radius);
  }
}

.smart-number-input {
  .nav {
    display: flex;
    width: var(--smart-editor-addon-width);
    height: 100%;
    flex-direction: column;
    color: var(--smart-surface-color);
    border-left: 1px solid var(--smart-border);
    background: var(--smart-surface);

    &:hover,
    &:active {
      background: var(--smart-surface);
      color: var(--smart-surface-color);
    }

    &.smart-drop-down-button:hover,
    &.smart-drop-down-button:active {
      background: var(--smart-surface);
      color: var(--smart-surface-color);
    }

    .up,
    .down {
      display: flex;
      height: 50%;
      overflow: hidden;
      cursor: pointer;
      font-family: var(--smart-font-family-icon);
      justify-content: center;
      align-items: center;
      outline: none;

      &:hover {
        background: var(--smart-ui-state-hover);
        color: var(--smart-ui-state-color-hover);
      }

      &:active,
      &[active] {
        background: var(--smart-ui-state-active);
        color: var(--smart-ui-state-color-active);
      }
    }

    .up {
      border-bottom: var(--smart-border-width) solid var(--smart-border);

      &:after {
        content: var(--smart-icon-arrow-up);
      }
    }

    .down {
      &:after {
        content: var(--smart-icon-arrow-down);
      }
    }
  }

  &[disabled] {
    .nav {

      .up,
      .down {
        pointer-events: none;
      }
    }
  }

  &[right-to-left] {
    >.smart-container {
      direction: rtl;
    }

    .nav {
      border-left: initial;
      border-right: var(--smart-border-width) solid var(--smart-border);
      border-top-left-radius: var(--smart-border-top-right-radius);
      border-bottom-left-radius: var(--smart-border-bottom-right-radius);
      border-top-right-radius: initial;
      border-bottom-right-radius: initial;
      order: initial;
    }

    .smart-input {
      border-top-left-radius: initial;
      border-bottom-left-radius: initial;
      border-top-right-radius: var(--smart-border-top-right-radius);
      border-bottom-right-radius: var(--smart-border-bottom-right-radius);
    }

    &[focus] {
      .nav {
        border-color: var(--smart-outline);
      }
    }
  }
}

smart-number-pad {
  display: block;
  max-width: 320px;
  font-family: var(--smart-font-family);
  overflow: hidden;
}

.smart-numberpad-container {
    box-sizing: border-box;
    overflow: hidden;
    display: flex !important;
    width: 100%;
    flex-direction: column;
}

.smart-numberpad-display {
  font-size: 32px;
  text-align: right;
  display: block;
  padding: 15px;
  margin-bottom: 15px;
  border: 2px solid var(--smart-border);
  border-radius: 8px;
  background: var(--smart-background);
}

.smart-numberpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.smart-numberpad-grid button {
    padding: 10px;
    font-size: 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.smart-numberpad-grid button:hover {
  background: var(--smart-ui-state-hover);
}

.smart-numberpad-action {
  background: var(--smart-primary);
  color: var(--smart-primary-color);
  font-weight: bold;
  width: 100%;
  margin-top: 10px;
  height: 40px;
  border-radius: 8px;
  border: none;
}

.smart-numberpad-backspace {
  background: var(--smart-error);
  color: var(--smart-error-color);
  font-weight: bold;
}