.home-popup-ad {
  position: fixed;
  inset: 0;
  z-index: 999998;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.home-popup-ad.is-open {
  display: flex;
}

.home-popup-ad__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
}

.home-popup-ad__dialog {
  position: relative;
  z-index: 1;
  width: min(800px, calc(100vw - 40px));
  min-height: 400px;
  max-height: calc(100vh - 40px);
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

.home-popup-ad__close {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.home-popup-ad__slot {
  width: 100%;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

html.has-home-popup-ad,
body.has-home-popup-ad {
  overflow: hidden;
}

@media (max-width: 767px) {
  .home-popup-ad {
    padding: 16px;
  }

  .home-popup-ad__dialog {
    width: min(90vw, calc(100vw - 32px));
    min-height: 0;
    max-height: calc(100vh - 32px);
  }

  .home-popup-ad__slot {
    min-height: 0;
  }
}
