.ih-newsletter-popup {
  position: fixed;
  z-index: var(--ihnp-z-index, 10000);
  display: block;
  width: min(var(--ihnp-desktop-width, 480px), calc(100vw - (var(--ihnp-margin, 24px) * 2)));
  margin: var(--ihnp-margin, 24px);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--ihnp-duration, 300ms) ease, transform var(--ihnp-duration, 300ms) ease;
}

.ih-newsletter-popup[hidden] {
  display: none !important;
}

.ih-newsletter-popup.is-open {
  opacity: 1;
  transform: translateY(0);
}

.ih-newsletter-popup--bottom-right { right: 0; bottom: 0; }
.ih-newsletter-popup--bottom-left { bottom: 0; left: 0; }
.ih-newsletter-popup--top-right { top: 0; right: 0; }
.ih-newsletter-popup--top-left { top: 0; left: 0; }
.ih-newsletter-popup--center {
  top: 50%;
  left: 50%;
  margin: 0;
  transform: translate(-50%, calc(-50% + 8px));
}
.ih-newsletter-popup--center.is-open { transform: translate(-50%, -50%); }

.ih-newsletter-popup__dialog {
  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  padding: var(--ihnp-padding, 28px);
  border-radius: var(--ihnp-radius, 12px);
  background: #fff;
  box-shadow: var(--ihnp-shadow, 0 12px 36px rgba(0, 0, 0, .22));
}

.ih-newsletter-popup__close {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 8px;
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
}

.ih-newsletter-popup__close:hover,
.ih-newsletter-popup__close:focus-visible {
  background: rgba(0, 0, 0, .08);
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.ih-newsletter-popup__content > :first-child { margin-top: 0; }
.ih-newsletter-popup__content > :last-child { margin-bottom: 0; }

@media (max-width: 1024px) {
  .ih-newsletter-popup {
    width: min(var(--ihnp-desktop-width, 480px), calc(100vw - (var(--ihnp-margin, 24px) * 2)));
  }
}

@media (max-width: 767px) {
  .ih-newsletter-popup {
    width: var(--ihnp-mobile-width, calc(100% - 30px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .ih-newsletter-popup { transition-duration: 1ms; }
}
