/* =========================================
   LIGA DOUTOR - CHATBOT
   ========================================= */

.chatbot {
  position: fixed;
  right: 22px;
  bottom: 90px;

  width: 390px;
  max-width: calc(100vw - 30px);

  height: 600px;
  max-height: calc(100vh - 120px);

  background: #ffffff;

  border-radius: 22px;

  box-shadow:
    0 18px 55px rgba(0, 0, 0, 0.22);

  overflow: hidden;

  display: none;
  flex-direction: column;

  z-index: 2000;

  border: 1px solid #e1ebee;
}


/* CHAT ABERTO */

.chatbot.active {
  display: flex;
}


/* =========================================
   CABEÇALHO
   ========================================= */

.chatbot-header {
  background:
    linear-gradient(
      135deg,
      #087f8c,
      #076b77
    );

  color: white;

  padding: 17px 18px;

  display: flex;

  align-items: center;

  justify-content: space-between;

  flex-shrink: 0;
}


.chatbot-header-left {
  display: flex;

  align-items: center;

  gap: 11px;
}


.chatbot-avatar {
  width: 43px;

  height: 43px;

  border-radius: 50%;

  background: white;

  color: #087f8c;

  display: flex;

  align-items: center;

  justify-content: center;

  font-size: 22px;

  font-weight: bold;

  flex-shrink: 0;
}


.chatbot-header h3 {
  margin: 0;

  color: white;

  font-size: 17px;

  font-weight: 700;

  line-height: 1.2;
}


.chatbot-status {
  margin-top: 4px;

  display: flex;

  align-items: center;

  gap: 6px;

  font-size: 11px;

  color: rgba(255,255,255,.90);
}


.status-dot {
  display: inline-block;

  width: 8px;

  height: 8px;

  border-radius: 50%;

  background: #5bea79;

  box-shadow:
    0 0 8px rgba(91,234,121,.8);
}


.chatbot-close {
  width: 38px;

  height: 38px;

  border: none;

  border-radius: 50%;

  background: rgba(255,255,255,.12);

  color: white;

  font-size: 24px;

  cursor: pointer;

  display: flex;

  align-items: center;

  justify-content: center;
}


.chatbot-close:hover {
  background: rgba(255,255,255,.22);
}


/* =========================================
   ÁREA DAS MENSAGENS
   ========================================= */

.chatbot-messages {
  flex: 1;

  min-height: 0;

  padding: 17px;

  overflow-y: auto;

  overflow-x: hidden;

  background: #f7fafb;

  scroll-behavior: smooth;
}


/* BARRA DE ROLAGEM */

.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}


.chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}


.chatbot-messages::-webkit-scrollbar-thumb {
  background: #c8d8dd;

  border-radius: 20px;
}


/* =========================================
   MENSAGENS
   ========================================= */

.message {
  width: fit-content;

  max-width: 88%;

  padding: 11px 13px;

  margin-bottom: 10px;

  border-radius: 14px;

  font-size: 13px;

  line-height: 1.5;

  word-wrap: break-word;

  overflow-wrap: anywhere;
}


.bot-message {
  background: #ffffff;

  color: #385267;

  border: 1px solid #e4ecef;

  border-bottom-left-radius: 4px;

  box-shadow:
    0 2px 7px rgba(0,0,0,.03);
}


.user-message {
  background: #087f8c;

  color: white;

  margin-left: auto;

  border-bottom-right-radius: 4px;
}


/* =========================================
   ÁREA INFERIOR / OPÇÕES
   ========================================= */

.chatbot-options {
  flex-shrink: 0;

  padding: 12px;

  background: #ffffff;

  border-top: 1px solid #e2ecef;

  max-height: 230px;

  overflow-y: auto;
}


/* =========================================
   BOTÕES DO CHAT
   ========================================= */

.chat-option {
  display: block;

  width: 100%;

  padding: 12px 13px;

  margin: 0 0 8px 0;

  border: 1px solid #cfe1e5;

  background: #ffffff;

  color: #087f8c;

  border-radius: 11px;

  cursor: pointer;

  text-align: left;

  font-family: inherit;

  font-size: 13px;

  font-weight: 700;

  transition:
    background .2s,
    border-color .2s,
    transform .1s;
}


.chat-option:last-child {
  margin-bottom: 0;
}


.chat-option:hover {
  background: #eaf8f8;

  border-color: #9fcdd2;
}


.chat-option:active {
  transform: scale(.99);
}


/* =========================================
   CAMPO DE DIGITAÇÃO
   ========================================= */

.chat-input {
  display: block;

  width: 100%;

  min-height: 48px;

  padding: 12px 13px;

  margin-bottom: 8px;

  border: 1px solid #cfe1e5;

  border-radius: 11px;

  background: #ffffff;

  color: #385267;

  font-family: inherit;

  font-size: 14px;

  outline: none;

  box-sizing: border-box;
}


.chat-input:focus {
  border-color: #087f8c;

  box-shadow:
    0 0 0 3px rgba(8,127,140,.08);
}


.chat-input::placeholder {
  color: #8b9da9;
}


/* =========================================
   BOTÃO SAC
   ========================================= */

.sac-button {
  position: fixed;

  right: 22px;

  bottom: 22px;

  height: 54px;

  min-width: 78px;

  padding: 0 17px;

  border-radius: 999px;

  background: #25d366;

  color: white;

  display: flex;

  align-items: center;

  justify-content: center;

  gap: 8px;

  font-size: 13px;

  font-weight: 800;

  text-decoration: none;

  box-shadow:
    0 10px 28px rgba(0,0,0,.18);

  z-index: 2001;

  transition:
    transform .2s,
    box-shadow .2s;
}


.sac-button:hover {
  transform: translateY(-2px);

  box-shadow:
    0 14px 32px rgba(0,0,0,.22);
}


.sac-icon {
  font-size: 19px;
}


.sac-label {
  line-height: 1;
}


/* =========================================
   CELULAR
   ========================================= */

@media (max-width: 500px) {

  .chatbot {
    right: 12px;

    bottom: 76px;

    width: calc(100% - 24px);

    max-width: none;

    height: calc(100vh - 100px);

    max-height: 650px;

    border-radius: 19px;
  }


  .chatbot-header {
    padding: 14px 15px;
  }


  .chatbot-avatar {
    width: 40px;

    height: 40px;

    font-size: 20px;
  }


  .chatbot-header h3 {
    font-size: 16px;
  }


  .chatbot-messages {
    padding: 14px;
  }


  .message {
    max-width: 92%;

    font-size: 13px;
  }


  .chatbot-options {
    padding: 10px;

    max-height: 42vh;
  }


  .sac-button {
    right: 12px;

    bottom: 12px;

    height: 50px;

    min-width: 72px;

    padding: 0 14px;
  }
}

/* =========================================
   AJUSTE DO QR CODE PIX
   ========================================= */

.pix-qr-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 8px 0 12px;
}

.pix-qr {
  display: block;
  width: 180px;
  height: 180px;
  max-width: 100%;
  object-fit: contain;
  border-radius: 12px;
  background: #ffffff;
  padding: 6px;
  box-sizing: border-box;
}

@media (max-width: 500px) {
  .pix-qr {
    width: 160px;
    height: 160px;
  }
}
/* Keep the complete local journey usable with mobile browser chrome and keyboards. */
@media(max-width:500px){.chatbot{height:calc(100dvh - 100px);max-height:calc(100dvh - 100px);bottom:max(76px,env(safe-area-inset-bottom));}.chatbot input,.chatbot select,.chatbot textarea{font-size:16px;max-width:100%;}.chatbot button{min-height:44px;overflow-wrap:anywhere;}}
