Why is "Que tengas un buen día" subjunctive?
So far I have heard about dual clauses and whatnot but I constantly encounter examples where subjunctive is used without apparent reason. Is it some kind of hidden first clause that is somehow implied or something? I seriously doubt it because that makes no sense to me.
Yes, you are correct in that this does not appear to be a subordinate (secondary) clause. This is called an indirect command; the main clause is understood to be along the lines of "ojalá que ..." Therefore; (Ojalá) que tengas un buen día.
It's subjunctive because of "Tengas." The phrase is a wish, which may or may not come true and therefore, subjunctive.
This construction kind of bothered me when I first encountered it because there's this subordinate clause just hanging out there...it bothered me until I realized that we CAN do this in English (but it's kind of old fashioned, really). For example, "Que tengas un buen día" would be roughly equivalent to us saying, "O, that you (would) have a good day," but English usually uses conditional instead of subjunctive for this. (In this example, it's conditional with the would, subjunctive without it -- I think)
I know in this case it's "Have a nice day," but I more frequently see this get translated as "Let..." I first noticed this construction in a Justice League cartoon. Aquaman said, "Que se hunda" in Spanish and "Let it sink" in English -- or something like that.
Now back to the clause dangling out there by itself, whether there is an implied main clause or not, I do not know (but that is easily possible and highly likely), but it no longer bothered me because I AM used to a very similar construction in English already...I just didn't realize it at first.
Along with the "ojalá que ..." mentioned by MountainGirl, you could imagine an understood "Espero que ..." These are all quite similar in spirit to the English "I hope/pray/wish/etc that ..." (which are also usually implied, rather than expressly stated).