/* ========================================
   CHATBOT - Art Beghelli
   ======================================== */

/* ---- Botón flotante ---- */
#ab-chatbot-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px 8px 10px;
  background: #FFD700;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  color: #837165;
  font-family: Raleway, sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
#ab-chatbot-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(0,0,0,0.35);
}
#ab-chatbot-btn img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
#ab-chatbot-btn .ab-label {
  white-space: nowrap;
  user-select: none;
}

/* ---- Panel del chat ---- */
#ab-chat-panel {
  position: fixed;
  bottom: 90px;
  right: 24px;
  z-index: 9998;
  width: 360px;
  max-width: calc(100vw - 48px);
  max-height: 520px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: Raleway, sans-serif;
  color: #333;
  animation: ab-slide-up 0.35s ease;
}
#ab-chat-panel.ab-open {
  display: flex;
}

@keyframes ab-slide-up {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- Header ---- */
#ab-chat-header {
  background: #837165;
  color: #fff;
  padding: 14px 18px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  min-height: 50px;
}
#ab-chat-header .ab-typing-text {
  display: inline;
}
#ab-chat-header .ab-cursor {
  display: inline-block;
  animation: ab-blink 0.6s step-end infinite;
  font-weight: 300;
  margin-left: 2px;
}
@keyframes ab-blink {
  50% { opacity: 0; }
}
#ab-close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s;
}
#ab-close-btn:hover { opacity: 1; }

/* ---- Mensajes ---- */
#ab-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8f7f5;
  min-height: 0;
}
.ab-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.45;
  word-wrap: break-word;
  animation: ab-fade-in 0.25s ease;
}
@keyframes ab-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ab-msg.bot {
  align-self: flex-start;
  background: #e8e6e0;
  color: #444;
  border-bottom-left-radius: 4px;
}
.ab-msg.user {
  align-self: flex-end;
  background: #837165;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.ab-msg.info {
  align-self: center;
  background: #fff3cd;
  color: #856404;
  font-size: 12.5px;
  text-align: center;
  max-width: 95%;
  border-radius: 8px;
}

/* ---- Burbuja de opciones ---- */
.ab-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.ab-opt-btn {
  padding: 8px 14px;
  border: 1.5px solid #837165;
  border-radius: 20px;
  background: transparent;
  color: #837165;
  font-family: Raleway, sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.ab-opt-btn:hover {
  background: #837165;
  color: #fff;
}

/* ---- Input ---- */
#ab-input-area {
  display: flex;
  border-top: 1px solid #ddd;
  padding: 10px 12px;
  background: #fff;
  flex-shrink: 0;
  gap: 8px;
}
#ab-input-area.ab-hidden { display: none; }
#ab-input {
  flex: 1;
  border: 1px solid #ccc;
  border-radius: 24px;
  padding: 10px 16px;
  font-family: Raleway, sans-serif;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
#ab-input:focus { border-color: #837165; }
#ab-send-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: #837165;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
#ab-send-btn:hover { background: #6b5f55; transform: scale(1.05); }
#ab-send-btn:active { transform: scale(0.95); }

/* ---- Formulario de contacto ---- */
#ab-contact-form {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: #fff;
  border-top: 1px solid #ddd;
  flex-shrink: 0;
}
#ab-contact-form.ab-show { display: flex; }
#ab-contact-form input,
#ab-contact-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: Raleway, sans-serif;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
#ab-contact-form input:focus,
#ab-contact-form textarea:focus {
  border-color: #837165;
}
#ab-contact-form textarea {
  resize: vertical;
  min-height: 70px;
}
#ab-contact-form button {
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: #837165;
  color: #fff;
  font-family: Raleway, sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
#ab-contact-form button:hover { background: #6b5f55; }
#ab-contact-form .ab-note {
  font-size: 12px;
  color: #888;
  text-align: center;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
  #ab-chat-panel {
    right: 12px;
    bottom: 80px;
    width: calc(100vw - 24px);
    max-height: 60vh;
  }
  #ab-chatbot-btn {
    bottom: 14px;
    right: 14px;
    padding: 6px 14px 6px 8px;
    font-size: 13px;
  }
  #ab-chatbot-btn img {
    width: 36px;
    height: 36px;
  }
}
