@font-face {
  font-family: "PacificoLocal";
  src: url("../fonts/Pacifico-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "FigtreeMediumLocal";
  src: url("../fonts/Figtree-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "FigtreeBoldLocal";
  src: url("../fonts/Figtree-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

.agency-chat {
  --chat-red: #c91235;
  --chat-red-dark: #a90d2b;
  --chat-blue: #004762;
  --chat-teal: #22d7be;
  --chat-muted: #617a87;
  --chat-surface: #f2f6f7;
  position: fixed;
  right: clamp(1rem, 2vw, 1.6rem);
  bottom: clamp(1rem, 2vw, 1.6rem);
  z-index: 250;
  color: var(--chat-blue);
  font-family: "FigtreeMediumLocal", "Figtree", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  pointer-events: none;
  -webkit-font-smoothing: antialiased;
}

.agency-chat *,
.agency-chat *::before,
.agency-chat *::after {
  box-sizing: border-box;
}

.agency-chat[hidden],
.agency-chat [hidden] {
  display: none !important;
}

.agency-chat.is-open {
  z-index: 800;
}

.agency-chat__whatsapp {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.8rem);
  display: grid;
  place-items: center;
  width: clamp(3.45rem, 4vw, 4rem);
  height: clamp(3.45rem, 4vw, 4rem);
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  background: linear-gradient(145deg, #31d36b, #19a94e);
  box-shadow: 0 16px 38px rgba(25, 169, 78, 0.32);
  color: #fff;
  cursor: pointer !important;
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition:
    opacity 180ms ease,
    transform 260ms cubic-bezier(0.19, 1, 0.22, 1),
    box-shadow 260ms ease,
    visibility 0s linear 0s;
}

.agency-chat__whatsapp:hover,
.agency-chat__whatsapp:focus-visible {
  transform: translateY(-3px) scale(1.035);
  box-shadow:
    0 22px 46px rgba(25, 169, 78, 0.4),
    0 0 0 7px rgba(49, 211, 107, 0.13);
}

.agency-chat__whatsapp:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.agency-chat__whatsapp svg {
  width: 1.9rem;
  height: 1.9rem;
  fill: currentColor;
}

.agency-chat.is-open .agency-chat__whatsapp {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  transform: translateY(0.65rem) scale(0.9);
  transition:
    opacity 150ms ease,
    transform 200ms ease,
    visibility 0s linear 200ms;
}

.agency-chat__launcher-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  pointer-events: none;
}

.agency-chat__hint {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.55rem 1rem;
  border: 1px solid rgba(0, 71, 98, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 38px rgba(0, 36, 52, 0.14);
  color: var(--chat-blue);
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  opacity: 1;
  transform: translateX(0);
  transition:
    opacity 180ms ease,
    transform 240ms cubic-bezier(0.19, 1, 0.22, 1);
}

.agency-chat.is-open .agency-chat__hint {
  opacity: 0;
  transform: translateX(0.75rem);
}

.agency-chat__launcher {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: clamp(3.8rem, 4.6vw, 4.5rem);
  height: clamp(3.8rem, 4.6vw, 4.5rem);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 72% 22%, rgba(255, 255, 255, 0.28), transparent 22%),
    linear-gradient(145deg, var(--chat-red), var(--chat-red-dark));
  box-shadow:
    0 18px 44px rgba(201, 18, 53, 0.32),
    0 0 0 0 rgba(34, 215, 190, 0.28);
  color: #fff1f4;
  cursor: pointer !important;
  pointer-events: auto;
  transition:
    transform 260ms cubic-bezier(0.19, 1, 0.22, 1),
    box-shadow 260ms ease;
  animation: agency-chat-pulse 3.2s ease-in-out infinite;
}

.agency-chat__launcher::after {
  content: "";
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  width: 0.82rem;
  height: 0.82rem;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--chat-teal);
}

.agency-chat__launcher:hover,
.agency-chat__launcher:focus-visible {
  transform: translateY(-3px) scale(1.025);
  box-shadow:
    0 24px 52px rgba(201, 18, 53, 0.38),
    0 0 0 8px rgba(34, 215, 190, 0.12);
}

.agency-chat__launcher:focus-visible {
  outline: 3px solid var(--chat-teal);
  outline-offset: 4px;
}

.agency-chat.is-open .agency-chat__launcher {
  transform: scale(0.92);
  animation: none;
}

.agency-chat__launcher svg {
  width: 1.75rem;
  height: 1.75rem;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

.agency-chat__panel {
  position: absolute;
  right: 0;
  bottom: calc(clamp(3.8rem, 4.6vw, 4.5rem) + 1rem);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(25rem, calc(100vw - 2rem));
  height: min(38rem, calc(100dvh - 8.5rem));
  min-height: 28rem;
  overflow: hidden;
  border: 1px solid rgba(0, 71, 98, 0.1);
  border-radius: 1.6rem;
  background: #fff;
  box-shadow:
    0 30px 85px rgba(0, 36, 52, 0.26),
    0 8px 28px rgba(0, 36, 52, 0.12);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(1rem) scale(0.96);
  transform-origin: right bottom;
  transition:
    opacity 180ms ease,
    visibility 0s linear 240ms,
    transform 280ms cubic-bezier(0.19, 1, 0.22, 1);
}

.agency-chat.is-open .agency-chat__panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition:
    opacity 180ms ease,
    visibility 0s linear 0s,
    transform 280ms cubic-bezier(0.19, 1, 0.22, 1);
}

.agency-chat__header {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  min-height: 5.4rem;
  padding: 1rem;
  overflow: hidden;
  background:
    radial-gradient(circle at 90% 0, rgba(34, 215, 190, 0.26), transparent 38%),
    linear-gradient(135deg, var(--chat-red), var(--chat-red-dark));
  color: #fff;
}

.agency-chat__header::after {
  content: "";
  position: absolute;
  top: -4.5rem;
  right: -3.5rem;
  width: 8rem;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  box-shadow: 0 0 0 1.6rem rgba(255, 255, 255, 0.035);
  pointer-events: none;
}

.agency-chat__header-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.agency-chat__header-copy h2 {
  max-width: none;
  margin: 0;
  color: #fff;
  font-family: "PacificoLocal", "Pacifico", cursive !important;
  font-size: 1.35rem;
  font-weight: 400 !important;
  line-height: 1.15;
  letter-spacing: 0;
}

html body .agency-chat .agency-chat__header-copy h2 {
  font-family: "PacificoLocal", "Pacifico", cursive !important;
  font-weight: 400 !important;
}

.agency-chat__header-copy p {
  margin: 0.18rem 0 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.76rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agency-chat__close {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2.65rem;
  height: 2.65rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer !important;
  transition:
    background 180ms ease,
    transform 180ms ease;
}

.agency-chat__close:hover,
.agency-chat__close:focus-visible {
  background: #fff;
  color: var(--chat-red);
  transform: rotate(4deg);
}

.agency-chat__close:focus-visible {
  outline: 3px solid var(--chat-teal);
  outline-offset: 3px;
}

.agency-chat__close svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

.agency-chat__messages {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-height: 0;
  padding: 1.1rem 1rem 1.3rem;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background:
    radial-gradient(circle at 100% 0, rgba(34, 215, 190, 0.08), transparent 28%),
    var(--chat-surface);
  scrollbar-color: rgba(0, 71, 98, 0.2) transparent;
  scrollbar-width: thin;
}

.agency-chat__message {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  width: 100%;
  animation: agency-chat-message-in 280ms cubic-bezier(0.19, 1, 0.22, 1) both;
}

.agency-chat__message--user {
  justify-content: flex-end;
}

.agency-chat__avatar {
  display: block;
  flex: 0 0 auto;
  width: 2.65rem;
  height: 2.65rem;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 7px 18px rgba(201, 18, 53, 0.2);
}

.agency-chat__avatar img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: contain;
}

.agency-chat__message-body {
  display: grid;
  justify-items: start;
  gap: 0.65rem;
  max-width: min(82%, 19rem);
}

.agency-chat__message--user .agency-chat__message-body {
  justify-items: end;
}

.agency-chat__bubble {
  margin: 0;
  padding: 0.78rem 0.92rem;
  border: 1px solid rgba(0, 71, 98, 0.08);
  border-radius: 1rem 1rem 1rem 0.28rem;
  background: #fff;
  box-shadow: 0 10px 24px rgba(0, 46, 64, 0.07);
  color: var(--chat-blue);
  font-size: 0.9rem;
  line-height: 1.52;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.agency-chat__message--user .agency-chat__bubble {
  border-color: transparent;
  border-radius: 1rem 1rem 0.28rem 1rem;
  background: var(--chat-red);
  color: #fff;
  box-shadow: 0 10px 24px rgba(201, 18, 53, 0.18);
}

.agency-chat__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  max-width: 100%;
}

.agency-chat__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.4rem;
  margin: 0;
  padding: 0.55rem 0.78rem;
  border: 1px solid rgba(0, 71, 98, 0.18);
  border-radius: 999px;
  background: #fff;
  color: var(--chat-blue);
  font-family: "FigtreeMediumLocal", "Figtree", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  cursor: pointer !important;
  transition:
    color 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.agency-chat__action:hover,
.agency-chat__action:focus-visible {
  border-color: var(--chat-red);
  background: var(--chat-red);
  color: #fff;
  transform: translateY(-1px);
}

.agency-chat__action:focus-visible {
  outline: 3px solid rgba(34, 215, 190, 0.55);
  outline-offset: 2px;
}

.agency-chat__typing {
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
  min-height: 2.65rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(0, 71, 98, 0.08);
  border-radius: 1rem 1rem 1rem 0.28rem;
  background: #fff;
  box-shadow: 0 10px 24px rgba(0, 46, 64, 0.07);
}

.agency-chat__typing span {
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: var(--chat-muted);
  animation: agency-chat-typing 900ms ease-in-out infinite;
}

.agency-chat__typing span:nth-child(2) {
  animation-delay: 120ms;
}

.agency-chat__typing span:nth-child(3) {
  animation-delay: 240ms;
}

.agency-chat__composer {
  display: grid;
  gap: 0.45rem;
  padding: 0.8rem 0.85rem max(0.78rem, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(0, 71, 98, 0.1);
  background: #fff;
}

.agency-chat__input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
  min-height: 3.2rem;
  padding: 0.25rem 0.28rem 0.25rem 0.9rem;
  border: 1px solid rgba(0, 71, 98, 0.16);
  border-radius: 1rem;
  background: #f8fafb;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.agency-chat__input-row:focus-within {
  border-color: var(--chat-teal);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(34, 215, 190, 0.12);
}

.agency-chat__input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--chat-blue);
  font: inherit;
  font-size: 0.88rem;
}

.agency-chat__input::placeholder {
  color: #8295a0;
  opacity: 1;
}

.agency-chat__input:disabled {
  opacity: 0.65;
}

.agency-chat__send {
  display: grid;
  place-items: center;
  width: 2.65rem;
  height: 2.65rem;
  padding: 0;
  border: 0;
  border-radius: 0.82rem;
  background: var(--chat-red);
  color: #fff;
  cursor: pointer !important;
  transition:
    background 180ms ease,
    transform 180ms ease,
    opacity 180ms ease;
}

.agency-chat__send:hover,
.agency-chat__send:focus-visible {
  background: var(--chat-blue);
  transform: translateX(1px);
}

.agency-chat__send:focus-visible {
  outline: 3px solid var(--chat-teal);
  outline-offset: 2px;
}

.agency-chat__send:disabled {
  opacity: 0.45;
  cursor: default !important;
  transform: none;
}

.agency-chat__send svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.agency-chat__note {
  margin: 0;
  color: #7c909a;
  font-size: 0.67rem;
  line-height: 1.3;
  text-align: center;
}

.agency-chat__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes agency-chat-pulse {
  0%,
  64%,
  100% {
    box-shadow:
      0 18px 44px rgba(201, 18, 53, 0.32),
      0 0 0 0 rgba(34, 215, 190, 0);
  }
  78% {
    box-shadow:
      0 18px 44px rgba(201, 18, 53, 0.32),
      0 0 0 12px rgba(34, 215, 190, 0.16);
  }
}

@keyframes agency-chat-message-in {
  from {
    opacity: 0;
    transform: translateY(0.65rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes agency-chat-typing {
  0%,
  60%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-0.18rem);
  }
}

@media (max-width: 640px) {
  .agency-chat {
    right: 0.6rem;
    bottom: max(0.65rem, env(safe-area-inset-bottom));
  }

  .agency-chat__hint {
    display: none;
  }

  .agency-chat__launcher {
    width: 3.7rem;
    height: 3.7rem;
  }

  .agency-chat__whatsapp {
    bottom: calc(100% + 0.65rem);
    width: 3.4rem;
    height: 3.4rem;
  }

  .agency-chat__panel {
    right: 0;
    bottom: 4.45rem;
    width: calc(100vw - 1.2rem);
    height: min(39rem, calc(100dvh - 5.6rem));
    min-height: min(27rem, calc(100dvh - 5.6rem));
    border-radius: 1.35rem;
  }

  .agency-chat__header {
    min-height: 4.9rem;
    padding: 0.85rem;
  }

  .agency-chat__header-copy h2 {
    font-size: 1.2rem;
  }

  .agency-chat__messages {
    padding: 0.95rem 0.85rem 1.1rem;
  }

  .agency-chat__bubble {
    font-size: 0.86rem;
  }
}

@media (max-width: 390px) {
  .agency-chat {
    right: 0.45rem;
  }

  .agency-chat__launcher {
    width: 3.3rem;
    height: 3.3rem;
  }

  .agency-chat__whatsapp {
    width: 3.15rem;
    height: 3.15rem;
  }

  .agency-chat__panel {
    bottom: 4rem;
    width: calc(100vw - 0.9rem);
  }
}

@media (max-height: 610px) and (min-width: 641px) {
  .agency-chat__panel {
    height: calc(100dvh - 7rem);
    min-height: 24rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .agency-chat *,
  .agency-chat *::before,
  .agency-chat *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
