Peace be upon you. According to Ayatollah Khamenei (may Allah protect him), there is no prohibition against a person in a state of major ritual impurity entering the holy shrines of the infallible Imams, although it is preferable to avoid doing so out of respect for these sacred places. On the other hand, Ayatollah Sistani (may Allah protect him) states that it is obligatory to treat the holy shrines of the infallibles as mosques in terms of the mentioned rulings, and this does not extend to their corridors unless it has been established that they are mosques, nor does it apply to the purified courtyard, although it is recommended to consider it as such. May you be successful in all good deeds.