Hello Rohan. Thank you for asking this question. I think you have perhaps already answered your own question when you realized that the monthly payment of the loan for which you qualify is high and it sounds like you can qualify for more than what you are comfortable with. I usually tell my clients to come up with a monthly payment amount that they are comfortable with and that leaves room for fun, retirement planning and unforeseen expenses. You may want to consult with a financial planner and/or accountant as part of your decision making process. I would recommend that you find out how much you'll be able to save in taxes as a result of being a home owner.
Once you have determined how much you'd like to spend for house payment (including insurance and taxes), you come up with the loan amount and a price range for the home. Sunnyvale and Campbell are desirable locations but they are not exactly close. I am wondering how you chose those two areas. Where do you work? There are other areas in the San Jose area that may be more affordable than Sunnyvale and Campbell. Since you are considering the purchase of a condo or townhome, you will also have to add HOA fees to your monthly budget.
Best of luck and happy new year.