/* ================================================================
   DEKEVA — exit-cta.css · Captación de salida hacia la auditoría

   Dos piezas, nunca las dos a la vez:
     1) .dkv-exit  modal de exit-intent (solo puntero fino)
     2) .dkv-bar   banda inferior (solo táctil), sin modal

   Convive con el widget de Deki Chat: mientras el modal esté abierto
   se oculta su burbuja proactiva, y cuando la banda está visible el
   launcher del chat sube para no solaparse (lo hace el JS, porque el
   widget pinta sus estilos inline y no hay hoja a la que ganarle).

   Tokens calcados del chrome del tema (ver auditoria.css / blog.css).
   No hereda de ninguna landing: se carga en todas las páginas.
================================================================ */

.dkv-exit,
.dkv-bar {
  --dkv-x-bg:      #f2ede4;
  --dkv-x-text:    #0d0d0b;
  --dkv-x-muted:   #6b6b68;
  --dkv-x-border:  rgba(13, 13, 11, 0.10);
  --dkv-x-blue:    #032FD4;
  --dkv-x-blue-dk: #021f8f;
  --dkv-x-display: 'Cormorant Garamond', Georgia, serif;
  --dkv-x-italic:  'Cormorant', Georgia, serif;
  --dkv-x-body:    'Inter', system-ui, sans-serif;
  --dkv-x-ease:    cubic-bezier(.19, 1, .22, 1);
}

[hidden] { display: none !important; }

/* ════════════════════════════════════════════════════════════
   1. MODAL DE SALIDA (desktop)
═══════════════════════════════════════════════════════════ */
.dkv-exit {
  position: fixed;
  inset: 0;
  /* Por encima del launcher del chat (2147483641) para que nada del
     widget quede flotando sobre el diálogo. */
  z-index: 2147483642;
  display: grid;
  place-items: center;
  padding: 24px;
}

.dkv-exit__scrim {
  position: absolute;
  inset: 0;
  background: rgba(13, 13, 11, 0.62);
  opacity: 0;
  transition: opacity .3s var(--dkv-x-ease);
}

.dkv-exit__panel {
  position: relative;
  width: min(520px, 100%);
  background: var(--dkv-x-bg);
  color: var(--dkv-x-text);
  font-family: var(--dkv-x-body);
  border: 1px solid var(--dkv-x-border);
  border-radius: 12px;
  box-shadow: 0 32px 80px -24px rgba(13, 13, 11, .45);
  padding: clamp(32px, 5vw, 48px);
  text-align: left;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .35s var(--dkv-x-ease), transform .35s var(--dkv-x-ease);
}

.dkv-exit.is-open .dkv-exit__scrim { opacity: 1; }
.dkv-exit.is-open .dkv-exit__panel { opacity: 1; transform: none; }

.dkv-exit__kicker {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dkv-x-muted);
  margin: 0 0 18px;
}

.dkv-exit__title {
  font-family: var(--dkv-x-display);
  font-weight: 400;
  font-size: clamp(30px, 3.4vw, 40px);
  line-height: 1.12;
  letter-spacing: -.01em;
  margin: 0 0 16px;
}

.dkv-exit__title em {
  font-family: var(--dkv-x-italic);
  font-style: italic;
  color: var(--dkv-x-blue);
  /* Reserva para el descendente de la "g" de "frenando". */
  line-height: 1.16;
  padding-bottom: 2px;
}

.dkv-exit__text {
  font-size: 15px;
  line-height: 1.65;
  color: var(--dkv-x-muted);
  margin: 0 0 28px;
  max-width: 44ch;
}

.dkv-exit__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--dkv-x-blue);
  color: #fff;
  font-family: var(--dkv-x-body);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .14em;
  text-decoration: none;
  padding: 16px 32px;
  border-radius: 12px;
  transition: background .25s, transform .25s var(--dkv-x-ease);
}

.dkv-exit__cta:hover,
.dkv-exit__cta:focus-visible { background: var(--dkv-x-blue-dk); color: #fff; }
.dkv-exit__cta:active { transform: translateY(1px); }

.dkv-exit__dismiss {
  display: block;
  margin-top: 18px;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--dkv-x-body);
  font-size: 13px;
  color: var(--dkv-x-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.dkv-exit__dismiss:hover { color: var(--dkv-x-text); }

.dkv-exit__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--dkv-x-muted);
  font-family: var(--dkv-x-body);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s, color .2s;
}

.dkv-exit__close:hover { background: rgba(13, 13, 11, .06); color: var(--dkv-x-text); }

/* Foco visible propio: el reset del tema apaga outlines en varios sitios. */
.dkv-exit :focus-visible,
.dkv-bar :focus-visible {
  outline: 2px solid var(--dkv-x-blue);
  outline-offset: 3px;
}

/* Mientras el diálogo está abierto, la burbuja proactiva del chat calla.
   Una interrupción cada vez. */
body.dkv-exit-open #deki-chat-teaser { display: none !important; }

/* ════════════════════════════════════════════════════════════
   2. BANDA INFERIOR (táctil)
═══════════════════════════════════════════════════════════ */
.dkv-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2147483642;
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--dkv-x-bg);
  border-top: 1px solid var(--dkv-x-border);
  box-shadow: 0 -8px 32px -12px rgba(13, 13, 11, .28);
  transform: translateY(100%);
  transition: transform .4s var(--dkv-x-ease);
  /* Barra de navegación de iOS. */
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.dkv-bar.is-open { transform: none; }

.dkv-bar__link {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 8px 4px 8px 16px;
  text-decoration: none;
  color: var(--dkv-x-text);
  font-family: var(--dkv-x-body);
}

.dkv-bar__text {
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--dkv-x-muted);
}

/* En pantallas estrechas el texto ya compite con el botón: la coletilla
   solo aparece cuando hay sitio de sobra. */
.dkv-bar__more { display: none; }

@media (min-width: 380px) {
  .dkv-bar__more { display: inline; }
}

/* Pantallas muy estrechas: el botón y la X ceden píxeles al mensaje. */
@media (max-width: 359px) {
  .dkv-bar__link { padding-left: 12px; }
  .dkv-bar__text { font-size: 12.5px; }
  .dkv-bar__cta { padding: 0 14px; }
  .dkv-bar__close { width: 40px; }
}

.dkv-bar__text b {
  font-weight: 500;
  color: var(--dkv-x-text);
}

.dkv-bar__cta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  /* 44px es el mínimo cómodo para el pulgar. */
  min-height: 44px;
  background: var(--dkv-x-blue);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .12em;
  padding: 0 18px;
  border-radius: 12px;
  white-space: nowrap;
}

.dkv-bar__close {
  flex: 0 0 auto;
  width: 48px;
  border: 0;
  background: none;
  color: var(--dkv-x-muted);
  font-family: var(--dkv-x-body);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

/* ════════════════════════════════════════════════════════════
   3. Preferencias del visitante
═══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .dkv-exit__scrim,
  .dkv-exit__panel,
  .dkv-bar {
    transition: none;
  }
  .dkv-exit__panel { transform: none; }
}
