#fnchat-pro-root {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
}

.fnchat-pro-button {
  width: 74px;
  height: 74px;
  cursor: pointer;
}

.fnchat-pro-button-border {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(from 180deg, #D4AF37, #27AE60, #0A5431, #D4AF37);
  animation: fnchat-rotate 4s linear infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.fnchat-pro-button-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.fnchat-pro-button-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

@keyframes fnchat-rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.fnchat-pro-window {
  position: fixed;
  bottom: 110px;
  right: 20px;
  width: 360px;
  max-height: 560px;
  background: rgba(255,255,255,0.98);
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(15,23,42,0.5);
  display: none;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(16px);
}

.fnchat-pro-window-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: linear-gradient(135deg, #0A5431, #27AE60);
  color: #ffffff;
}

.fnchat-pro-header-main {
  display: flex;
  flex-direction: column;
}

.fnchat-pro-header-title {
  font-size: 14px;
  font-weight: 600;
}

.fnchat-pro-header-sub {
  font-size: 11px;
  opacity: 0.9;
}

/* Barra de pruebas sociales */
.fnchat-pro-notice {
  padding: 6px 12px;
  font-size: 11px;
  color: #065f46;
  background: #ecfdf5;
  border-bottom: 1px solid rgba(16,185,129,0.15);
  display: flex;
  align-items: center;
  gap: 6px;
}

.fnchat-pro-notice-icon {
  font-size: 12px;
}

.fnchat-pro-notice-text {
  flex: 1;
}

/* Catálogo colapsable */
.fnchat-pro-products {
  border-bottom: 1px solid rgba(148,163,184,0.3);
  background: linear-gradient(135deg, rgba(10,84,49,0.06), rgba(39,174,96,0.03));
}

.fnchat-pro-products-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  color: #065f46;
}

.fnchat-pro-products-bar-label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fnchat-pro-products-bar-label span.badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(22,163,74,0.12);
  color: #16a34a;
}

.fnchat-pro-products-toggle {
  font-size: 14px;
  color: #047857;
}

.fnchat-pro-products-list {
  padding: 4px 10px 8px;
  overflow-x: auto;
  display: flex;
  gap: 10px;
  scrollbar-width: thin;
}

.fnchat-pro-products-list::-webkit-scrollbar {
  height: 4px;
}
.fnchat-pro-products-list::-webkit-scrollbar-thumb {
  background: rgba(15,23,42,0.25);
  border-radius: 999px;
}

.fnchat-pro-products.collapsed .fnchat-pro-products-list {
  display: none;
}

.fnchat-pro-products.collapsed .fnchat-pro-products-bar-label span.badge {
  background: rgba(22,163,74,0.06);
}

.fnchat-pro-products.collapsed .fnchat-pro-products-toggle {
  transform: rotate(180deg);
}

/* Tarjetas catálogo mini */
.fnchat-pro-product-card {
  min-width: 190px;
  max-width: 210px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 6px 16px rgba(15,23,42,0.12);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fnchat-pro-product-image {
  width: 100%;
  height: 90px;
  border-radius: 12px;
  overflow: hidden;
  background: #f3f4f6;
}

.fnchat-pro-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fnchat-pro-product-title {
  font-size: 13px;
  font-weight: 600;
  margin-top: 4px;
}

.fnchat-pro-product-prices {
  font-size: 12px;
  display: flex;
  gap: 6px;
  align-items: baseline;
}

.fnchat-pro-product-prices .before {
  text-decoration: line-through;
  color: #9ca3af;
}

.fnchat-pro-product-prices .after {
  color: #0A5431;
  font-weight: 600;
}

.fnchat-pro-product-actions {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.fnchat-pro-product-actions button {
  flex: 1;
  font-size: 11px;
  padding: 5px 8px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 500;
}

.fnchat-pro-product-actions .btn-primary {
  background: #0A5431;
  color: #ffffff;
}

.fnchat-pro-product-actions .btn-ghost {
  background: #ffffff;
  color: #0A5431;
  border: 1px solid rgba(10,84,49,0.18);
}

/* Área mensajes */
.fnchat-pro-messages {
  flex: 1;
  padding: 10px 12px;
  overflow-y: auto;
  background-size: cover;
  background-position: center;
}

.fnchat-pro-message {
  max-width: 78%;
  border-radius: 18px;
  padding: 8px 10px;
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.4;
  display: inline-block;
  word-wrap: break-word;
}

.fnchat-pro-message.user {
  background: #e5e7eb;
  color: #111827;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

.fnchat-pro-message.ai {
  background: #0A5431;
  color: #ffffff;
  margin-right: auto;
  border-bottom-left-radius: 4px;
}

/* Mensaje tipo producto inline */
.fnchat-pro-message-product {
  padding: 0;
  background: transparent;
}

.fnchat-pro-message-product .fnchat-pro-product-inline {
  display: flex;
  gap: 8px;
  background: #0A5431;
  border-radius: 18px;
  padding: 8px;
}

.fnchat-pro-product-inline-img {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  overflow: hidden;
  background: #f3f4f6;
  flex-shrink: 0;
}

.fnchat-pro-product-inline-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fnchat-pro-product-inline-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fnchat-pro-product-inline-name {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
}

.fnchat-pro-product-inline-prices {
  font-size: 12px;
  display: flex;
  gap: 6px;
  align-items: baseline;
}

.fnchat-pro-product-inline-prices .before {
  text-decoration: line-through;
  color: #bbf7d0;
  opacity: 0.8;
}

.fnchat-pro-product-inline-prices .after {
  color: #facc15;
  font-weight: 600;
}

.fnchat-pro-product-inline-shipping {
  font-size: 11px;
  color: #e5e7eb;
}

/* Input */
.fnchat-pro-input-area {
  border-top: 1px solid rgba(148,163,184,0.4);
  padding: 8px;
  display: flex;
  gap: 6px;
  background: #f9fafb;
  -webkit-text-size-adjust: 100%;
}

.fnchat-pro-input-area input {
  flex: 1;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  padding: 10px 14px;
  font-size: 16px;
  outline: none;
  background: #ffffff;
  transition: box-shadow 0.35s ease, border-color 0.35s ease;
  animation: fnchat-input-pulse 4s ease-in-out infinite;
}

@keyframes fnchat-input-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(34,197,94,0);
    border-color: #d1d5db;
  }
  50% {
    box-shadow: 0 0 0 3px rgba(34,197,94,0.18);
    border-color: #16a34a;
  }
}

.fnchat-pro-input-area button {
  border-radius: 999px;
  border: none;
  padding: 0 18px;
  font-size: 16px;
  background: #0A5431;
  color: #ffffff;
  cursor: pointer;
  font-weight: 500;
}

/* Escribiendo */
.fnchat-pro-typing {
  font-size: 11px;
  color: #6b7280;
  margin-bottom: 6px;
}

.fnchat-pro-typing span {
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-right: 3px;
  border-radius: 999px;
  background: #9ca3af;
  animation: fnchat-dot 1s infinite ease-in-out;
}
.fnchat-pro-typing span:nth-child(2) { animation-delay: 0.15s; }
.fnchat-pro-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes fnchat-dot {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-3px); opacity: 1; }
}

/* Responsive */
@media (max-width: 600px) {
  .fnchat-pro-window {
    right: 10px;
    width: 92vw;
  }
}

/* Pantalla completa */
.fnchat-pro-fullscreen-wrapper {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.fnchat-pro-fullscreen-wrapper #fnchat-pro-root {
  position: static;
  width: 100%;
  max-width: 100%;
}

.fnchat-pro-fullscreen-wrapper .fnchat-pro-button {
  display: none;
}

.fnchat-pro-fullscreen-wrapper .fnchat-pro-window {
  position: static;
  display: flex !important;
  width: 100%;
  max-width: 100%;
  height: 100vh;
  max-height: none;
  border-radius: 0;
  box-shadow: none;
}
