/* ============================================================
   NoNatty — Welcome Modal CSS
   ============================================================
   Versión: 2.1
   Fecha: 2026-11-05

   Cambios en esta versión (v2.1):
   - 🆕 Añadido estilo .welcome-modal__brand-logo (logo tipográfico "NoNatty")
   - 🆕 Padding superior reducido en .welcome-modal__content (1.5rem) para subir el bloque
   - 🆕 Margen inferior del .welcome-modal__title aumentado a 1rem (respiración logo→título)
   - 🆕 Regla dark-mode para que el "No" del brand-logo se vea blanco en html.dark
   - ✅ Resto de estilos intactos respecto a la v2.0 (checkbox Comprador Suscrito, etc.)

   Cambios en v2.0:
   - ✅ Añadido estilo .welcome-modal__buyer-checkbox (checkbox Comprador Suscrito)
   - ✅ El resto de estilos intactos respecto a la versión anterior

   Estructura:
   1.  Base del <dialog> y backdrop
   2.  Contenedor de dos columnas (imagen + contenido)
   3.  Imagen lateral (desktop) / banner superior (móvil)
   4.  Contenido: logo, selector de idioma, título, subtítulo
       4.1. 🆕 Brand-logo tipográfico
   5.  Formulario: input flotante, checkbox, error, CTA, skip
   6.  Texto legal
   7.  Honeypot (oculto)
   8.  Responsive (≤ 720px)
   9.  Dark mode opcional (data-theme + html.dark)
   10. 🆕 Pantallas con poca altura (≤ 700px)

   Convenciones:
   - BEM: .welcome-modal__elemento, .welcome-modal--modificador
   - Variables CSS no usadas para mantener compatibilidad con el resto del sitio
   - Colores alineados con la marca NoNatty (#FE0201 verde, #ca2222 rojo error)
   ============================================================ */

/* ------------------------------------------------------------
   1. BASE DEL <dialog> Y BACKDROP
   ------------------------------------------------------------ */
.welcome-modal {
  border: none;
  border-radius: 16px;
  padding: 0;
  max-width: 880px;
  width: calc(100% - 2rem);
  max-height: 90vh; /* 🚀 Añadido: evita desbordes en pantallas bajas */
  background: #fff;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .18);
  overflow: hidden;
}

.welcome-modal::backdrop {
  background: rgba(15, 20, 15, .55);
  backdrop-filter: blur(4px);
}

.welcome-modal[open] {
  animation: wm-fade-in .35s ease-out;
}

@keyframes wm-fade-in {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ------------------------------------------------------------
   2. CONTENEDOR DE DOS COLUMNAS (IMAGEN + CONTENIDO)
   ------------------------------------------------------------ */
.welcome-modal__container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 520px;
  max-height: 90vh;
  position: relative;
}

/* ------------------------------------------------------------
   3. IMAGEN LATERAL (DESKTOP) / BANNER SUPERIOR (MÓVIL)
   ------------------------------------------------------------ */
.welcome-modal__image {
  background: #f4f6f4;
}

.welcome-modal__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ------------------------------------------------------------
   4. CONTENIDO: LOGO, IDIOMA, TÍTULO, SUBTÍTULO
   ------------------------------------------------------------ */
.welcome-modal__content {
  padding: 1.5rem 2.25rem 1.5rem; /* 🆕 Padding superior reducido (2rem → 1.5rem) para subir todo el bloque */
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* 🚀 Subimos el contenido en lugar de centrarlo */
  position: relative;
  overflow-y: auto; /* 🚀 Scroll interno si no cabe */
}

.welcome-modal__close {
  position: absolute;
  top: .75rem;
  right: .75rem;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  font-size: 1.75rem;
  line-height: 1;
  color: #333;
  cursor: pointer;
  border-radius: 50%;
  transition: background .2s;
  z-index: 100; /* 🚀 Asegura que esté por encima de todo */
  outline: none; /* 🚀 Quita el aro azul feo del navegador */
}

/* Hover limpio sin aros */
.welcome-modal__close:hover {
  background: #f2f2f2;
}

/* Quitar el aro azul incluso cuando está enfocado */
.welcome-modal__close:focus-visible {
  outline: none;
}

.welcome-modal__logo {
  margin-bottom: 1.25rem;
}

.welcome-modal__logo svg {
  width: 110px;
  height: auto;
}

/* ------------------------------------------------------------
   4.1. 🆕 BRAND-LOGO TIPOGRÁFICO
   Logo "NoNatty" hecho con texto (Anton) en lugar de SVG.
   Centrado, con letter-spacing de marca y márgenes que lo
   separan del borde superior y del título.
   ------------------------------------------------------------ */
.welcome-modal__brand-logo {
  font-family: 'Anton', sans-serif; /* Usamos la fuente de la marca */
  font-size: 2.2rem;
  text-align: center;
  letter-spacing: 1px;
  margin-bottom: 1rem; /* Espacio entre el logo y el título */
  margin-top: 0.5rem;  /* Un poco de margen superior para no chocar con el borde */
}

.welcome-modal__lang {
  position: absolute;
  top: 1rem;
  left: 1rem;
  display: flex;
  gap: .25rem;
}

.welcome-modal__lang button {
  border: 1px solid #ddd;
  background: #fff;
  padding: .2rem .55rem;
  font-size: .75rem;
  font-weight: 600;
  border-radius: 6px;
  color: #666;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}

.welcome-modal__lang button:hover {
  border-color: #FE0201;
  color: #FE0201;
}

.welcome-modal__lang button.is-active {
  background: #FE0201;
  border-color: #FE0201;
  color: #fff;
}

.welcome-modal__title {
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  font-weight: 800;
  line-height: 1.2;
  color: #1a1a1a;
  margin: 0 0 1rem; /* 🆕 Margen inferior aumentado (.75rem → 1rem): respiración logo→título */
  text-align: center;
}

.welcome-modal__subtitle {
  font-size: .95rem;
  color: #555;
  line-height: 1.5;
  text-align: center;
  margin: 0 0 1.5rem;
}

/* ------------------------------------------------------------
   5. FORMULARIO: INPUT FLOTANTE, CHECKBOX, ERROR, CTA, SKIP
   ------------------------------------------------------------ */
.welcome-modal__input-group {
  position: relative;
  margin-bottom: .75rem;
}

.welcome-modal__input-group input {
  width: 100%;
  padding: 1rem .9rem .45rem;
  border: 1.5px solid #d5d5d5;
  border-radius: 10px;
  font-size: 1rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.welcome-modal__input-group input:focus {
  border-color: #FE0201;
  box-shadow: 0 0 0 3px rgba(47, 125, 50, .12);
}

.welcome-modal__input-group label {
  position: absolute;
  left: .9rem;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
  font-size: .95rem;
  pointer-events: none;
  transition: all .15s ease-out;
  background: #fff;
  padding: 0 .25rem;
}

.welcome-modal__input-group input:focus + label,
.welcome-modal__input-group input:not(:placeholder-shown) + label {
  top: 0;
  font-size: .72rem;
  color: #FE0201;
  font-weight: 600;
}

/* --- Checkbox "Comprador Suscrito" --- */
.welcome-modal__buyer-checkbox {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  margin: .5rem 0 .75rem;
  font-size: .82rem;
  color: #444;
  line-height: 1.45;
  cursor: pointer;
  user-select: none;
}

.welcome-modal__buyer-checkbox input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: .15rem;
  accent-color: #FE0201;
  cursor: pointer;
}

.welcome-modal__buyer-checkbox span {
  display: inline-block;
}

.welcome-modal__buyer-checkbox:hover {
  color: #1a1a1a;
}

/* --- Mensaje de error --- */
.welcome-modal__error {
  color: #ca2222;
  font-size: .82rem;
  min-height: 1.1rem;
  margin: .1rem 0 .35rem;
}

/* --- Botón CTA --- */
.welcome-modal__cta {
  width: 100%;
  padding: .95rem 1rem;
  border: 0;
  border-radius: 10px;
  background: #FE0201;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, transform .1s;
}

.welcome-modal__cta:hover {
  background: #CC0200;
}

.welcome-modal__cta:active {
  transform: translateY(1px);
}

.welcome-modal__cta[disabled] {
  opacity: .65;
  cursor: wait;
}

/* --- Enlace "No thanks" --- */
.welcome-modal__skip {
  display: block;
  margin: 1rem auto .5rem;
  background: none;
  border: 0;
  color: #FE0201;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  transition: color .2s;
}

.welcome-modal__skip:hover {
  color: #1f5a22;
}

/* ------------------------------------------------------------
   6. TEXTO LEGAL
   ------------------------------------------------------------ */
.welcome-modal__legal {
  font-size: .72rem;
  color: #888;
  line-height: 1.45;
  text-align: center;
  margin: 1rem 0 0;
}

.welcome-modal__legal a {
  color: #FE0201;
  text-decoration: underline;
}

.welcome-modal__legal a:hover {
  color: #1f5a22;
}

/* ------------------------------------------------------------
   7. HONEYPOT (OCULTO — NO USAR display:none, los bots lo detectan)
   ------------------------------------------------------------ */
.welcome-modal__honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* ------------------------------------------------------------
   8. RESPONSIVE (≤ 720px) — UNA COLUMNA, IMAGEN COMO BANNER
   ------------------------------------------------------------ */
@media (max-width: 720px) {
  .welcome-modal {
    max-width: 460px;
    border-radius: 14px;
  }

  .welcome-modal__container {
    grid-template-columns: 1fr;
    min-height: 0;
    max-height: 90vh; 
    overflow-y: auto; 
  }

  .welcome-modal__image {
    max-height: 200px; /* 🚀 Aumentado de 140px a 200px */
  }

  .welcome-modal__image img {
    height: 200px; /* 🚀 Aumentado de 140px a 170px */
  }

  .welcome-modal__content {
    padding: 0 1.25rem 1.25rem; /* 🚀 Padding-top a 0: el contenido sube al tope */
  }

  /* Ajuste del brand-logo en móvil */
  .welcome-modal__brand-logo {
    font-size: 1.9rem;
    margin-top: 1rem; /* 🚀 Reducido de 1.5rem a 1rem (un pequeño respiro, pero más pegado) */
    margin-bottom: .5rem; /* 🚀 Reducido para compactar el bloque */
  }

  .welcome-modal__title {
    font-size: 1.25rem;
  }

  .welcome-modal__subtitle {
    font-size: .9rem;
    margin-bottom: 1.1rem;
  }

  .welcome-modal__buyer-checkbox {
    font-size: .78rem;
  }
}

/* ------------------------------------------------------------
   9. DARK MODE OPCIONAL
   (solo si el sitio usa [data-theme="dark"], como dark-mode-init.php)
   ------------------------------------------------------------ */
[data-theme="dark"] .welcome-modal {
  background: #1c1f1c;
  color: #eee;
}

[data-theme="dark"] .welcome-modal__title {
  color: #fff;
}

[data-theme="dark"] .welcome-modal__subtitle {
  color: #bbb;
}

[data-theme="dark"] .welcome-modal__input-group label {
  background: #1c1f1c;
}

[data-theme="dark"] .welcome-modal__input-group input {
  background: #232823;
  border-color: #3a403a;
  color: #fff;
}

[data-theme="dark"] .welcome-modal__buyer-checkbox {
  color: #ccc;
}

[data-theme="dark"] .welcome-modal__legal {
  color: #999;
}

[data-theme="dark"] .welcome-modal__close {
  color: #eee;
}

[data-theme="dark"] .welcome-modal__close:hover {
  background: #2a2f2a;
}

/* ============================================================
   DARK MODE — alineado con html.dark del sitio
   ============================================================ */
html.dark .welcome-modal { background: #17181C; color: #ECEAE3; box-shadow: 0 24px 64px rgba(0,0,0,.6); }
html.dark .welcome-modal__title { color: #FEFEFE; }
html.dark .welcome-modal__subtitle { color: #9A9689; }
html.dark .welcome-modal__input-group input { background: #1E2026; border-color: #33363F; color: #ECEAE3; }
html.dark .welcome-modal__input-group input:focus { border-color: #FE0201; box-shadow: 0 0 0 3px rgba(254,2,1,.15); }
html.dark .welcome-modal__input-group label { background: #17181C; color: #9A9689; }
html.dark .welcome-modal__input-group input:focus + label,
html.dark .welcome-modal__input-group input:not(:placeholder-shown) + label { color: #FE0201; }
html.dark .welcome-modal__buyer-checkbox { color: #C9C5BA; }
html.dark .welcome-modal__close { color: #ECEAE3; }
html.dark .welcome-modal__close:hover { background: #262932; }
html.dark .welcome-modal__lang button { background: #1E2026; border-color: #33363F; color: #9A9689; }
html.dark .welcome-modal__lang button.is-active { background: #FE0201; border-color: #FE0201; color: #fff; }
html.dark .welcome-modal__legal { color: #7A7668; }
html.dark .welcome-modal__legal a { color: #FF4A49; }
html.dark .welcome-modal__error { color: #FF6B6B; }

/* 🆕 Brand-logo en modo oscuro:
   - El "No" (primer <span>) pasa a blanco para mantener el contraste de marca.
   - El resto del texto hereda el color del contenedor (normalmente #FE0201).
   El !important es intencional: sobrescribe estilos inline que el HTML
   pueda inyectar para colorear el primer tramo del logo. */
html.dark .welcome-modal__brand-logo span:first-child {
  color: #ECEAE3 !important;
}

/* ------------------------------------------------------------
   10. PANTALLAS CON POCA ALTURA (Laptops pequeñas, móviles horizontales)
   ------------------------------------------------------------ */
@media (max-height: 700px) {
  .welcome-modal__container {
    min-height: auto;
  }
  .welcome-modal__content {
    justify-content: flex-start;
    padding-top: 1.5rem;
  }
}