/* We don't use 2xl, 3xl, 4xl map keys because in some Intellij configurations, these keys are reformatted */
:host {
  /**
   * @prop --counter-items-height: Set a new value for this property, and it will resize both buttons and input
   */
  --counter-items-height: var(--joy-form-field-height-small);
  --counter-input-color: var(--joy-color-secondary-50);
  --counter-input-bg-color: var(--joy-color-secondary-10);
  --counter-input-bg-color-focus: white;
  --counter-input-border-color-invalid: var(--joy-color-error-50);
  --counter-input-color-invalid: var(--joy-color-error-50);
  --counter-input-border-color-invalid-hover: var(--joy-color-error-90);
  --counter-input-color-invalid-hover: var(--joy-color-error-90);
  --counter-button-bg-color: var(--joy-color-secondary-10);
  --counter-button-bg-color-hover: var(--joy-color-secondary-50);
  --counter-button-bg-color-active: var(--joy-color-secondary-50);
  --counter-button-bg-color-disabled: var(--joy-color-neutral-30);
  --counter-button-color: var(--joy-color-secondary-50);
  --counter-border-color-focus: var(--joy-color-neutral-60);
  display: inline-flex;
  flex-wrap: wrap;
  max-width: 200px;
  align-items: center;
  justify-content: center;
  position: relative;
  font-weight: var(--joy-font-weight-normal);
  font-size: var(--joy-font-size-primary-400);
  line-height: var(--joy-line-height-large);
  font-family: var(--joy-font-family-base);
}

.joy-counter__wrapper {
  display: inline-flex;
  flex-wrap: wrap;
  max-width: 200px;
  align-items: center;
  justify-content: center;
  position: relative;
}
.joy-counter__wrapper input {
  height: auto;
  font-size: inherit;
  font-family: inherit;
  margin: 0;
  padding: 0;
  background: transparent;
  border: var(--joy-form-border-width) solid transparent;
  color: inherit;
  box-shadow: none;
  background-color: var(--counter-input-bg-color);
  color: var(--counter-input-color);
  width: 80px;
  outline: none;
  height: var(--counter-items-height);
  border-radius: var(--joy-core-radius-2);
  text-align: center;
  -moz-appearance: textfield;
  box-sizing: border-box;
}
.joy-counter__wrapper input::-webkit-inner-spin-button, .joy-counter__wrapper input::-webkit-outer-spin-button {
  -webkit-appearance: none;
}
.joy-counter__wrapper input {
  transition: border-color var(--joy-transition-duration-default) var(--joy-transition-timing-function);
}
.joy-counter__wrapper input:hover {
  border-color: var(--joy-color-state-hover);
}
.joy-counter__wrapper input {
  transition: border-color var(--joy-transition-duration-default) var(--joy-transition-timing-function);
}
.joy-counter__wrapper input:focus {
  border-color: var(--joy-color-state-focus);
  background-color: var(--counter-input-bg-color-focus);
}
.joy-counter__wrapper input.joy-counter__invalid, .joy-counter__wrapper input.joy-counter__invalid:focus-visible {
  border-color: var(--counter-input-border-color-invalid);
  color: var(--counter-input-color-invalid);
}
.joy-counter__wrapper input.joy-counter__invalid:hover {
  border-color: var(--counter-input-border-color-invalid-hover);
  color: var(--counter-input-color-invalid-hover);
}
.joy-counter__wrapper button {
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  width: var(--counter-items-height);
  height: var(--counter-items-height);
  border-radius: var(--joy-core-radius-6);
  background-color: var(--counter-button-bg-color);
  color: var(--counter-button-color);
  transition: background var(--joy-transition-duration-default) var(--joy-transition-timing-function);
}
.joy-counter__wrapper button, .joy-counter__wrapper button:hover, .joy-counter__wrapper button:active, .joy-counter__wrapper button:focus {
  outline: none;
  cursor: pointer;
}
.joy-counter__wrapper button:before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  border-radius: 50%;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  transition: box-shadow var(--joy-transition-duration-default) var(--joy-transition-timing-function);
}
.joy-counter__wrapper button:hover {
  background-color: var(--counter-button-bg-color-hover);
}
.joy-counter__wrapper button:hover:not(:disabled).joy-counter__increment joy-icon, .joy-counter__wrapper button:hover:not(:disabled).joy-counter__decrement joy-icon {
  color: white;
}
.joy-counter__wrapper button:focus-visible:before {
  box-shadow: 0 0 0 2px var(--counter-border-color-focus);
}
.joy-counter__wrapper button:active {
  background-color: var(--counter-button-bg-color-active);
}
.joy-counter__wrapper button:disabled {
  background-color: var(--counter-button-bg-color-disabled);
  cursor: not-allowed;
}
.joy-counter__wrapper button:disabled joy-icon {
  color: white;
}
.joy-counter__wrapper button.joy-counter__increment {
  margin-left: 10px;
}
.joy-counter__wrapper button.joy-counter__decrement {
  margin-right: 10px;
}
.joy-counter__wrapper .joy-counter_error {
  flex-basis: 100%;
  max-width: 100%;
  margin-top: 20px;
}