/* ==========================================================================
 * UJ WhatsApp Popup (Popup Maker #3835 + formulario nativo tochat wa.urieljareth.com)
 * Sistema de diseño: DM Sans, #0400C4 / #0F172A / #FFFFFF, radios 10-14px.
 * ========================================================================== */

/* Bloqueo de scroll del documento mientras el popup esta abierto */
html.pum-open.pum-open-overlay,
html.pum-open.pum-open-overlay body {
  overflow: hidden !important;
}

/* Mantener el modal libre de solapamientos (banner de cookies, Chatwoot, reCAPTCHA y FAB) */
html.pum-open #uj-cc,
html.pum-open .woot-widget-bubble,
html.pum-open .woot-widget-holder,
html.pum-open #uj-wa-fab,
html.pum-open .grecaptcha-badge {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: 1 !important;
}

/* Overlay del popup #3835 */
#pum-3835.pum-overlay {
  background-color: rgba(7, 11, 20, 0.72) !important;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2147483647 !important;
  padding: 16px !important;
  box-sizing: border-box !important;
  overflow-y: auto !important;
}

/* Contenedor principal del modal #3835 */
#popmake-3835.pum-container {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important;
  width: min(472px, calc(100vw - 24px)) !important;
  max-width: 472px !important;
  min-width: 0 !important;
  max-height: calc(100dvh - 32px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 24px 24px 20px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  background-color: #FFFFFF !important;
  color: #0F172A !important;
  box-shadow: 0 24px 60px rgba(7, 11, 20, 0.32) !important;
  box-sizing: border-box !important;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  text-align: left !important;
}

#popmake-3835 .pum-title {
  display: none !important;
}

/* Boton de cierre visible, accesible y tactil (40x40) */
#popmake-3835 .pum-close.popmake-close {
  position: absolute !important;
  top: 14px !important;
  right: 14px !important;
  left: auto !important;
  bottom: auto !important;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  padding: 0 !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 10px !important;
  border: 1px solid #CBD5E1 !important;
  background-color: #F1F5F9 !important;
  color: #0F172A !important;
  font-family: "DM Sans", sans-serif !important;
  font-size: 22px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  text-shadow: none !important;
  box-shadow: none !important;
  cursor: pointer !important;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease !important;
  z-index: 5 !important;
}

#popmake-3835 .pum-close.popmake-close:hover {
  background-color: #E2E8F0 !important;
  border-color: #94A3B8 !important;
  color: #070707 !important;
}

#popmake-3835 .pum-close.popmake-close:focus-visible {
  outline: 2px solid #0400C4 !important;
  outline-offset: 2px !important;
}

/* Encabezado interno del modal */
.uj-wa-modal-head {
  padding-right: 48px;
  margin-bottom: 14px;
}

.uj-wa-modal-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #15803D;
}

.uj-wa-modal-kicker-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background-color: #25D366;
  display: inline-block;
}

.uj-wa-modal-title {
  margin: 0 0 6px;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.32rem;
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.02em;
  color: #0F172A;
}

.uj-wa-modal-sub {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.48;
  color: #475569;
}

/* Estado de carga antes de que monte Svelte */
.uj-wa-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 180px;
  padding: 20px 12px;
  border-radius: 10px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  text-align: center;
  color: #334155;
  font-size: 0.92rem;
}

.uj-wa-loading[hidden] {
  display: none !important;
}

.uj-wa-spinner {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 3px solid #E2E8F0;
  border-top-color: #0400C4;
  animation: ujWaSpin 0.75s linear infinite;
}

@keyframes ujWaSpin {
  to { transform: rotate(360deg); }
}

.uj-wa-error {
  padding: 14px 16px;
  border-radius: 10px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
  font-size: 0.9rem;
  line-height: 1.45;
  margin-bottom: 12px;
}

.uj-wa-error[hidden] {
  display: none !important;
}

/* Contenedor del widget nativo de tochat */
#whatapp-people-widget-db9ba377-3202-4e79-afd6-0b0348fa3a94 {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#whatapp-people-widget-db9ba377-3202-4e79-afd6-0b0348fa3a94 .copy-widget-wrapper {
  display: none !important;
}

#whatapp-people-widget-db9ba377-3202-4e79-afd6-0b0348fa3a94 .chatwith-big-person,
#whatapp-people-widget-db9ba377-3202-4e79-afd6-0b0348fa3a94 .widget-container,
#whatapp-people-widget-db9ba377-3202-4e79-afd6-0b0348fa3a94 .widget-wrapper,
#whatapp-people-widget-db9ba377-3202-4e79-afd6-0b0348fa3a94 form {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

#whatapp-people-widget-db9ba377-3202-4e79-afd6-0b0348fa3a94 .chatwith-big-person,
#whatapp-people-widget-db9ba377-3202-4e79-afd6-0b0348fa3a94 .chatwith-big-person > div {
  box-shadow: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}

#whatapp-people-widget-db9ba377-3202-4e79-afd6-0b0348fa3a94 .chatwith-button {
  background-color: #0F172A !important;
  color: #FFFFFF !important;
  border-radius: 10px !important;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  min-height: 46px !important;
  transition: background-color 0.16s ease !important;
}

#whatapp-people-widget-db9ba377-3202-4e79-afd6-0b0348fa3a94 .chatwith-button:hover {
  background-color: #0400C4 !important;
}

#whatapp-people-widget-db9ba377-3202-4e79-afd6-0b0348fa3a94 .chatwith-button:focus-visible {
  outline: 2px solid #0400C4 !important;
  outline-offset: 2px !important;
}

#whatapp-people-widget-db9ba377-3202-4e79-afd6-0b0348fa3a94 input[type="text"],
#whatapp-people-widget-db9ba377-3202-4e79-afd6-0b0348fa3a94 input[type="email"],
#whatapp-people-widget-db9ba377-3202-4e79-afd6-0b0348fa3a94 input[type="tel"],
#whatapp-people-widget-db9ba377-3202-4e79-afd6-0b0348fa3a94 input[type="number"],
#whatapp-people-widget-db9ba377-3202-4e79-afd6-0b0348fa3a94 textarea,
#whatapp-people-widget-db9ba377-3202-4e79-afd6-0b0348fa3a94 select {
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 16px !important;
  color: #0F172A !important;
  border-radius: 8px !important;
  box-sizing: border-box !important;
}

#whatapp-people-widget-db9ba377-3202-4e79-afd6-0b0348fa3a94 input::placeholder,
#whatapp-people-widget-db9ba377-3202-4e79-afd6-0b0348fa3a94 textarea::placeholder {
  color: #475569 !important;
  opacity: 1 !important;
}

#whatapp-people-widget-db9ba377-3202-4e79-afd6-0b0348fa3a94 input:focus,
#whatapp-people-widget-db9ba377-3202-4e79-afd6-0b0348fa3a94 textarea:focus,
#whatapp-people-widget-db9ba377-3202-4e79-afd6-0b0348fa3a94 select:focus {
  border-color: #0400C4 !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(4, 0, 196, 0.14) !important;
}

#whatapp-people-widget-db9ba377-3202-4e79-afd6-0b0348fa3a94 button[type="submit"],
#whatapp-people-widget-db9ba377-3202-4e79-afd6-0b0348fa3a94 .chatwith-send-btn,
#whatapp-people-widget-db9ba377-3202-4e79-afd6-0b0348fa3a94 button.send-button {
  background-color: #15803D !important;
  color: #FFFFFF !important;
  border-radius: 10px !important;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  min-height: 46px !important;
  cursor: pointer !important;
  transition: background-color 0.16s ease !important;
}

#whatapp-people-widget-db9ba377-3202-4e79-afd6-0b0348fa3a94 button[type="submit"]:hover,
#whatapp-people-widget-db9ba377-3202-4e79-afd6-0b0348fa3a94 .chatwith-send-btn:hover,
#whatapp-people-widget-db9ba377-3202-4e79-afd6-0b0348fa3a94 button.send-button:hover {
  background-color: #166534 !important;
}

#whatapp-people-widget-db9ba377-3202-4e79-afd6-0b0348fa3a94 button[type="submit"]:focus-visible {
  outline: 2px solid #0400C4 !important;
  outline-offset: 2px !important;
}

/* Pie de respaldo dentro del modal */
.uj-wa-modal-foot {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #E2E8F0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: #475569;
  text-align: center;
}

.uj-wa-modal-foot a {
  color: #0400C4;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.uj-wa-modal-foot a:hover,
.uj-wa-modal-foot a:focus-visible {
  color: #532DF5;
}

/* Boton flotante ligero de WhatsApp (reemplaza el script flotante de 1.1 MB en carga inicial) */
.uj-wa-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99990;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 11px 18px;
  border-radius: 12px;
  background-color: #0F172A;
  color: #FFFFFF !important;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 26px rgba(7, 11, 20, 0.24);
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-decoration: none !important;
  cursor: pointer;
  transition: background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease, bottom 0.2s ease;
}

.uj-wa-fab:hover {
  background-color: #0400C4;
  color: #FFFFFF !important;
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(4, 0, 196, 0.28);
}

.uj-wa-fab:focus-visible {
  outline: 2px solid #0400C4;
  outline-offset: 3px;
}

.uj-wa-fab svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: block;
}

/* Boton reutilizable para entradas del blog y bloques de contenido */
.uj-wa-blog-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 16px 0 24px;
}

.uj-wa-cta-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 12px 20px;
  border-radius: 10px;
  background-color: #0F172A !important;
  color: #FFFFFF !important;
  border: 1px solid #0F172A;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.96875rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none !important;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.uj-wa-cta-btn:hover {
  background-color: #0400C4 !important;
  border-color: #0400C4;
  color: #FFFFFF !important;
  transform: translateY(-1px);
}

.uj-wa-cta-btn:focus-visible {
  outline: 2px solid #0400C4;
  outline-offset: 2px;
}

.uj-wa-cta-btn svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

.uj-wa-blog-cta-note {
  font-size: 0.875rem;
  color: #475569;
}

/* Responsivo movil (390x844 y menores) */
@media (max-width: 640px) {
  #pum-3835.pum-overlay {
    padding: 10px !important;
  }

  #popmake-3835.pum-container {
    width: calc(100vw - 20px) !important;
    max-height: calc(100dvh - 20px) !important;
    padding: 18px 16px 16px !important;
    border-radius: 12px !important;
  }

  #popmake-3835 .pum-close.popmake-close {
    top: 10px !important;
    right: 10px !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
  }

  .uj-wa-modal-title {
    font-size: 1.18rem;
  }

  .uj-wa-modal-sub {
    font-size: 0.875rem;
  }

  #whatapp-people-widget-db9ba377-3202-4e79-afd6-0b0348fa3a94 select {
    max-width: 96px !important;
    padding-left: 6px !important;
    padding-right: 16px !important;
    font-size: 14px !important;
  }

  .uj-wa-fab {
    right: 12px;
    bottom: 12px;
    padding: 10px 14px;
    min-height: 44px;
    font-size: 0.875rem;
    gap: 7px;
  }

  .uj-wa-blog-cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .uj-wa-cta-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .uj-wa-spinner {
    animation: none;
  }
  .uj-wa-fab,
  .uj-wa-cta-btn,
  #popmake-3835 .pum-close.popmake-close {
    transition: none !important;
    transform: none !important;
  }
}
