/**
 * Baxi Baxi — Widget 06 · Atendimento
 * Botão fixo + cartão do QR. Não estiliza o voltar-ao-topo do tema.
 */

body:not(.elementor-editor-active):not(.elementor-editor-preview) .bbx-floating-host,
body:not(.elementor-editor-active):not(.elementor-editor-preview) .bbx-floating-host .elementor,
body:not(.elementor-editor-active):not(.elementor-editor-preview) .bbx-floating-host .elementor-section,
body:not(.elementor-editor-active):not(.elementor-editor-preview) .bbx-floating-host .elementor-container,
body:not(.elementor-editor-active):not(.elementor-editor-preview) .bbx-floating-host .elementor-column,
body:not(.elementor-editor-active):not(.elementor-editor-preview) .bbx-floating-host .e-con,
body:not(.elementor-editor-active):not(.elementor-editor-preview) .bbx-floating-host .elementor-widget,
body:not(.elementor-editor-active):not(.elementor-editor-preview) .bbx-floating-host .elementor-widget-container {
  height: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: visible;
  pointer-events: none;
}

.bbx-atendimento {
  --bbx-green: #1faf5a;
  --bbx-green-deep: #178a46;
  --bbx-red: #c8102e;
  --bbx-navy: #152a5c;
  --bbx-ink: #3d4550;
  --bbx-muted: #6b7280;
  --bbx-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bbx-edge: 20px;
  --bbx-fab-bottom: calc(var(--bbx-edge) + env(safe-area-inset-bottom, 0px));

  position: fixed;
  z-index: 40;
  right: max(var(--bbx-edge), env(safe-area-inset-right, 0px));
  bottom: var(--bbx-fab-bottom);
  width: max-content;
  max-width: calc(100vw - 32px);
  margin: 0;
  padding: 0;
  pointer-events: none;
  font-family: var(--bbx-font);
  color: var(--bbx-ink);
}

.bbx-atendimento.is-open {
  z-index: 100000;
}

.bbx-atendimento *,
.bbx-atendimento *::before,
.bbx-atendimento *::after {
  box-sizing: border-box;
}

.bbx-atendimento .bbx-veil {
  position: fixed;
  inset: 0;
  margin: 0;
  background: rgba(21, 42, 92, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.bbx-atendimento.is-open .bbx-veil {
  opacity: 1;
  pointer-events: auto;
}

.bbx-atendimento .bbx-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: min(320px, calc(100vw - 32px));
  margin: 0;
  pointer-events: none;
}

.bbx-atendimento.is-open .bbx-panel {
  pointer-events: auto;
}

.bbx-atendimento .bbx-card {
  margin: 0;
  padding: 18px 18px 16px;
  border: 0;
  border-radius: 18px;
  background: #fff;
  box-shadow:
    0 18px 40px rgba(21, 42, 92, 0.16),
    0 2px 8px rgba(21, 42, 92, 0.06);
  transform-origin: 100% 100%;
  transform: translateY(8px) scale(0.96);
  opacity: 0;
  max-height: min(440px, calc(100dvh - var(--bbx-fab-bottom) - 88px));
  overflow: auto;
  transition: transform 0.24s ease, opacity 0.24s ease;
}

.bbx-atendimento.is-open .bbx-card {
  transform: none;
  opacity: 1;
}

.bbx-atendimento .bbx-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
}

.bbx-atendimento .bbx-title {
  margin: 0;
  font: 700 1rem/1.3 var(--bbx-font);
  color: var(--bbx-green-deep);
}

.bbx-atendimento .bbx-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #8b93a0;
  line-height: 0;
  cursor: pointer;
}

.bbx-atendimento .bbx-close svg {
  display: block;
  width: 16px;
  height: 16px;
}

.bbx-atendimento .bbx-close:hover,
.bbx-atendimento .bbx-close:focus-visible {
  background: #f3f4f6;
  color: var(--bbx-navy);
}

.bbx-atendimento .bbx-close:focus-visible,
.bbx-atendimento .bbx-fab:focus-visible,
.bbx-atendimento .bbx-link:focus-visible {
  outline: 2px solid rgba(31, 175, 90, 0.55);
  outline-offset: 2px;
}

.bbx-atendimento .bbx-lead {
  margin: 0 0 14px;
  font: 400 0.92rem/1.45 var(--bbx-font);
  color: var(--bbx-ink);
}

.bbx-atendimento .bbx-qr-wrap {
  margin: 0 0 14px;
  text-align: center;
}

.bbx-atendimento .bbx-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 148px;
  height: 148px;
  margin: 0 auto;
  border: 1.5px dashed #c5cad3;
  border-radius: 12px;
  background: #fafbfc;
  color: var(--bbx-muted);
  font: 500 0.82rem/1.3 var(--bbx-font);
}

.bbx-atendimento .bbx-qr img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
}

.bbx-atendimento .bbx-caption {
  margin: 8px 0 0;
  font: 500 0.75rem/1.35 var(--bbx-font);
  letter-spacing: 0.01em;
  color: #8b93a0;
}

.bbx-atendimento .bbx-more {
  margin: 0;
  text-align: center;
}

.bbx-atendimento .bbx-link {
  display: inline-block;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--bbx-red);
  font: 600 0.88rem/1.4 var(--bbx-font);
  text-decoration: none;
  cursor: pointer;
}

.bbx-atendimento .bbx-link-beam {
  color: var(--bbx-red);
  background-image: linear-gradient(
    105deg,
    var(--bbx-red) 0%,
    var(--bbx-red) 48.5%,
    #c9953a 50%,
    var(--bbx-red) 51.5%,
    var(--bbx-red) 100%
  );
  background-size: 320% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.bbx-atendimento .bbx-link:hover .bbx-link-beam,
.bbx-atendimento .bbx-link:focus-visible .bbx-link-beam {
  animation: bbx-atendimento-beam 1.15s ease;
}

.bbx-atendimento .bbx-fab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  margin: 0;
  padding: 8px 18px 8px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--bbx-green);
  color: #fff;
  box-shadow:
    0 10px 24px rgba(31, 175, 90, 0.38),
    0 0 0 6px rgba(31, 175, 90, 0.12);
  font: 700 0.95rem/1.15 var(--bbx-font);
  cursor: pointer;
  pointer-events: auto;
  opacity: 1;
  transform: none;
  transition:
    transform 0.4s ease,
    opacity 0.4s ease,
    box-shadow 0.25s ease,
    background 0.25s ease;
}

.bbx-atendimento.is-in .bbx-fab {
  opacity: 1;
  transform: none;
}

.bbx-atendimento.is-in:not(.is-open) .bbx-fab::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  border: 2px solid rgba(31, 175, 90, 0.45);
  pointer-events: none;
  animation: bbx-atendimento-pulse 2.8s ease-in-out infinite;
}

.bbx-atendimento.bbx-is-editor {
  position: relative;
  right: auto;
  bottom: auto;
  z-index: 1;
  width: 100%;
  max-width: none;
}

.bbx-atendimento.bbx-is-editor.is-open {
  z-index: 100000;
}

.bbx-atendimento.bbx-is-editor .bbx-fab,
.bbx-atendimento.bbx-is-editor .bbx-fab::after {
  opacity: 1;
  transform: none;
  animation: none;
}

.bbx-atendimento.bbx-is-editor .bbx-fab::after {
  content: none;
}

.bbx-atendimento.is-in .bbx-fab:hover,
.bbx-atendimento.is-in .bbx-fab:focus-visible {
  background: var(--bbx-green-deep);
  transform: translateY(-2px);
  box-shadow:
    0 14px 28px rgba(31, 175, 90, 0.42),
    0 0 0 8px rgba(31, 175, 90, 0.14);
}

.bbx-atendimento.is-in .bbx-fab:hover::after,
.bbx-atendimento.is-in .bbx-fab:focus-visible::after,
.bbx-atendimento.is-open .bbx-fab::after {
  animation: none;
  opacity: 0;
}

.bbx-atendimento.is-open .bbx-fab,
.bbx-atendimento.is-open .bbx-fab:hover,
.bbx-atendimento.is-open .bbx-fab:focus-visible {
  transform: none;
}

.bbx-atendimento .bbx-icon {
  display: block;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
}

.bbx-atendimento .bbx-fab-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.bbx-atendimento .bbx-fab-kicker {
  font: 700 0.92rem/1.1 var(--bbx-font);
}

.bbx-atendimento .bbx-fab-sub {
  font: 600 0.72rem/1.2 var(--bbx-font);
  opacity: 0.92;
}

@media (max-width: 1024px) {
  .bbx-atendimento .bbx-title { font-size: 1.0625rem; }
  .bbx-atendimento .bbx-lead { font-size: 1rem; line-height: 1.5; }
  .bbx-atendimento .bbx-caption { font-size: 0.875rem; }
  .bbx-atendimento .bbx-link { font-size: 1rem; }
  .bbx-atendimento .bbx-qr { font-size: 0.875rem; }
  .bbx-atendimento .bbx-fab-kicker { font-size: 0.9375rem; }
  .bbx-atendimento .bbx-fab-sub { font-size: 0.8125rem; }
}

@media (max-width: 719px) {
  .bbx-atendimento {
    --bbx-edge: 16px;
  }

  .bbx-atendimento .bbx-panel {
    width: calc(100vw - 32px);
  }

  .bbx-atendimento .bbx-card {
    padding: 16px 16px 14px;
  }

  .bbx-atendimento .bbx-title { font-size: 1.125rem; }
  .bbx-atendimento .bbx-lead { font-size: 1rem; line-height: 1.5; margin-bottom: 12px; }
  .bbx-atendimento .bbx-caption { font-size: 0.875rem; }
  .bbx-atendimento .bbx-link { font-size: 1rem; }
  .bbx-atendimento .bbx-qr {
    width: 136px;
    height: 136px;
    font-size: 0.875rem;
  }

  .bbx-atendimento .bbx-fab {
    min-height: 52px;
    padding: 8px 14px 8px 12px;
  }

  .bbx-atendimento .bbx-fab-kicker { font-size: 1rem; }
  .bbx-atendimento .bbx-fab-sub { font-size: 0.875rem; }
}

@keyframes bbx-atendimento-beam {
  from { background-position: 100% 0; }
  to { background-position: 0% 0; }
}

@keyframes bbx-atendimento-pulse {
  0%,
  100% {
    opacity: 0.7;
    transform: scale(1);
  }
  70% {
    opacity: 0;
    transform: scale(1.12);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bbx-atendimento:not(.bbx-force-motion) .bbx-fab,
  .bbx-atendimento:not(.bbx-force-motion) .bbx-fab::after,
  .bbx-atendimento:not(.bbx-force-motion) .bbx-card,
  .bbx-atendimento:not(.bbx-force-motion) .bbx-veil,
  .bbx-atendimento:not(.bbx-force-motion) .bbx-link-beam {
    transition: none;
    animation: none;
  }

  .bbx-atendimento:not(.bbx-force-motion) .bbx-fab,
  .bbx-atendimento:not(.bbx-force-motion).is-open .bbx-card {
    opacity: 1;
    transform: none;
  }
}
