/**
 * Leadster (Neurolead) — isolamento SEM quebrar cliques/layout do widget.
 * Não usar pointer-events:none nem reset margin/padding em * (quebrava botões e overlay).
 */

:root {
  --sobilis-leadster-z: 9800;
  --sobilis-leadster-fab-bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
}

body.page-implante-ads {
  --sobilis-leadster-fab-bottom: calc(var(--ads-sticky-h, 76px) + 0.65rem + env(safe-area-inset-bottom, 0px));
}

body.lp {
  --sobilis-leadster-fab-bottom: calc(var(--lp-fab-clearance, 68px) + 0.65rem);
}

body.tpl-body:not(.lp):not(.page-implante-ads) {
  --sobilis-leadster-fab-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
}

.nld-chatbot {
  z-index: var(--sobilis-leadster-z) !important;
  isolation: isolate;
}

#nld-event-bus {
  z-index: calc(var(--sobilis-leadster-z) + 1);
}

/* Site/LP não herdam estilos de link/imagem nos botões do chat */
.nld-chatbot a {
  color: revert;
  text-decoration: revert;
}

.nld-chatbot img:not([width]):not([height]) {
  max-width: 100%;
  height: auto;
}

/* Bolha acima do CTA fixo mobile */
.nld-chatbot .nld-avatar,
.nld-chatbot .nld-avatar-medium,
.nld-chatbot .nld-avatar-small {
  bottom: var(--sobilis-leadster-fab-bottom) !important;
  right: max(0.75rem, env(safe-area-inset-right, 0px)) !important;
}

@media (max-width: 768px) {
  .nld-chatbot .nld-widget,
  .nld-chatbot .nld-chatbot-widget {
    bottom: var(--sobilis-leadster-fab-bottom) !important;
    max-height: min(78dvh, 34rem) !important;
    max-width: min(100vw - 1.5rem, 26rem) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    left: 0.75rem !important;
    right: 0.75rem !important;
  }
}

html.ads-privacy-open body.page-implante-ads .ads-privacy-modal {
  z-index: 10050;
}

.sobilis-ag-overlay.is-open {
  z-index: 10050 !important;
}

html.sobilis-leadster-ready:has(.nld-chatbot) .wa-float {
  display: none !important;
}
