<style>
  html, body {
    margin: 0;
    padding: 0;
    height: 100%;
  }

  #popup_content_wrap {
    width: 100%;
    height: 100vh;
    top: 0;
    left: 0;
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999999;

    display: flex;
    justify-content: center;
    align-items: center;
  }

  #popup_content {
    width: auto;
    max-width: 700px;
    background: #005ABF;
    border: 1px solid #005ABF;
    padding: 0;
    border-radius: 0;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
  }

  #popup_content img {
    max-height: 90vh;
    max-width: 100%;
    height: auto;
    width: auto;
    display: block;
  }

  .btn-primary {
    color: #fff;
    background-color: #005ABF;
    border-color: #005ABF;
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 1000;
    border-radius: 0;
    outline: none;
    padding: 6px 10px;
    font-size: 16px;
    cursor: pointer;
  }

  /* Responsivo */
  @media (max-width: 600px) {
    #popup_content {
      width: 95%;
    }

    #popup_content img {
      width: 100%;
      height: auto;
      max-height: none;
    }
  }
</style>

<div id="popup_content_wrap">
  <div id="popup_content">
    <button type="button" class="btn btn-primary" onclick="popup_content('hide')">X</button>
    <img src="<?=$url?>/popup/popup.jpg" alt="popup" title="popup" />
  </div>
</div>

<script>
  function popup_content(action) {
    const wrap = document.getElementById('popup_content_wrap');
    if (action === 'hide') {
      wrap.style.display = 'none';
    } else {
      wrap.style.display = 'flex';
    }
  }

  window.onload = function () {
    setTimeout(function () {
      popup_content('show');
    }, 100);
  };
</script>
