/* ChatGo España 2.0.0 — conserva el diseño, el avatar y el botón actuales */
.chatgo-widget-container {
    position: fixed;
    bottom: 20px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}
.chatgo-widget-container.position-right { right: 20px; }
.chatgo-widget-container.position-left { left: 20px; }

/* El lanzador y el avatar mantienen el aspecto aprobado */
.chatgo-toggle-button {
    width: 68px;
    height: 68px;
    flex-shrink: 0;
    border-radius: 50%;
    background-color: #0073aa;
    color: #fff;
    border: none;
    box-shadow: 0 5px 16px rgba(0,0,0,.18);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s ease, box-shadow .2s ease;
    padding: 0;
    overflow: hidden;
}
.chatgo-toggle-button:hover { transform: scale(1.04); box-shadow: 0 7px 20px rgba(0,0,0,.22); }
.chatgo-btn-icon { width: 36px; height: 36px; fill: #fff; }
.chatgo-btn-avatar { width: 100%; height: 100%; max-width: none; object-fit: cover; border-radius: 50%; display: block; }

/* Ventana */
.chatgo-window {
    width: 370px;
    max-width: min(92vw, 370px);
    height: 520px;
    max-height: calc(100vh - 120px);
    max-height: calc(100dvh - 120px);
    background: #fff;
    border: 1px solid rgba(15, 35, 60, .08);
    border-radius: 18px;
    box-shadow: 0 16px 48px rgba(16, 35, 60, .20), 0 3px 10px rgba(16, 35, 60, .08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: absolute;
    bottom: 84px;
    isolation: isolate;
}
.position-right .chatgo-window { right: 0; }
.position-left .chatgo-window { left: 0; }
.chatgo-hidden { display: none !important; }

.chatgo-header {
    background-color: #0073aa;
    color: #fff;
    padding: 15px 16px;
    min-height: 58px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}
.chatgo-header-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.chatgo-header-avatar {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,.85);
    max-width: none;
    display: block;
}
.chatgo-title { overflow-wrap: anywhere; line-height: 1.3; }
.chatgo-close-button {
    background: rgba(255,255,255,.12);
    border: 0;
    color: #fff;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 50%;
    font-size: 23px;
    line-height: 1;
    cursor: pointer;
    transition: background .18s ease;
}
.chatgo-close-button:hover { background: rgba(255,255,255,.24); }

.chatgo-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #f5f7fa;
    scroll-behavior: smooth;
}
.chatgo-message { margin-bottom: 12px; max-width: 90%; overflow-wrap: anywhere; }
.chatgo-bot-message p {
    background: #fff;
    padding: 11px 13px;
    border-radius: 4px 14px 14px 14px;
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: #263445;
    border: 1px solid #e4e9ef;
    box-shadow: 0 2px 5px rgba(20,40,65,.035);
}
.chatgo-bot-message a.chatgo-contact-link { color: #0073aa; font-weight: 700; text-decoration: underline; }
.chatgo-user-message { margin-left: auto; text-align: right; }
.chatgo-user-message p {
    background: #0073aa;
    color: #fff;
    padding: 11px 13px;
    border-radius: 14px 4px 14px 14px;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    display: inline-block;
    text-align: left;
    overflow-wrap: anywhere;
}
.chatgo-suggestions-wrapper { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 4px; }
.chatgo-sug-btn {
    background: #fff;
    border-radius: 18px;
    padding: 7px 12px;
    font-size: 12px;
    line-height: 1.3;
    cursor: pointer;
    transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.chatgo-search-results { margin-top: 10px; padding-left: 0; list-style: none; }
.chatgo-search-item { margin-bottom: 9px; background: #fff; padding: 11px 12px; border-radius: 10px; border: 1px solid #e2e8f0; box-shadow: 0 2px 5px rgba(20,40,65,.035); }
.chatgo-search-item a { color: #0073aa; font-weight: 700; text-decoration: none; font-size: 13px; line-height: 1.45; }
.chatgo-search-item a:hover { text-decoration: underline; }
.chatgo-search-badge { display: inline-block; background: #eef3f7; color: #526273; font-size: 10px; padding: 3px 6px; border-radius: 5px; margin-left: 6px; vertical-align: middle; }
.chatgo-search-excerpt { font-size: 12px; line-height: 1.45; color: #647184; margin-top: 5px; }

.chatgo-footer {
    padding: 12px;
    border-top: 1px solid #e8edf2;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
}
.chatgo-footer input {
    min-width: 0;
    flex: 1 1 auto;
    padding: 11px 12px;
    border: 1px solid #d5dde6;
    border-radius: 10px;
    font: inherit;
    font-size: 14px;
    color: #263445;
    background: #fff;
    box-shadow: none;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.chatgo-footer input:focus { border-color: #0073aa; box-shadow: 0 0 0 3px rgba(0,115,170,.12); }
.chatgo-footer button {
    flex: 0 0 auto;
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: filter .18s ease, transform .18s ease;
}
.chatgo-footer button:hover { filter: brightness(.94); }
.chatgo-footer button:active { transform: scale(.98); }

.chatgo-toggle-button:focus-visible,
.chatgo-close-button:focus-visible,
.chatgo-footer button:focus-visible,
.chatgo-sug-btn:focus-visible,
.chatgo-search-item a:focus-visible { outline: 3px solid #ffda00; outline-offset: 3px; }

@media (max-width: 480px) {
    .chatgo-widget-container.position-right { right: 12px; }
    .chatgo-widget-container.position-left { left: 12px; }
    .chatgo-widget-container { bottom: 12px; }
    .chatgo-toggle-button { width: 64px; height: 64px; }
    .chatgo-window {
        width: min(370px, calc(100vw - 24px));
        max-width: calc(100vw - 24px);
        height: min(520px, calc(100dvh - 100px));
        max-height: calc(100dvh - 100px);
        bottom: 76px;
        border-radius: 16px;
    }
    .chatgo-header { padding: 12px 13px; }
    .chatgo-body { padding: 13px; }
    .chatgo-footer { padding: 10px; gap: 7px; }
    .chatgo-footer input { padding: 10px; }
    .chatgo-footer button { padding: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .chatgo-toggle-button, .chatgo-close-button, .chatgo-sug-btn, .chatgo-footer input, .chatgo-footer button { transition: none; }
    .chatgo-body { scroll-behavior: auto; }
}
