Think before you speak, please. I have never been in favor of the phrase, "Have a nice day." Who knows what is going on in another person's life at that moment. Maybe they are barely able to keep it together.
This dislike came home to me not long ago. My family and I were ushered into a doctor's office with a nurse standing by. The doctor quickly came to the point. He told my husband, "Your condition is very grave and you only have a short time yet to live." As we were leaving the office trying to absorb this extremely bad news, the nurse said, "Have a nice day."
On the same day, while we were waiting our turn at the Cancer Center, I observed people leaving the appointment desk and staff members saying, "Have a nice day." How many people there were having a nice day?
This is not a one-size-fits-all comment. In the medical profession in particular, a more caring and compassionate reply shows more concern for the people often facing a bad day.
Why not say, "Be safe," or, "Take care"?