/**
 * Universal RAG Chatbot - Estilos CSS
 * Version: 2.3.0 - Categorías y sugerencias dinámicas
 */

/* Universal RAG Chatbot - Forzar posicionamiento flotante */
#universal-rag-chatbot {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    width: 450px !important;
    max-height: 600px !important;
    background: #fff !important;
    border-radius: 20px !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15) !important;
    z-index: 999999 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    display: none !important;
    overflow: hidden !important;
    max-width: 450px !important;
}

#universal-rag-chatbot.open {
    display: block !important;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

@keyframes slideUp {
    from { 
        transform: translateY(40px) scale(0.9); 
        opacity: 0; 
    }
    60% {
        transform: translateY(-5px) scale(1.02); 
        opacity: 0.8; 
    }
    to { 
        transform: translateY(0) scale(1); 
        opacity: 1; 
    }
}

.rag-chat-header {
    background: linear-gradient(135deg, #10b981 0%, #0ea5e9 100%) !important;
    color: white !important;
    padding: 20px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    position: relative !important;
    border-radius: 20px 20px 0 0 !important;
}

.rag-chat-header::before {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 2px !important;
    background: linear-gradient(90deg, #4ade80, #22d3ee, #0ea5e9, #10b981) !important;
    animation: rainbow 3s linear infinite !important;
    border-radius: 20px 20px 0 0 !important;
}

@keyframes rainbow {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

.rag-chat-title {
    margin: 0 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    color: white !important;
}

.rag-chat-subtitle {
    font-size: 12px !important;
    opacity: 0.9 !important;
    margin-top: 4px !important;
    font-weight: 400 !important;
    color: white !important;
}

.rag-header-actions {
    display: flex !important;
    gap: 8px !important;
    align-items: center !important;
}

/* Make header actions position relative so we can better center the close button visually */
.rag-header-actions {
    position: relative !important;
}

.rag-clear-btn {
    background: rgba(255,255,255,0.2) !important;
    border: none !important;
    color: white !important;
    font-size: 16px !important;
    cursor: pointer !important;
    padding: 8px !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s !important;
}

.rag-clear-btn:hover {
    background: rgba(255,255,255,0.3) !important;
    transform: scale(1.1) !important;
}

.rag-chat-close {
    background: rgba(255,255,255,0.2) !important;
    border: none !important;
    color: white !important;
    font-size: 22px !important;
    cursor: pointer !important;
    padding: 8px !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s !important;
}

/* Visually center the close X within the header action area */
.rag-header-actions .rag-chat-close {
    margin-left: 6px !important;
    margin-right: 6px !important;
    /* keep natural flow, but make it appear centered by equal margins */
}

.rag-chat-close:hover {
    background: rgba(255,255,255,0.3) !important;
    transform: rotate(90deg) !important;
}

.rag-chat-messages {
    height: 400px !important;
    overflow-y: auto !important;
    padding: 24px !important;
    background: linear-gradient(to bottom, #f8fafc, #e2e8f0) !important;
}

.rag-message {
    margin-bottom: 20px !important;
    display: flex !important;
    gap: 14px !important;
    align-items: flex-end !important;
}

.rag-message.user {
    justify-content: flex-end !important;
}

.rag-message.bot {
    justify-content: flex-start !important;
}

.rag-message-content {
    max-width: 85% !important;
    padding: 16px 20px !important;
    border-radius: 20px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    word-wrap: break-word !important;
    position: relative !important;
}

.rag-message.user .rag-message-content {
    background: linear-gradient(135deg, #10b981 0%, #0ea5e9 100%) !important;
    color: white !important;
    border-bottom-right-radius: 6px !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
}

.rag-message.bot .rag-message-content {
    background: white !important;
    color: #2d3748 !important;
    border: 1px solid #e2e8f0 !important;
    border-bottom-left-radius: 6px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    white-space: normal !important;
    line-height: 1.6 !important;
}

/* Formateo HTML del bot */
.rag-message.bot .rag-message-content p {
    margin: 0 0 12px 0 !important;
    line-height: 1.6 !important;
}

.rag-message.bot .rag-message-content p:last-child {
    margin-bottom: 0 !important;
}

/* Secciones de chat */
.rag-message.bot .rag-message-content .chat-section {
    background: #f8f9fa !important;
    border-left: 4px solid #10b981 !important;
    padding: 12px 16px !important;
    margin: 12px 0 !important;
    border-radius: 0 8px 8px 0 !important;
}

/* Contenido destacado */
.rag-message.bot .rag-message-content .chat-highlight {
    background: linear-gradient(135deg, #e3f2fd 0%, #f1f8e9 100%) !important;
    border: 1px solid #bbdefb !important;
    padding: 12px 16px !important;
    margin: 12px 0 !important;
    border-radius: 8px !important;
}

/* Títulos h4 */
.rag-message.bot .rag-message-content h4 {
    margin: 8px 0 !important;
    font-size: 15px !important;
    color: #1a365d !important;
}

/* Texto en negrita */
.rag-message.bot .rag-message-content strong {
    color: #1a365d !important;
    font-weight: 600 !important;
}

/* Enlaces como botones atractivos */
.rag-message.bot .rag-message-content .chat-link,
.rag-message.bot .rag-message-content a {
    display: inline-block !important;
    background: linear-gradient(135deg, #10b981 0%, #0ea5e9 100%) !important;
    color: white !important;
    padding: 8px 16px !important;
    border-radius: 20px !important;
    text-decoration: none !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    margin: 8px 0 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3) !important;
}

.rag-message.bot .rag-message-content .chat-link:hover,
.rag-message.bot .rag-message-content a:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4) !important;
    background: linear-gradient(135deg, #0ea5e9 0%, #10b981 100%) !important;
}

/* Separadores elegantes */
.rag-message.bot .rag-message-content .chat-separator,
.rag-message.bot .rag-message-content hr {
    border: none !important;
    height: 1px !important;
    background: linear-gradient(to right, transparent, #e0e0e0, transparent) !important;
    margin: 20px 0 !important;
}

/* Listas con mejor formato */
.rag-message.bot .rag-message-content ul {
    margin: 8px 0 !important;
    padding-left: 20px !important;
}

.rag-message.bot .rag-message-content li {
    margin: 4px 0 !important;
    line-height: 1.5 !important;
    color: #555 !important;
}

.rag-chat-input {
    padding: 20px 24px !important;
    border-top: 1px solid #e2e8f0 !important;
    background: white !important;
    border-radius: 0 0 20px 20px !important;
}

.rag-input-group {
    display: flex !important;
    gap: 12px !important;
    align-items: center !important;
}

.rag-chat-input input {
    flex: 1 !important;
    padding: 14px 20px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 25px !important;
    outline: none !important;
    font-size: 14px !important;
    transition: all 0.3s !important;
}

.rag-chat-input input:focus {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1) !important;
}

#universal-rag-chatbot .rag-send-btn {
    background: linear-gradient(135deg, #22d3ee 0%, #0ea5e9 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    width: 50px !important;
    height: 50px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 20px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 14px rgba(34, 211, 238, 0.3) !important;
    margin: 0 !important;
    padding: 0 !important;
    outline: none !important;
    flex-shrink: 0 !important;
}

#universal-rag-chatbot .rag-send-btn:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4) !important;
    background: linear-gradient(135deg, #10b981 0%, #0284c7 100%) !important;
}

#universal-rag-chatbot .rag-send-btn:disabled {
    background: #cbd5e0 !important;
    transform: none !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}

/* Estilo para el botón en modo stop */
#universal-rag-chatbot .rag-send-btn.rag-stop-mode {
    background: linear-gradient(135deg, #ff4757 0%, #ff6b9d 100%) !important;
    animation: pulseStop 1.5s ease-in-out infinite !important;
}

#universal-rag-chatbot .rag-send-btn.rag-stop-mode:hover {
    background: linear-gradient(135deg, #ff3742 0%, #ff5d8d 100%) !important;
    transform: scale(1.1) !important;
}

@keyframes pulseStop {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.rag-chat-toggle {
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;
    width: 70px !important;
    height: 70px !important;
    background: linear-gradient(135deg, #10b981 0%, #0ea5e9 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    font-size: 28px !important;
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.3) !important;
    z-index: 1000000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    outline: none !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    user-select: none !important;
    -webkit-tap-highlight-color: transparent !important;
    /* Forzar forma redonda en todos los temas */
    min-width: 70px !important;
    max-width: 70px !important;
    min-height: 70px !important;
    max-height: 70px !important;
    padding: 0 !important;
    margin: 0 !important;
    /* Reset completo para evitar interferencias del tema */
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    text-decoration: none !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
}

.rag-chat-toggle:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 12px 40px rgba(16, 185, 129, 0.4) !important;
    background: linear-gradient(135deg, #0ea5e9 0%, #10b981 100%) !important;
}

.rag-chat-toggle:active {
    transform: scale(0.95) !important;
    transition: all 0.1s ease !important;
}

.rag-chat-toggle:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3) !important;
}

/* Animación de entrada del botón */
.rag-chat-toggle {
    animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
}

@keyframes bounceIn {
    0% { 
        transform: scale(0) rotate(-180deg) !important; 
        opacity: 0 !important; 
    }
    60% { 
        transform: scale(1.15) rotate(-45deg) !important; 
        opacity: 0.9 !important; 
    }
    80% {
        transform: scale(0.95) rotate(10deg) !important;
        opacity: 1 !important;
    }
    100% { 
        transform: scale(1) rotate(0deg) !important; 
        opacity: 1 !important; 
    }
}

/* Estado oculto del botón */
.rag-chat-toggle.hidden {
    transform: scale(0) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Ícono del botón toggle */
.rag-toggle-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    line-height: 1 !important;
    transition: all 0.3s ease !important;
    pointer-events: none !important; /* Evitar que el icono interfiera con el click */
    user-select: none !important;
}

.rag-toggle-icon svg {
    width: 100% !important;
    height: 100% !important;
    color: currentColor !important;
    transition: all 0.3s ease !important;
}

.rag-chat-toggle:hover .rag-toggle-icon {
    transform: scale(1.1) !important;
}

/* Asegurar que todo el botón sea clickeable */
.rag-chat-toggle * {
    pointer-events: none !important;
    user-select: none !important;
}

/* Pulso sutil para llamar la atención */
.rag-chat-toggle::after {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 50% !important;
    background: rgba(16, 185, 129, 0.3) !important;
    animation: pulse-ring 2s infinite !important;
    z-index: -1 !important;
}

@keyframes pulse-ring {
    0% {
        transform: scale(1) !important;
        opacity: 0.8 !important;
    }
    100% {
        transform: scale(1.8) !important;
        opacity: 0 !important;
    }
}

.rag-typing {
    display: none !important;
    padding: 12px 20px !important;
    font-style: italic !important;
    color: #10b981 !important;
    font-size: 13px !important;
    background: #f7fafc !important;
    border-top: 1px solid #e2e8f0 !important;
}

.rag-typing.show {
    display: block !important;
}

.rag-typing::before {
    content: "🧠 " !important;
    animation: pulse 1.5s infinite !important;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Botón de detener respuesta */
#universal-rag-chatbot .rag-stop-typing {
    padding: 10px 20px !important;
    text-align: center !important;
    opacity: 0 !important;
    transform: translateY(10px) !important;
    transition: all 0.3s ease !important;
    background: #f7fafc !important;
    border-top: 1px solid #e2e8f0 !important;
    display: none !important;
    margin: 0 !important;
}

#universal-rag-chatbot .rag-stop-typing.show {
    opacity: 1 !important;
    transform: translateY(0) !important;
    display: block !important;
}

#universal-rag-chatbot .rag-stop-btn {
    background: linear-gradient(135deg, #ff4757, #ff3742) !important;
    color: white !important;
    border: none !important;
    padding: 8px 16px !important;
    border-radius: 20px !important;
    font-size: 12px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3) !important;
    font-family: inherit !important;
    margin: 0 !important;
    outline: none !important;
}

#universal-rag-chatbot .rag-stop-btn:hover {
    background: linear-gradient(135deg, #ff3742, #ff2d42) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.4) !important;
}

#universal-rag-chatbot .rag-stop-btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 4px rgba(255, 71, 87, 0.3) !important;
}

/* Responsivo mejorado */
@media (max-width: 480px) {
    #universal-rag-chatbot {
        width: calc(100vw - 32px) !important;
        right: 16px !important;
        left: 16px !important;
        bottom: 100px !important;
        max-width: none !important;
    }
    
    .rag-chat-toggle {
        right: 16px !important;
        bottom: 16px !important;
        width: 64px !important;
        height: 64px !important;
        min-width: 64px !important;
        max-width: 64px !important;
        min-height: 64px !important;
        max-height: 64px !important;
        font-size: 24px !important;
    }
    
    .rag-toggle-icon {
        font-size: 24px !important;
    }
    
    .rag-stop-btn {
        padding: 10px 18px !important;
        font-size: 13px !important;
    }
}

@media (max-width: 360px) {
    .rag-chat-toggle {
        width: 58px !important;
        height: 58px !important;
        min-width: 58px !important;
        max-width: 58px !important;
        min-height: 58px !important;
        max-height: 58px !important;
        font-size: 22px !important;
    }
    
    .rag-toggle-icon {
        font-size: 22px !important;
    }
}

/* Asegurar que no hay conflictos con otros elementos */
#universal-rag-chatbot * {
    box-sizing: border-box !important;
}

/* ================== ESTILOS KNOWLEDGE GRAPH ================== */

/* Contenedor principal de respuestas KG */
.rag-kg-products-response {
    margin: 15px 0 !important;
    padding: 0 !important;
}

.rag-response-intro {
    margin-bottom: 15px !important;
}

.rag-response-intro h3 {
    color: #2c3e50 !important;
    font-size: 18px !important;
    margin: 0 0 8px 0 !important;
    font-weight: 600 !important;
}

.rag-response-intro p {
    color: #555 !important;
    font-size: 14px !important;
    margin: 0 !important;
    line-height: 1.4 !important;
}

.rag-response-footer {
    margin-top: 15px !important;
    padding-top: 10px !important;
    border-top: 1px solid #eee !important;
}

.rag-response-footer p {
    color: #666 !important;
    font-size: 13px !important;
    margin: 0 !important;
    font-style: italic !important;
}

/* Estilos para cuando no hay resultados */
.rag-kg-no-results {
    background: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 8px !important;
    padding: 20px !important;
    margin: 15px 0 !important;
    text-align: center !important;
}

.rag-kg-no-results h3 {
    color: #6c757d !important;
    font-size: 16px !important;
    margin: 0 0 10px 0 !important;
}

.rag-kg-no-results p {
    color: #868e96 !important;
    font-size: 14px !important;
    margin: 5px 0 !important;
}

/* Sugerencias */
.rag-suggestions {
    margin: 15px 0 !important;
    text-align: left !important;
}

.rag-suggestions h4 {
    color: #495057 !important;
    font-size: 15px !important;
    margin: 0 0 10px 0 !important;
}

.rag-suggestions ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.rag-suggestions li {
    padding: 5px 0 !important;
    color: #6c757d !important;
    font-size: 14px !important;
}

/* ================== ESTILOS PARA PRODUCTOS ================== */

/* Tarjetas de productos */
.chat-product-card {
    background: #ffffff !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 16px !important;
    padding: 16px !important;
    margin: 16px 0 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
    overflow: hidden !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
}

.chat-product-card:hover {
    border-color: #10b981 !important;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.2) !important;
    transform: translateY(-4px) scale(1.02) !important;
}

.chat-product-card::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.03), rgba(14, 165, 233, 0.03)) !important;
    border-radius: 16px !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
    pointer-events: none !important;
}

.chat-product-card:hover::before {
    opacity: 1 !important;
}

/* Imagen del producto */
.chat-product-image {
    width: 100% !important;
    margin-bottom: 12px !important;
    text-align: center !important;
    background: #f8f9fa !important;
    border-radius: 12px !important;
    padding: 8px !important;
}

.product-img {
    max-width: 100% !important;
    height: 180px !important;
    object-fit: cover !important;
    border-radius: 8px !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
}

/* Ensure product images are horizontally centered inside their container */
.chat-product-image .product-img,
.rag-message .product-img,
.rag-message-content .product-img {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Hide the pause/stop response button UI so it's not visible */
#rag-stop-btn,
.rag-send-btn.rag-stop-mode {
    display: none !important;
}

/* Información del producto */
.chat-product-info {
    padding: 0 !important;
}

.product-title {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #1a365d !important;
    margin: 0 0 12px 0 !important;
    line-height: 1.3 !important;
}

/* Precio del producto */
.chat-product-price {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%) !important;
    color: white !important;
    padding: 8px 12px !important;
    border-radius: 8px !important;
    margin: 8px 0 !important;
    font-weight: 600 !important;
    display: inline-block !important;
}

.price-label {
    font-size: 14px !important;
    opacity: 0.9 !important;
}

.price-value {
    font-size: 16px !important;
    font-weight: 700 !important;
}

/* Estado del stock */
.chat-stock-status {
    margin: 8px 0 !important;
    padding: 6px 10px !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    display: inline-block !important;
}

/* Estados específicos de stock - en stock */
.chat-stock-status:contains("✅") {
    background: #f0fff4 !important;
    color: #22543d !important;
    border: 1px solid #68d391 !important;
}

/* Estados específicos de stock - sin stock */  
.chat-stock-status:contains("❌") {
    background: #fff5f5 !important;
    color: #742a2a !important;
    border: 1px solid #fc8181 !important;
}

.stock-icon {
    margin-right: 4px !important;
}

/* Descripción del producto */
.product-description {
    color: #4a5568 !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    margin: 12px 0 !important;
    text-align: justify !important;
    max-height: none !important;
    overflow: visible !important;
}

/* Descripción generada por AI - estilo especial */
.product-description.ai-generated {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%) !important;
    border: 1px solid #bbf7d0 !important;
    border-radius: 8px !important;
    padding: 12px !important;
    position: relative !important;
    font-style: italic !important;
    color: #065f46 !important;
}

.product-description.ai-generated::before {
    content: "✨ AI" !important;
    position: absolute !important;
    top: -8px !important;
    right: 8px !important;
    background: linear-gradient(135deg, #10b981 0%, #0ea5e9 100%) !important;
    color: white !important;
    font-size: 10px !important;
    padding: 2px 6px !important;
    border-radius: 10px !important;
    font-weight: bold !important;
    font-style: normal !important;
}

/* Categorías */
.product-categories {
    margin: 8px 0 !important;
    font-size: 13px !important;
    color: #6b7280 !important;
}

.categories-label {
    font-weight: 600 !important;
    color: #374151 !important;
}

/* Botones de acción del producto */
.product-actions {
    margin-top: 16px !important;
    display: flex !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
}

.chat-product-btn {
    background: linear-gradient(135deg, #10b981 0%, #0ea5e9 100%) !important;
    color: white !important;
    padding: 10px 16px !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: inline-block !important;
    flex: 1 !important;
    text-align: center !important;
    min-width: 120px !important;
    position: relative !important;
    overflow: hidden !important;
}

.chat-product-btn::before {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 0 !important;
    height: 0 !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border-radius: 50% !important;
    transform: translate(-50%, -50%) !important;
    transition: width 0.6s, height 0.6s !important;
}

.chat-product-btn:hover::before {
    width: 300px !important;
    height: 300px !important;
}

.chat-product-btn:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4) !important;
    text-decoration: none !important;
    color: white !important;
}

.chat-buy-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
    color: white !important;
    padding: 10px 16px !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    transition: all 0.3s ease !important;
    display: inline-block !important;
    flex: 1 !important;
    text-align: center !important;
    min-width: 120px !important;
}

.chat-buy-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(245, 87, 108, 0.3) !important;
    text-decoration: none !important;
    color: white !important;
}

/* Botón "Cargar más productos" */
.load-more-container {
    text-align: center !important;
    margin: 20px 0 !important;
    padding: 15px !important;
    background: #f8f9fa !important;
    border-radius: 10px !important;
    border: 1px solid #e9ecef !important;
}

.load-more-products-btn {
    background: linear-gradient(135deg, #10b981 0%, #0ea5e9 100%) !important;
    color: white !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 25px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
    font-size: 14px !important;
    font-family: inherit !important;
    margin: 0 !important;
    outline: none !important;
}

.load-more-products-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4) !important;
    background: linear-gradient(135deg, #0ea5e9 0%, #10b981 100%) !important;
}

.load-more-products-btn:active {
    transform: translateY(0) !important;
    transition-duration: 0.1s !important;
}

/* Responsive para productos */
@media (max-width: 480px) {
    .chat-product-card {
        padding: 12px !important;
        margin: 12px 0 !important;
    }
    
    .product-img {
        height: 140px !important;
    }
    
    .product-title {
        font-size: 16px !important;
    }
    
    .product-actions {
        flex-direction: column !important;
    }
    
    .chat-product-btn,
    .chat-buy-btn {
        flex: none !important;
        width: 100% !important;
        min-width: auto !important;
    }
}

/* ================== SISTEMA DE CATEGORÍAS v2.3.0 ================== */

/* Grid de categorías */
.chat-categories-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
    gap: 16px !important;
    margin: 16px 0 !important;
}

/* Tarjetas de categorías */
.chat-category-card {
    background: #ffffff !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 16px !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    overflow: hidden !important;
}

.chat-category-card:hover {
    border-color: #10b981 !important;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.15) !important;
    transform: translateY(-2px) !important;
}

/* Imagen de categoría */
.category-image {
    width: 100% !important;
    height: 120px !important;
    margin-bottom: 12px !important;
    overflow: hidden !important;
    border-radius: 8px !important;
    background: #f8f9fa !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.category-img {
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover !important;
    border-radius: 6px !important;
}

/* Información de categoría */
.category-info {
    text-align: center !important;
}

.category-title {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #1a365d !important;
    margin: 0 0 6px 0 !important;
}

.category-count {
    font-size: 12px !important;
    color: #6b7280 !important;
    margin: 0 0 8px 0 !important;
    font-weight: 500 !important;
}

.category-description {
    font-size: 13px !important;
    color: #4a5568 !important;
    margin: 8px 0 12px 0 !important;
    line-height: 1.4 !important;
}

/* Botón de categoría */
.chat-category-btn {
    background: linear-gradient(135deg, #22d3ee 0%, #0ea5e9 100%) !important;
    color: white !important;
    border: none !important;
    padding: 8px 16px !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    width: 100% !important;
}

.chat-category-btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 8px rgba(34, 211, 238, 0.3) !important;
}

/* ================== SUGERENCIAS DINÁMICAS v2.3.0 ================== */

/* Contenedor de sugerencias */
.chat-suggestions {
    background: linear-gradient(135deg, #f8f9ff 0%, #f1f3ff 100%) !important;
    border: 1px solid #e0e7ff !important;
    border-radius: 12px !important;
    padding: 16px !important;
    margin: 16px 0 !important;
}

.suggestions-title {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #3730a3 !important;
    margin: 0 0 12px 0 !important;
    text-align: center !important;
}

/* Grid de sugerencias */
.suggestions-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    gap: 8px !important;
}

/* Botones de sugerencia */
.chat-suggestion-btn {
    background: white !important;
    border: 1px solid #d1d5db !important;
    border-radius: 8px !important;
    padding: 10px 12px !important;
    font-size: 13px !important;
    color: #374151 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-align: left !important;
    display: flex !important;
    align-items: center !important;
    min-height: 44px !important;
}

.chat-suggestion-btn:hover {
    background: linear-gradient(135deg, #10b981 0%, #0ea5e9 100%) !important;
    color: white !important;
    border-color: #10b981 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2) !important;
}

.suggestion-text {
    line-height: 1.3 !important;
    font-weight: 500 !important;
}

/* Responsive para categorías y sugerencias */
@media (max-width: 480px) {
    .chat-categories-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    .chat-category-card {
        padding: 12px !important;
    }
    
    .category-image {
        height: 100px !important;
    }
    
    .suggestions-grid {
        grid-template-columns: 1fr !important;
        gap: 6px !important;
    }
    
    .chat-suggestion-btn {
        padding: 12px !important;
        font-size: 12px !important;
        min-height: 40px !important;
    }
    
    .chat-suggestions {
        padding: 12px !important;
        margin: 12px 0 !important;
    }
}

@media (max-width: 360px) {
    .category-title {
        font-size: 15px !important;
    }
    
    .category-description {
        font-size: 12px !important;
    }
    
    .chat-category-btn {
        font-size: 12px !important;
        padding: 6px 12px !important;
    }
}

/* =========================
   ANIMACIONES Y TRANSICIONES MEJORADAS
   ========================= */

/* Animación de aparición para elementos */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Typing indicator animation */
@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.3;
    }
    30% {
        opacity: 1;
    }
}

/* Cursor parpadeante para efecto de escritura */
.typing-cursor::after {
    content: '|';
    display: inline-block;
    animation: typing 1s infinite;
    margin-left: 2px;
    color: #007cba;
    font-weight: normal;
}

/* Suave aparición de mensajes */
.rag-message {
    animation: fadeInUp 0.4s ease-out;
}

/* Transiciones mejoradas para elementos interactivos */
.chat-product-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-category-btn,
.chat-suggestion-btn {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Estados hover con transiciones suaves */
.chat-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 124, 186, 0.12);
}

.chat-category-btn:hover,
.chat-suggestion-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 3px 12px rgba(0, 124, 186, 0.15);
}

/* Efectos para contenido que aparece gradualmente */
.gradual-reveal {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.gradual-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Loading dots para contenido que se está cargando */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
    background: #f8f9fa;
    border-radius: 18px;
    margin: 10px 0;
    border: 1px solid #e9ecef;
}

.typing-indicator span {
    width: 7px;
    height: 7px;
    background: #007cba;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Indicador de escribiendo específico para el bot */
.bot-typing-indicator {
    display: none;
    padding: 12px 20px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    margin: 10px 0;
    position: relative;
    max-width: 85%;
    align-self: flex-start;
}

.bot-typing-indicator.show {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bot-typing-text {
    color: #10b981;
    font-style: italic;
    font-size: 13px;
    margin-right: 8px;
}

.bot-typing-dots {
    display: flex;
    gap: 3px;
}

.bot-typing-dots span {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    animation: typing 1.2s infinite ease-in-out;
}

.bot-typing-dots span:nth-child(1) {
    animation-delay: 0s;
}

.bot-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.bot-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

.bot-typing-info {
    margin-top: 8px;
    text-align: center;
}

.bot-typing-info small {
    color: #888;
    font-size: 11px;
    font-style: italic;
}

/* Pulse effect para elementos destacados */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 124, 186, 0.4);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(0, 124, 186, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 124, 186, 0);
    }
}

.pulse-effect {
    animation: pulse 2s infinite;
}

/* Mejoras en responsive con transiciones */
@media (max-width: 768px) {
    .chat-product-card:hover {
        transform: none; /* Desactivar hover en móvil */
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .chat-category-btn:hover,
    .chat-suggestion-btn:hover {
        transform: scale(1.01); /* Reducir efecto en móvil */
    }
    
    .typing-indicator {
        padding: 8px 12px;
    }
}

/* Smooth scroll para el contenedor de mensajes */
#rag-messages {
    scroll-behavior: smooth;
}

/* Mejoras visuales para estados activos */
.chat-category-btn:active,
.chat-suggestion-btn:active {
    transform: scale(0.98);
    transition-duration: 0.1s;
}

/* Efectos de enfoque para accesibilidad */
.chat-category-btn:focus,
.chat-suggestion-btn:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* =========================
   PREVISUALIZACIÓN DE PRODUCTOS
   ========================= */

/* Contenedor de previsualización */
.product-preview {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1000001;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    pointer-events: none;
}

.product-preview.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: all;
}

/* Overlay de fondo */
.product-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.product-preview-overlay.show {
    opacity: 1;
    pointer-events: all;
}

/* Header de la previsualización */
.product-preview-header {
    padding: 20px 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.product-preview-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a365d;
    margin: 0;
}

.product-preview-close {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    color: #4a5568;
}

.product-preview-close:hover {
    background: #e2e8f0;
    color: #2d3748;
}

/* Contenido de la previsualización */
.product-preview-content {
    padding: 0 24px 24px;
}

.product-preview-image {
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
}

.product-preview-img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 8px;
}

.product-preview-info {
    margin-top: 16px;
}

.product-preview-price {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 10px;
    margin: 16px 0;
    font-weight: 600;
    text-align: center;
}

.product-preview-description {
    color: #4a5568;
    font-size: 14px;
    line-height: 1.6;
    margin: 16px 0;
    text-align: justify;
}

.product-preview-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.product-preview-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.product-preview-btn.primary {
    background: linear-gradient(135deg, #10b981 0%, #0ea5e9 100%);
    color: white;
}

.product-preview-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.product-preview-btn.secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.product-preview-btn.secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 87, 108, 0.3);
}

/* Tooltip para hover en productos */
.product-hover-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    transform: translateX(-50%);
}

.chat-product-card:hover .product-hover-tooltip {
    opacity: 1;
}

/* Responsive para previsualización */
@media (max-width: 480px) {
    .product-preview {
        width: 95%;
        max-height: 85vh;
    }
    
    .product-preview-header {
        padding: 16px 20px 0;
        padding-bottom: 12px;
        margin-bottom: 16px;
    }
    
    .product-preview-title {
        font-size: 16px;
    }
    
    .product-preview-content {
        padding: 0 20px 20px;
    }
    
    .product-preview-actions {
        flex-direction: column;
    }
    
    .product-preview-btn {
        flex: none;
    }
}

/* ================================
   ESTILOS PARA INFORMACIÓN DE CONTACTO
   ================================ */

.contact-info-container {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%) !important;
    border-radius: 16px !important;
    padding: 20px !important;
    margin: 10px 0 !important;
    border: 1px solid #e1e8ed !important;
}

.contact-info-header {
    display: flex !important;
    align-items: center !important;
    margin-bottom: 16px !important;
    padding-bottom: 12px !important;
    border-bottom: 2px solid #ddd !important;
}

.contact-info-icon {
    font-size: 24px !important;
    margin-right: 12px !important;
    color: #10b981 !important;
}

.contact-info-title {
    font-size: 18px !important;
    font-weight: bold !important;
    color: #2c3e50 !important;
    margin: 0 !important;
}

.contact-info-message {
    background: #fff !important;
    padding: 14px !important;
    border-radius: 12px !important;
    margin-bottom: 16px !important;
    border-left: 4px solid #10b981 !important;
    font-style: italic !important;
    color: #555 !important;
}

.contact-details {
    display: grid !important;
    gap: 12px !important;
}

.contact-item {
    display: flex !important;
    align-items: center !important;
    background: #fff !important;
    padding: 12px 16px !important;
    border-radius: 10px !important;
    transition: all 0.3s ease !important;
    border: 1px solid #e8eaf6 !important;
    text-decoration: none !important;
    color: #333 !important;
}

.contact-item:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15) !important;
    border-color: #10b981 !important;
    text-decoration: none !important;
    color: #333 !important;
}

.contact-item-icon {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-right: 12px !important;
    font-size: 18px !important;
    flex-shrink: 0 !important;
}

.contact-item-icon.phone {
    background: linear-gradient(135deg, #4CAF50, #45a049) !important;
    color: white !important;
}

.contact-item-icon.email {
    background: linear-gradient(135deg, #2196F3, #1976D2) !important;
    color: white !important;
}

.contact-item-icon.address {
    background: linear-gradient(135deg, #FF9800, #F57C00) !important;
    color: white !important;
}

.contact-item-icon.hours {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2) !important;
    color: white !important;
}

.contact-item-icon.whatsapp {
    background: linear-gradient(135deg, #25D366, #128C7E) !important;
    color: white !important;
}

.contact-item-icon.social {
    background: linear-gradient(135deg, #10b981, #0ea5e9) !important;
    color: white !important;
}

.contact-item-content {
    flex: 1 !important;
}

.contact-item-label {
    font-weight: bold !important;
    color: #2c3e50 !important;
    font-size: 14px !important;
    margin-bottom: 2px !important;
}

.contact-item-value {
    color: #555 !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
}

.contact-social-group {
    display: flex !important;
    gap: 8px !important;
    margin-top: 16px !important;
}

.contact-social-item {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #fff !important;
    padding: 12px 8px !important;
    border-radius: 10px !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    border: 1px solid #e8eaf6 !important;
    color: #555 !important;
    font-size: 12px !important;
}

.contact-social-item:hover {
    transform: translateY(-2px) !important;
    text-decoration: none !important;
    color: #555 !important;
}

.contact-social-item.facebook:hover {
    background: #1877f2 !important;
    color: white !important;
    border-color: #1877f2 !important;
}

.contact-social-item.instagram:hover {
    background: linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%) !important;
    color: white !important;
    border-color: #e6683c !important;
}

.contact-social-item.twitter:hover {
    background: #1DA1F2 !important;
    color: white !important;
    border-color: #1DA1F2 !important;
}

.contact-form-container {
    background: #fff !important;
    border-radius: 12px !important;
    padding: 16px !important;
    margin-top: 16px !important;
    border: 1px solid #e1e8ed !important;
}

.contact-form-container iframe {
    width: 100% !important;
    border: none !important;
    border-radius: 8px !important;
}

.contact-page-link {
    display: inline-flex !important;
    align-items: center !important;
    background: linear-gradient(135deg, #10b981, #0ea5e9) !important;
    color: white !important;
    padding: 12px 20px !important;
    border-radius: 25px !important;
    text-decoration: none !important;
    font-weight: bold !important;
    font-size: 14px !important;
    transition: all 0.3s ease !important;
    margin-top: 16px !important;
    border: none !important;
    cursor: pointer !important;
}

.contact-page-link:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3) !important;
    color: white !important;
    text-decoration: none !important;
}

.contact-page-link i {
    margin-right: 8px !important;
}

/* Responsive para información de contacto */
@media (max-width: 480px) {
    .contact-info-container {
        padding: 16px !important;
        margin: 8px 0 !important;
    }
    
    .contact-social-group {
        flex-direction: column !important;
    }
    
    .contact-social-item {
        flex: none !important;
    }
    
    .contact-item {
        padding: 10px 12px !important;
    }
    
    .contact-item-icon {
        width: 35px !important;
        height: 35px !important;
        font-size: 16px !important;
        margin-right: 10px !important;
    }
}

/* ================== ESTILOS PARA KNOWLEDGE GRAPH ================== */

/* Contenedor principal de respuestas del KG */
.rag-kg-products-response {
    margin: 15px 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border-radius: 12px !important;
}

/* Introducción de la respuesta */
.rag-response-intro {
    margin-bottom: 15px !important;
    padding: 12px !important;
    background: linear-gradient(135deg, #f0fdf4 0%, #e0f2fe 100%) !important;
    border-radius: 8px !important;
    border-left: 4px solid #10b981 !important;
}

.rag-response-intro h3 {
    margin: 0 0 8px 0 !important;
    color: #065f46 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
}

.rag-response-intro p {
    margin: 0 !important;
    color: #424242 !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
}

/* Pie de respuesta */
.rag-response-footer {
    margin-top: 15px !important;
    padding: 10px !important;
    background: #f5f5f5 !important;
    border-radius: 8px !important;
    text-align: center !important;
}

.rag-response-footer p {
    margin: 0 !important;
    color: #666 !important;
    font-size: 13px !important;
    font-style: italic !important;
}

/* Sin resultados */
.rag-kg-no-results {
    margin: 15px 0 !important;
    padding: 20px !important;
    background: #fff3e0 !important;
    border-radius: 12px !important;
    border-left: 4px solid #ff9800 !important;
    text-align: center !important;
}

.rag-kg-no-results h3 {
    margin: 0 0 10px 0 !important;
    color: #f57c00 !important;
    font-size: 16px !important;
}

.rag-kg-no-results p {
    margin: 0 !important;
    color: #5d4037 !important;
    font-size: 14px !important;
}

/* Sugerencias */
.rag-suggestions {
    margin: 15px 0 !important;
    padding: 15px !important;
    background: #e8f5e8 !important;
    border-radius: 8px !important;
}

.rag-suggestions h4 {
    margin: 0 0 10px 0 !important;
    color: #2e7d32 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}

.rag-suggestions ul {
    margin: 0 !important;
    padding-left: 0 !important;
    list-style: none !important;
}

.rag-suggestions li {
    margin: 5px 0 !important;
    padding: 5px 0 !important;
    color: #388e3c !important;
    font-size: 13px !important;
}

/* Mejorar espaciado de tarjetas de productos */
.chat-product-card {
    margin-bottom: 15px !important;
}

.chat-product-card:last-child {
    margin-bottom: 0 !important;
}

/* ================== ESTILOS PARA KNOWLEDGE GRAPH ================== */

/* Contenedor principal para respuestas de productos del KG */
.rag-kg-products-response {
    background: #f8f9fa !important;
    border-radius: 12px !important;
    padding: 20px !important;
    margin: 15px 0 !important;
    border: 1px solid #e9ecef !important;
}

.rag-response-intro h3 {
    color: #333 !important;
    margin: 0 0 10px 0 !important;
    font-size: 18px !important;
    font-weight: 600 !important;
}

.rag-response-intro p {
    color: #666 !important;
    margin: 0 0 20px 0 !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
}

/* Estilos para cuando no hay resultados */
.rag-kg-no-results {
    background: #fff3cd !important;
    border: 1px solid #ffeaa7 !important;
    border-radius: 12px !important;
    padding: 20px !important;
    margin: 15px 0 !important;
}

.rag-kg-no-results h3 {
    color: #856404 !important;
    margin: 0 0 10px 0 !important;
    font-size: 18px !important;
}

.rag-suggestions {
    margin: 15px 0 !important;
}

.rag-suggestions h4 {
    color: #495057 !important;
    font-size: 16px !important;
    margin: 0 0 10px 0 !important;
}

.rag-suggestions ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.rag-suggestions li {
    padding: 5px 0 !important;
    color: #495057 !important;
    font-size: 14px !important;
}

.rag-response-footer {
    margin-top: 20px !important;
    padding-top: 15px !important;
    border-top: 1px solid #dee2e6 !important;
}

.rag-response-footer p {
    color: #6c757d !important;
    font-style: italic !important;
    margin: 0 !important;
    font-size: 13px !important;
    text-align: center !important;
}

/* Mejoras adicionales para las tarjetas de productos existentes */
.chat-product-card {
    margin-bottom: 15px !important;
    border: 1px solid #e9ecef !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
}

.chat-product-card:hover {
    border-color: #667eea !important;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.15) !important;
}

.chat-product-card.in-stock {
    border-left: 4px solid #28a745 !important;
}

.chat-product-card.out-of-stock {
    border-left: 4px solid #dc3545 !important;
    opacity: 0.8 !important;
}

/* Asegurar que las imágenes de productos se vean correctamente */
.chat-product-image {
    width: 100% !important;
    height: 120px !important;
    overflow: hidden !important;
    background: #f8f9fa !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.product-img {
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover !important;
    border-radius: 0 !important;
}

/* Mejorar la información del producto */
.chat-product-info {
    padding: 15px !important;
}

.product-title {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #333 !important;
    margin: 0 0 10px 0 !important;
    line-height: 1.3 !important;
}

.chat-product-price {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 8px 0 !important;
}

.price-label {
    font-size: 14px !important;
    color: #666 !important;
}

.price-value {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: black !important;
}

.chat-stock-status {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 8px 0 !important;
    font-size: 14px !important;
}

.chat-stock-status.in-stock {
    color: #28a745 !important;
}

.chat-stock-status.out-of-stock {
    color: #dc3545 !important;
}

.product-description {
    margin: 10px 0 !important;
    font-size: 13px !important;
    color: #666 !important;
    line-height: 1.4 !important;
}

.product-actions {
    margin-top: 15px !important;
}

.chat-product-btn {
    display: inline-block !important;
    background: linear-gradient(135deg, #10b981, #0ea5e9) !important;
    color: white !important;
    padding: 10px 16px !important;
    border-radius: 20px !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    border: none !important;
}

.chat-product-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
    color: white !important;
    text-decoration: none !important;
}

/* ================== NUEVOS ESTILOS PARA KNOWLEDGE GRAPH AGRESIVO ================== */

/* Grid mejorado para productos del KG */
.rag-products-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
    gap: 20px !important;
    margin: 20px 0 !important;
}

/* Introducción con estilo destacado */
.rag-response-intro {
    background: linear-gradient(135deg, #10b981 0%, #0ea5e9 100%) !important;
    color: white !important;
    padding: 16px 20px !important;
    border-radius: 12px !important;
    margin-bottom: 20px !important;
    box-shadow: 0 3px 8px rgba(16, 185, 129, 0.3) !important;
}

.rag-response-intro h3 {
    color: white !important;
    margin: 0 0 8px 0 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1) !important;
}

.rag-response-intro p {
    color: rgba(255,255,255,0.95) !important;
    margin: 0 !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
}

/* Tarjetas de productos mejoradas para KG */
.rag-kg-products-response .chat-product-card {
    background: white !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
    position: relative !important;
}

.rag-kg-products-response .chat-product-card:hover {
    border-color: #667eea !important;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.2) !important;
    transform: translateY(-4px) !important;
}

/* Imágenes de productos optimizadas para KG */
.rag-kg-products-response .chat-product-image {
    width: 100% !important;
    height: 200px !important;
    overflow: hidden !important;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
}

.rag-kg-products-response .product-img {
    max-width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border: none !important;
    transition: transform 0.3s ease !important;
}

.rag-kg-products-response .chat-product-card:hover .product-img {
    transform: scale(1.05) !important;
}

/* Footer de respuesta mejorado */
.rag-response-footer {
    background: linear-gradient(135deg, #edf2f7 0%, #e2e8f0 100%) !important;
    padding: 15px 20px !important;
    margin-top: 20px !important;
    border-radius: 12px !important;
    text-align: center !important;
    border: 1px solid #cbd5e0 !important;
}

.rag-response-footer p {
    color: #4a5568 !important;
    font-style: italic !important;
    margin: 0 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
}

/* Estado cuando no hay resultados - mejorado */
.rag-kg-no-results {
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%) !important;
    border: 2px solid #fc8181 !important;
    border-radius: 16px !important;
    padding: 30px !important;
    margin: 20px 0 !important;
    text-align: center !important;
    box-shadow: 0 4px 12px rgba(252, 129, 129, 0.15) !important;
}

.rag-kg-no-results h3 {
    color: #c53030 !important;
    font-size: 18px !important;
    margin: 0 0 15px 0 !important;
    font-weight: 700 !important;
}

.rag-kg-no-results p {
    color: #742a2a !important;
    font-size: 14px !important;
    margin: 0 0 10px 0 !important;
    line-height: 1.5 !important;
}

/* Sugerencias mejoradas */
.rag-suggestions {
    background: linear-gradient(135deg, #f0fff4 0%, #c6f6d5 100%) !important;
    border: 2px solid #9ae6b4 !important;
    border-radius: 16px !important;
    padding: 20px !important;
    margin: 20px 0 !important;
    box-shadow: 0 4px 12px rgba(154, 230, 180, 0.15) !important;
}

.rag-suggestions h4 {
    color: #22543d !important;
    font-size: 16px !important;
    margin: 0 0 15px 0 !important;
    font-weight: 700 !important;
    text-align: center !important;
}

.rag-suggestions ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.rag-suggestions li {
    background: white !important;
    padding: 10px 15px !important;
    margin: 8px 0 !important;
    border-radius: 8px !important;
    color: #22543d !important;
    font-size: 14px !important;
    border-left: 4px solid #48bb78 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
    transition: all 0.2s ease !important;
}

.rag-suggestions li:hover {
    transform: translateX(5px) !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1) !important;
}

/* Responsive para Knowledge Graph */
@media (max-width: 768px) {
    .rag-products-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .rag-kg-products-response .chat-product-image {
        height: 160px !important;
    }
}

@media (max-width: 480px) {
    .rag-kg-products-response {
        padding: 15px !important;
        margin: 10px 0 !important;
    }
    
    .rag-response-intro {
        padding: 12px 15px !important;
    }
    
    .chat-product-card {
        margin-bottom: 12px !important;
    }
    
    .chat-product-image {
        height: 100px !important;
    }
    
    .chat-product-info {
        padding: 12px !important;
    }
    
    .product-title {
        font-size: 15px !important;
    }
    
    .price-value {
        font-size: 15px !important;
    }
    
    .chat-product-btn {
        padding: 8px 14px !important;
        font-size: 13px !important;
    }
}
