/* ==========================================================================
   WIDGET DE WHATSAPP (PADRÃO OFICIAL: FAB, MODAL CHAT & TEASER)
   ========================================================================== */
:root {
  --wa-accent: #25D366;
  --wa-accent-hover: #20BA5A;
  --wa-ink: #111827;
  --wa-ink-2: #374151;
  --wa-ink-3: #6B7280;
  --wa-line: #D1D5DB;
  --wa-line-soft: #E5E7EB;
  --wa-chip-border: #D1D5DB;
  --wa-bubble-in: #F3F4F6;
  --wa-bubble-out: #111827;
  --wa-surface: #FFFFFF;
  --wa-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-float: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.wa-ico {
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  flex: 0 0 auto;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ffffff' d='M.057 24l1.687-6.163a11.867 11.867 0 0 1-1.587-5.946C.16 5.335 5.495 0 12.05 0a11.817 11.817 0 0 1 8.413 3.488 11.824 11.824 0 0 1 3.48 8.414c-.003 6.557-5.338 11.892-11.893 11.892a11.9 11.9 0 0 1-5.688-1.448L.057 24zm6.597-3.807c1.676.995 3.276 1.591 5.392 1.592 5.448 0 9.886-4.434 9.889-9.885.002-5.462-4.415-9.89-9.881-9.892-5.452 0-9.887 4.434-9.889 9.884a9.86 9.86 0 0 0 1.51 5.26l-.999 3.648 3.748-.984zm11.387-5.464c-.074-.124-.272-.198-.57-.347-.297-.149-1.758-.868-2.031-.967-.272-.099-.47-.149-.669.149-.198.297-.768.967-.941 1.165-.173.198-.347.223-.644.074-.297-.149-1.255-.462-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.297-.347.446-.521.151-.172.2-.296.3-.495.099-.198.05-.372-.025-.521-.075-.148-.669-1.611-.916-2.206-.242-.579-.487-.501-.669-.51l-.57-.01a1.1 1.1 0 0 0-.792.372c-.272.297-1.04 1.016-1.04 2.479s1.065 2.876 1.213 3.074c.149.198 2.095 3.2 5.076 4.487.709.306 1.263.489 1.694.626.712.226 1.36.194 1.872.118.571-.085 1.758-.719 2.006-1.413.248-.695.248-1.29.173-1.414z'/%3E%3C/svg%3E");
}

.wa-ico--lg {
  width: 1.7rem;
  height: 1.7rem;
}

/* Floating Action Button (FAB) */
#whatsappFab {
  position: fixed;
  right: 20px;
  bottom: 84px;
  z-index: 46;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--wa-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-float);
  transform: translateY(120%) scale(0.6);
  opacity: 0;
  transition: transform 0.4s var(--wa-ease), opacity 0.4s ease, box-shadow 0.3s ease;
  text-decoration: none;
  pointer-events: auto;
}

#whatsappFab.is-visible {
  transform: translateY(0) scale(1);
  opacity: 1;
}

body.menu-open #whatsappFab.is-visible {
  transform: translateY(120%) scale(0.6);
  opacity: 0;
}

@media (min-width: 768px) {
  #whatsappFab {
    right: 36px;
    bottom: 36px;
    width: 64px;
    height: 64px;
  }
  #whatsappFab .wa-ico {
    width: 2rem;
    height: 2rem;
  }
}

@media (min-width: 768px) and (hover: hover) {
  #whatsappFab.is-visible:hover {
    box-shadow: 0 16px 40px rgba(37, 211, 102, 0.45);
    transform: scale(1.06);
    background: var(--wa-accent-hover);
  }
}

/* Chat Widget (Modal Desktop) */
.wa-widget {
  position: fixed;
  right: 36px;
  bottom: 116px;
  z-index: 59;
  width: 285px;
  transform-origin: bottom right;
  opacity: 0;
  transform: scale(0.9) translateY(4px);
  pointer-events: none;
  transition: opacity 0.35s var(--wa-ease), transform 0.4s var(--wa-ease);
  font-family: var(--font-sans);
}

.wa-widget.is-open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

.wa-panel {
  position: relative;
  background: var(--wa-surface);
  border: 1.5px solid var(--wa-line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22);
}

.wa-panel::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--wa-surface);
  border-right: 1.5px solid var(--wa-line);
  border-bottom: 1.5px solid var(--wa-line);
  border-bottom-right-radius: 3px;
  bottom: -8px;
  right: 28px;
  transform: rotate(45deg);
}

.wa-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--wa-line-soft);
}

.wa-head .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
  flex-shrink: 0;
}

.wa-head b {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--wa-ink);
  display: block;
  font-family: var(--font-sans);
}

.wa-head small {
  font-size: 0.68rem;
  color: var(--wa-ink-3);
  display: block;
}

.wa-scroll {
  max-height: min(58vh, 380px);
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #D1D5DB transparent;
}

.wa-scroll::-webkit-scrollbar {
  width: 5px;
}

.wa-scroll::-webkit-scrollbar-thumb {
  background: #D1D5DB;
  border-radius: 5px;
}

.wa-thread {
  display: flex;
  flex-direction: column;
}

.wa-bubble {
  max-width: 88%;
  padding: 8px 11px;
  font-size: 0.82rem;
  line-height: 1.45;
  border-radius: 13px;
  margin-bottom: 12px;
  overflow-wrap: break-word;
  animation: waMsgIn 0.35s var(--wa-ease) both;
  flex-shrink: 0;
}

.wa-bubble--in {
  background: var(--wa-bubble-in);
  color: var(--wa-ink);
  border-top-left-radius: 4px;
  align-self: flex-start;
  border: 1px solid var(--wa-line-soft);
}

.wa-bubble--out {
  background: var(--wa-bubble-out);
  color: #FFFFFF;
  border-top-right-radius: 4px;
  align-self: flex-end;
  border: 1px solid #1E293B;
}

.wa-bubble--typing {
  padding: 11px 13px;
}

.wa-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.wa-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--wa-ink-3);
  animation: waType 1.2s infinite ease-in-out;
}

.wa-dots span:nth-child(2) { animation-delay: 0.18s; }
.wa-dots span:nth-child(3) { animation-delay: 0.36s; }

@keyframes waType {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

@keyframes waMsgIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.wa-quick {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 5px;
  flex-shrink: 0;
}

.wa-chip {
  width: 100%;
  text-align: left;
  background: #FFFFFF;
  border: 1.5px solid var(--wa-chip-border);
  border-radius: 10px;
  padding: 8px 11px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--wa-ink);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.wa-chip:hover {
  border-color: var(--wa-accent);
  color: #111827;
  background: #F9FAFB;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
}

.wa-quick-end {
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--wa-ink-3);
  margin: 6px 2px 0;
}

.wa-cta {
  display: block;
  text-align: center;
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px solid var(--wa-line-soft);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #16A34A;
  text-decoration: none;
  transition: color 0.2s ease;
}

.wa-cta:hover {
  color: #15803D;
  text-decoration: underline;
}

.wa-close {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--wa-line);
  background: #FFFFFF;
  color: #4B5563;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.wa-close:hover {
  background: #FEE2E2;
  border-color: #EF4444;
  color: #EF4444;
}

.wa-close::before, .wa-close::after,
.wa-teaser-x::before, .wa-teaser-x::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
}

.wa-close::before, .wa-teaser-x::before { transform: translate(-50%, -50%) rotate(45deg); }
.wa-close::after, .wa-teaser-x::after { transform: translate(-50%, -50%) rotate(-45deg); }

/* Teaser de Notificação (Desktop) */
.wa-teaser {
  position: fixed;
  right: 36px;
  bottom: 116px;
  z-index: 58;
  opacity: 0;
  transform: translateY(6px) scale(0.96);
  transform-origin: bottom right;
  pointer-events: none;
  transition: opacity 0.35s var(--wa-ease), transform 0.4s var(--wa-ease);
  font-family: var(--font-sans);
}

.wa-teaser.is-shown {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.wa-teaser-bubble {
  position: relative;
  display: block;
  max-width: 220px;
  background: #FFFFFF;
  border: 1.5px solid var(--wa-line);
  border-radius: 14px;
  padding: 10px 14px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--wa-ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.wa-teaser-bubble:hover {
  background: #F9FAFB;
  border-color: var(--wa-accent);
  transform: translateY(-2px);
}

.wa-teaser-bubble::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  background: #FFFFFF;
  border-right: 1.5px solid var(--wa-line);
  border-bottom: 1.5px solid var(--wa-line);
  border-bottom-right-radius: 3px;
  bottom: -7px;
  right: 26px;
  transform: rotate(45deg);
}

.wa-teaser-x {
  position: absolute;
  top: -9px;
  right: -9px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--wa-line);
  background: #FFFFFF;
  color: #4B5563;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.wa-teaser-x:hover {
  background: #FEE2E2;
  border-color: #EF4444;
  color: #EF4444;
}

.hidden { display: none; }
@media (min-width: 768px) {
  .md-block { display: block; }
}
