@four-digit-country-code-width: 120px;

.tw-telephone {
  display: flex;

  .tw-telephone__number-input {
    margin-left: var(--size-12);
  }

  &__number-input-field {
    [dir="rtl"] & {
      text-align: end;
    }
  }
}

.tw-telephone__country-select {
  flex-basis: @four-digit-country-code-width;
  flex-shrink: 0;

  .np-input-group {
    width: 100%;
  }

  .np-select-input-content {
    [dir="rtl"] & {
      text-align: end;
      direction: ltr;
    }
  }
}

.tw-telephone__country-select--with-input-group-addon-start {
  .np-button-input {
    padding-inline-start: var(--size-48);
    padding-inline-end: 26px !important;
  }
}

.tw-telephone__number-input {
  flex: auto 1 1;
}

// Prevent bidi algorithm from flipping "+{country-code}" to "{country-code}+"
// in RTL dropdown options as phone numbers are universally read as LTR.
.tw-telephone__prefix-option .np-select-input-option-content-title {
  [dir="rtl"] & {
    direction: ltr;
  }
}
