
#mi-chatbot-marketing {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 99999;
    font-family: var(--font-primary, system-ui, sans-serif);

}

/* Botón flotante */
.mi-chatbot-toggle {
    width: 64px;
    height: 64px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    box-shadow: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

.mi-chatbot-toggle:hover {
    transform: translateY(-2px) scale(1.02);
}

.mi-chatbot-toggle:active {
    transform: scale(0.96);
}

.mi-chatbot-toggle img,
#mi-chatbot-toggle-image {
    display: block;
    height: 72px;
    width: auto;
    object-fit: contain;
    transform-origin: center center;
    filter: drop-shadow(0 8px 18px rgba(15, 23, 42, 0.16));
    transition: transform 0.28s ease, opacity 0.28s ease, filter 0.28s ease;
}

#mi-chatbot-toggle-image {
    transition: transform 0.28s ease, opacity 0.28s ease, filter 0.28s ease;
}

#mi-chatbot-toggle-image.is-love {
    transform: scale(1.05) rotate(-2deg);
}

#mi-chatbot-toggle-image.is-angry {
    transform: scale(1.03);
    filter: drop-shadow(0 10px 18px rgba(220, 38, 38, 0.18));
}

/* Ventana */
.mi-chatbot-window {
    width: 360px;
    max-width: calc(100vw - 24px);
    border-radius: 24px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(16, 63, 82, 0.08);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
    transform-origin: bottom right;
    animation: chatbotFadeIn 0.28s ease;
}

@keyframes chatbotFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Estados */
#mi-chatbot-marketing.is-collapsed .mi-chatbot-window {
    display: none;
}

#mi-chatbot-marketing.is-collapsed .mi-chatbot-toggle {
    display: flex;
}

#mi-chatbot-marketing.is-open .mi-chatbot-window {
    display: block;
}

#mi-chatbot-marketing.is-open .mi-chatbot-toggle {
    display: none;
}

/* Header */
.mi-chatbot-header {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 52px 16px 18px;
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    overflow: visible;
}

.mi-chatbot-avatar-wrap {
    position: relative;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mi-chatbot-avatar {
    width: 44px;
    height: 44px;
    object-fit: contain;
    display: block;
    transform-origin: center center;
    filter: drop-shadow(0 8px 18px rgba(15, 23, 42, 0.16));
    transition: transform 0.28s ease, opacity 0.28s ease, filter 0.28s ease;
}

.mi-chatbot-avatar.is-love {
    transform: scale(1.08) rotate(-2deg);
}

.mi-chatbot-avatar.is-angry {
    animation: none;
    transform: scale(1.04);
    filter: drop-shadow(0 10px 18px rgba(220, 38, 38, 0.18));
}



.mi-chatbot-header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.2;
}

.mi-chatbot-header-text p {
    margin: 4px 0 0;
    font-size: 12px;
    font-weight: 400;
    color: #64748b;
    line-height: 1.4;
}

.mi-chatbot-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 999px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.22s ease, transform 0.22s ease, opacity 0.22s ease, box-shadow 0.22s ease;
    -webkit-tap-highlight-color: transparent;
}

.mi-chatbot-close:hover {
    background: #e2e8f0;
    transform: scale(1.05);
}

.mi-chatbot-close:active {
    transform: scale(0.95);
}

.mi-chatbot-close.is-pressing {
    background: #dbeafe;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

/* Mensajes */
.mi-chatbot-messages {
    height: 280px;
    overflow-y: auto;
    padding: 16px;
    background: linear-gradient(to bottom, #f8fafc 0%, #f1f5f9 100%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

.mi-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.mi-chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.35);
    border-radius: 999px;
}

.mi-chatbot-message {
    max-width: 85%;
    padding: 11px 14px;
    border-radius: 16px;
    line-height: 1.5;
    font-size: 13px;
    word-wrap: break-word;
    transition: transform 0.22s ease, opacity 0.22s ease;
}

.mi-chatbot-message.bot {
    align-self: flex-start;
    background: #ffffff;
    color: #0f172a;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.mi-chatbot-message.user {
    align-self: flex-end;
    background: #0f172a;
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.16);
}

/* Typing */
.mi-chatbot-typing {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 18px;
}

.mi-chatbot-typing span {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #94a3b8;
    display: inline-block;
    animation: chatbotTyping 1.1s infinite ease-in-out;
}

.mi-chatbot-typing span:nth-child(2) {
    animation-delay: 0.15s;
}

.mi-chatbot-typing span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes chatbotTyping {
    0%, 80%, 100% {
        opacity: 0.35;
        transform: scale(0.85);
    }
    40% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Opciones */
.mi-chatbot-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.8);
    border-top: 1px solid rgba(15, 23, 42, 0.04);
    border-bottom: 1px solid rgba(15, 23, 42, 0.04);
    transition: opacity 0.2s ease;
}

.mi-chatbot-option {
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #ffffff;
    color: #0f172a;
    padding: 9px 12px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background-color 0.25s ease,
                color 0.25s ease,
                transform 0.2s ease,
                box-shadow 0.25s ease,
                border-color 0.25s ease,
                opacity 0.2s ease;
    font-family: var(--font-primary, system-ui, sans-serif);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    outline: none;
}

.mi-chatbot-option:hover {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.mi-chatbot-option:active {
    transform: scale(0.97);
}

.mi-chatbot-option:focus-visible {
    box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.08);
}

.mi-chatbot-option.is-back {
    background: #f8fafc;
    color: #475569;
    border-style: dashed;
}

.mi-chatbot-option.is-back:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #cbd5e1;
    box-shadow: none;
}

/* Input */
.mi-chatbot-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #ffffff;
}

#mi-chatbot-input {
    flex: 1;
    min-width: 0;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #dbe4ea;
    border-radius: 999px;
    background: #f8fafc;
    font-size: 16px;
    font-family: var(--font-primary, system-ui, sans-serif);
    color: #0f172a;
    outline: none;
    transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

#mi-chatbot-input::placeholder {
    color: #94a3b8;
}

#mi-chatbot-input:focus {
    border-color: #0f172a;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.06);
}

#mi-chatbot-send {
    height: 44px;
    border: none;
    border-radius: 999px;
    background: #0f172a;
    color: #ffffff;
    padding: 0 16px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-primary, system-ui, sans-serif);
    transition: transform 0.22s ease, opacity 0.22s ease, box-shadow 0.22s ease;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
    -webkit-tap-highlight-color: transparent;
}

#mi-chatbot-send:hover {
    transform: translateY(-1px);
    opacity: 0.96;
}

#mi-chatbot-send:active {
    transform: scale(0.97);
}

#mi-chatbot-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Bloqueo */
.mi-chatbot-locked .mi-chatbot-window {
    pointer-events: none;
    opacity: 0.96;
}

.mi-chatbot-toggle.is-locked {
    opacity: 0.55;
    pointer-events: none;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    #mi-chatbot-marketing {
        right: 12px;
        bottom: 12px;
    }

    .mi-chatbot-window {
        width: calc(100vw - 24px);
        border-radius: 20px;
    }

    .mi-chatbot-messages {
        height: 250px;
    }

    .mi-chatbot-toggle {
        width: 58px;
        height: 58px;
    }

    .mi-chatbot-toggle img,
    #mi-chatbot-toggle-image {
        height: 66px;
    }

    .mi-chatbot-header {
        gap: 10px;
        padding: 14px 48px 14px 14px;
    }

    .mi-chatbot-avatar-wrap {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .mi-chatbot-avatar {
        width: 40px;
        height: 40px;
    }

    .mi-chatbot-option {
        font-size: 11px;
        padding: 8px 11px;
    }

    #mi-chatbot-input,
    #mi-chatbot-send {
        height: 42px;
    }
}


.mi-chatbot-hint {
    position: absolute;
    right: 8px;
    bottom: 92px;
    width: 100px;
    padding: 10px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    color: #0f172a;
    font-family: var(--font-primary, system-ui, sans-serif);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14);
    border: 1px solid rgba(15, 23, 42, 0.08);
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    transform-origin: bottom right;
    transition:
        opacity 0.28s ease,
        visibility 0.28s ease,
        transform 0.28s ease;
    pointer-events: none;
    z-index: 100001;
}

.mi-chatbot-hint::after {
    content: "";
    position: absolute;
    right: 22px;
    bottom: -7px;
    width: 14px;
    height: 14px;
    background: rgba(255, 255, 255, 0.96);
    border-right: 1px solid rgba(15, 23, 42, 0.08);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    transform: rotate(45deg);
}

.mi-chatbot-hint.is-hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) scale(0.96);
}

.mi-chatbot-hint-text {
    display: block;
}

#mi-chatbot-marketing.is-open .mi-chatbot-hint {
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) scale(0.96);
}

@media (max-width: 768px) {
    .mi-chatbot-hint {
        right: 2px;
        bottom: 84px;
        max-width: 190px;
        font-size: 12px;
        padding: 9px 12px;
    }

    .mi-chatbot-hint::after {
        right: 18px;
    }
}