bhean is what is called the "lenited" form. You use it any time lenition occurs, and there are several rules that govern that. Here, it's lenited because it's following the singular definite article an, and is a feminine noun.
The -im ending is added because the root word "clois" is one syllable and slender. If it were a monosyllabic word where the stem was shortened to "clois-" then it would have the "ím" ending with a fada.