/* Chatbot widget — button-driven flow (mobile first) */

.chatbot {
  position: fixed;
  top: 609px;
  right: 16px;
  bottom: auto;
  z-index: 9999;
}

.chatbot__trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 64px;
  padding: 12px 32px;
  background-color: #000;
  color: #fff;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s ease;
}

.chatbot__trigger:hover,
.chatbot__trigger:focus-visible {
  background-color: #222;
  outline: none;
}

.chatbot__trigger-text {
  display: none;
  font-family: 'proxima-nova', sans-serif;
  font-size: 20px;
  font-weight: 400;
  line-height: 30px;
  color: #fff;
}

.chatbot__trigger-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
}

.chatbot__panel {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  overflow: hidden;
  pointer-events: none;
}

.chatbot.is-open .chatbot__panel {
  transform: translateY(0);
  pointer-events: all;
}

.chatbot__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  padding-top: calc(12px + env(safe-area-inset-top));
  background-color: #000;
  color: #fff;
  flex-shrink: 0;
}

.chatbot__header-title {
  font-family: 'proxima-nova', sans-serif;
  font-size: 20px;
  font-weight: 400;
  line-height: 30px;
  color: #fff;
  margin: 0;
}

.chatbot__header-title strong {
  font-weight: 700;
}

.chatbot__close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

.chatbot__close:hover,
.chatbot__close:focus-visible {
  opacity: 1;
  outline: none;
}

.chatbot__messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 16px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chatbot__message {
  max-width: 85%;
  padding: 16px;
  font-family: 'proxima-nova', sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 26px;
}

.chatbot__message--bot {
  background-color: #c50053;
  color: #fff;
  border-radius: 12px 12px 12px 0;
  align-self: flex-start;
  position: relative;
  box-shadow: 0 2px 0.5px rgba(0, 0, 0, 0.05);
}

.chatbot__typing {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 56px;
  padding: 18px 16px;
}

.chatbot__typing span {
  display: block;
  width: 8px;
  height: 8px;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  animation: chatbot-typing-bounce 1.2s infinite ease-in-out;
}

.chatbot__typing span:nth-child(2) { animation-delay: 0.2s; }
.chatbot__typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes chatbot-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

.chatbot__message--bot::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 0;
  width: 20px;
  height: 12px;
  background-color: #c50053;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

/* Inline link (ex.: Política de Privacidade) */
.chatbot__message--bot a {
  color: #fff;
  text-decoration: underline;
}

/* Option pills inside bot bubble */
.chatbot__message-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.chatbot__message--bot .chatbot__option {
  display: block;
  width: 100%;
  margin: 0;
  padding: 7px 16px;
  background-color: #fff;
  color: #c50053;
  border: none;
  border-radius: 8px;
  font-family: 'proxima-nova', sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 22px;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.chatbot__message--bot .chatbot__option:hover,
.chatbot__message--bot .chatbot__option:focus {
  background-color: #1a1a1a;
  color: #fff;
  outline: none;
}

/* Links soltos dentro do texto da mensagem (ex.: "Política de Privacidade" no
   aviso inicial) — o tema tem um reset global "a { outline: none }" que
   deixava esses links sem nenhum indicador visível de foco pelo teclado.
   Branco (não a cor de marca) porque a bolha do bot já é rosa (#c50053) —
   um outline na mesma cor do fundo fica invisível. */
.chatbot__message-text a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  border-radius: 2px;
}

.chatbot__message--bot .chatbot__option:disabled,
.chatbot__message--bot .chatbot__option.is-disabled {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}

.chatbot__message--bot a.chatbot__option {
  text-decoration: none;
  box-sizing: border-box;
}

.chatbot__message--user {
  background-color: #000;
  color: #fff;
  border-radius: 12px 12px 0 12px;
  align-self: flex-end;
}

@media (min-width: 768px) {
  .chatbot {
    top: 729px;
    right: 40px;
  }

  .chatbot__trigger-text {
    display: inline;
  }

  .chatbot__panel {
    position: absolute;
    top: auto;
    bottom: 100%;
    right: 0;
    left: auto;
    width: 475px;
    height: auto;
    max-height: 615px;
    border-radius: 0;
    transform: translateY(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  }

  .chatbot__header {
    padding-top: 12px;
  }

  .chatbot__messages {
    padding-bottom: 24px;
  }

  .chatbot.is-open .chatbot__panel {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
}
