.contact-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1450;
  display: grid;
  justify-items: end;
  gap: 12px;
  font-family: inherit;
}
.contact-widget__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.contact-widget__button,
.contact-widget__close {
  border: 0;
  font: inherit;
  cursor: pointer;
}
.contact-widget__button {
  min-height: 54px;
  padding: 0 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  background: #20201d;
  box-shadow: 0 14px 34px rgb(31 29 24/20%);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}
.contact-widget__button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgb(31 29 24/27%);
}
.contact-widget__button--ai {
  width: 96px;
  min-height: 104px;
  padding: 0;
  justify-content: center;
  background: transparent;
  box-shadow: none;
}
.contact-widget__button--ai:hover {
  transform: translateY(-3px);
  box-shadow: none;
}
.contact-widget__button--ai:focus-visible {
  outline: 2px solid #a3772c;
  outline-offset: 3px;
}
.contact-widget__pet {
  --spark-end-x: -576px;
  width: 96px;
  height: 104px;
  display: block;
  background-image: url("assets/brand/spark-spritesheet-v2.webp");
  background-repeat: no-repeat;
  background-size: 768px 1144px;
  background-position: 0 0;
  filter: drop-shadow(0 10px 12px rgb(31 29 24 / 24%));
  animation: spark-frames 2.4s steps(6) infinite;
}
.contact-widget__button--ai[data-pet-state="idle"]:is(:hover, :focus-visible) .contact-widget__pet {
  --spark-end-x: -384px;
  background-position-y: -312px;
  animation: spark-frames 0.9s steps(4) infinite;
}
.contact-widget__button--ai[data-pet-state="waiting"] .contact-widget__pet {
  background-position-y: -624px;
  animation: spark-frames 1.8s steps(6) infinite;
}
.contact-widget__button--ai[data-pet-state="running"] .contact-widget__pet {
  background-position-y: -728px;
  animation: spark-frames 1.1s steps(6) infinite;
}
.contact-widget__button--ai[data-pet-state="review"] .contact-widget__pet {
  background-position-y: -832px;
  animation: spark-frames 1.25s steps(6) infinite;
}
.contact-widget__button--ai[data-pet-state="failed"] .contact-widget__pet {
  --spark-end-x: -768px;
  background-position-y: -520px;
  animation: spark-frames 1.6s steps(8) infinite;
}
.contact-widget__button.is-unavailable {
  background: #6b675f;
}
.contact-widget__button svg,
.contact-widget__channel svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.contact-widget--no-chat .contact-widget__button--ai {
  opacity: 1;
}
.contact-widget__panel {
  width: min(340px, calc(100vw - 32px));
  padding: 18px;
  border: 1px solid rgb(38 34 28/10%);
  border-radius: 24px;
  background: rgb(250 248 244/98%);
  box-shadow: 0 24px 64px rgb(31 29 24/20%);
  transform-origin: bottom right;
  animation: contact-widget-in 0.2s ease-out both;
}
.contact-widget__panel[hidden] {
  display: none;
}
.contact-widget__heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.contact-widget__heading div {
  display: grid;
  gap: 4px;
}
.contact-widget__heading strong {
  color: #24221e;
  font-size: 18px;
}
.contact-widget__heading span {
  color: #706c64;
  font-size: 13px;
}
.contact-widget__close {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  color: #4c4943;
  background: #ece8df;
  display: grid;
  place-items: center;
}
.contact-widget__close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.contact-widget__channels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.contact-widget__channel {
  min-height: 52px;
  padding: 0 14px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #2d2a25;
  background: #f0ece4;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  transition:
    transform 0.18s ease,
    background-color 0.18s ease;
}
.contact-widget__channel:hover {
  transform: translateY(-1px);
  background: #e8e1d6;
}
.contact-widget__channel--whatsapp {
  color: #176c3a;
}
.contact-widget__channel--instagram {
  color: #9d254d;
}
.contact-widget__channel--facebook {
  color: #2457a7;
}
.contact-widget__channel--telegram {
  color: #1474a5;
}
@keyframes contact-widget-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes spark-frames { to { background-position-x: var(--spark-end-x); } }
@media (max-width: 760px) {
  .contact-widget {
    right: 14px;
    bottom: calc(104px + env(safe-area-inset-bottom));
  }
  .contact-widget__button:not(.contact-widget__button--ai) {
    width: 52px;
    min-height: 52px;
    padding: 0;
    justify-content: center;
  }
  .contact-widget__button:not(.contact-widget__button--ai) > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .contact-widget__button--ai {
    width: 80px;
    min-height: 86.6667px;
  }
  .contact-widget__pet {
    --spark-end-x: -480px;
    width: 80px;
    height: 86.6667px;
    background-size: 640px 953.3333px;
  }
  .contact-widget__button--ai[data-pet-state="idle"]:is(:hover, :focus-visible) .contact-widget__pet {
    --spark-end-x: -320px;
    background-position-y: -260px;
  }
  .contact-widget__button--ai[data-pet-state="waiting"] .contact-widget__pet { background-position-y: -520px; }
  .contact-widget__button--ai[data-pet-state="running"] .contact-widget__pet { background-position-y: -606.6667px; }
  .contact-widget__button--ai[data-pet-state="review"] .contact-widget__pet { background-position-y: -693.3333px; }
  .contact-widget__button--ai[data-pet-state="failed"] .contact-widget__pet {
    --spark-end-x: -640px;
    background-position-y: -433.3333px;
  }
  .contact-widget__panel {
    padding: 16px;
    border-radius: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .contact-widget__panel {
    animation: none;
  }
  .contact-widget__button,
  .contact-widget__channel {
    transition: none;
  }
  .contact-widget__pet {
    animation: none !important;
  }
}

.contact-widget__chat {
  width: min(390px, calc(100vw - 32px));
  padding: 18px;
  border: 1px solid rgb(38 34 28 / 10%);
  border-radius: 24px;
  background: rgb(250 248 244 / 98%);
  box-shadow: 0 24px 64px rgb(31 29 24 / 20%);
  transform-origin: bottom right;
  animation: contact-widget-in 0.2s ease-out both;
  display: grid;
  gap: 14px;
}
.contact-widget__chat[hidden] { display: none; }
.contact-widget__messages {
  height: min(360px, 45vh);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 4px;
}
.contact-widget__message {
  max-width: 88%;
  margin: 0;
  padding: 10px 12px;
  border-radius: 15px;
  color: #292621;
  background: #eee9df;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.contact-widget__message--user { align-self: flex-end; color: #fff; background: #7d2d22; }
.contact-widget__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: end;
  gap: 7px;
  padding: 6px;
  border: 1px solid #d7d0c4;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 8px 24px rgb(31 29 24 / 8%);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.contact-widget__form:focus-within {
  border-color: rgb(125 45 34 / 58%);
  box-shadow:
    0 0 0 3px rgb(125 45 34 / 12%),
    0 10px 28px rgb(31 29 24 / 10%);
}
.contact-widget__composer {
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: flex-end;
  padding: 0 6px 0 10px;
  border-radius: 22px;
}
.contact-widget__form textarea {
  width: 100%; min-height: 42px; max-height: 112px; resize: none; padding: 10px 0;
  overflow-y: hidden; border: 0; outline: 0; background: transparent; color: #292621;
  caret-color: #7d2d22; font: inherit; font-size: 14px; line-height: 1.45;
}
.contact-widget__form textarea.is-scrollable { overflow-y: auto; }
.contact-widget__form textarea::placeholder { color: #766f64; opacity: 1; }
.contact-widget__send {
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; color: #fff; background: #7d2d22;
  box-shadow: 0 8px 18px rgb(125 45 34 / 24%); font: inherit; cursor: pointer;
  transition:
    transform 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
}
.contact-widget__send:not(:disabled):hover {
  transform: translateY(-1px);
  background: #66241b;
  box-shadow: 0 10px 22px rgb(125 45 34 / 30%);
}
.contact-widget__send:not(:disabled):active { transform: scale(0.96); }
.contact-widget__send:focus-visible { outline: 2px solid #7d2d22; outline-offset: 3px; }
.contact-widget__send:disabled { opacity: 0.38; cursor: default; box-shadow: none; }
.contact-widget__send-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
}
.contact-widget__send svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: currentColor;
  stroke: none;
  transform: translateX(-0.5px);
}
.contact-widget__send-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgb(255 255 255 / 42%);
  border-top-color: #fff;
  border-radius: 50%;
  animation: contact-widget-spin 0.8s linear infinite;
}
.contact-widget__form.is-loading .contact-widget__send-icon { display: none; }
.contact-widget__form.is-loading .contact-widget__send-spinner { display: block; }
@keyframes contact-widget-spin { to { transform: rotate(360deg); } }
.contact-widget .sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
@media (prefers-reduced-motion: reduce) {
  .contact-widget__chat { animation: none; }
  .contact-widget__form,
  .contact-widget__send { transition: none; }
  .contact-widget__send-spinner { animation-duration: 1.4s; }
}
