How to add a 3-second delay to this cookie-based pop-up?

This .popup-overlay-b container is set to “display: none” in CSS but has a javascript code forcing it to show if there’s no previous cookie session and it’s supposed to expire after 1 day. I just need to give it a few seconds delay before it shows.

This code works without the delay

$(document).ready(function(){
    if (!Cookies.get('alert')) { 
      $('.popup-overlay-b').show(); 
      Cookies.set('alert', true, { expires: 1 });
    }
});
</script>

This is what I’ve attempted and doesn’t work

$(document).setTimeout(function(){
    if (!Cookies.get('alert')) { 
      $('.popup-overlay-b').show(); 
      Cookies.set('alert', true, { expires: 1 });
    }
},3000);
</script>