.quantity-selector {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;

  &__controls {
    display: flex;
    align-items: center;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
  }

  &__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #f8f8f8;
    color: #666;
    transition: all 0.2s ease;

    &:active {
      background: #e5e5e5;
    }

    &--disabled {
      background: #f5f5f5 !important;
      color: #ccc !important;
      cursor: not-allowed;
    }
  }

  &__input {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-left: 1px solid #e5e5e5;
    border-right: 1px solid #e5e5e5;
  }

  &__value {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    text-align: center;
  }

  &__stock {
    margin-top: 2px;
  }

  &__stock-text {
    color: #999;
  }

  // 尺寸变体
  &--small {
    .quantity-selector__controls {
      height: 24px;
    }

    .quantity-selector__btn {
      width: 24px;
      height: 24px;
    }

    .quantity-selector__input {
      width: 32px;
      height: 24px;
    }

    .quantity-selector__value {
      font-size: 12px;
    }
  }

  &--medium {
    .quantity-selector__controls {
      height: 32px;
    }

    .quantity-selector__btn {
      width: 32px;
      height: 32px;
    }

    .quantity-selector__input {
      width: 40px;
      height: 32px;
    }

    .quantity-selector__value {
      font-size: 14px;
    }
  }

  &--large {
    .quantity-selector__controls {
      height: 40px;
    }

    .quantity-selector__btn {
      width: 40px;
      height: 40px;
    }

    .quantity-selector__input {
      width: 48px;
      height: 40px;
    }

    .quantity-selector__value {
      font-size: 16px;
    }
  }
}
