A local bakery sells two types of pastries: croissants and muffins. Each croissant costs $2 and each muffin costs $1. If a customer buys 3 croissants and 4 muffins, how much will the customer spend in total?