/**
 * Copyright © 2026 Eprodes Solutions S.L.
 */
.epd-np-body-lock {
  overflow: hidden;
}

.epd-np-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--epd-np-z, 10050);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: color-mix(in srgb, var(--epd-np-overlay, #000) calc(var(--epd-np-overlay-opacity, 0.45) * 100%), transparent);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
  box-sizing: border-box;
}

.epd-np-overlay *,
.epd-np-overlay *::before,
.epd-np-overlay *::after {
  box-sizing: border-box;
}

.epd-np-overlay.epd-np-modal--visible {
  opacity: 1;
  visibility: visible;
}

.epd-np-overlay.epd-np-modal--bottom_right {
  align-items: flex-end;
  justify-content: flex-end;
}

.epd-np-overlay.epd-np-modal--bottom_left {
  align-items: flex-end;
  justify-content: flex-start;
}

.epd-np-overlay.epd-np-modal--top_center {
  align-items: flex-start;
  justify-content: center;
}

/* —— Modal shell —— */
.epd-np-modal {
  position: relative;
  width: 100%;
  max-width: min(var(--epd-np-width, 560px), calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  background: var(--epd-np-bg, #fff);
  color: var(--epd-np-text, #1b1b1b);
  border-radius: var(--epd-np-radius, 16px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.28s ease;
  background-size: cover;
  background-position: center;
}

/* Con imagen lateral el modal necesita más ancho */
.epd-np-overlay.epd-np-modal--layout-image_left .epd-np-modal,
.epd-np-overlay.epd-np-modal--layout-image_right .epd-np-modal {
  max-width: min(max(var(--epd-np-width, 560px), 720px), calc(100vw - 32px));
}

.epd-np-overlay.epd-np-modal--visible .epd-np-modal {
  transform: translateY(0) scale(1);
}

.epd-np-overlay.epd-np-modal--anim-slide_up .epd-np-modal {
  transform: translateY(24px);
}

.epd-np-overlay.epd-np-modal--layout-image_top .epd-np-modal {
  flex-direction: column;
  max-width: min(max(var(--epd-np-width, 560px), 480px), calc(100vw - 32px));
}

.epd-np-overlay.epd-np-modal--layout-image_right .epd-np-modal {
  flex-direction: row-reverse;
}

.epd-np-overlay.epd-np-modal--layout-no_image .epd-np-media {
  display: none;
}

/* Popup informativo solo con imagen (sin HTML/texto/CTA) */
.epd-np-overlay.epd-np-modal--media-only .epd-np-modal {
  width: auto;
  max-width: calc(100vw - 32px);
  flex-direction: column;
  background: transparent;
  box-shadow: none;
}

.epd-np-overlay.epd-np-modal--media-only.epd-np-modal--layout-image_left .epd-np-modal,
.epd-np-overlay.epd-np-modal--media-only.epd-np-modal--layout-image_right .epd-np-modal {
  max-width: calc(100vw - 32px);
}

.epd-np-overlay.epd-np-modal--media-only .epd-np-body {
  display: none;
}

.epd-np-overlay.epd-np-modal--media-only .epd-np-media,
.epd-np-overlay.epd-np-modal--media-only a.epd-np-media-link {
  flex: none;
  width: auto;
  max-width: none;
  min-height: 0;
  background: transparent;
  border-radius: var(--epd-np-radius, 16px);
  overflow: hidden;
  line-height: 0;
}

.epd-np-overlay.epd-np-modal--media-only .epd-np-media img,
.epd-np-overlay.epd-np-modal--media-only a.epd-np-media-link img {
  width: auto;
  height: auto;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  object-fit: contain;
  display: block;
  border-radius: var(--epd-np-radius, 16px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
}

.epd-np-overlay.epd-np-modal--media-only .epd-np-close {
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
}

/* —— Imagen —— */
.epd-np-media,
a.epd-np-media-link {
  flex: 0 0 42%;
  width: 42%;
  max-width: 300px;
  min-height: 200px;
  background: #f6f6f6;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

a.epd-np-media-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}

a.epd-np-media-link:hover {
  filter: brightness(1.03);
}

a.epd-np-media-link:focus-visible {
  outline: 2px solid var(--epd-np-primary, #2d6a4f);
  outline-offset: 2px;
}

.epd-np-media img,
a.epd-np-media-link img {
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.epd-np-media--top {
  flex: none;
  width: 100%;
  max-width: none;
  max-height: 220px;
  min-height: 0;
}

.epd-np-media--top img {
  object-fit: contain;
}

/* —— Contenido —— */
.epd-np-body {
  flex: 1 1 auto;
  min-width: 0;
  padding: 28px 28px 24px;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.epd-np-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s, transform 0.15s;
}

.epd-np-close:hover {
  background: #fff;
  transform: scale(1.05);
}

.epd-np-title {
  margin: 0 0 10px;
  padding-right: 44px;
  font-size: clamp(1.15rem, 2.8vw, 1.45rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.epd-np-subtitle {
  margin: 0 0 12px;
  font-size: clamp(0.88rem, 2vw, 0.95rem);
  line-height: 1.5;
  opacity: 0.88;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.epd-np-desc {
  margin: 0 0 14px;
  font-size: 0.92rem;
  line-height: 1.55;
  opacity: 0.9;
}

/* —— Formulario newsletter —— */
.epd-np-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
  width: 100%;
}

.epd-np-email {
  width: 100%;
  min-width: 0;
  border: 1px solid #d8dde3;
  border-radius: 10px;
  padding: 13px 16px;
  font-size: 1rem;
  line-height: 1.3;
  background: #fff;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.epd-np-email:focus {
  outline: none;
  border-color: var(--epd-np-primary, #2d6a4f);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--epd-np-primary, #2d6a4f) 20%, transparent);
}

.epd-np-submit,
.epd-np-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 13px 20px;
  background: var(--epd-np-primary, #2d6a4f);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: normal;
  text-align: center;
  transition: filter 0.15s, transform 0.1s;
}

.epd-np-submit:hover:not(:disabled),
.epd-np-cta:hover {
  filter: brightness(1.06);
}

.epd-np-submit:active:not(:disabled),
.epd-np-cta:active {
  transform: scale(0.98);
}

.epd-np-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.epd-np-captcha-mount {
  width: 100%;
  min-height: 65px;
  margin: 2px 0 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.epd-np-captcha-mount:empty {
  display: none;
}

/* Sin imagen lateral: email + botón en fila en pantallas anchas */
@media (min-width: 520px) {
  .epd-np-overlay.epd-np-modal--layout-no_image .epd-np-form,
  .epd-np-overlay.epd-np-modal--layout-image_top .epd-np-form {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
  }

  .epd-np-overlay.epd-np-modal--layout-no_image .epd-np-email,
  .epd-np-overlay.epd-np-modal--layout-image_top .epd-np-email {
    flex: 1 1 180px;
    width: auto;
  }

  .epd-np-overlay.epd-np-modal--layout-no_image .epd-np-submit,
  .epd-np-overlay.epd-np-modal--layout-image_top .epd-np-submit {
    flex: 0 0 auto;
    width: auto;
    min-width: 140px;
  }

  .epd-np-overlay.epd-np-modal--layout-no_image .epd-np-captcha-mount,
  .epd-np-overlay.epd-np-modal--layout-image_top .epd-np-captcha-mount {
    flex: 1 1 100%;
  }
}

.epd-np-alert {
  min-height: 1.2em;
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.epd-np-alert--ok {
  color: #1b7f4b;
}

.epd-np-alert--err {
  color: #c0392b;
}

.epd-np-dismiss-link {
  display: inline-block;
  margin-top: 12px;
  border: 0;
  background: none;
  color: inherit;
  opacity: 0.6;
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 4px 0;
  align-self: flex-start;
}

.epd-np-dismiss-link:hover {
  opacity: 0.85;
}

.epd-np-html {
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 12px;
  overflow-wrap: break-word;
}

.epd-np-html img {
  max-width: 100%;
  height: auto;
}

/* —— Tablet / móvil: apilar imagen arriba —— */
@media (max-width: 768px) {
  .epd-np-overlay {
    padding: 12px;
    align-items: center;
    justify-content: center;
  }

  .epd-np-modal {
    flex-direction: column !important;
    max-width: min(var(--epd-np-width, 560px), calc(100vw - 24px)) !important;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .epd-np-media {
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 0;
    max-height: none;
    height: auto;
    overflow: visible;
    background: #fff;
    line-height: 0;
  }

  .epd-np-media img {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
    object-position: center top;
  }

  .epd-np-media--top,
  .epd-np-media--top img {
    max-height: none;
    object-fit: contain;
  }

  .epd-np-body {
    padding: 22px 20px 20px;
    flex: 0 0 auto;
  }

  .epd-np-title {
    padding-right: 40px;
    font-size: 1.2rem;
  }

  .epd-np-form {
    flex-direction: column !important;
  }

  .epd-np-submit,
  .epd-np-cta {
    width: 100% !important;
  }
}

@media (max-width: 400px) {
  .epd-np-body {
    padding: 18px 16px 16px;
  }

  .epd-np-close {
    top: 8px;
    right: 8px;
    width: 34px;
    height: 34px;
    font-size: 22px;
  }
}
