/**
 * Chatbot IA WP - Estilos v3.7
 * Diseño moderno y profesional
 */

:root {
    --chatbot-primary: #1e73be;
    --chatbot-primary-dark: #1557a0;
    --chatbot-primary-light: #e8f4fc;
    --chatbot-secondary: #f8f9fa;
    --chatbot-bg: #ffffff;
    --chatbot-text: #2d3748;
    --chatbot-text-light: #718096;
    --chatbot-header-text: #ffffff;
    --chatbot-light: #f7fafc;
    --chatbot-border: #e2e8f0;
    --chatbot-success: #48bb78;
    --chatbot-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    --chatbot-shadow-hover: 0 15px 50px rgba(0, 0, 0, 0.18);
    --chatbot-radius: 20px;
    --chatbot-radius-sm: 12px;
}

/* Bloquear scroll del body cuando el chat está abierto (móvil) */
body.chatbot-ia-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
}

/* En desktop no bloquear el scroll del body */
@media (min-width: 500px) {
    body.chatbot-ia-open {
        overflow: auto !important;
        position: static !important;
        width: auto !important;
        height: auto !important;
    }
}

/* ========================================
   TOGGLE BUTTON - Botón flotante
   ======================================== */

.chatbot-ia-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 30px rgba(30, 115, 190, 0.4);
    z-index: 99998;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: visible;
    animation: bounceAttention 2s ease-in-out infinite;
}

/* Animación de rebote para llamar la atención */
@keyframes bounceAttention {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-12px);
    }
    60% {
        transform: translateY(-6px);
    }
}

/* Badge de notificación */
.chatbot-ia-toggle::before {
    content: '1';
    position: absolute;
    top: -4px;
    right: -4px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
    animation: badgePulse 1.5s ease-in-out infinite;
    z-index: 2;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

/* Brillo del botón */
.chatbot-ia-toggle-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, transparent 50%);
    border-radius: 50%;
    pointer-events: none;
}

.chatbot-ia-toggle:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 10px 40px rgba(30, 115, 190, 0.5);
    animation: none;
	background: white !important;	
}

.chatbot-ia-toggle.open {
    transform: rotate(0deg) scale(1);
    animation: none;
}

/* Ocultar badge cuando está abierto */
.chatbot-ia-toggle.open::before {
    display: none;
}

.chatbot-ia-toggle svg,
.chatbot-ia-toggle img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
}

.chatbot-ia-toggle svg {
    width: 28px;
    height: 28px;
    fill: var(--chatbot-header-text);
}

/* Pulse animation ring */
.chatbot-ia-toggle::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid var(--chatbot-primary);
    animation: pulseRing 2s infinite;
    z-index: -1;
    pointer-events: none;
}

@keyframes pulseRing {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

.chatbot-ia-toggle.open::after {
    animation: none;
    opacity: 0;
}

/* ========================================
   CHAT WINDOW - Ventana principal
   ======================================== */

.chatbot-ia-window {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 400px;
    height: 600px;
    max-height: calc(100vh - 140px);
    background: var(--chatbot-bg);
    border-radius: var(--chatbot-radius);
    box-shadow: var(--chatbot-shadow);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(30px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chatbot-ia-window.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* ========================================
   HEADER - Cabecera
   ======================================== */

.chatbot-ia-header {
    background: linear-gradient(135deg, var(--chatbot-primary) 0%, var(--chatbot-primary-dark) 100%);
    color: var(--chatbot-header-text);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    overflow: hidden;
}

.chatbot-ia-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 150px;
    height: 150px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    pointer-events: none;
}

.chatbot-ia-header::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    pointer-events: none;
}

.chatbot-ia-avatar {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.80);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    border: 2px solid rgba(255,255,255,0.3);
}

.chatbot-ia-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chatbot-ia-avatar svg {
    width: 26px;
    height: 26px;
    fill: var(--chatbot-header-text);
}

.chatbot-ia-header-info {
    flex: 1;
    position: relative;
    z-index: 1;
}

.chatbot-ia-header-title {
    font-weight: 700;
    font-size: 16px;
    margin: 0 0 2px 0;
    color: var(--chatbot-header-text);
    letter-spacing: -0.3px;
}

.chatbot-ia-header-status {
    font-size: 13px;
    opacity: 0.9;
    color: var(--chatbot-header-text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.chatbot-ia-header-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.chatbot-ia-header-actions {
    display: flex;
    gap: 6px;
    position: relative;
    z-index: 10;
}

.chatbot-ia-close,
.chatbot-ia-reset {
    background: rgba(255,255,255,0.15);
    border: none;
    color: var(--chatbot-header-text);
    cursor: pointer;
    padding: 10px;
    border-radius: 10px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
}

.chatbot-ia-close:hover,
.chatbot-ia-reset:hover {
    background: rgba(255,255,255,0.85);
    transform: scale(1.05);
}

.chatbot-ia-close svg,
.chatbot-ia-reset svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* ========================================
   LANGUAGE SELECTOR - Selector de idioma
   ======================================== */

.chatbot-ia-lang-selector {
    position: relative;
}

.chatbot-ia-lang-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: var(--chatbot-header-text);
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 10px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.chatbot-ia-lang-btn:hover {
    background: rgba(255,255,255,0.85);
    transform: scale(1.05);
}

.chatbot-ia-lang-flag {
    line-height: 1;
}

.chatbot-ia-lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 8px;
    display: none;
    flex-direction: row;
    gap: 4px;
    z-index: 100;
}

.chatbot-ia-lang-dropdown.open {
    display: flex;
}

.chatbot-ia-lang-option {
    background: transparent;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    font-size: 20px;
    transition: all 0.2s ease;
    line-height: 1;
}

.chatbot-ia-lang-option:hover {
    background: var(--chatbot-primary-light, #e8f4fc);
    transform: scale(1.1);
}

.chatbot-ia-lang-option.active {
    background: var(--chatbot-primary-light, #e8f4fc);
    border-color: var(--chatbot-primary);
}

/* ========================================
   MESSAGES CONTAINER - Contenedor de mensajes
   ======================================== */

.chatbot-ia-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: linear-gradient(180deg, var(--chatbot-light) 0%, var(--chatbot-bg) 100%);
    overscroll-behavior: contain; /* Evita que el scroll se propague al padre */
    -webkit-overflow-scrolling: touch; /* Scroll suave en iOS */
}

.chatbot-ia-messages::-webkit-scrollbar {
    width: 5px;
}

.chatbot-ia-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-ia-messages::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
}

.chatbot-ia-messages::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* ========================================
   MESSAGES - Mensajes
   ======================================== */

.chatbot-ia-message {
    max-width: 88%;
    animation: messageSlide 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chatbot-ia-message-bot {
    align-self: flex-start;
}

.chatbot-ia-message-user {
    align-self: flex-end;
}

.chatbot-ia-message-content {
    padding: 14px 18px;
    border-radius: 20px;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
    position: relative;
}

.chatbot-ia-message-bot .chatbot-ia-message-content {
    background: var(--chatbot-bg);
    color: var(--chatbot-text);
    border-bottom-left-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--chatbot-border);
}

.chatbot-ia-message-user .chatbot-ia-message-content {
    background: linear-gradient(135deg, var(--chatbot-primary) 0%, var(--chatbot-primary-dark) 100%);
    color: var(--chatbot-header-text);
    border-bottom-right-radius: 6px;
    box-shadow: 0 4px 12px rgba(30, 115, 190, 0.3);
}

.chatbot-ia-message-content a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.chatbot-ia-message-content a:hover {
    opacity: 0.8;
}

/* ========================================
   TYPING INDICATOR - Indicador escribiendo
   ======================================== */

.chatbot-ia-typing .chatbot-ia-message-content {
    display: flex;
    gap: 5px;
    padding: 18px 22px;
    background: var(--chatbot-bg);
}

.typing-dot {
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, var(--chatbot-primary) 0%, var(--chatbot-primary-dark) 100%);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

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

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* ========================================
   WELCOME MESSAGE - Mensaje de bienvenida
   ======================================== */

.chatbot-ia-welcome-question {
    margin-top: 12px;
    font-weight: 600;
    color: var(--chatbot-text);
    font-size: 15px;
}

/* ========================================
   QUICK ACTIONS - Botones rápidos
   ======================================== */

.chatbot-ia-quick-actions-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.chatbot-ia-quick-btn-inline {
    background: var(--chatbot-bg);
    color: var(--chatbot-primary);
    border: 2px solid var(--chatbot-primary);
    padding: 10px 16px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chatbot-ia-quick-btn-inline:hover {
    background: var(--chatbot-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(30, 115, 190, 0.3);
}

.chatbot-ia-request-callback {
    background: linear-gradient(135deg, var(--chatbot-success) 0%, #38a169 100%);
    color: white;
    border-color: var(--chatbot-success);
}

.chatbot-ia-request-callback:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    border-color: #38a169;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.4);
}

/* Need more buttons */
.chatbot-ia-need-more-btns {
    justify-content: center;
}

.chatbot-ia-need-more-btns .chatbot-ia-quick-btn-inline {
    flex: 1;
    justify-content: center;
    max-width: 180px;
}

/* ========================================
   INPUT AREA - Área de entrada
   ======================================== */

.chatbot-ia-input-area {
    padding: 16px 20px;
    background: var(--chatbot-bg);
    border-top: 1px solid var(--chatbot-border);
    display: flex;
    gap: 12px;
    align-items: center;
}

.chatbot-ia-input {
    flex: 1;
    border: 2px solid var(--chatbot-border);
    border-radius: 25px;
    padding: 14px 20px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    background: var(--chatbot-light);
    color: var(--chatbot-text);
}

.chatbot-ia-input:focus {
    border-color: var(--chatbot-primary);
    background: var(--chatbot-bg);
    box-shadow: 0 0 0 4px rgba(30, 115, 190, 0.1);
}

.chatbot-ia-input::placeholder {
    color: var(--chatbot-text-light);
}

.chatbot-ia-send {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chatbot-primary) 0%, var(--chatbot-primary-dark) 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(30, 115, 190, 0.3);
}

.chatbot-ia-send:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 115, 190, 0.4);
}

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

.chatbot-ia-send svg {
    width: 22px;
    height: 22px;
    fill: var(--chatbot-header-text);
    margin-left: 2px;
}

/* ========================================
   FORMS - Formularios generales
   ======================================== */

.chatbot-ia-form-intro {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--chatbot-border);
}

.chatbot-ia-form-intro strong {
    display: block;
    font-size: 16px;
    margin-bottom: 6px;
    color: var(--chatbot-text);
}

.chatbot-ia-form-intro p {
    margin: 0;
    font-size: 13px;
    color: var(--chatbot-text-light);
}

.chatbot-ia-callback-form,
.chatbot-ia-lead-form,
.chatbot-ia-satisfaction-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chatbot-ia-callback-form input,
.chatbot-ia-callback-form select,
.chatbot-ia-callback-form textarea,
.chatbot-ia-lead-form input,
.chatbot-ia-lead-form textarea,
.chatbot-ia-satisfaction-form textarea {
    border: 2px solid var(--chatbot-border);
    border-radius: var(--chatbot-radius-sm);
    padding: 12px 16px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
    background: var(--chatbot-bg);
    color: var(--chatbot-text);
}

.chatbot-ia-callback-form input:focus,
.chatbot-ia-callback-form select:focus,
.chatbot-ia-callback-form textarea:focus,
.chatbot-ia-lead-form input:focus,
.chatbot-ia-lead-form textarea:focus,
.chatbot-ia-satisfaction-form textarea:focus {
    border-color: var(--chatbot-primary);
    box-shadow: 0 0 0 4px rgba(30, 115, 190, 0.1);
}

.chatbot-ia-callback-form input::placeholder,
.chatbot-ia-lead-form input::placeholder,
.chatbot-ia-callback-form textarea::placeholder,
.chatbot-ia-lead-form textarea::placeholder {
    color: var(--chatbot-text-light);
}

.chatbot-ia-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chatbot-ia-form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--chatbot-text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.chatbot-ia-form-group small {
    color: var(--chatbot-text-light);
    font-weight: normal;
}

/* ========================================
   FORM BUTTONS - Botones de formulario
   ======================================== */

.chatbot-ia-callback-form button[type="submit"],
.chatbot-ia-lead-form button[type="submit"],
.chatbot-ia-satisfaction-form button[type="submit"] {
    background: linear-gradient(135deg, var(--chatbot-primary) 0%, var(--chatbot-primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(30, 115, 190, 0.3);
}

.chatbot-ia-callback-form button[type="submit"]:hover,
.chatbot-ia-lead-form button[type="submit"]:hover,
.chatbot-ia-satisfaction-form button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 115, 190, 0.4);
}

.chatbot-ia-callback-form button[type="submit"]:disabled,
.chatbot-ia-lead-form button[type="submit"]:disabled,
.chatbot-ia-satisfaction-form button[type="submit"]:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.chatbot-ia-form-cancel,
.chatbot-ia-link-btn {
    background: transparent;
    color: var(--chatbot-text-light);
    border: 2px solid var(--chatbot-border);
    border-radius: 25px;
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chatbot-ia-form-cancel:hover,
.chatbot-ia-link-btn:hover {
    background: var(--chatbot-light);
    border-color: var(--chatbot-text-light);
    color: var(--chatbot-text);
}

/* ========================================
   TIME SLOTS - Selector de horarios
   ======================================== */

.chatbot-ia-time-slots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding: 12px;
    background: var(--chatbot-light);
    border-radius: var(--chatbot-radius-sm);
    border: 2px solid var(--chatbot-border);
}

.chatbot-ia-time-slots::-webkit-scrollbar {
    width: 4px;
}

.chatbot-ia-time-slots::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
}

.chatbot-ia-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    padding: 10px 12px;
    background: var(--chatbot-bg);
    border: 2px solid var(--chatbot-border);
    border-radius: 10px;
    transition: all 0.2s ease;
    user-select: none;
    font-weight: 500;
    color: var(--chatbot-text);
}

.chatbot-ia-checkbox:hover {
    border-color: var(--chatbot-primary);
    background: var(--chatbot-primary-light);
}

.chatbot-ia-checkbox input {
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    accent-color: var(--chatbot-primary);
    cursor: pointer;
}

.chatbot-ia-checkbox:has(input:checked) {
    border-color: var(--chatbot-primary);
    background: var(--chatbot-primary-light);
    color: var(--chatbot-primary);
}

.chatbot-ia-checkbox-all {
    grid-column: span 2;
    justify-content: center;
    background: linear-gradient(135deg, var(--chatbot-primary-light) 0%, #dbeafe 100%);
    border-style: dashed;
    border-color: var(--chatbot-primary);
    color: var(--chatbot-primary);
}

.chatbot-ia-checkbox-all:hover {
    background: var(--chatbot-primary);
    color: white;
}

.chatbot-ia-checkbox-all:has(input:checked) {
    background: var(--chatbot-primary);
    color: white;
    border-style: solid;
}

/* ========================================
   CONTACT OPTIONS - Opciones de contacto
   ======================================== */

.chatbot-ia-contact-intro {
    margin-bottom: 14px;
}

.chatbot-ia-contact-intro strong {
    font-size: 15px;
    color: var(--chatbot-text);
}

.chatbot-ia-contact-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.chatbot-ia-contact-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 18px;
    background: var(--chatbot-bg);
    border: 2px solid var(--chatbot-border);
    border-radius: var(--chatbot-radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.chatbot-ia-contact-option:hover {
    border-color: var(--chatbot-primary);
    background: var(--chatbot-primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 115, 190, 0.15);
}

.chatbot-ia-contact-option .contact-icon {
    font-size: 24px;
    margin-bottom: 6px;
}

.chatbot-ia-contact-option .contact-text {
    font-weight: 700;
    color: var(--chatbot-text);
    font-size: 15px;
}

.chatbot-ia-contact-option .contact-desc {
    font-size: 12px;
    color: var(--chatbot-text-light);
    margin-top: 2px;
}

/* ========================================
   SATISFACTION SURVEY - Encuesta
   ======================================== */

.chatbot-ia-stars {
    display: flex;
    gap: 6px;
    font-size: 36px;
    margin: 10px 0;
    justify-content: center;
}

.chatbot-ia-star {
    cursor: pointer;
    transition: all 0.2s ease;
    filter: grayscale(80%) opacity(0.5);
    padding: 4px;
    border-radius: 50%;
}

.chatbot-ia-star:hover {
    transform: scale(1.25);
    filter: grayscale(0%) opacity(1);
}

.chatbot-ia-star.active {
    filter: grayscale(0%) opacity(1);
    transform: scale(1.15);
}

.chatbot-ia-resolved-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.chatbot-ia-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    padding: 10px 16px;
    background: var(--chatbot-bg);
    border: 2px solid var(--chatbot-border);
    border-radius: 25px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.chatbot-ia-radio:hover {
    border-color: var(--chatbot-primary);
}

.chatbot-ia-radio:has(input:checked) {
    border-color: var(--chatbot-primary);
    background: var(--chatbot-primary-light);
    color: var(--chatbot-primary);
}

.chatbot-ia-radio input {
    width: auto !important;
    margin: 0;
    accent-color: var(--chatbot-primary);
}

/* ========================================
   SYSTEM MESSAGES - Mensajes del sistema
   ======================================== */

.chatbot-ia-message-system {
    align-self: center;
}

.chatbot-ia-system-message {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    font-size: 12px;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
}

/* ========================================
   RESPONSIVE - Móviles
   ======================================== */

@media (max-width: 480px) {
    .chatbot-ia-window {
        bottom: 0;
        right: 0;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        /* Usar dvh para manejar el teclado virtual */
        height: 100dvh;
        max-height: 100dvh;
    }
    
    /* Cuando el teclado está visible, la ventana se adapta */
    .chatbot-ia-window.open {
        height: 100%;
        height: 100dvh;
    }
    
    .chatbot-ia-toggle {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
    }
    
    .chatbot-ia-header {
        padding: 14px 16px;
        flex-shrink: 0;
    }
    
    .chatbot-ia-messages {
        padding: 12px 16px;
        flex: 1;
        min-height: 0; /* Importante para que flex funcione bien */
    }
    
    .chatbot-ia-input-area {
        padding: 10px 12px;
        padding-bottom: max(10px, env(safe-area-inset-bottom, 10px)); /* Para iPhones con notch */
        flex-shrink: 0;
        /* Asegurar que el input siempre esté visible */
        position: relative;
        z-index: 10;
        background: var(--chatbot-bg);
    }
    
    /* Cuando el teclado está visible, añadir espacio extra */
    .chatbot-ia-window.keyboard-open .chatbot-ia-input-area {
        padding-bottom: 20px;
    }
    
    .chatbot-ia-input {
        font-size: 16px !important; /* Evitar zoom en iOS */
    }
    
    .chatbot-ia-quick-actions-inline {
        gap: 6px;
    }
    
    .chatbot-ia-quick-btn-inline {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .chatbot-ia-time-slots {
        grid-template-columns: 1fr;
    }
    
    .chatbot-ia-checkbox-all {
        grid-column: span 1;
    }
    
    .chatbot-ia-stars {
        font-size: 36px;
    }
    
    .chatbot-ia-resolved-options {
        flex-direction: column;
        gap: 8px;
    }
    
    .chatbot-ia-radio {
        justify-content: center;
    }
    
    /* Formularios en móvil */
    .chatbot-ia-callback-form,
    .chatbot-ia-lead-form,
    .chatbot-ia-satisfaction-form {
        max-height: none;
        overflow-y: visible;
    }
}

/* Para pantallas muy pequeñas o cuando hay teclado */
@media (max-width: 480px) and (max-height: 500px) {
    .chatbot-ia-header {
        padding: 10px 14px;
    }
    
    .chatbot-ia-avatar {
        width: 32px;
        height: 32px;
    }
    
    .chatbot-ia-header-info h4 {
        font-size: 14px;
    }
    
    .chatbot-ia-messages {
        padding: 8px 12px;
        gap: 8px;
    }
    
    .chatbot-ia-message-content {
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* ========================================
   HIDE ELEMENTS WHEN CHAT OPEN
   ======================================== */

body.chatbot-ia-chat-open {
    overflow: hidden;
}

body.chatbot-ia-chat-open .trp-floater-ls-wrap,
body.chatbot-ia-chat-open .grecaptcha-badge {
    display: none !important;
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* ========================================
   DARK MODE SUPPORT (optional)
   ======================================== */

@media (prefers-color-scheme: dark) {
    /* Se puede añadir soporte para modo oscuro aquí */
}