/* Chatbot Pro 5.2 - Estilos Base + SVG Icons GRANDES */
:root {
    --chatbot-bg: #FFFFFF;
    --chatbot-text: #1F2937;
    --chatbot-border: #E5E7EB;
    --chatbot-bot-bg: #F3F4F6;
}

#chatbot-pro-container {
    /* CAMBIO: Ahora hereda la fuente y tamaño de tu web */
    font-family: inherit;
    font-size: inherit;
    position: fixed;
    z-index: 999999;
}

/* Posicionamiento Desktop */
#chatbot-pro-container.chatbot-pro-bottom-right { bottom: 20px; right: 20px; }
#chatbot-pro-container.chatbot-pro-bottom-left { bottom: 20px; left: 20px; }
#chatbot-pro-container.chatbot-pro-top-right { top: 20px; right: 20px; }
#chatbot-pro-container.chatbot-pro-top-left { top: 20px; left: 20px; }

/* Botón flotante - SOPORTE SVG */
#chatbot-pro-button {
    width: 60px; height: 60px;
    background: var(--chatbot-button);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    color: white;
    position: relative;
}
#chatbot-pro-button:hover { filter: brightness(1.1); transform: scale(1.1); box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4); }

/* SVG Icons - MÁS GRANDES Y VISIBLES */
.chatbot-icon { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}

.chatbot-icon svg { 
    color: white; 
    stroke: white; 
    width: 36px !important;  
    height: 36px !important; 
}

#chatbot-pro-button svg { 
    color: white; 
    stroke: white; 
    width: 36px !important;  
}

.chatbot-avatar svg { 
    color: white; 
    stroke: white; 
    width: 28px;  
    height: 28px; 
}

/* Badge de notificación con animación */
.chatbot-notification-badge {
    position: absolute; top: -5px; right: -5px; background: #EF4444; color: white; border-radius: 50%;
    width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: bold; animation: pulse 2s infinite; z-index: 1000001;
}
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.1); opacity: 0.8; } }

/* Ventana */
#chatbot-pro-window {
    position: absolute; bottom: 80px; right: 0;
    width: 380px; height: 600px;
    background: var(--chatbot-bg);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none; flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}
#chatbot-pro-window.active { display: flex; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* Header y Status */
#chatbot-pro-header { color: white; padding: 16px; display: flex; justify-content: space-between; align-items: center; }
.chatbot-header-content { display: flex; align-items: center; gap: 12px; }
.chatbot-avatar { width: 40px; height: 40px; background: rgba(255, 255, 255, 0.2); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.chatbot-title { font-weight: 600; font-size: 16px; }
.chatbot-status { font-size: 12px; opacity: 0.9; display: flex; align-items: center; gap: 6px; }
.status-indicator { width: 8px; height: 8px; background: #10B981; border-radius: 50%; animation: blink 2s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
#chatbot-pro-close { background: transparent; border: none; color: white; cursor: pointer; padding: 4px; border-radius: 4px; }

/* Mensajes */
#chatbot-pro-messages { flex: 1; overflow-y: auto; padding: 20px; background: #F9FAFB; display: flex; flex-direction: column; gap: 12px; }
#chatbot-pro-messages::-webkit-scrollbar { width: 6px; }
#chatbot-pro-messages::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 3px; }

.chatbot-message { max-width: 80%; padding: 12px 16px; border-radius: 12px; line-height: 1.5; font-size: 14px; animation: fadeIn 0.3s ease; white-space: pre-wrap; word-wrap: break-word; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.chatbot-message.bot { background: var(--chatbot-bot-bg); color: var(--chatbot-text); align-self: flex-start; border-bottom-left-radius: 4px; }
.chatbot-message.user { color: white; align-self: flex-end; border-bottom-right-radius: 4px; }

/* Botones de flujo dinámicos */
.chatbot-flow-options { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; align-self: flex-start; max-width: 100%; }
.chatbot-flow-option {
    background: white !important; border: 2px solid; padding: 10px 16px; border-radius: 8px;
    cursor: pointer; transition: all 0.2s; font-size: 14px; text-align: left; font-weight: 500;
}

/* Indicador de Escritura */
.chatbot-typing { display: flex; gap: 4px; padding: 12px 16px; background: var(--chatbot-bot-bg); border-radius: 12px; border-bottom-left-radius: 4px; align-self: flex-start; max-width: 80px; }
.chatbot-typing span { width: 8px; height: 8px; background: #9CA3AF; border-radius: 50%; animation: typing 1.4s infinite; }
.chatbot-typing span:nth-child(2) { animation-delay: 0.2s; }
.chatbot-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-10px); } }

/* Input y Enviar */
#chatbot-pro-input-container { padding: 16px; background: white; border-top: 1px solid var(--chatbot-border); display: flex; gap: 8px; }
#chatbot-pro-input { flex: 1; padding: 12px 16px; border: 1px solid var(--chatbot-border); border-radius: 24px; font-size: 14px; outline: none; }
#chatbot-pro-send { width: 44px; height: 44px; border: none; border-radius: 50%; color: white; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* ==============================================
   RESPONSIVE MÓVIL - MEJORADO AL 85%
   ============================================== */
@media (max-width: 768px) {
    #chatbot-pro-window, #chatbot-pro-window.active {
        position: fixed !important; 
        left: 50% !important; 
        right: auto !important; 
        bottom: 50% !important;
        transform: translate(-50%, 50%) !important;
        
        /* CAMBIO: Ocupar el 85% de la pantalla */
        width: 85% !important; 
        height: 85% !important; 
        
        /* Eliminamos restricciones que impedían el crecimiento */
        max-width: none !important; 
        max-height: none !important; 
        
        border-radius: 20px !important; 
        z-index: 999999 !important;
    }
    
    #chatbot-pro-window.active { 
        animation: slideUpCenterMobile 0.3s ease-out !important; 
    }
    
    @keyframes slideUpCenterMobile {
        from { opacity: 0; transform: translate(-50%, 60%) !important; }
        to { opacity: 1; transform: translate(-50%, 50%) !important; }
    }
}

/* ================================================
   FORMULARIO NATIVO - ChatBot Pro 5.2
   ================================================ */

.chatbot-form-wrapper {
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 4px 0 !important;
}

.chatbot-native-form {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    width: 100%;
    box-sizing: border-box;
    font-size: 13px;
}

.chatbot-form-title {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: var(--chatbot-primary, #2596be) !important;
    margin: 0 0 6px !important;
    padding: 0 !important;
    border: none !important;
}

.chatbot-form-desc {
    font-size: 12px !important;
    color: #6b7280 !important;
    margin: 0 0 12px !important;
}

.chatbot-form-field {
    margin-bottom: 10px;
}

.chatbot-form-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.chatbot-native-form input[type="text"],
.chatbot-native-form input[type="email"],
.chatbot-native-form input[type="tel"],
.chatbot-native-form textarea,
.chatbot-native-form select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    color: #1f2937;
    background: #f9fafb;
    box-sizing: border-box;
    transition: border-color 0.2s;
    outline: none;
}

.chatbot-native-form input:focus,
.chatbot-native-form textarea:focus,
.chatbot-native-form select:focus {
    border-color: var(--chatbot-primary, #2596be);
    background: #fff;
}

.chatbot-native-form textarea {
    resize: vertical;
    min-height: 60px;
}

.chatbot-form-privacy label {
    font-size: 11px !important;
    font-weight: 400 !important;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    color: #6b7280;
}

.chatbot-form-privacy input[type="checkbox"] {
    width: 15px !important;
    height: 15px !important;
    margin-top: 1px;
    flex-shrink: 0;
    border: 1px solid #d1d5db !important;
    padding: 0 !important;
    cursor: pointer;
}

.chatbot-form-privacy a {
    color: var(--chatbot-primary, #2596be);
    text-decoration: underline;
}

.chatbot-form-submit {
    width: 100%;
    padding: 10px;
    background: var(--chatbot-primary, #2596be);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: filter 0.2s;
    font-family: inherit;
}

.chatbot-form-submit:hover:not(:disabled) {
    filter: brightness(1.1);
}

.chatbot-form-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.chatbot-form-volver {
    width: 100%;
    padding: 9px;
    background: transparent;
    color: var(--chatbot-primary, #2596be);
    border: 2px solid var(--chatbot-primary, #2596be);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.2s;
    font-family: inherit;
}

.chatbot-form-volver:hover {
    background: var(--chatbot-primary, #2596be);
    color: white;
}

.chatbot-form-success {
    background: #d1fae5;
    color: #065f46;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
}

/* ══════════════════════════════════════════════════════════
   ⚠️ NUEVO: ESTILOS PARA SHORTCODES DE FORMULARIOS MULTI-PLUGIN
   Soporte para: Forminator, Contact Form 7, WPForms, Gravity Forms
   ══════════════════════════════════════════════════════════ */

.chatbot-shortcode-container {
    max-width: 100%;
    width: 100%;
    margin: 10px 0;
    padding: 0;
}

.chatbot-shortcode-message {
    max-width: 100% !important;
    width: 100%;
    padding: 16px !important;
    background: #fff !important;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-sizing: border-box;
    margin: 0;
}

.chatbot-shortcode-message * {
    max-width: 100%;
    box-sizing: border-box;
}

.chatbot-shortcode-message form {
    width: 100%;
    margin: 0;
    padding: 0;
}

.chatbot-shortcode-message input[type="text"],
.chatbot-shortcode-message input[type="email"],
.chatbot-shortcode-message input[type="tel"],
.chatbot-shortcode-message input[type="number"],
.chatbot-shortcode-message input[type="password"],
.chatbot-shortcode-message input[type="url"],
.chatbot-shortcode-message input[type="date"],
.chatbot-shortcode-message select,
.chatbot-shortcode-message textarea {
    width: 100%;
    padding: 10px 12px;
    margin: 8px 0;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: #f9fafb;
    color: #1f2937;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.chatbot-shortcode-message input:focus,
.chatbot-shortcode-message select:focus,
.chatbot-shortcode-message textarea:focus {
    border-color: var(--chatbot-primary, #2596be);
    background: #fff;
    outline: none;
}

.chatbot-shortcode-message button,
.chatbot-shortcode-message input[type="submit"],
.chatbot-shortcode-message input[type="button"] {
    width: 100%;
    padding: 12px 16px;
    background: var(--chatbot-primary, #2596be);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: filter 0.2s, opacity 0.2s;
    font-family: inherit;
}

.chatbot-shortcode-message button:hover,
.chatbot-shortcode-message input[type="submit"]:hover,
.chatbot-shortcode-message input[type="button"]:hover {
    filter: brightness(1.1);
    opacity: 0.9;
}

.chatbot-shortcode-message button:disabled,
.chatbot-shortcode-message input[type="submit"]:disabled,
.chatbot-shortcode-message input[type="button"]:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.chatbot-shortcode-message label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
    margin-top: 8px;
}

.chatbot-shortcode-message .forminator-label,
.chatbot-shortcode-message .wpcf7-form-control-wrap,
.chatbot-shortcode-message .wpforms-field-container,
.chatbot-shortcode-message .gfield {
    margin-bottom: 12px;
}

.chatbot-shortcode-message select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.chatbot-shortcode-message textarea {
    resize: vertical;
    min-height: 80px;
}

.chatbot-shortcode-message .forminator-radio,
.chatbot-shortcode-message .forminator-checkbox,
.chatbot-shortcode-message input[type="radio"],
.chatbot-shortcode-message input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.chatbot-shortcode-message .forminator-radio label,
.chatbot-shortcode-message .forminator-checkbox label,
.chatbot-shortcode-message input[type="radio"] + label,
.chatbot-shortcode-message input[type="checkbox"] + label {
    display: inline;
    font-weight: 400;
    margin-top: 0;
}

.chatbot-shortcode-message .forminator-required,
.chatbot-shortcode-message .required,
.chatbot-shortcode-message .gfield_required {
    color: #ef4444;
}

.chatbot-shortcode-message .forminator-error,
.chatbot-shortcode-message .wpcf7-not-valid-tip,
.chatbot-shortcode-message .wpforms-error-container,
.chatbot-shortcode-message .gfield_error {
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
}

.chatbot-shortcode-message .forminator-input.forminator-error,
.chatbot-shortcode-message .wpcf7-form-control.wpcf7-not-valid,
.chatbot-shortcode-message .wpforms-field-error,
.chatbot-shortcode-message .gfield_error input {
    border-color: #ef4444;
}

/* Ajustes específicos para Forminator */
.chatbot-shortcode-message .forminator-field {
    margin-bottom: 12px;
}

.chatbot-shortcode-message .forminator-input,
.chatbot-shortcode-message .forminator-textarea,
.chatbot-shortcode-message .forminator-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

/* Ajustes específicos para Contact Form 7 */
.chatbot-shortcode-message .wpcf7-form {
    margin: 0;
}

.chatbot-shortcode-message .wpcf7-form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    margin: 8px 0;
}

.chatbot-shortcode-message .wpcf7-submit {
    width: 100%;
    padding: 12px 16px;
    background: var(--chatbot-primary, #2596be);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
}

/* Ajustes específicos para WPForms */
.chatbot-shortcode-message .wpforms-field {
    margin-bottom: 12px;
}

.chatbot-shortcode-message .wpforms-field-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.chatbot-shortcode-message .wpforms-field-sublabel {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

/* Ajustes específicos para Gravity Forms */
.chatbot-shortcode-message .gfield {
    margin-bottom: 12px;
}

.chatbot-shortcode-message .gfield_label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.chatbot-shortcode-message .ginput_container input,
.chatbot-shortcode-message .ginput_container select,
.chatbot-shortcode-message .ginput_container textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    margin: 8px 0;
}

.chatbot-shortcode-message .gform_button {
    width: 100%;
    padding: 12px 16px;
    background: var(--chatbot-primary, #2596be);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
}

/* Responsive para shortcodes en móvil */
@media (max-width: 768px) {
    .chatbot-shortcode-message {
        padding: 12px !important;
    }
    
    .chatbot-shortcode-message input,
    .chatbot-shortcode-message select,
    .chatbot-shortcode-message textarea,
    .chatbot-shortcode-message button {
        font-size: 13px;
        padding: 8px 10px;
    }
}

/* ════════════════════════════════════════════════════════════════════
   AGREGADO: Estilos adicionales para campos de pago de Forminator
   ════════════════════════════════════════════════════════════════════ */

.chatbot-shortcode-message .forminator-payment-gateway {
    width: 100%;
    margin-top: 15px;
    padding: 15px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.chatbot-shortcode-message .forminator-payment-gateway label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    display: block;
}

.chatbot-shortcode-message .forminator-payment-gateway .forminator-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
}

.chatbot-shortcode-message .forminator-stripe-element,
.chatbot-shortcode-message .stripe-input-wrapper {
    width: 100%;
    padding: 10px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    margin-top: 8px;
}

.chatbot-shortcode-message iframe {
    max-width: 100%;
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    min-height: 50px;
    background: #fff;
}

.chatbot-shortcode-message .forminator-card-cvc,
.chatbot-shortcode-message .forminator-card-number,
.chatbot-shortcode-message .forminator-card-expiry {
    margin-bottom: 10px;
}

/* Soporte para PayPal y otros gateways */
.chatbot-shortcode-message .paypal-button-container,
.chatbot-shortcode-message .payment-gateway-wrapper {
    margin-top: 15px;
    width: 100%;
}

/* Mensajes de error específicos de pago */
.chatbot-shortcode-message .forminator-payment-error {
    color: #ef4444;
    font-size: 12px;
    margin-top: 8px;
    padding: 8px;
    background: #fef2f2;
    border-radius: 4px;
    border-left: 3px solid #ef4444;
}
/* ── Tarjeta URL — botón de redirección universal para pagos ── */
.chatbot-url-card {
    display: flex !important;
    flex-direction: column;
    gap: 12px;
    max-width: 90% !important;
    padding: 14px 16px !important;
    white-space: normal !important;
}
.chatbot-url-text {
    font-size: 13px;
    line-height: 1.5;
    color: inherit;
}
.chatbot-url-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--chatbot-primary, #2596be);
    color: #fff !important;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    transition: filter 0.2s;
    align-self: flex-start;
}
.chatbot-url-btn:hover { filter: brightness(1.1); }
