/* Citricus Lead Router - botoes flutuantes */
.clr-fab,
.clr-fab *,
.clr-fab *::before,
.clr-fab *::after { box-sizing: border-box; }

.clr-fab {
  position: fixed;
  z-index: 99990;
  display: flex;
  gap: 10px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .45s ease, visibility .45s ease, transform .45s cubic-bezier(.16,1,.3,1);
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
}
.clr-fab.is-in { opacity: 1; visibility: visible; pointer-events: auto; }

.clr-fab-btn {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 99px;
  overflow: hidden;
  text-decoration: none !important;
  animation: clr-wiggle 7s ease-in-out infinite;
}

/* ---------- DESKTOP: lateral flutuante ---------- */
@media (min-width: 769px) {
  .clr-fab {
    top: 50%;
    flex-direction: column;
    align-items: flex-start;
    transform: translateY(-50%);
    animation: clr-drift 4.5s ease-in-out infinite;
  }
  .clr-fab.clr-side-left  { left: var(--clr-offset, 22px); }
  .clr-fab.clr-side-right { right: var(--clr-offset, 22px); align-items: flex-end; }
  .clr-fab.clr-no-desktop { display: none; }

  .clr-fab-btn {
    height: 58px;
    padding: 0;
    max-width: calc(100vw - 80px);
    box-shadow: 0 16px 34px -10px rgba(0,0,0,.45);
    transition: box-shadow .3s ease;
  }
  .clr-fab-btn:hover { box-shadow: 0 20px 40px -10px rgba(0,0,0,.55); }

  /* largura automatica: o rotulo abre sozinho, cabe qualquer texto */
  .clr-fab-label {
    max-width: 0;
    opacity: 0;
    padding-right: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: max-width .42s cubic-bezier(.16,1,.3,1),
                opacity .24s ease,
                padding-right .42s cubic-bezier(.16,1,.3,1);
  }
  .clr-fab-btn:hover .clr-fab-label,
  .clr-fab-btn:focus-visible .clr-fab-label { max-width: 340px; opacity: 1; padding-right: 24px; }

  .clr-fab-ico { margin: 0 10px; }
}

/* ---------- MOBILE: WhatsApp dominante + telefone so icone ---------- */
@media (max-width: 768px) {
  .clr-fab {
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: row;
    align-items: center;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    gap: 8px;
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(33,35,38,.1);
    box-shadow: 0 -8px 26px -12px rgba(33,35,38,.35);
    transform: translateY(100%);
  }
  .clr-fab.is-in { transform: translateY(0); }
  .clr-fab.clr-no-mobile { display: none; }

  .clr-fab-btn {
    height: 48px;
    box-shadow: 0 8px 18px -10px rgba(0,0,0,.45);
  }

  /* WhatsApp ocupa toda a largura que sobra */
  .clr-fab-wpp {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
    gap: 9px;
    padding: 0 14px;
  }

  /* Telefone: circulo fixo, so o icone */
  .clr-fab-tel {
    flex: 0 0 48px;
    width: 48px;
    padding: 0;
    justify-content: center;
  }
  /* rotulo continua no DOM para leitor de tela */
  .clr-fab-tel .clr-fab-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    white-space: nowrap;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
  }

  .clr-fab-ico { width: auto; height: auto; margin: 0; background: none !important; border-radius: 0; }
  .clr-fab-wpp .clr-fab-ico svg { width: 22px; height: 22px; fill: #fff; }
  .clr-fab-tel .clr-fab-ico svg { width: 21px; height: 21px; }

  .clr-fab-label {
    font-size: 14px;
    letter-spacing: -.01em;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  body.clr-has-bar { padding-bottom: 66px !important; }
}

@media (max-width: 380px) {
  .clr-fab { padding: 7px 8px calc(7px + env(safe-area-inset-bottom, 0px)); gap: 7px; }
  .clr-fab-btn { height: 46px; }
  .clr-fab-tel { flex-basis: 46px; width: 46px; }
  .clr-fab-wpp { padding: 0 12px; gap: 8px; }
  .clr-fab-label { font-size: 13px; }
}

/* ---------- Cores e conteudo ---------- */
.clr-fab-wpp {
  background: linear-gradient(135deg, #1c8a4a 0%, var(--clr-wpp, #25D366) 60%, #1EBE5B 100%);
  color: #fff !important;
}
.clr-fab-tel {
  background: #212326;
  color: var(--clr-accent, #FFA501) !important;
  border: 1px solid rgba(255,165,1,.45);
}

.clr-fab-ico {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.clr-fab-wpp .clr-fab-ico svg { width: 21px; height: 21px; fill: var(--clr-wpp, #25D366); }
.clr-fab-tel .clr-fab-ico { background: rgba(255,165,1,.16); }
.clr-fab-tel .clr-fab-ico svg { width: 18px; height: 18px; color: var(--clr-accent, #FFA501); }

.clr-fab-label {
  position: relative;
  z-index: 2;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .01em;
  line-height: 1;
  color: inherit;
}

/* ---------- Espelho (shine) ---------- */
.clr-fab-shine {
  position: absolute;
  top: 0;
  left: -120%;
  width: 45%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.42) 50%, transparent 100%);
  transform: skewX(-24deg);
  animation: clr-shine 4.2s ease-in-out infinite;
}
.clr-fab-tel .clr-fab-shine { background: linear-gradient(90deg, transparent 0%, rgba(255,165,1,.32) 50%, transparent 100%); }

/* ---------- Pulso ---------- */
.clr-fab-ring {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 99px;
  pointer-events: none;
  box-shadow: 0 0 0 0 rgba(37,211,102,.6);
  animation: clr-pulse 2.6s ease-out infinite;
}

@keyframes clr-drift {
  0%, 100% { transform: translateY(-50%); }
  50%      { transform: translateY(calc(-50% - 7px)); }
}
@keyframes clr-wiggle {
  0%, 78%, 100% { rotate: 0deg; }
  82%           { rotate: -5deg; }
  86%           { rotate: 4deg; }
  90%           { rotate: -3deg; }
  94%           { rotate: 0deg; }
}
@keyframes clr-shine {
  0%   { left: -120%; }
  55%  { left: 190%; }
  100% { left: 190%; }
}
@keyframes clr-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(37,211,102,.55); }
  70%  { box-shadow: 0 0 0 16px rgba(37,211,102,0); }
  100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); }
}

@media (prefers-reduced-motion: reduce) {
  .clr-fab, .clr-fab-btn, .clr-fab-shine, .clr-fab-ring { animation: none !important; }
  .clr-fab { transition: opacity .2s linear; }
}

@media print { .clr-fab { display: none !important; } }
