/* ============================================================
   CHATBOT DAVINCI SIN IA
============================================================ */

.edn-chatbot {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99999;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.edn-chatbot-toggle {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: none;
    background: #00793d;
    color: #ffffff;
    font-size: 1.7rem;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
}

.edn-chatbot-toggle:hover {
    background: #005c2f;
}

.edn-chatbot-toggle::after {
    content: "Asistente";
    position: absolute;
    right: 72px;
    background: #1f2933;
    color: #fff;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 8px 22px rgba(0,0,0,.18);
}

.edn-chatbot-panel {
    position: absolute;
    right: 0;
    bottom: 78px;
    width: 360px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 120px);
    max-height: calc(100dvh - 120px);
    background: #ffffff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
    border: 1px solid #d9dee5;
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px);
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
}

.edn-chatbot.is-open .edn-chatbot-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.edn-chatbot-header {
    flex-shrink: 0;
    background: #1f2933;
    color: #ffffff;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.edn-chatbot-header strong {
    display: block;
    font-size: 1rem;
}

.edn-chatbot-header span {
    display: block;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.72);
    margin-top: 2px;
}

.edn-chatbot-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.edn-chatbot-body {
    padding: 18px;
    overflow-y: auto;
    background: #f5f7f9;
    flex: 1;
    min-height: 0;
    overscroll-behavior: contain;
}

.edn-chatbot-message {
    padding: 12px 14px;
    border-radius: 14px;
    margin-bottom: 12px;
    font-size: 0.92rem;
    line-height: 1.55;
}

.edn-chatbot-message--bot {
    background: #ffffff;
    color: #3f3a44;
    border: 1px solid #e1e5ea;
}

.edn-chatbot-message--bot p {
    margin: 8px 0 0;
}

.edn-chatbot-message--user {
    background: #00793d;
    color: #ffffff;
    margin-left: 45px;
}

.edn-chatbot-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin: 16px 0;
}

.edn-chatbot-options button {
    border: 1px solid #cfd6dd;
    background: #ffffff;
    color: #3f3a44;
    padding: 10px 12px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.85rem;
    text-align: left;
}

.edn-chatbot-options button:hover {
    border-color: #00793d;
    color: #00793d;
    background: #eef7f2;
}

.edn-chatbot-options button.is-active {
    background: #1f2933;
    color: #ffffff;
    border-color: #1f2933;
}

.edn-chatbot-links {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.edn-chatbot-links a {
    display: block;
    background: #eef7f2;
    color: #00793d;
    text-decoration: none;
    padding: 9px 11px;
    border-radius: 9px;
    font-weight: 800;
    font-size: 0.86rem;
}

.edn-chatbot-links a:hover {
    background: #dff0e7;
    text-decoration: underline;
}

@media (max-width: 520px) {
    .edn-chatbot {
        right: 16px;
        bottom: 16px;
    }

    .edn-chatbot-toggle {
        width: 56px;
        height: 56px;
    }

    .edn-chatbot-toggle::after {
        display: none;
    }

    .edn-chatbot-panel {
        width: calc(100vw - 32px);
        right: 0;
        bottom: 70px;
        max-height: calc(100vh - 95px);
        max-height: calc(100dvh - 95px);
    }

    .edn-chatbot-options {
        grid-template-columns: 1fr 1fr;
    }
}
