/* Pulso conversational guide — editorial, direct and consistent with the landing. */
#contacto .contact-chat-button {
  position: static !important;
  inset: auto !important;
  display: inline-flex !important;
  align-self: flex-end !important;
  justify-content: center !important;
  width: min(52%, 260px) !important;
  margin: -8px 0 0 auto !important;
  padding: 12px 18px !important;
  opacity: 1 !important;
  visibility: visible !important;
  border: 1px solid #c63d2d !important;
  border-radius: 3px !important;
  background: transparent !important;
  color: #fff !important;
  box-shadow: none !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  letter-spacing: -.02em !important;
  transition: background-color .28s ease, border-color .28s ease, transform .28s cubic-bezier(.16,1,.3,1) !important;
}

#contacto .contact-chat-button:hover,
#contacto .contact-chat-button:focus-visible {
  background: #c63d2d !important;
  border-color: #c63d2d !important;
  color: #fff !important;
  transform: translateY(-2px) !important;
}

#chat-dialog.pulso-chat-v2 {
  inset: 50% auto auto 50% !important;
  width: min(680px, calc(100vw - 32px)) !important;
  height: min(720px, calc(100svh - 32px)) !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: translate(-50%, -50%) !important;
  overflow: hidden !important;
  border: 1px solid #24211f !important;
  border-radius: 5px !important;
  background: #fff !important;
  color: #171513 !important;
  box-shadow: 0 32px 110px rgba(0,0,0,.32) !important;
  font-family: Aileron, Arial, sans-serif !important;
}

#chat-dialog.pulso-chat-v2::backdrop {
  background: rgba(8,8,8,.66) !important;
  backdrop-filter: blur(5px);
}

#chat-dialog.pulso-chat-v2[open] {
  display: grid !important;
  grid-template-rows: auto minmax(0,1fr) auto auto auto !important;
}

#chat-dialog .chat-top {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 24px !important;
  padding: 24px 26px 22px !important;
  border: 0 !important;
  border-bottom: 1px solid #34302d !important;
  background: #151515 !important;
  color: #fff !important;
}

#chat-dialog .chat-top strong {
  display: block !important;
  color: #fff !important;
  font-size: clamp(25px,3vw,36px) !important;
  font-weight: 400 !important;
  letter-spacing: -.055em !important;
  line-height: .95 !important;
}

#chat-dialog .chat-top strong span { color: #c63d2d !important; }
#chat-dialog .chat-top p { max-width: 430px !important; margin: 10px 0 0 !important; color: #bbb6b1 !important; font-size: 14px !important; line-height: 1.35 !important; }

#chat-dialog #chat-close {
  flex: 0 0 auto !important;
  width: 34px !important;
  height: 34px !important;
  padding: 0 !important;
  border: 1px solid #5d5854 !important;
  border-radius: 50% !important;
  background: transparent !important;
  color: #fff !important;
  font-size: 22px !important;
  line-height: 1 !important;
  transition: background-color .22s ease, border-color .22s ease !important;
}

#chat-dialog #chat-close:hover,
#chat-dialog #chat-close:focus-visible { background: #c63d2d !important; border-color: #c63d2d !important; }
#chat-dialog #chat-close::before,
#chat-dialog #chat-close::after { content: none !important; display: none !important; }

#chat-dialog #chat-log {
  min-height: 0 !important;
  padding: 24px 26px 8px !important;
  overflow-y: auto !important;
  background: #f8f7f4 !important;
  scrollbar-color: #c63d2d transparent;
}

#chat-dialog #chat-log p {
  width: fit-content !important;
  max-width: 84% !important;
  margin: 0 0 14px !important;
  padding: 13px 15px !important;
  border: 0 !important;
  border-radius: 2px !important;
  background: #fff !important;
  color: #1b1816 !important;
  box-shadow: 0 0 0 1px #ddd7d0 !important;
  font-size: 15px !important;
  line-height: 1.48 !important;
  white-space: pre-line !important;
}

#chat-dialog #chat-log .bot-message { border-left: 3px solid #c63d2d !important; }
#chat-dialog #chat-log .user-message { margin-left: auto !important; background: #171513 !important; color: #fff !important; box-shadow: none !important; }
#chat-dialog #chat-log .chat-thinking { color: #756e68 !important; font-size: 13px !important; font-style: italic !important; }

#chat-dialog .chat-prompts {
  display: flex !important;
  gap: 8px !important;
  padding: 12px 26px 14px !important;
  overflow-x: auto !important;
  flex-wrap: nowrap !important;
  border-top: 1px solid #e1dcd6 !important;
  background: #fff !important;
}

#chat-dialog .chat-prompts button {
  flex: 0 0 auto !important;
  padding: 8px 11px !important;
  border: 1px solid #bdb6af !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: #211e1b !important;
  font-size: 12px !important;
  line-height: 1 !important;
  transition: background-color .22s ease, border-color .22s ease, color .22s ease !important;
}

#chat-dialog .chat-prompts button:hover,
#chat-dialog .chat-prompts button:focus-visible { background: #c63d2d !important; border-color: #c63d2d !important; color: #fff !important; }
#chat-dialog .chat-prompts button::before,
#chat-dialog .chat-prompts button::after,
#chat-dialog .chat-prompts button .button-arrow { display: none !important; }

#chat-dialog #chat-form {
  display: grid !important;
  grid-template-columns: minmax(0,1fr) 48px !important;
  gap: 8px !important;
  padding: 0 26px 13px !important;
  background: #fff !important;
}

#chat-dialog #chat-input {
  min-width: 0 !important;
  width: 100% !important;
  padding: 13px 14px !important;
  border: 1px solid #a9a29b !important;
  border-radius: 2px !important;
  background: #fff !important;
  color: #171513 !important;
  font-size: 14px !important;
}

#chat-dialog #chat-input:focus { border-color: #c63d2d !important; outline: 1px solid #c63d2d !important; }
#chat-dialog #chat-form button {
  position: relative !important;
  isolation: isolate !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 2px !important;
  background: #c63d2d !important;
  color: #fff !important;
  font-size: 20px !important;
}
#chat-dialog #chat-form button::before,
#chat-dialog #chat-form button::after { display: none !important; }
#chat-dialog #chat-form button .button-label { display: none !important; }
#chat-dialog #chat-form button .chat-send-icon {
  display: grid !important;
  position: relative !important;
  z-index: 1 !important;
  place-items: center !important;
  width: 100% !important;
  height: 100% !important;
  opacity: 1 !important;
  transform: none !important;
  transition: transform .25s cubic-bezier(.16,1,.3,1) !important;
}
#chat-dialog #chat-form button:hover .chat-send-icon,
#chat-dialog #chat-form button:focus-visible .chat-send-icon { transform: translateX(3px) !important; }

#chat-dialog #chat-contact {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin: 0 !important;
  padding: 13px 26px 15px !important;
  border-top: 1px solid #e1dcd6 !important;
  background: #fff !important;
  color: #c63d2d !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}

#chat-dialog #chat-contact:hover,
#chat-dialog #chat-contact:focus-visible { background: #c63d2d !important; color: #fff !important; }

/* Keep the contact form action to one deliberate arrow. */
#contacto #brief-form > button[type="submit"]::before,
#contacto #brief-form > button[type="submit"]::after { display: none !important; }
#contacto #brief-form > button[type="submit"] .button-label { transform: none !important; }
#contacto #brief-form > button[type="submit"] .chat-prepare-arrow {
  display: inline-block !important;
  margin-left: 8px !important;
  opacity: 1 !important;
  transform: none !important;
  transition: transform .25s cubic-bezier(.16,1,.3,1) !important;
}
#contacto #brief-form > button[type="submit"]:hover .chat-prepare-arrow,
#contacto #brief-form > button[type="submit"]:focus-visible .chat-prepare-arrow { transform: translateX(3px) !important; }

#chat-dialog #chat-close .chat-close-icon {
  display: grid !important;
  place-items: center !important;
  width: 100% !important;
  height: 100% !important;
  opacity: 1 !important;
  transform: none !important;
  transition: transform .28s cubic-bezier(.16,1,.3,1) !important;
}
#chat-dialog #chat-close:hover .chat-close-icon,
#chat-dialog #chat-close:focus-visible .chat-close-icon { transform: rotate(90deg) !important; }

@media (max-width: 650px) {
  #contacto .contact-chat-button { width: min(72%, 250px) !important; }
  #chat-dialog.pulso-chat-v2 { width: calc(100vw - 18px) !important; height: calc(100svh - 18px) !important; }
  #chat-dialog .chat-top { padding: 20px 18px !important; }
  #chat-dialog #chat-log { padding: 18px 18px 6px !important; }
  #chat-dialog .chat-prompts { padding: 11px 18px 13px !important; }
  #chat-dialog #chat-form { padding: 0 18px 12px !important; }
  #chat-dialog #chat-contact { padding: 12px 18px 14px !important; }
}

@media (prefers-reduced-motion: reduce) {
  #contacto .contact-chat-button,
  #chat-dialog * { transition: none !important; }
}
