@keyframes sofia-bounce {
  0% { transform: translateY(0); }
  30% { transform: translateY(-10px); }
  50% { transform: translateY(0); }
  100% { transform: translateY(0); }
}

/* Forzar que la opacidad nunca cambie durante el bounce */
.sofia-chatbot-bubble, .sofia-chatbot-bubble.sofia-bounce {
  opacity: 0.96 !important;
}
.sofia-chatbot-bubble.sofia-bounce {
  animation: sofia-bounce 0.5s cubic-bezier(.36,1.5,.64,1) !important;
}
/* Botones de sugerencias FAQ */

.sofia-faq-btn {
  background: #f5f5f7;
  color: #47477b;
  border: 2px solid #4cd964;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 14px;
  margin: 4px 0;
  cursor: pointer;
  box-shadow: 0 1px 4px #e3e8ee22;
}
/* Paleta: verde #4cd964, azul #47477b, gris claro #f5f5f7, blanco #fff */
.sofia-chatbot-bubble {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 9999;
  display: flex;
  align-items: center;
  background: #4cd964;
  color: #47477b;
  border-radius: 50px;
  box-shadow: 0 4px 24px rgba(76, 217, 100, 0.18);
  cursor: pointer;
  padding: 10px 20px 10px 10px;
  font-weight: 500;
  font-size: 16px;
  transition: box-shadow 0.2s;
  opacity: 0.96;
}
.sofia-chatbot-bubble:hover {
  box-shadow: 0 8px 32px rgba(76, 217, 100, 0.28);
  opacity: 1;
}
.sofia-chatbot-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
}
.sofia-chatbot-label {
  display: flex;
  align-items: center;
  background: #4cd964;
  color: #47477b;
  border-radius: 50px;
  box-shadow: 0 4px 24px rgba(76, 217, 100, 0.18);
  cursor: pointer;
  padding: 10px 20px 10px 10px;
  font-weight: 500;
  font-size: 16px;
  transition: box-shadow 0.2s, opacity 0.2s;
  opacity: 0.96;
  position: relative;
  box-shadow: 0 8px 32px rgba(76, 217, 100, 0.18);
  font-family: 'Segoe UI', 'Arial', sans-serif;
  z-index: 10000;
  overflow: hidden;
  border: none;
  flex-direction: column;
}
.sofia-chatbot-header {
  background: #47477b;
  color: #fff;
  padding: 10px 16px 6px 16px;
  border-radius: 18px 18px 0 0;
  font-weight: 700;
  text-align: center;
  font-size: 19px;
  border-bottom: none;
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px #47477b44;
}
.sofia-chatbot-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: #fff;
  border: none;
  color: #47477b;
  font-size: 20px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 50%;
  box-shadow: 0 2px 8px #47477b22;
  z-index: 2;
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sofia-chatbot-close:hover {
  background: #f5f5f7;
  color: #d32f2f;
}
.sofia-chatbot-header-info {
  margin: 0 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: #4cd964;
  flex: 1;
  text-align: left;
}
.sofia-chatbot-header-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
  justify-content: center;
}
.sofia-chatbot-header-tab {
  color: #47477b;
  font-size: 15px;
  font-weight: 500;
  background: #fff;
  border: 2px solid #4cd964;
  border-radius: 16px;
  cursor: pointer;
  padding: 6px 18px;
  opacity: 0.92;
  transition: opacity 0.2s, background 0.2s, color 0.2s;
  box-shadow: 0 2px 8px #e3e8ee22;
  margin-bottom: 2px;
}
.sofia-chatbot-header-tab.active {
  opacity: 1;
  font-weight: 700;
  background: #4cd964;
  color: #fff;
  border-color: #4cd964;
  text-decoration: none;
}
.sofia-chatbot-messages {
  height: 340px;
  overflow-y: auto;
  padding: 24px 18px 18px 18px;
  background: #fff;
  font-size: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sofia-chatbot-message {
  background: #f5f5f7;
  border-radius: 16px;
  padding: 14px 20px;
  color: #47477b;
  max-width: 80%;
  align-self: flex-start;
  font-size: 16px;
  border: none;
  box-shadow: 0 2px 8px #e3e8ee44;
  position: relative;
  word-break: break-word;
  line-height: 1.5;
  font-family: 'Segoe UI', 'Arial', sans-serif;
}
.sofia-chatbot-message.user {
  background: #4cd964;
  color: #fff;
  align-self: flex-end;
  box-shadow: 0 2px 8px #4cd96444;
  border-radius: 16px;
  margin-left: auto;
  margin-right: 0;
}
.sofia-chatbot-form {
  display: flex;
  border-top: none;
  background: #f5f5f7;
  padding: 16px 16px 16px 16px;
  gap: 10px;
}
.sofia-chatbot-input {
  flex: 1;
  border: 2px solid #4cd964;
  padding: 14px 18px;
  border-radius: 24px;
  outline: none;
  font-size: 16px;
  background: #fff;
  transition: border 0.2s;
  box-shadow: 0 2px 8px #e3e8ee22;
  color: #47477b;
}
.sofia-chatbot-input:focus {
  border: 2px solid #47477b;
}
.sofia-chatbot-send {
  background: #4cd964;
  color: #fff;
  border: none;
  padding: 0 22px;
  border-radius: 24px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 2px 8px #4cd96444;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sofia-chatbot-send:active {
  background: #47477b;
}
.sofia-chatbot-send::after {
  content: '\1F5F8'; /* Unicode paper plane */
  font-size: 18px;
  margin-left: 6px;
}
.sofia-faq-btn {
  background: #f5f5f7;
  color: #47477b;
  border: 2px solid #4cd964;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 14px;
  margin: 4px 0;
  cursor: pointer;
  box-shadow: 0 1px 4px #e3e8ee22;
  transition: background 0.2s, color 0.2s, border 0.2s;
  outline: none;
  display: block;
  width: 100%;
  text-align: left;
}
.sofia-faq-btn:hover, .sofia-faq-btn:focus {
  background: #4cd964;
  color: #fff;
  border-color: #4cd964;
}
.sofia-faq-btn.active {
  background: #47477b;
  color: #fff;
  border-color: #47477b;
}
@media (max-width: 600px) {
  .sofia-chatbot-bubble {
    left: auto;
    right: 16px;
    bottom: 16px;
    transform: none;
    opacity: 0.96;
  }
  .sofia-chatbot-container {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 99vw;
    max-width: 420px;
    bottom: 40px;
    border-radius: 16px;
  }
  .sofia-chatbot-header {
    border-radius: 16px 16px 0 0;
    font-size: 17px;
    padding: 8px 8px 4px 12px;
    min-height: 36px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .sofia-chatbot-messages {
    height: 260px;
    padding: 10px 6px 8px 6px;
    font-size: 15px;
  }
  .sofia-chatbot-form {
    padding: 10px 8px 10px 8px;
    gap: 8px;
  }
  .sofia-chatbot-input {
    font-size: 15px;
    padding: 10px 10px;
  }
  .sofia-chatbot-send {
    font-size: 15px;
    padding: 0 14px;
  }
}
.sofia-chatbot-bubble-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: #fff;
  border: none;
  color: #47477b;
  font-size: 20px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 50%;
  box-shadow: 0 2px 8px #47477b22;
  z-index: 2;
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sofia-chatbot-bubble-close:hover {
  background: #f5f5f7;
  color: #d32f2f;
}
@media (max-width: 600px) {
  .sofia-chatbot-bubble {
    min-width: 56px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    padding: 0;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 24px rgba(76, 217, 100, 0.18);
  }
  .sofia-chatbot-label,
  .sofia-chatbot-bubble-close {
    display: none !important;
  }
  .sofia-chatbot-icon {
    margin: 0;
    width: 32px;
    height: 32px;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}