Updated media-query mixin with better error handling