@use "design-system";

.unit-input {
  @include design-system.Paragraph;

  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  min-height: 54px;
  border: 1px solid var(--color-border-default);
  border-radius: 4px;
  background-color: var(--color-background-default);
  color: var(--color-text-default);
  padding: 8px 10px;
  position: relative;

  input[type="number"] {
    -moz-appearance: textfield;
  }

  input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    -moz-appearance: none;
    display: none;
  }

  input[type="number"]:hover::-webkit-inner-spin-button {
    -webkit-appearance: none;
    -moz-appearance: none;
    display: none;
  }

  &__inputs {
    flex: 1 0 auto;
    display: flex;
    flex-flow: column nowrap;
  }

  &__input {
    @include design-system.Paragraph;

    color: var(--color-text-default);
    background: transparent;
    border: none;
    min-width: 0;
    max-width: 15ch;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 16px;
    outline: none;
  }

  &__input-container {
    display: flex;
    align-items: center;
    padding-bottom: 2px;
  }

  &__suffix {
    @include design-system.Paragraph;

    margin-left: 3px;
  }

  &--error {
    border-color: var(--color-error-default);
  }
}
