Rafi baked some cookies for sale. 60 percent of them were chocolate cookies, 25 percent of them were peanut cookies and the rest were almond cookies. There were 225 more chocolate cookies than almond cookies. He sold 80 percent of the chocolate cookies.

(A) How many cookies did Rafi bake at first?
(B) How many chocolate cookies did he sell?

Let's assume that Rafi baked a total of x cookies.

The number of chocolate cookies is 60/100 * x = 3/5 * x.
The number of peanut cookies is 25/100 * x = 1/4 * x.
Since the rest were almond cookies, we can say that the number of almond cookies is x - (3/5 * x) - (1/4 * x) = x - 3/5x - 1/4x = 8/20x - 3/5x = 8/20 * x - 12/20 * x = 20/20 * x - 12/20 * x = 8/20x = 2/5x.
Given that there were 225 more chocolates than almonds, we can write the equation 3/5x - 2/5x = 225.
Combining like terms gives us 1/5x = 225.
Multiplying both sides of the equation by 5 gives us x = 225 * 5 = <<225*5=1125>>1125 cookies.
To find out how many chocolate cookies Rafi sold, we can multiply the number of chocolate cookies by 80/100: 3/5 * 1125 * 80/100 = 9/25 * 1125 = 9/25 * 45 * 25 = 45 * 9 = 405 cookies.
Therefore, the answer is:
(A) Rafi baked 1125 cookies at first.
(B) Rafi sold 405 chocolate cookies. Answer: \boxed{405}.