In real conversation, people do not always use the full standard phrase.
Very often you will simply hear:
Buenas.
This is a short, flexible greeting. You can use it when entering a shop, elevator, café, or a small group of people.
Another option is:
Muy buenas.
This is similar to a friendly “hello,” “good afternoon,” or “good evening.” It sounds warm and natural, especially in Spain.
If you want to wish someone a pleasant evening when saying goodbye, you can use:
Que tengas una buena tarde. — Have a nice afternoon / evening.
Que pases una buena tarde. — Have a nice afternoon / evening.
Later in the evening, you can say:
Que tengas buenas noches. — Have a good evening / good night.
Or, before bed, a more natural phrase is:
Que descanses. — Sleep well / get some rest.