Note that OP is in Spain, where the iPhones are quite more expensive than in the US, and where the wages are quite lower.
iPhone 17 is $799 in US, but 950e in Spain (=$1130) ie 40% more expensive.
average wage is 80k in US and 35k in Spain.
So clearly it's not the same investment...