/* Section mount: zero footprint until overlay opens */
.newsletter-popup-section {
  flex: none;
}

.newsletter-popup-section .newsletter-popup-section__anchor {
  position: relative;
  width: 0;
  height: 0;
  overflow: visible;
}

.newsletter-popup-overlay {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: rgb(0 0 0 / 50%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.newsletter-popup-overlay.is-active {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.newsletter-popup {
  position: relative;
  display: flex;
  flex-direction: row;
  width: min(900px, 100%);
  max-height: calc(100vh - 40px);
  overflow: hidden;
  background: #fff;
  border-radius: 20px;
  transform: scale(0.96);
  opacity: 0;
  transition: transform 0.45s ease, opacity 0.45s ease;
}

.newsletter-popup--image-right {
  flex-direction: row-reverse;
}

.newsletter-popup--no-image {
  max-width: 480px;
}

.newsletter-popup--no-image .newsletter-popup__image-wrap {
  display: none;
}

.newsletter-popup-overlay.is-active .newsletter-popup {
  transform: scale(1);
  opacity: 1;
}

.newsletter-popup__close {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  cursor: pointer;
  background: rgb(255 255 255 / 0.94);
  border: none;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  color: #000;
  transition: opacity 0.2s ease;
}

.newsletter-popup__close:hover {
  opacity: 0.75;
}

.newsletter-popup__image-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  min-width: 42%;
  overflow: hidden;
  background: #f4f4f4;
}

.newsletter-popup__image-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
}

.newsletter-popup__content {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: center;
  padding: 48px 40px;
}

.newsletter-popup__heading {
  margin: 0 0 12px;
  font-size: clamp(20px, 2.8vw, 28px);
  font-weight: 500;
  line-height: 1.25;
  color: #000;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.newsletter-popup__text {
  margin: 0 0 28px;
  font-size: 14px;
  line-height: 1.6;
  color: #666;
}

.newsletter-popup__form-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.newsletter-popup .field__label {
  display: none;
}

.newsletter-popup .newsletter-popup__inline-form .field__input {
  box-sizing: border-box;
  width: 100%;
  padding: 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
  outline: none;
  transition: border-color 0.2s ease;
}

.newsletter-popup .newsletter-popup__inline-form .field__input::placeholder {
  color: #999;
}

.newsletter-popup .newsletter-popup__inline-form .field__input:focus {
  border-color: #999;
}

.newsletter-popup__submit {
  box-sizing: border-box;
  width: 100%;
  padding: 16px;
  margin: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: #5a5a5a;
  border: none;
  border-radius: 50px;
  transition: background 0.2s ease;
}

.newsletter-popup__submit:hover {
  background: #444;
}

.newsletter-popup__info {
  display: inline-flex;
  gap: 6px;
  align-items: flex-start;
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.45;
}

.newsletter-popup__info--success {
  box-sizing: border-box;
  padding: 12px;
  margin-top: 12px;
  color: #2e7d32;
  background: #e8f5e9;
  border-radius: 8px;
}

.newsletter-popup__info--error {
  color: rgb(227 38 25);
}

.newsletter-popup__disclaimer {
  margin: 16px 0 0;
  font-size: 11px;
  line-height: 1.5;
  color: #999;
}

@media screen and (max-width: 749px) {
  .newsletter-popup {
    flex-direction: column;
    max-height: calc(100vh - 40px);
    overflow: auto;
  }

  .newsletter-popup--image-right {
    flex-direction: column;
  }

  /* Image panel always above copy on narrow screens */
  .newsletter-popup__image-wrap {
    order: -1;
    min-width: unset;
    min-height: min(260px, 40vh);
  }

  .newsletter-popup__image-wrap img {
    min-height: 180px;
  }

  .newsletter-popup__content {
    padding: 32px 24px;
  }

  .newsletter-popup-overlay.is-active {
    align-items: flex-end;
    padding-bottom: env(safe-area-inset-bottom, 12px);
  }
}
