/* ==========================================================================
   CABAÑAS AMOR.ES - ASISTENTE VIRTUAL CHATBOT CSS
   ========================================================================== */

:root {
  --chat-primary: #1b4332;
  --chat-primary-light: #2d6a4f;
  --chat-accent: #f35525;
  --chat-accent-hover: #ee626b;
  --chat-whatsapp: #25d366;
  --chat-whatsapp-dark: #128c7e;
  --chat-maps: #4285f4;
  --chat-bg: #f8fafc;
  --chat-bubble-bot: #ffffff;
  --chat-bubble-user: #2d6a4f;
  --chat-text-dark: #1e293b;
  --chat-text-muted: #64748b;
  --chat-border: #e2e8f0;
  --chat-shadow: 0 12px 36px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.08);
  --chat-radius: 18px;
  --chat-transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Float WhatsApp repositioning to stack cleanly above chatbot */
.float {
  position: fixed !important;
  width: 54px !important;
  height: 54px !important;
  bottom: 92px !important;
  right: 24px !important;
  background-color: var(--chat-whatsapp) !important;
  color: #fff !important;
  border-radius: 50% !important;
  text-align: center !important;
  font-size: 26px !important;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4) !important;
  z-index: 99980 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: transform 0.25s ease, box-shadow 0.25s ease !important;
}

.float:hover {
  transform: scale(1.08) !important;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6) !important;
}

.float .my-float {
  margin-top: 0 !important;
}

/* Floating Launcher Button */
.amores-chat-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(27, 67, 50, 0.35);
  cursor: pointer;
  z-index: 99985;
  transition: var(--chat-transition);
  border: 2px solid rgba(255, 255, 255, 0.2);
  outline: none;
}

.amores-chat-launcher:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 12px 28px rgba(27, 67, 50, 0.45);
}

.amores-chat-launcher .launcher-icon-open,
.amores-chat-launcher .launcher-icon-close {
  position: absolute;
  transition: var(--chat-transition);
}

.amores-chat-launcher .launcher-icon-open {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.amores-chat-launcher .launcher-icon-close {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

.amores-chat-launcher.is-active .launcher-icon-open {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

.amores-chat-launcher.is-active .launcher-icon-close {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* Pulsing Badge on Launcher */
.amores-launcher-pulse {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  background-color: #25d366;
  border: 2px solid #ffffff;
  border-radius: 50%;
  animation: amoresPulse 2s infinite;
}

@keyframes amoresPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(37, 211, 102, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

/* Teaser bubble on closed launcher */
.amores-launcher-teaser {
  position: fixed;
  bottom: 34px;
  right: 94px;
  background: #ffffff;
  color: var(--chat-text-dark);
  padding: 8px 14px;
  border-radius: 20px 20px 4px 20px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  white-space: nowrap;
  z-index: 99984;
  opacity: 0;
  visibility: hidden;
  transform: translateX(10px);
  transition: var(--chat-transition);
  pointer-events: none;
}

.amores-launcher-teaser::after {
  content: '';
  position: absolute;
  right: -6px;
  bottom: 8px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 8px solid #ffffff;
}

.amores-chat-launcher:hover + .amores-launcher-teaser,
.amores-launcher-teaser.show-teaser {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* Chatbot Main Window */
.amores-chat-window {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 385px;
  height: 610px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 48px);
  background: var(--chat-bg);
  border-radius: var(--chat-radius);
  box-shadow: var(--chat-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 99990;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.96);
  transform-origin: bottom right;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.35s;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  border: 1px solid rgba(27, 67, 50, 0.15);
}

.amores-chat-window.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Chat Header */
.amores-chat-header {
  background: linear-gradient(135deg, #1b4332 0%, #245842 60%, #2d6a4f 100%);
  color: #ffffff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.amores-header-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.amores-header-avatar {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  padding: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.amores-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.amores-avatar-status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  background-color: #25d366;
  border: 2px solid #ffffff;
  border-radius: 50%;
}

.amores-header-info h4 {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.2px;
}

.amores-header-info p {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.85);
  margin: 2px 0 0 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.amores-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.amores-header-btn {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #ffffff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: var(--chat-transition);
}

.amores-header-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

/* Notice Banner */
.amores-notice-banner {
  background: #fff8e6;
  border-bottom: 1px solid #fed7aa;
  color: #92400e;
  padding: 8px 12px;
  font-size: 11.5px;
  line-height: 1.35;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 500;
}

.amores-notice-banner i {
  color: #f59e0b;
  font-size: 13px;
  margin-top: 1px;
  flex-shrink: 0;
}

/* Messages Area */
.amores-chat-messages {
  flex: 1;
  padding: 16px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.amores-chat-messages::-webkit-scrollbar {
  width: 5px;
}
.amores-chat-messages::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.15);
  border-radius: 10px;
}

/* Message Rows */
.amores-msg-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  animation: amoresFadeIn 0.3s ease forwards;
}

@keyframes amoresFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.amores-msg-row.bot {
  align-self: flex-start;
  max-width: 90%;
}

.amores-msg-row.user {
  align-self: flex-end;
  max-width: 85%;
  flex-direction: row-reverse;
}

.amores-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1b4332;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  overflow: hidden;
}

.amores-msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.amores-msg-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.amores-msg-bubble {
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.amores-msg-row.bot .amores-msg-bubble {
  background: #ffffff;
  color: var(--chat-text-dark);
  border: 1px solid var(--chat-border);
  border-bottom-left-radius: 4px;
}

.amores-msg-row.bot .amores-msg-bubble p {
  color: var(--chat-text-dark) !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
  margin: 0 0 8px 0;
}
.amores-msg-row.bot .amores-msg-bubble p:last-child {
  margin-bottom: 0;
}

.amores-msg-row.user .amores-msg-bubble {
  background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 100%) !important;
  color: #ffffff !important;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(27, 67, 50, 0.25);
}

.amores-msg-row.user .amores-msg-bubble p,
.amores-msg-row.user .amores-msg-bubble span,
.amores-msg-row.user .amores-msg-bubble * {
  color: #ffffff !important;
  font-size: 13.5px !important;
  line-height: 1.45 !important;
  font-weight: 500 !important;
  margin: 0 !important;
}

.amores-msg-bubble p {
  margin: 0 0 8px 0;
}
.amores-msg-bubble p:last-child {
  margin-bottom: 0;
}

.amores-msg-bubble ul {
  margin: 6px 0;
  padding-left: 18px;
}

.amores-msg-bubble li {
  margin-bottom: 4px;
}

.amores-msg-time {
  font-size: 10px;
  color: var(--chat-text-muted);
  margin-top: 2px;
  align-self: flex-start;
}
.amores-msg-row.user .amores-msg-time {
  align-self: flex-end;
}

/* Call to action buttons in bot messages */
.amores-msg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.amores-btn-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none !important;
  transition: var(--chat-transition);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.amores-btn-whatsapp {
  background-color: var(--chat-whatsapp);
  color: #ffffff !important;
}

.amores-btn-whatsapp:hover {
  background-color: var(--chat-whatsapp-dark);
  transform: translateY(-1px);
  color: #ffffff !important;
}

.amores-btn-maps {
  background-color: #ffffff;
  color: #1a73e8 !important;
  border: 1px solid #d2e3fc;
}

.amores-btn-maps:hover {
  background-color: #f1f8ff;
  border-color: #1a73e8;
  transform: translateY(-1px);
}

/* Typing Indicator */
.amores-typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid var(--chat-border);
  border-bottom-left-radius: 4px;
  width: fit-content;
}

.amores-typing-dot {
  width: 6px;
  height: 6px;
  background: #94a3b8;
  border-radius: 50%;
  animation: amoresBounce 1.4s infinite ease-in-out;
}
.amores-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.amores-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes amoresBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Quick Question Chips Container */
.amores-chips-wrapper {
  padding: 8px 14px 4px 14px;
  background: #ffffff;
  border-top: 1px solid var(--chat-border);
}

.amores-chips-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--chat-text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.amores-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 115px;
  overflow-y: auto;
  padding-bottom: 4px;
}

.amores-chips-container::-webkit-scrollbar {
  width: 4px;
}
.amores-chips-container::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
}

.amores-chip-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 5px 10px;
  border-radius: 14px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--chat-transition);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.amores-chip-btn:hover {
  background: #1b4332;
  border-color: #1b4332;
  color: #ffffff;
  transform: translateY(-1px);
}

/* Chat Input Bar ("Tu pregunta") */
.amores-chat-footer {
  padding: 10px 14px;
  background: #ffffff;
  border-top: 1px solid var(--chat-border);
}

.amores-chat-form {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.amores-chat-input {
  flex: 1;
  border: 1.5px solid #cbd5e1;
  border-radius: 22px;
  padding: 9px 16px;
  font-size: 13px;
  font-family: 'Poppins', sans-serif;
  color: var(--chat-text-dark);
  background: #f8fafc;
  outline: none;
  transition: var(--chat-transition);
}

.amores-chat-input:focus {
  border-color: #2d6a4f;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.15);
}

.amores-chat-input::placeholder {
  color: #94a3b8;
}

.amores-chat-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #1b4332;
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: var(--chat-transition);
  flex-shrink: 0;
}

.amores-chat-send:hover {
  background: #2d6a4f;
  transform: scale(1.05);
}

.amores-chat-send:active {
  transform: scale(0.95);
}

/* Mobile Responsive Optimization */
@media (max-width: 480px) {
  .amores-chat-window {
    width: calc(100vw - 24px);
    right: 12px;
    bottom: 12px;
    height: calc(100vh - 24px);
    max-height: 640px;
    border-radius: 14px;
  }
  
  .amores-chat-launcher {
    bottom: 16px;
    right: 16px;
    width: 54px;
    height: 54px;
  }

  .float {
    bottom: 80px !important;
    right: 16px !important;
    width: 48px !important;
    height: 48px !important;
    font-size: 24px !important;
  }

  .amores-launcher-teaser {
    display: none;
  }
}
