/**
 * Estilos especificos del chatbot flotante.
 * El interior compartido vive en chatbot-common.css.
 */

#buscador-ai-floating-wrapper {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  font-family: var(--buscador-ai-font-family);
}

#buscador-ai-floating-wrapper .buscador-ai-floating-icon {
  width: 60px;
  height: 60px;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--pkf-azul);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

#buscador-ai-floating-wrapper .buscador-ai-floating-icon-text {
  font-size: 24px;
  line-height: 1;
}

#buscador-ai-floating-wrapper .buscador-ai-floating-icon-text .buscador-ai-icon-image,
#buscador-ai-floating-wrapper .buscador-ai-floating-icon-text .buscador-ai-icon-svg svg,
#buscador-ai-floating-wrapper .buscador-ai-floating-icon-text .buscador-ai-icon-mask {
  width: 24px;
  height: auto;
  display: block;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border-radius: 50%;
}

#buscador-ai-floating-wrapper .buscador-ai-floating-icon-text .buscador-ai-icon-svg svg {
  fill: currentColor;
  stroke: currentColor;
}

#buscador-ai-floating-wrapper .buscador-ai-floating-icon:hover {
  transform: scale(1.1);
  background: var(--pkf-azul);
  box-shadow: 0 22px 46px rgba(15, 23, 42, 0.28);
}

#buscador-ai-floating-wrapper .buscador-ai-floating-icon:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.55);
  outline-offset: 4px;
}

#buscador-ai-floating-wrapper.chat-open .buscador-ai-floating-icon {
  opacity: 0.9;
  transform: scale(0.94);
}

#buscador-ai-floating-chat {
  position: absolute;
  right: 0;
  bottom: 80px;
  width: 500px;
  max-width: calc(100vw - 32px);
  height: 75dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(0, 24px, 0) scale(0.94);
  transform-origin: bottom right;
  transition: opacity 0.22s ease, transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.34s, box-shadow 0.34s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
}

#buscador-ai-floating-chat.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) scale(1);
  transition: opacity 0.18s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0s, box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

#buscador-ai-floating-chat.is-maximized {
  position: fixed;
  top: 16px;
  right: 16px;
  bottom: 16px;
  left: 16px;
  width: auto;
  max-width: none;
  height: auto;
  border-radius: 24px;
  transform-origin: center center;
}

#buscador-ai-floating-chat .buscador-ai-window-btn {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
  padding: 0 !important;
  margin: 0 !important;
  flex: 0 0 24px;
  line-height: 1;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

#buscador-ai-floating-chat .buscador-ai-window-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

body.buscador-ai-floating-chat-maximized {
  overflow: hidden;
}

@media (max-width: 768px) {
  #buscador-ai-floating-chat {
    position: fixed;
    top: 90px;
    left: 17px;
    bottom: 10px;
    width: calc(100vw - 20px);
    height: calc(100dvh - 110px);
    border-radius: 8px;
  }

  #buscador-ai-floating-chat.is-maximized {
    top: 10px;
    right: 10px;
    bottom: 10px;
    left: 10px;
    border-radius: 18px;
  }

  #buscador-ai-floating-wrapper {
    right: 15px;
    bottom: 15px;
  }

  #buscador-ai-floating-wrapper .buscador-ai-floating-icon {
    width: 50px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #buscador-ai-floating-wrapper .buscador-ai-floating-icon,
  #buscador-ai-floating-chat {
    transition: none;
  }
}
