/**
 * UNICOM AI Sales Assistant - Estilo Google Gemini con Paleta Oficial UNICOM
 * Colores: Tech Slate (#0f172a, #1e293b), Dorado UNICOM (#f59e0b, #fbbf24), Blanco (#ffffff)
 */

/* ==========================================================================
   1. BOTÓN LAUNCHER FLOTANTE (ESTILO GEMINI SPARKLE)
   ========================================================================== */
.unicom-ai-launcher-wrapper {
    position: fixed;
    right: 40px;
    bottom: 112px; /* Alineado justo encima de WhatsApp */
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
}

.unicom-ai-launcher-btn {
    position: relative;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border: 2px solid #f59e0b;
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.32), 0 0 16px rgba(245, 158, 11, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    outline: none;
    padding: 0;
}

.unicom-ai-launcher-btn:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.45), 0 0 24px rgba(245, 158, 11, 0.5);
    border-color: #fbbf24;
}

.unicom-ai-launcher-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.35s ease;
}

.unicom-ai-launcher-btn:hover .unicom-ai-launcher-icon {
    transform: rotate(20deg) scale(1.08);
}

.unicom-ai-launcher-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    color: #0f172a;
    font-size: 10px;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 8px;
    border: 2px solid #0f172a;
    letter-spacing: 0.5px;
}

.unicom-ai-launcher-tooltip {
    position: absolute;
    right: 70px;
    background: #0f172a;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    pointer-events: none;
    opacity: 0;
    transform: translateX(8px);
    transition: all 0.25s ease;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.unicom-ai-launcher-wrapper:hover .unicom-ai-launcher-tooltip {
    opacity: 1;
    transform: translateX(0);
}

/* ==========================================================================
   2. VENTANA DE CHAT (ESTILO GOOGLE GEMINI)
   ========================================================================== */
.unicom-ai-chat-window {
    display: none !important;
    position: fixed;
    right: 40px;
    bottom: 112px;
    width: 400px;
    max-width: calc(100vw - 32px);
    height: 630px;
    max-height: calc(100vh - 135px);
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22), 0 0 1px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(226, 232, 240, 0.85);
    z-index: 10001;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    transform-origin: bottom right;
}

.unicom-ai-chat-window.is-open {
    display: flex !important;
    animation: unicomAiPopIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.unicom-ai-chat-window.is-closing {
    animation: unicomAiPopOut 0.22s cubic-bezier(0.4, 0, 1, 1) forwards !important;
}

@keyframes unicomAiPopIn {
    0% {
        opacity: 0;
        transform: scale(0.88) translateY(22px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes unicomAiPopOut {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.88) translateY(18px);
    }
}

/* ==========================================================================
   3. ENCABEZADO ESTILO GEMINI PULIDO
   ========================================================================== */
.unicom-ai-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
    color: #ffffff !important;
    padding: 12px 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    border-bottom: 2px solid #f59e0b !important;
    min-height: 60px !important;
    box-sizing: border-box !important;
}

.unicom-ai-header-info {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex: 1 !important;
    min-width: 0 !important;
}

.unicom-ai-avatar {
    position: relative !important;
    width: 38px !important;
    height: 38px !important;
    border-radius: 12px !important;
    background: rgba(245, 158, 11, 0.12) !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    transition: transform 0.3s ease !important;
}

.unicom-ai-avatar:hover {
    transform: rotate(15deg);
}

.unicom-ai-online-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 9px;
    height: 9px;
    background: #22c55e;
    border: 2px solid #0f172a;
    border-radius: 50%;
    animation: unicomAiPulse 2s infinite;
}

@keyframes unicomAiPulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
    70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.unicom-ai-header-titles {
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
    line-height: 1.2 !important;
}

.unicom-ai-title-wrap {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.unicom-ai-title {
    margin: 0 !important;
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    letter-spacing: -0.2px !important;
    max-width: 175px !important;
}

.unicom-ai-gemini-pill {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%) !important;
    color: #0f172a !important;
    font-size: 0.62rem !important;
    font-weight: 900 !important;
    padding: 1px 6px !important;
    border-radius: 5px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    display: inline-block !important;
    white-space: nowrap !important;
}

.unicom-ai-subtitle {
    margin: 2px 0 0 0 !important;
    font-size: 0.72rem !important;
    color: #94a3b8 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.unicom-ai-header-actions {
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
    flex-shrink: 0 !important;
}

/* Botón Circular Acción (Reset) */
#unicom-ai-reset-btn,
.unicom-ai-action-icon-btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    color: #cbd5e1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    padding: 0 !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
}

#unicom-ai-reset-btn:hover,
.unicom-ai-action-icon-btn:hover {
    background: rgba(245, 158, 11, 0.25) !important;
    border-color: #f59e0b !important;
    color: #fbbf24 !important;
    transform: scale(1.05) !important;
}

#unicom-ai-reset-btn:hover svg,
.unicom-ai-action-icon-btn:hover svg {
    transform: rotate(-180deg) !important;
}

#unicom-ai-reset-btn svg,
.unicom-ai-action-icon-btn svg {
    transition: transform 0.35s ease !important;
    display: block !important;
}

/* Botón WhatsApp */
.unicom-ai-wa-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    background: #25d366 !important;
    color: #ffffff !important;
    font-size: 0.74rem !important;
    font-weight: 700 !important;
    padding: 0 10px !important;
    height: 32px !important;
    min-height: 32px !important;
    border-radius: 99px !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 6px rgba(37, 211, 102, 0.25) !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
}

.unicom-ai-wa-btn:hover {
    background: #20bd5a !important;
    transform: translateY(-1px) !important;
    color: #ffffff !important;
}

.unicom-ai-wa-btn svg {
    display: block !important;
    flex-shrink: 0 !important;
}

/* Botón Cerrar (X) Perfecto y Elegante */
.unicom-ai-close-btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
}

.unicom-ai-close-btn:hover {
    background: #ef4444 !important;
    border-color: #ef4444 !important;
    color: #ffffff !important;
    transform: scale(1.08) !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35) !important;
}

.unicom-ai-close-btn svg {
    display: block !important;
    width: 14px !important;
    height: 14px !important;
    stroke: currentColor !important;
    stroke-width: 2.5 !important;
}

/* ==========================================================================
   5. CONTENEDOR DE MENSAJES Y BURBUJAS (ESTILO GOOGLE GEMINI)
   ========================================================================== */
.unicom-ai-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden !important; /* Prevenir scroll horizontal */
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #ffffff;
    scroll-behavior: smooth;
    box-sizing: border-box;
}

.unicom-ai-messages::-webkit-scrollbar {
    width: 5px;
}
.unicom-ai-messages::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

/* Mensajes */
.unicom-ai-msg {
    display: flex;
    animation: unicomAiFadeUp 0.25s ease forwards;
    width: 100%;
    box-sizing: border-box;
}

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

/* Mensaje del Usuario */
.unicom-ai-msg-user {
    justify-content: flex-end;
}

.unicom-ai-msg-user .unicom-ai-bubble {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    border-radius: 20px 20px 4px 20px;
    padding: 10px 16px;
    font-size: 0.88rem;
    line-height: 1.5;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.15);
    max-width: 82%;
    box-sizing: border-box;
}

/* Mensaje de Gemini / Asistente */
.unicom-ai-msg-model {
    display: flex !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.unicom-ai-gemini-sparkle-mark {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 3px;
    animation: unicomSparkleGlow 3s infinite ease-in-out;
}

@keyframes unicomSparkleGlow {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.35); }
    50% { transform: scale(1.08); box-shadow: 0 0 8px rgba(245, 158, 11, 0.35); }
}

/* Contenedor vertical de respuesta (texto arriba, tarjetas debajo) */
.unicom-ai-msg-content {
    flex: 1 !important;
    min-width: 0 !important;
    width: calc(100% - 36px) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    box-sizing: border-box !important;
}

.unicom-ai-msg-model .unicom-ai-bubble {
    background: #f8fafc;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-radius: 4px 20px 20px 20px;
    padding: 12px 16px;
    font-size: 0.88rem;
    line-height: 1.55;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.03);
    width: 100% !important;
    box-sizing: border-box !important;
}

.unicom-ai-msg-model .unicom-ai-bubble p {
    margin: 0 0 8px 0;
}
.unicom-ai-msg-model .unicom-ai-bubble p:last-child {
    margin-bottom: 0;
}
.unicom-ai-msg-model .unicom-ai-bubble ul {
    margin: 6px 0 8px 18px;
    padding: 0;
}
.unicom-ai-msg-model .unicom-ai-bubble li {
    margin-bottom: 4px;
}
.unicom-ai-msg-model .unicom-ai-bubble strong {
    color: #0f172a;
}

.unicom-ai-msg-model .unicom-ai-bubble a.unicom-ai-inline-link {
    color: #0f172a;
    background: #fef3c7;
    border: 1px solid #fde68a;
    padding: 3px 9px;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 2px 3px;
    font-size: 0.83rem;
    transition: all 0.2s ease;
}

.unicom-ai-msg-model .unicom-ai-bubble a.unicom-ai-inline-link:hover {
    background: #f59e0b;
    color: #ffffff;
    border-color: #f59e0b;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.25);
}

/* ==========================================================================
   6. SUGERENCIAS RÁPIDAS (PROMPT CHIPS ESTILO GEMINI)
   ========================================================================== */
.unicom-ai-chips-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 6px;
    padding: 2px 0;
}

.unicom-ai-chip {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 7px 13px;
    border-radius: 99px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.unicom-ai-chip:hover {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #b45309;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.18);
}

/* ==========================================================================
   7. TARJETAS DE PRODUCTO (RICH CARDS ESTILO GEMINI)
   ========================================================================== */
.unicom-ai-products-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    margin-top: 4px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.unicom-ai-product-card {
    background: #ffffff;
    border: 1.5px solid #f1f5f9;
    border-radius: 16px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.04);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.unicom-ai-product-card:hover {
    border-color: #f59e0b;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.12);
}

.unicom-ai-card-body {
    display: flex;
    gap: 12px;
}

.unicom-ai-card-img-wrap {
    width: 68px;
    height: 68px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.unicom-ai-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
    box-sizing: border-box;
}

.unicom-ai-card-info {
    flex: 1;
    min-width: 0;
}

.unicom-ai-card-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
    margin: 0 0 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    transition: color 0.15s ease;
}

.unicom-ai-card-title:hover {
    color: #f59e0b;
}

.unicom-ai-card-price-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
}

.unicom-ai-card-price {
    font-size: 0.96rem;
    font-weight: 800;
    color: #0f172a;
}

.unicom-ai-card-regular-price {
    font-size: 0.76rem;
    color: #94a3b8;
    text-decoration: line-through;
}

.unicom-ai-card-savings-badge {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 6px;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.unicom-ai-card-badges-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 3px;
}

.unicom-ai-card-stock {
    font-size: 0.71rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 5px;
}

.unicom-ai-card-stock.in-stock {
    background: #dcfce7;
    color: #15803d;
}

.unicom-ai-card-stock.out-stock {
    background: #fee2e2;
    color: #b91c1c;
}

.unicom-ai-card-cuotas {
    font-size: 0.7rem;
    font-weight: 700;
    color: #0369a1;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    padding: 2px 7px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    width: fit-content;
}

/* Botones de acción en la tarjeta */
.unicom-ai-card-actions {
    display: flex;
    gap: 7px;
    border-top: 1px solid #f1f5f9;
    padding-top: 8px;
}

.unicom-ai-add-cart-btn {
    flex: 1;
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    color: #0f172a !important;
    font-size: 0.79rem;
    font-weight: 800;
    border: none;
    border-radius: 99px;
    padding: 7px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none !important;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.25);
}

.unicom-ai-add-cart-btn:hover {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.unicom-ai-add-cart-btn.added {
    background: #16a34a !important;
    color: #ffffff !important;
}

.unicom-ai-view-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569 !important;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 99px;
    padding: 7px 12px;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.unicom-ai-view-btn:hover {
    background: #0f172a;
    color: #ffffff !important;
    border-color: #0f172a;
}

/* ==========================================================================
   8. TARJETA ESPECIAL DE DERIVACIÓN A WHATSAPP
   ========================================================================== */
.unicom-ai-whatsapp-card {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 14px;
    padding: 12px 14px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.unicom-ai-whatsapp-card p {
    margin: 0;
    font-size: 0.81rem;
    font-weight: 600;
    color: #166534;
    line-height: 1.3;
}

.unicom-ai-whatsapp-card a {
    background: #25d366;
    color: #ffffff !important;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 99px;
    text-decoration: none !important;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 6px rgba(37, 211, 102, 0.3);
}

.unicom-ai-whatsapp-card a:hover {
    background: #1eb956;
}

/* ==========================================================================
   9. TYPING INDICATOR (ESTILO GEMINI)
   ========================================================================== */
.unicom-ai-typing {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 99px;
    width: fit-content;
    margin: 0 16px 10px 16px;
    gap: 5px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.unicom-ai-gemini-sparkle-typing {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 4px;
    animation: unicomSparkleGlow 2s infinite ease-in-out;
}

.unicom-ai-typing-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #f59e0b;
    animation: unicomAiBounce 1.4s infinite ease-in-out both;
}

.unicom-ai-typing-dot:nth-child(2) { animation-delay: -0.32s; }
.unicom-ai-typing-dot:nth-child(3) { animation-delay: -0.16s; }
.unicom-ai-typing-dot:nth-child(4) { animation-delay: 0s; }

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

.unicom-ai-typing-label {
    font-size: 0.77rem;
    color: #64748b;
    margin-left: 4px;
    font-weight: 500;
}

/* ==========================================================================
   10. PROMPT BAR INFERIOR (CÁPSULA GEMINI)
   ========================================================================== */
.unicom-ai-form {
    padding: 10px 16px 12px 16px;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
}

.unicom-ai-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 28px; /* Cápsula Gemini */
    padding: 4px 6px 4px 14px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.unicom-ai-input-wrapper:focus-within {
    border-color: #f59e0b;
    background: #ffffff;
    box-shadow: 0 0 0 3.5px rgba(245, 158, 11, 0.2);
}

.unicom-ai-back-btn {
    display: none;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 0;
    margin-right: 4px;
}

.unicom-ai-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.unicom-ai-action-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.unicom-ai-mic-btn:hover {
    color: #ef4444;
    background: #fee2e2;
}

.unicom-ai-mic-btn.is-listening {
    background: #ef4444 !important;
    color: #ffffff !important;
    animation: unicomAiPulseRed 1.2s infinite;
}

@keyframes unicomAiPulseRed {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.unicom-ai-voice-status {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 7px 14px;
    border-radius: 99px;
    margin: 0 16px 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 600;
    animation: unicomAiFadeUp 0.2s ease forwards;
}

.unicom-ai-voice-pulse {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ef4444;
    display: inline-block;
    margin-right: 8px;
    animation: unicomAiPulseRed 1.2s infinite;
}

.unicom-ai-voice-stop {
    background: #ef4444;
    color: #ffffff;
    border: none;
    font-size: 0.73rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 99px;
    cursor: pointer;
}

.unicom-ai-attachment-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    border: 1.5px solid #f59e0b;
    border-radius: 14px;
    padding: 8px 12px;
    margin: 0 16px 8px 16px;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.15);
    animation: unicomAiFadeUp 0.2s ease forwards;
}

.unicom-ai-preview-thumb {
    position: relative;
    width: 46px;
    height: 46px;
    border-radius: 8px;
    overflow: hidden;
    background: #f1f5f9;
    flex-shrink: 0;
}

.unicom-ai-preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.unicom-ai-remove-attachment {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(15, 23, 42, 0.85);
    color: #ffffff;
    border: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.unicom-ai-preview-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.unicom-ai-preview-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unicom-ai-preview-sub {
    font-size: 0.71rem;
    color: #64748b;
    margin-top: 1px;
}

.unicom-ai-msg-photo-wrap {
    margin-bottom: 6px;
    border-radius: 10px;
    overflow: hidden;
    max-width: 220px;
    max-height: 220px;
    background: rgba(0,0,0,0.1);
}

.unicom-ai-msg-photo-wrap img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    display: block;
}

.unicom-ai-input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    font-size: 0.89rem !important;
    font-family: inherit !important;
    color: #1e293b !important;
    outline: none !important;
    padding: 7px 6px !important;
    min-width: 0 !important;
    resize: none !important;
    line-height: 1.45 !important;
    max-height: 96px !important;
    box-shadow: none !important;
    margin: 0 !important;
    vertical-align: middle;
}

.unicom-ai-input::placeholder {
    color: #94a3b8;
}

.unicom-ai-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #0f172a;
    color: #f59e0b;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    padding: 0;
    flex-shrink: 0;
}

.unicom-ai-send-btn:hover {
    background: #f59e0b;
    color: #0f172a;
    transform: scale(1.08);
}

.unicom-ai-send-btn:active {
    transform: scale(0.95);
}

.unicom-ai-send-btn:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

.unicom-ai-footer-note {
    font-size: 0.68rem;
    color: #94a3b8;
    text-align: center;
    margin-top: 6px;
    letter-spacing: 0.2px;
}

/* ==========================================================================
   11. RESPONSIVO Y MÓVIL (PANTALLA COMPLETA NATIVA)
   ========================================================================== */
@media (max-width: 768px) {
    body.unicom-ai-chat-open {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
        height: 100% !important;
    }

    .unicom-ai-launcher-wrapper {
        right: 18px;
        bottom: 84px;
    }
    .unicom-ai-launcher-btn {
        width: 52px;
        height: 52px;
    }

    .unicom-ai-chat-window {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100% !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
        z-index: 999999 !important;
        animation: none !important;
        overscroll-behavior: contain !important;
    }

    .unicom-ai-back-btn {
        display: none !important;
    }

    .unicom-ai-header {
        padding: 12px 14px !important;
        border-radius: 0 !important;
    }

    .unicom-ai-header-info {
        flex: 1;
        min-width: 0;
        gap: 10px !important;
    }

    .unicom-ai-avatar {
        width: 36px !important;
        height: 36px !important;
        flex-shrink: 0 !important;
    }

    .unicom-ai-avatar svg {
        width: 20px !important;
        height: 20px !important;
    }

    .unicom-ai-title {
        font-size: 0.9rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 145px !important;
    }

    .unicom-ai-subtitle {
        font-size: 0.68rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 145px !important;
    }

    .unicom-ai-header-actions {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        flex-shrink: 0 !important;
    }

    #unicom-ai-reset-btn,
    .unicom-ai-action-icon-btn,
    .unicom-ai-reset-btn {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    #unicom-ai-reset-btn span,
    .unicom-ai-action-icon-btn span,
    .unicom-ai-reset-btn span {
        display: none !important;
    }

    .unicom-ai-wa-btn {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .unicom-ai-wa-btn .unicom-ai-wa-text,
    .unicom-ai-wa-btn span {
        display: none !important;
    }

    .unicom-ai-close-btn {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .unicom-ai-messages {
        padding: 14px 12px !important;
        overscroll-behavior: contain !important;
    }

    .unicom-ai-form {
        padding: 8px 10px max(10px, env(safe-area-inset-bottom, 10px)) 10px !important;
    }

    .unicom-ai-input-wrapper {
        padding: 3px 6px 3px 10px !important;
    }

    .unicom-ai-input {
        font-size: 16px !important;
    }
}