Coles misled shoppers with illusory discounts, a court has ruled after a landmark case brought by the consumer watchdog.