Calculate margins based on percentage