/* Ensamble Widget Styles - tokens base
   Los colores principales (primary, chat_bg, etc.) se inyectan dinámicamente
   desde la vista del widget usando variables CSS en :root. */
:root {
    --secondary-color: #3B4FC7;
    --white: #FFFFFF;
    --light-gray: #F5F5F7;
    --medium-gray: #8E8E93;
    --dark-gray: #2C2C2C;
    --text-black: #1A1A1A;
    --border-radius: 12px;
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-black);
    overflow: hidden;
}

.chatbot-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 300px;
    max-height: 100vh;
}

.chat-window {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--chat-bg, var(--white));
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    color: var(--header-text-color, white);
    min-height: 75px;
}

.chat-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    flex-shrink: 0;
    overflow: hidden;
}

.avatar-img,
.chat-avatar-image img,
.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.chat-avatar-icon i {
    font-size: 1.5rem;
    color: white; /* fallback; overridden by inline style when avatar_icon_color is set */
}

.chat-title h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--header-text-color, white);
}

.chat-title p {
    font-size: 12px;
    color: var(--header-text-color, white);
    opacity: 0.8;
    font-weight: 400;
}

.chat-messages {
    flex: 1;
    padding: 10px 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--chat-bg, var(--white));
    min-height: 220px;
}

/* En pantalla completa: centrar contenido, escalar tipografía y espaciado */
@media (min-width: 920px) {
    html, body {
        font-size: 16px;
    }

    .chat-header {
        padding: 14px 24px;
        min-height: 88px;
    }

    .chat-avatar {
        width: 48px;
        height: 48px;
    }

    .chat-avatar-icon i {
        font-size: 1.75rem;
    }

    .chat-title h3 {
        font-size: 18px;
    }

    .chat-title p {
        font-size: 14px;
    }

    .chat-messages {
        max-width: 900px;
        margin-left: auto;
        margin-right: auto;
        width: 100%;
        padding: 16px 20px;
        gap: 14px;
    }

    .message-avatar {
        width: 44px;
        height: 44px;
        min-width: 44px;
    }

    .message-avatar-icon i {
        font-size: 1.25rem;
    }

    .message {
        gap: 12px;
        max-width: 85%;
    }

    .message-content {
        padding: clamp(12px, 1.2vw + 9px, 16px) clamp(16px, 1.5vw + 11px, 22px);
        max-width: 100%;
    }

    .message-content p {
        font-size: clamp(16px, 1.2vw + 12px, 19px);
        line-height: 1.55;
    }

    .message-content code {
        font-size: clamp(14px, 1vw + 11px, 16px);
    }

    .message-content h1 { font-size: clamp(18px, 1.8vw + 12px, 24px); }
    .message-content h2 { font-size: clamp(17px, 1.6vw + 11px, 22px); }
    .message-content h3 { font-size: clamp(16px, 1.4vw + 10px, 20px); }

    .widget-reply-buttons {
        margin-left: 56px;
        gap: 10px;
    }

    .widget-reply-btn {
        padding: 10px 18px;
        font-size: clamp(15px, 1.2vw + 11px, 18px);
    }

    .widget-centered-notification {
        padding: 14px 22px;
    }

    .widget-centered-notification p {
        font-size: clamp(15px, 1.2vw + 11px, 18px);
    }

    .chat-input-container {
        max-width: 900px;
        margin-left: auto;
        margin-right: auto;
        width: 100%;
        padding: 12px 20px;
        min-height: 96px;
        border-radius: 16px 16px 0 0;
    }

    .chat-input-wrapper {
        border-radius: 28px;
    }

    .chat-input {
        padding: 12px 18px;
        font-size: clamp(16px, 1.2vw + 12px, 19px);
    }

    .send-button {
        width: 48px;
        height: 48px;
    }

    .send-button i {
        font-size: 1.35rem;
    }

    .powered-by-container {
        padding: 6px 12px 4px;
    }

    .powered-by-link {
        font-size: 12px;
    }

    .powered-by-logo {
        height: 26px;
    }

    .typing-indicator .message-content {
        padding: 20px 26px;
    }

    .close-button {
        display: none !important;
    }

    .human-assist-button {
        width: 48px;
        height: 48px;
    }

    .human-assist-button i {
        font-size: 1.5rem;
    }
}

/* Nota de descripción al inicio (fondo gris) */
.widget-centered-notification {
    align-self: center;
    text-align: center;
    background: rgba(29, 43, 128, 0.08);
    border: 1px solid rgba(29, 43, 128, 0.2);
    padding: 12px 18px;
    border-radius: 12px;
    margin: 8px 0;
    max-width: 90%;
}

.widget-centered-notification p {
    font-size: clamp(13px, 1.2vw + 9px, 16px);
    line-height: 1.5;
    color: var(--primary-color);
    margin: 0;
    font-weight: 500;
}

.widget-reply-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-self: flex-start;
    max-width: 85%;
    margin-left: calc(10px + clamp(32px, 6vw, 48px));
}

.widget-reply-btn {
    padding: clamp(8px, 1vw + 5px, 12px) clamp(14px, 1.5vw + 9px, 20px);
    font-size: clamp(13px, 1.2vw + 9px, 16px);
    border-radius: 20px;
    border: 1.5px solid var(--user-message-bg, var(--primary-color));
    background: transparent;
    color: var(--user-message-bg, var(--primary-color));
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    width: 100%;
    text-align: center;
}

.widget-reply-btn:hover {
    background: var(--user-message-bg, var(--primary-color));
    color: var(--user-message-text-color, #ffffff);
    opacity: 1;
    filter: none;
}

.widget-reply-btn:active {
    transform: scale(0.98);
}

.message {
    display: flex;
    gap: 10px;
    max-width: 85%;
    align-items: flex-end;
    animation: slideIn 0.3s ease-out;
}

.bot-message {
    align-self: flex-start;
    flex-direction: row;
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: clamp(32px, 6vw, 48px);
    height: clamp(32px, 6vw, 48px);
    min-width: clamp(32px, 6vw, 48px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.message-avatar-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-avatar-icon {
    background: rgba(0, 0, 0, 0.06);
}

.message-avatar-icon i {
    font-size: clamp(1rem, 2.5vw, 1.35rem);
}

.message-avatar-placeholder {
    background: transparent;
    visibility: hidden;
}

.message-content {
    background: var(--light-gray);
    padding: clamp(10px, 1vw + 7px, 14px) clamp(12px, 1.2vw + 8px, 18px);
    border-radius: 20px 20px 20px 0;
    word-wrap: break-word;
    position: relative;
}

.user-message .message-content {
    background: var(--user-message-bg, var(--primary-color));
    color: var(--user-message-text-color, white);
    border-radius: 18px 18px 0 18px;
}

.message-content p {
    font-size: clamp(14px, 1.5vw + 10px, 18px);
    line-height: 1.5;
    margin: 0;
    color: inherit;
}

.bot-message .message-content {
    color: var(--text-color, var(--text-black));
}

.message-content strong { font-weight: 700; color: inherit; }
.message-content em { font-style: italic; }
.message-content code {
    background: rgba(0, 0, 0, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: clamp(12px, 1.2vw + 9px, 15px);
}
.user-message .message-content code { background: rgba(255, 255, 255, 0.25); }
.message-content ul, .message-content ol { margin: 6px 0; padding-left: 20px; }
.message-content ul { list-style-type: disc; }
.message-content ol { list-style-type: decimal; }
.message-content li { margin: 3px 0; line-height: 1.5; }
.message-content a {
    color: var(--primary-color);
    text-decoration: underline;
    transition: opacity 0.2s ease;
}
.message-content a:hover { opacity: 0.8; }
.user-message .message-content a { color: white; text-decoration: underline; }
.message-content h1, .message-content h2, .message-content h3 {
    margin: 8px 0 4px 0;
    font-weight: 700;
    line-height: 1.3;
}
.message-content h1 { font-size: clamp(16px, 2vw + 12px, 22px); }
.message-content h2 { font-size: clamp(15px, 1.8vw + 11px, 20px); }
.message-content h3 { font-size: clamp(14px, 1.5vw + 10px, 18px); }
.message-content br { display: block; content: ""; margin: 4px 0; }

.powered-by-container {
    padding: 4px 12px 2px;
    background: var(--white);
    text-align: center;
    flex-shrink: 0;
}

.powered-by-link {
    font-size: 11px;
    color: var(--medium-gray);
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 500;
}

.powered-by-link:hover {
    opacity: 0.85;
}

.powered-by-logo {
    height: 24px;
    width: auto;
    display: inline-block;
    vertical-align: middle;
}

.chat-input-container {
    padding: 8px 12px;
    background: var(--white);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
    min-height: 80px;
}


.chat-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--light-gray);
    border-radius: 25px;
    padding: 2px;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.chat-input-wrapper:focus-within {
    border-color: var(--primary-color);
    background: white;
    box-shadow: var(--shadow-light);
}

.chat-input {
    flex: 1;
    border: none;
    background: none;
    padding: clamp(8px, 1vw + 6px, 14px) clamp(12px, 1.5vw + 8px, 18px);
    font-size: clamp(14px, 1.5vw + 10px, 18px);
    color: var(--text-black);
    outline: none;
    font-family: inherit;
}

.chat-input::placeholder {
    color: var(--medium-gray);
}

.send-button {
    width: 44px;
    height: 44px;
    border: none;
    color: var(--medium-gray);
    background: transparent;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    opacity: 0.5;
}

.send-button i {
    font-size: 1.25rem;
}

/* Cuando hay texto, el botón se ilumina con el color del tema (sin hover) */
.chat-input-wrapper:has(.chat-input:not(:placeholder-shown)) .send-button {
    background: var(--primary-color);
    color: white;
    opacity: 1;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

.send-button:active {
    transform: scale(0.95);
}

.typing-indicator {
    animation: slideIn 0.4s ease-out;
}

.typing-indicator .message-content {
    padding: 18px 22px;
    background: var(--light-gray);
    border-radius: 18px 18px 18px 0;
}

.typing-dots {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 20px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--medium-gray);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }
    30% { transform: translateY(-8px); opacity: 1; }
}

@keyframes slideIn {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

.chat-messages::-webkit-scrollbar,
.widget-contact-modal-content::-webkit-scrollbar,
.widget-contact-modal-body::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-track,
.widget-contact-modal-content::-webkit-scrollbar-track,
.widget-contact-modal-body::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb,
.widget-contact-modal-content::-webkit-scrollbar-thumb,
.widget-contact-modal-body::-webkit-scrollbar-thumb {
    background: var(--medium-gray);
    border-radius: 3px;
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.human-assist-btn {
    position: relative;
    display: flex;
    align-items: center;
}

.human-assist-button {
    width: 40px;
    height: 40px;
    border: none;
    color: white;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.human-assist-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.human-assist-button:active {
    transform: scale(0.95);
}

.human-assist-button i {
    font-size: 1.25rem;
}

.human-assist-label {
    position: absolute;
    right: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%) translateX(8px);
    white-space: nowrap;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-dark);
    background: var(--white);
    padding: 6px 10px;
    border-radius: 8px;
    box-shadow: var(--shadow-medium);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.human-assist-btn:hover .human-assist-label {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.close-button {
    width: 40px;
    height: 40px;
    border: none;
    color: white;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.close-button:hover { transform: scale(1.1); }
.close-button:active { transform: scale(0.95); }
.close-button svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* Modal de contacto - full widget */
.widget-contact-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.widget-contact-modal.visible {
    opacity: 1;
    visibility: visible;
}

.widget-contact-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
}

.widget-contact-modal-content {
    position: relative;
    background: var(--white);
    border-radius: var(--border-radius);
    max-width: 360px;
    width: 100%;
    max-height: calc(100vh - 32px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-medium);
    border: 1px solid rgba(29, 43, 128, 0.1);
}

.widget-contact-modal-header {
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 20px 24px;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.widget-contact-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: white;
    margin: 0 0 8px 0;
}

.widget-contact-modal-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    line-height: 1.4;
}

.widget-contact-modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
    -webkit-overflow-scrolling: touch;
}

.widget-contact-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.widget-contact-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 6px;
}

.widget-contact-field input,
.widget-contact-field select {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid rgba(29, 43, 128, 0.2);
    border-radius: 8px;
    background: var(--white);
    color: var(--text-black);
    transition: border-color 0.2s ease;
}

.widget-contact-field input:focus,
.widget-contact-field select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.widget-contact-phone-row {
    display: flex;
    gap: 8px;
}

.widget-contact-phone-row select {
    width: 120px;
    flex-shrink: 0;
}

.widget-contact-phone-row input {
    flex: 1;
}

.widget-contact-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.widget-contact-btn {
    flex: 1;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.widget-contact-btn-cancel {
    background: var(--light-gray);
    color: var(--dark-gray);
}

.widget-contact-btn-cancel:hover {
    background: #e8e8ed;
}

.widget-contact-btn-accept {
    background: var(--primary-color);
    color: white;
}

.widget-contact-btn-accept:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}


/* Imagen en widget - mismas proporciones y colores que mensaje regular del bot */
.image-bubble {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    max-width: 85%;
}
.image-bubble .message-content.image-content {
    background: var(--light-gray);
    padding: clamp(10px, 1vw + 7px, 14px) clamp(12px, 1.2vw + 8px, 18px);
    border-radius: 20px 20px 20px 0;
    max-width: min(400px, calc(100vw - 120px));
    color: var(--text-color, var(--text-black));
    box-shadow: none;
}
.wimg-wrapper {
    border-radius: 10px;
    overflow: hidden;
    background: transparent;
    box-shadow: none;
    position: relative;
    max-width: 100%;
}
.wimg-img {
    width: 100%;
    height: auto;
    display: block;
}
.wimg-caption {
    margin-top: 8px;
    font-size: clamp(14px, 1.5vw + 10px, 18px);
    line-height: 1.5;
    color: inherit;
}
.wimg-download {
    position: absolute;
    left: 8px;
    bottom: 8px;
    background: var(--user-message-bg, var(--primary-color));
    color: var(--user-message-text-color, #ffffff) !important;
    text-decoration: none !important;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
    box-shadow: none;
}
.wimg-download:hover {
    background: var(--primary-dark, #16215f);
    color: var(--user-message-text-color, #ffffff) !important;
    text-decoration: none !important;
}

/* Archivo en widget - icono + filename lado a lado, caption, botón descargar (sin preview) */
.file-bubble {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    max-width: 85%;
}
.file-bubble .message-content.file-content {
    background: var(--light-gray);
    padding: clamp(10px, 1vw + 7px, 14px) clamp(12px, 1.2vw + 8px, 18px);
    border-radius: 20px 20px 20px 0;
    max-width: min(400px, calc(100vw - 120px));
    color: var(--text-color, var(--text-black));
    box-shadow: none;
}
.wfile-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.wfile-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.wfile-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
    flex-shrink: 0;
}
.wfile-icon i {
    display: block;
}
.wfile-filename {
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 0;
    flex: 1;
    word-break: break-all;
}
.wfile-caption {
    font-size: clamp(14px, 1.5vw + 10px, 18px);
    line-height: 1.5;
    color: inherit;
}
.wfile-download {
    display: inline-block;
    width: fit-content;
    padding: 6px 12px;
    background: var(--user-message-bg, var(--primary-color));
    color: var(--user-message-text-color, #ffffff) !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s;
}
.wfile-download:hover {
    background: var(--primary-dark, #16215f);
    color: var(--user-message-text-color, #ffffff) !important;
    text-decoration: none !important;
}

/* Ubicación en widget */
.location-bubble {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    max-width: 85%;
}
.location-bubble .message-content.location-content {
    background: var(--light-gray);
    padding: 0;
    border-radius: 20px 20px 20px 0;
    max-width: min(320px, calc(100vw - 120px));
    overflow: hidden;
    box-shadow: none;
}
.wlocation-wrapper {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
}
.wlocation-map-container {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
}
.wlocation-map-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
    cursor: pointer;
}
.wlocation-map-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.wlocation-map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, opacity 0.2s ease;
    opacity: 0;
}
.wlocation-map-link:hover .wlocation-map-overlay {
    background: rgba(0, 0, 0, 0.3);
    opacity: 1;
}
.wlocation-map-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    color: #111b21;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.wlocation-map-action i {
    font-size: 1rem;
    font-style: normal;
    color: #25D366;
}
.wlocation-info-wrapper {
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.wlocation-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: inherit;
    line-height: 1.4;
}
.wlocation-address {
    font-size: 0.8125rem;
    color: #667781;
    line-height: 1.4;
}
.wlocation-coordinates {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #667781;
}
.wlocation-coordinates i {
    font-size: 0.9rem;
    font-style: normal;
    color: #25D366;
}

/* Estilo de botones de redirección en el widget */
.redirect-buttons-bubble {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    max-width: 85%;
}

.redirect-buttons-content {
    background: var(--light-gray);
    padding: clamp(10px, 1vw + 7px, 14px) clamp(12px, 1.2vw + 8px, 18px);
    border-radius: 20px 20px 20px 0;
    max-width: min(400px, calc(100vw - 120px));
}

.redirect-buttons-wrapper {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
}

.redirect-button {
    padding: 10px 16px;
    background: var(--user-message-bg, var(--primary-color));
    color: var(--user-message-text-color, #ffffff);
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    width: fit-content;
    white-space: nowrap;
}

.redirect-button:hover {
    background: var(--primary-dark, #16215f);
    transform: translateY(-1px);
}

/* Mensaje con botones de redirección (texto en globo, botones abajo y fuera) */
.message-with-buttons {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    max-width: 85%;
}

.message-with-buttons-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}

.message-with-buttons-bubble {
    background: var(--light-gray);
    padding: clamp(10px, 1vw + 7px, 14px) clamp(12px, 1.2vw + 8px, 18px);
    border-radius: 20px 20px 20px 0;
    max-width: min(400px, calc(100vw - 120px));
}

.message-with-buttons-bubble .message-text {
    margin: 0;
}

/* Botones fuera del globo, debajo, en lista vertical */
.redirect-buttons-below {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    margin-top: 2px;
}

/* Estilo de burbuja para contacto en el widget */
.contact-bubble {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 10px 0;
}
.contact-content {
    background: #ffffff;
    border-radius: 16px;
    padding: 12px 14px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 260px;
}
.wcc-header {
    display: flex;
    align-items: center;
    gap: 10px;
}
.wcc-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #e8eaf0;
    color: #4a5568;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}
.wcc-name {
    font-weight: 700;
    color: #111827;
    font-size: 14px;
    line-height: 1.3;
}
.wcc-dept {
    font-size: 12px;
    color: #6b7280;
    margin-top: 1px;
}
.wcc-body {
    display: none;
}
.wcc-phone-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #374151;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f3f4f6;
}
.wcc-phone-row i {
    font-size: 1rem;
    color: #6b7280;
    flex-shrink: 0;
}
.wcc-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.wcc-btn {
    flex: 1;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    background: #ffffff;
    color: #374151;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.wcc-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    transform: translateY(-1px);
}
.wcc-copy { }
.wcc-wa {
    background: #25D366;
    color: #fff !important;
    border-color: #25D366;
    text-decoration: none !important;
}
.wcc-wa:hover {
    background: #1da851;
    border-color: #1da851;
    color: #fff !important;
}
.wcc-wa:visited,
.wcc-wa:focus,
.wcc-wa:active {
    color: #fff !important;
    text-decoration: none !important;
}
