#fxp-chat-floating-container {
  position: fixed !important;
  z-index: 10 !important;
}

#fxp-chat-floating-container[data-position='bottom-right'] {
  bottom: 0px !important;
  right: 0px !important;
  left: auto !important;
  top: auto !important;
}

#fxp-chat-floating-container[data-position='bottom-left'] {
  bottom: 30px !important;
  left: 90px !important;
  right: auto !important;
  top: auto !important;
}

#fxp-chat-floating-container[data-position='top-right'] {
  top: 30px !important;
  right: 20px !important;
  bottom: auto !important;
  left: auto !important;
}

#fxp-chat-floating-container[data-position='top-left'] {
  top: 30px !important;
  left: 20px !important;
  bottom: auto !important;
  right: auto !important;
}

.fxp-chat-button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: absolute;
  z-index: 100;
  bottom: 20px;
  right: 20px;
  overflow: hidden;
}

.fxp-chat-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

.fxp-chat-button:active {
  transform: scale(0.95);
}

.fxp-chat-button-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  transition: opacity 0.3s ease;
}

.fxp-chat-button-close {
  font-size: 32px;
  color: #fff;
  font-weight: bold;
  line-height: 1;
}

.fxp-chat-button.active .fxp-chat-button-icon {
  opacity: 0;
}

.fxp-chat-button.active .fxp-chat-button-close {
  display: block !important;
}

/* Ventana del chat */
.fxp-chat-window {
  position: relative !important;
  width: 400px;
  height: 600px;
  margin-right: 16px !important;
  margin-bottom: 24px !important;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 110px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s ease;
  z-index: 100 !important;
}

.chat-header-icon {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fxp-chat-window-header {
  background: black;
  /*linear-gradient(135deg, #ff8b2c 0%, #e27100 100%);*/
  color: #fff;
  padding: 24px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 16px;
}

.fxp-chat-window-header-text {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fxp-chat-window-header-text h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
  padding: 0;
}

.fxp-chat-window-header-text p {
  font-size: 0.8rem;
  opacity: 0.9;
  margin: 0;
  padding: 0;
}

.fxp-chat-close-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.fxp-chat-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

#fxp-chat-iframe {
  width: 100%;
  height: 100%;
  border: none;
  flex: 1;
  background: #fff;
}

.fxp-chat-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.fxp-chat-content .chat-wrapper {
  height: 100%;
  margin: 0;
  padding: 0;
}

.fxp-chat-content .brand-header {
  display: none;
}

.fxp-chat-content .footer-info {
  display: none;
}

/* Spinner de carga */
.spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #ff8b2c;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 10px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Mensaje de bienvenida */
.fxp-welcome-message {
  position: fixed;
  z-index: 999998;
  background: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  font-size: 14px;
  color: #333;
  max-width: 250px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.fxp-welcome-message.show {
  opacity: 1;
  transform: translateY(0);
}

.fxp-welcome-message[data-position='bottom-right'] {
  bottom: 90px !important;
  right: 20px !important;
  left: auto !important;
  top: auto !important;
}

.fxp-welcome-message[data-position='bottom-left'] {
  bottom: 90px !important;
  left: 20px !important;
  right: auto !important;
  top: auto !important;
}

.fxp-welcome-message[data-position='top-right'] {
  top: 90px !important;
  right: 20px !important;
  bottom: auto !important;
  left: auto !important;
}

.fxp-welcome-message[data-position='top-left'] {
  top: 90px !important;
  left: 20px !important;
  bottom: auto !important;
  right: auto !important;
}

.fxp-welcome-message::after {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border: 8px solid transparent;
}

.fxp-welcome-message[data-position='bottom-right']::after,
.fxp-welcome-message[data-position='bottom-left']::after {
  bottom: -16px;
  border-top-color: #fff;
}

.fxp-welcome-message[data-position='bottom-right']::after {
  right: 20px;
}

.fxp-welcome-message[data-position='bottom-left']::after {
  left: 20px;
}

.fxp-welcome-message[data-position='top-right']::after,
.fxp-welcome-message[data-position='top-left']::after {
  top: -16px;
  border-bottom-color: #fff;
}

.fxp-welcome-message[data-position='top-right']::after {
  right: 20px;
}

.fxp-welcome-message[data-position='top-left']::after {
  left: 20px;
}

/* Responsive */
@media (max-width: 768px) {
  #fxp-chat-floating-container[data-position='bottom-right'],
  #fxp-chat-floating-container[data-position='bottom-left'] {
    bottom: 15px !important;
  }

  #fxp-chat-floating-container[data-position='bottom-right'] {
    right: 15px !important;
  }

  #fxp-chat-floating-container[data-position='bottom-left'] {
    left: 15px !important;
  }

  .fxp-chat-button {
    width: 56px;
    height: 56px;
  }

  #fxp-chat-floating-container[data-position='bottom-right'] .fxp-chat-window,
  #fxp-chat-floating-container[data-position='bottom-left'] .fxp-chat-window {
    bottom: 80px !important;
    left: 15px !important;
    right: 15px !important;
    width: auto !important;
    height: calc(100vh - 100px) !important;
    max-height: calc(100vh - 100px) !important;
  }
}

@media (max-width: 480px) {
  .fxp-chat-window {
    bottom: 0 !important;
    right: 0 !important;
    left: 0 !important;
    top: auto !important;
    width: 100% !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
  }
}
