{"id":3403,"date":"2025-11-17T11:26:00","date_gmt":"2025-11-17T14:26:00","guid":{"rendered":"https:\/\/xysexchange.com\/?page_id=3403"},"modified":"2025-11-22T16:21:08","modified_gmt":"2025-11-22T19:21:08","slug":"token-marketplace","status":"publish","type":"page","link":"https:\/\/xysexchange.com\/pt\/token-marketplace\/","title":{"rendered":"Marketplace de Tokens:"},"content":{"rendered":"\r\n<style>\n\/* Marketplace CSS - Version 1.3.5 - Login Logo 50px *\/\n\/* Cores base *\/\n:root {\n    --bg-primary: #0B0E11;\n    --bg-secondary: #1E2329;\n    --bg-tertiary: #2B3139;\n    --accent-primary: #FCD535;\n    --accent-secondary: #F0B90B;\n    --text-primary: #EAECEF;\n    --text-secondary: #848E9C;\n    --success: #0ECB81;\n    --danger: #F6465D;\n    --border-color: #2B3139;\n}\n\n\/* Reset e base *\/\n* {\n    margin: 0;\n    padding: 0;\n    box-sizing: border-box;\n}\n\nbody {\n    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;\n    background: #0B0E11 !important;\n    background-color: #0B0E11 !important;\n    color: #EAECEF !important;\n    line-height: 1.6;\n}\n\n\/* ZyroPay PIX quantity input \u2014 force black text on white bg (theme overrides body color) *\/\n#pix-qty-input,\ninput#pix-qty-input[type=\"number\"] {\n    color: #000 !important;\n    background: #fff !important;\n    -webkit-text-fill-color: #000 !important;\n    opacity: 1 !important;\n}\n\n\/* Force dark theme for MetaMask browser and all mobile browsers *\/\n\/* Force dark em TODOS os elementos do tema WP - mobile menu, search, dropdowns *\/\n.mobile-menu, .mobile-nav, .nav-menu, .menu-toggle + ul, .menu-toggle + nav,\n.main-navigation ul, .main-navigation li, .main-navigation a,\n.sub-menu, .dropdown-menu, .nav-dropdown,\n.site-header .search-field, .site-header input[type=search], .site-header input[type=text],\n#searchform, .search-form, .search-form input,\n.widget_search input, .search-field,\n.site-header select, .site-header .widget {\n    background: #0B0E11 !important;\n    background-color: #0B0E11 !important;\n    color: #EAECEF !important;\n    border-color: #2B3139 !important;\n}\n\n.main-navigation a, .nav-menu a, .menu-item a {\n    color: #EAECEF !important;\n}\n\n.main-navigation a:hover, .nav-menu a:hover, .menu-item a:hover {\n    color: #FCD535 !important;\n    background: rgba(252, 213, 53, 0.1) !important;\n}\n\n\nhtml, html body {\n    background: #0B0E11 url('\/wp-content\/plugins\/codex-integration\/assets\/images\/background.jpg') center center \/ cover no-repeat fixed !important;\n    color: #EAECEF !important;\n}\n\n.site-content, #content, .content-area, .entry-content, article, main, #main,\n#page, .layout-fullwidth, .block-content, .block-content > .container, .panel, .panel-center {\n    background: transparent !important;\n    background-color: transparent !important;\n    color: #EAECEF !important;\n}\n\n\/* Container *\/\n#marketplace-container {\n    width: 100%;\n    max-width: 1400px;\n    margin: 0 auto;\n    padding: 20px;\n    background: transparent;\n    min-height: 100vh;\n}\n\n\/* Header do marketplace *\/\n.marketplace-header {\n    background: var(--bg-secondary);\n    border-radius: 12px;\n    padding: 24px;\n    margin-bottom: 24px;\n    border: 1px solid var(--border-color);\n}\n\n\/* Preservar background do header\/menu WordPress *\/\n.site-header, #masthead, .main-header, .navbar, .main-navigation, header.site-header, header#masthead {\n    background: rgba(11, 14, 17, 0.98) !important;\n    backdrop-filter: blur(12px) !important;\n    -webkit-backdrop-filter: blur(12px) !important;\n    z-index: 9999 !important;\n    position: relative;\n}\n\n\/* Garantir que o header fixo\/sticky tenha fundo *\/\n.site-header.sticky, .site-header.fixed, #masthead.sticky, #masthead.fixed,\n.main-header.sticky, .main-header.fixed, .navbar.fixed-top {\n    background: rgba(11, 14, 17, 0.98) !important;\n    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5) !important;\n}\n\n.marketplace-title {\n    font-size: 28px;\n    font-weight: 700;\n    margin-bottom: 8px;\n    color: var(--text-primary);\n}\n\n.marketplace-subtitle {\n    color: var(--text-secondary);\n    font-size: 14px;\n}\n\n\/* Tabela de tokens *\/\n.tokens-table-container {\n    background: rgba(30, 35, 41, 0.85);\n    backdrop-filter: blur(8px);\n    -webkit-backdrop-filter: blur(8px);\n    border-radius: 12px;\n    overflow: hidden;\n    border: 1px solid #2B3139;\n}\n\n.tokens-table {\n    width: 100%;\n    border-collapse: collapse;\n}\n\n.tokens-table thead {\n    background: rgba(20, 24, 29, 0.9);\n    border-bottom: 1px solid rgba(255, 255, 255, 0.05);\n}\n\n.tokens-table th {\n    text-align: left;\n    padding: 16px 20px;\n    font-weight: 600;\n    font-size: 12px;\n    text-transform: uppercase;\n    letter-spacing: 1px;\n    color: #0ECB81;\n}\n\n.tokens-table tbody tr {\n    border-bottom: 1px solid rgba(255, 255, 255, 0.02);\n    transition: background 0.2s;\n    cursor: pointer;\n}\n\n.tokens-table tbody tr:hover {\n    background: rgba(252, 213, 53, 0.03);\n}\n\n.tokens-table tbody tr.selected {\n    background: rgba(252, 213, 53, 0.05);\n    border-left: 3px solid #2B3139;\n}\n\n.tokens-table td {\n    padding: 20px;\n    font-size: 14px;\n}\n\n\/* Cells espec\u00edficas *\/\n.token-info {\n    display: flex;\n    align-items: center;\n    gap: 12px;\n}\n\n.token-logo {\n    width: 40px;\n    height: 40px;\n    border-radius: 50%;\n    object-fit: contain;\n    background: rgba(20, 24, 29, 0.9);\n    padding: 8px;\n}\n\n.token-details {\n    display: flex;\n    flex-direction: column;\n}\n\n.token-symbol {\n    font-weight: 600;\n    font-size: 16px;\n}\n\n.token-name {\n    color: var(--text-secondary);\n    font-size: 12px;\n}\n\n.token-address {\n    font-family: 'Roboto Mono', monospace;\n    font-size: 12px;\n    color: var(--text-secondary);\n}\n\n.token-amount {\n    font-weight: 500;\n    color: var(--success);\n}\n\n.token-price {\n    font-weight: 500;\n}\n\n\/* Status badges *\/\n.status-badge {\n    display: inline-block;\n    padding: 4px 12px;\n    border-radius: 20px;\n    font-size: 12px;\n    font-weight: 500;\n}\n\n.status-badge.active {\n    background: rgba(14, 203, 129, 0.1);\n    color: var(--success);\n}\n\n.status-badge.pending {\n    background: rgba(252, 213, 53, 0.1);\n    color: var(--accent-primary);\n}\n\n\/* Bot\u00f5es *\/\n.btn-buy {\n    background: var(--success);\n    color: white;\n    border: none;\n    padding: 5px 15px;\n    border-radius: 6px;\n    font-weight: 500;\n    font-size: 13px;\n    cursor: pointer;\n    transition: all 0.3s;\n}\n\n.btn-buy:hover {\n    background: #0BAF6E;\n    transform: translateY(-1px);\n    box-shadow: 0 4px 8px rgba(14, 203, 129, 0.3);\n}\n\n\/* Painel de detalhes *\/\n.token-details-panel {\n    display: none;\n    background: rgba(20, 24, 29, 0.9);\n    border-top: 1px solid #2B3139;\n    animation: slideDown 0.3s ease;\n}\n\n.token-details-panel.active {\n    display: table-row;\n}\n\n.panel-content {\n    padding: 24px;\n}\n\n.panel-grid {\n    display: grid;\n    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));\n    gap: 20px;\n    margin-bottom: 20px;\n}\n\n.panel-item {\n    display: flex;\n    flex-direction: column;\n}\n\n.panel-label {\n    color: var(--text-secondary);\n    font-size: 12px;\n    margin-bottom: 4px;\n}\n\n.panel-value {\n    font-size: 16px;\n    font-weight: 500;\n}\n\n\/* Gr\u00e1fico placeholder *\/\n.price-chart {\n    background: var(--bg-secondary);\n    height: 200px;\n    border-radius: 8px;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    color: var(--text-secondary);\n    margin: 20px 0;\n}\n\n\/* Bot\u00f5es de a\u00e7\u00e3o *\/\n.action-buttons {\n    display: flex;\n    gap: 12px;\n    margin-top: 20px;\n}\n\n.buy-btn-large {\n    padding: 12px 24px;\n    background: var(--accent-primary);\n    color: var(--bg-primary);\n    border: none;\n    border-radius: 8px;\n    font-weight: 600;\n    font-size: 14px;\n    cursor: pointer;\n    transition: all 0.3s;\n    display: flex;\n    align-items: center;\n    gap: 8px;\n}\n\n.buy-btn-large:hover {\n    background: var(--accent-secondary);\n    transform: translateY(-2px);\n}\n\n.buy-metamask {\n    background: linear-gradient(135deg, #FFA85C 0%, #FF9547 100%);\n}\n\n.buy-pix {\n    background: linear-gradient(135deg, #32BCAD 0%, #00BDAE 100%);\n}\n\n\/* Responsive - Tablet *\/\n\/* Buy button: texto no desktop, icone no mobile *\/\n.btn-buy-icon {\n    display: none;\n    font-size: 16px;\n}\n\n.btn-buy-text {\n    display: inline;\n}\n\n@media (max-width: 1024px) {\n    \/* Esconder TOTAL USD (col 4) e LIQUIDITY (col 5) em tablet *\/\n    .tokens-table thead th:nth-child(4),\n    .tokens-table tbody td:nth-child(4),\n    .tokens-table thead th:nth-child(5),\n    .tokens-table tbody td:nth-child(5) {\n        display: none;\n    }\n}\n\n\/* Responsive - Mobile *\/\n@media (max-width: 768px) {\n    html, html body {\n        background-size: 200% auto !important;\n        background-position: center top !important;\n        background-repeat: no-repeat !important;\n        background-attachment: scroll !important;\n        background-position: center center !important;\n    }\n    #marketplace-container {\n        padding: 10px;\n    }\n\n    .marketplace-header {\n        padding: 15px 0;\n        margin-bottom: 15px;\n    }\n\n    .marketplace-title {\n        font-size: 20px;\n    }\n\n    .marketplace-stats .stat {\n        padding: 12px 20px;\n        min-width: 120px;\n    }\n\n    .stat-value {\n        font-size: 18px;\n    }\n\n    .stat-label {\n        font-size: 11px;\n    }\n\n    \/* Filtros mobile *\/\n    .filters-wrapper {\n        flex-direction: column;\n        gap: 10px;\n        padding: 0 10px;\n    }\n\n    .filter-search {\n        max-width: 100%;\n        width: 100%;\n    }\n\n    .quick-filters {\n        justify-content: center;\n        gap: 6px;\n    }\n\n    .filter-btn {\n        padding: 8px 12px;\n        font-size: 12px;\n    }\n\n    \/* Tabela mobile - esconder colunas menos importantes *\/\n    \/* Esconder: TOTAL USD (4), LIQUIDITY (5), PAYMENT (6) *\/\n    .tokens-table thead th:nth-child(4),\n    .tokens-table tbody td:nth-child(4),\n    .tokens-table thead th:nth-child(5),\n    .tokens-table tbody td:nth-child(5),\n    .tokens-table thead th:nth-child(6),\n    .tokens-table tbody td:nth-child(6) {\n        display: none;\n    }\n\n    .tokens-table {\n        font-size: 12px;\n    }\n\n    .tokens-table th {\n        padding: 10px 8px;\n        font-size: 10px;\n        letter-spacing: 0;\n    }\n\n    .tokens-table td {\n        padding: 12px 8px;\n    }\n\n    .tokens-table-container {\n        border-radius: 12px;\n        padding: 0;\n    }\n\n    \/* Token info compacto *\/\n    .token-info {\n        gap: 8px;\n    }\n\n    .token-logo {\n        width: 28px;\n        height: 28px;\n        padding: 4px;\n    }\n\n    .token-logo-placeholder {\n        width: 28px;\n        height: 28px;\n        font-size: 12px;\n    }\n\n    .token-name {\n        font-size: 13px !important;\n    }\n\n    .token-symbol-text {\n        font-size: 10px !important;\n    }\n\n    \/* Preco compacto *\/\n    .price-usd {\n        font-size: 12px !important;\n    }\n\n    .price-bnb {\n        font-size: 10px !important;\n    }\n\n    \/* Botao Buy compacto *\/\n    .btn-buy {\n        padding: 4px 10px;\n        font-size: 11px;\n    }\n\n    .token-address {\n        display: none;\n    }\n\n    .panel-grid {\n        grid-template-columns: 1fr;\n    }\n\n    \/* Painel de detalhes mobile *\/\n    .token-details-content {\n        padding: 12px !important;\n        margin: 8px !important;\n        overflow: hidden;\n    }\n\n    .details-grid {\n        grid-template-columns: 1fr !important;\n        gap: 15px !important;\n    }\n\n    .details-header {\n        flex-direction: column;\n        align-items: flex-start;\n        gap: 12px !important;\n        margin-bottom: 15px !important;\n        padding-bottom: 12px !important;\n    }\n\n    .token-logo-large {\n        width: 50px !important;\n        height: 50px !important;\n    }\n\n    .details-token-name {\n        font-size: 18px !important;\n    }\n\n    .details-contract {\n        flex-wrap: wrap;\n        gap: 6px !important;\n    }\n\n    .contract-address {\n        font-size: 11px !important;\n        word-break: break-all;\n        max-width: 180px;\n        overflow: hidden;\n        text-overflow: ellipsis;\n    }\n\n    .details-section {\n        padding: 12px !important;\n    }\n\n    .details-section h4 {\n        font-size: 12px !important;\n        margin-bottom: 10px !important;\n    }\n\n    .detail-row {\n        flex-direction: column;\n        align-items: flex-start !important;\n        gap: 4px;\n        padding: 8px 0 !important;\n    }\n\n    .detail-label {\n        font-size: 11px !important;\n    }\n\n    .detail-value {\n        font-size: 13px !important;\n        word-break: break-all;\n        overflow-wrap: break-word;\n        max-width: 100%;\n    }\n\n    .detail-value a {\n        word-break: break-all !important;\n        overflow-wrap: break-word !important;\n    }\n\n    .buy-actions {\n        flex-direction: column !important;\n        gap: 8px !important;\n    }\n\n    .buy-btn-large {\n        padding: 12px 16px !important;\n        font-size: 13px !important;\n    }\n\n    .buy-btn-large img {\n        width: 28px !important;\n        height: 28px !important;\n    }\n\n    .liquidity-info-box {\n        padding: 10px !important;\n    }\n\n    .payment-badges {\n        flex-wrap: wrap;\n    }\n\n    \/* Paginacao mobile *\/\n    .marketplace-pagination {\n        flex-wrap: wrap;\n        gap: 6px;\n        padding: 12px 0;\n    }\n\n    .marketplace-pagination .page-btn {\n        padding: 6px 10px;\n        font-size: 12px;\n    }\n\n    .marketplace-pagination .page-current {\n        padding: 6px 10px;\n        font-size: 12px;\n    }\n\n    #pagination-info {\n        width: 100%;\n        text-align: center;\n        font-size: 11px !important;\n    }\n}\n\n\/* Responsive - Mobile pequeno *\/\n@media (max-width: 480px) {\n    \/* Mobile: 4 colunas compactas - TOKEN, PRICE, QTY, BUY *\/\n    .tokens-table {\n        table-layout: fixed;\n        width: 100%;\n    }\n\n    .tokens-table thead th:nth-child(1),\n    .tokens-table tbody td:nth-child(1) {\n        width: 30%;\n    }\n\n    .tokens-table thead th:nth-child(2),\n    .tokens-table tbody td:nth-child(2) {\n        width: 28%;\n    }\n\n    .tokens-table thead th:nth-child(3),\n    .tokens-table tbody td:nth-child(3) {\n        width: 20%;\n        padding: 8px 2px;\n        font-size: 11px;\n        text-align: right;\n    }\n\n    .tokens-table thead th:nth-child(7),\n    .tokens-table tbody td:nth-child(7) {\n        width: 22%;\n        padding: 8px 4px;\n    }\n\n    .tokens-table th {\n        padding: 8px 4px;\n        font-size: 9px;\n    }\n\n    .tokens-table td {\n        padding: 10px 4px;\n    }\n\n    .token-logo {\n        width: 22px;\n        height: 22px;\n        padding: 4px;\n    }\n\n    .token-info {\n        gap: 6px;\n    }\n\n    .token-symbol {\n        font-size: 12px;\n    }\n\n    .token-name {\n        font-size: 10px !important;\n    }\n\n    .price-usd {\n        font-size: 11px !important;\n    }\n\n    .price-bnb {\n        font-size: 8px !important;\n    }\n\n    .btn-buy {\n        padding: 6px 10px;\n        font-size: 16px;\n        white-space: nowrap;\n        min-width: 0;\n    }\n\n    .btn-buy-text {\n        display: none;\n    }\n\n    .btn-buy-icon {\n        display: inline;\n        filter: brightness(0);\n    }\n\n    \/* Painel detalhes - mobile pequeno *\/\n    .token-details-content {\n        padding: 8px !important;\n        margin: 4px !important;\n    }\n\n    .token-logo-large {\n        width: 40px !important;\n        height: 40px !important;\n    }\n\n    .details-token-name {\n        font-size: 16px !important;\n    }\n\n    .details-section {\n        padding: 10px !important;\n    }\n\n    .detail-value {\n        font-size: 12px !important;\n    }\n\n    .contract-address {\n        max-width: 140px;\n        font-size: 10px !important;\n    }\n\n    .buy-btn-large {\n        padding: 10px 12px !important;\n        font-size: 12px !important;\n    }\n\n    .buy-btn-large img {\n        width: 24px !important;\n        height: 24px !important;\n    }\n}\n\n\/* Pagina\u00e7\u00e3o *\/\n.marketplace-pagination {\n    display: flex;\n    justify-content: center;\n    align-items: center;\n    gap: 10px;\n    padding: 20px 0;\n}\n\n.marketplace-pagination .page-btn {\n    background: rgba(30, 35, 41, 0.8);\n    border: 1px solid #2B3139;\n    border-radius: 8px;\n    padding: 8px 16px;\n    color: #848E9C;\n    cursor: pointer;\n    font-size: 14px;\n    transition: all 0.2s ease;\n}\n\n.marketplace-pagination .page-btn:hover {\n    background: rgba(240, 185, 11, 0.15);\n    color: #F0B90B;\n    border-color: #F0B90B;\n}\n\n.marketplace-pagination .page-current {\n    background: #F0B90B;\n    color: #0B0E11;\n    border-radius: 8px;\n    padding: 8px 14px;\n    font-size: 14px;\n    font-weight: 700;\n}\n\n.marketplace-pagination .page-ellipsis {\n    color: #848E9C;\n    font-size: 14px;\n    padding: 0 4px;\n}\n\n\/* Animations *\/\n@keyframes slideDown {\n    from {\n        opacity: 0;\n        transform: translateY(-10px);\n    }\n    to {\n        opacity: 1;\n        transform: translateY(0);\n    }\n}\n\n\/* Modal Styles *\/\n.modal {\n    position: fixed;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    z-index: 10000;\n    display: none;\n}\n\n.modal-overlay {\n    position: absolute;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    background: rgba(0, 0, 0, 0.7);\n    backdrop-filter: blur(5px);\n}\n\n.modal-container {\n    position: absolute;\n    top: 50%;\n    left: 50%;\n    transform: translate(-50%, -50%);\n    background: var(--bg-secondary);\n    border-radius: 16px;\n    width: 90%;\n    max-width: 500px;\n    max-height: 90vh;\n    overflow-y: auto;\n    border: 1px solid var(--border-color);\n}\n\n.modal-header {\n    padding: 24px;\n    border-bottom: 1px solid var(--border-color);\n}\n\n.modal-body {\n    padding: 24px;\n}\n\n.modal-close {\n    position: absolute;\n    top: 20px;\n    right: 20px;\n    background: none;\n    border: none;\n    color: var(--text-secondary);\n    font-size: 24px;\n    cursor: pointer;\n    transition: color 0.2s;\n}\n\n.modal-close:hover {\n    color: var(--text-primary);\n}\n\n\/* PIX Modal specific styles *\/\n.pix-container .modal-header {\n    text-align: center;\n}\n\n.pix-logo {\n    width: 60px;\n    height: 60px;\n    margin-bottom: 16px;\n}\n\n#pix-qr-container {\n    text-align: center;\n    padding: 20px;\n    background: white;\n    border-radius: 12px;\n    margin-bottom: 20px;\n}\n\n.pix-details {\n    background: rgba(20, 24, 29, 0.9);\n    border-radius: 12px;\n    padding: 20px;\n}\n\n.pix-row {\n    margin-bottom: 16px;\n}\n\n.pix-row label {\n    display: block;\n    color: var(--text-secondary);\n    font-size: 12px;\n    margin-bottom: 8px;\n}\n\n.copy-container {\n    display: flex;\n    gap: 8px;\n}\n\n.copy-container input {\n    flex: 1;\n    padding: 10px;\n    background: var(--bg-secondary);\n    border: 1px solid var(--border-color);\n    border-radius: 8px;\n    color: var(--text-primary);\n}\n\n.copy-btn {\n    padding: 10px 20px;\n    background: var(--accent-primary);\n    color: var(--bg-primary);\n    border: none;\n    border-radius: 8px;\n    cursor: pointer;\n    font-weight: 600;\n}\n\n\/* Login Modal Styles - Redesign conforme imagem *\/\n#login-modal .modal-overlay {\n    background: url('\/wp-content\/plugins\/codex-integration\/assets\/images\/background.jpg') center center \/ cover no-repeat;\n}\n\n#login-modal .modal-container {\n    background: #1E2329;\n    border-radius: 20px;\n    padding: 20px 40px;\n    max-width: 450px;\n    min-height: 420px;\n    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);\n}\n\n#login-modal .modal-close {\n    position: absolute;\n    top: 10px;\n    right: 10px;\n    background: transparent;\n    border: none;\n    color: #B0B3B8;\n    font-size: 24px;\n    cursor: pointer;\n    line-height: 1;\n    padding: 5px;\n    transition: color 0.3s ease;\n}\n\n#login-modal .modal-close:hover {\n    color: #FFFFFF;\n}\n\n#login-modal .modal-header {\n    text-align: center;\n    margin-bottom: 12px;\n    border-bottom: none;\n    padding: 0;\n}\n\n#login-modal .modal-body {\n    padding: 0;\n}\n\n#login-modal .modal-logo {\n    height: 50px !important;\n    display: block;\n    margin: 0 auto 8px;\n}\n\n#login-modal .modal-header h2 {\n    font-size: 28px;\n    color: #FFFFFF;\n    text-align: center;\n    margin: 4px 0;\n    font-weight: 600;\n    text-transform: lowercase;\n    line-height: 1.2;\n}\n\n#login-modal .modal-header p {\n    text-align: center;\n    color: #B0B3B8;\n    font-size: 13px;\n    margin: 4px 0 0 0;\n    line-height: 1.3;\n}\n\n#login-modal .form-group {\n    margin-bottom: 10px;\n}\n\n#login-modal .form-group label {\n    display: block;\n    color: #848E9C;\n    margin-bottom: 4px;\n    font-size: 11px;\n    text-transform: uppercase;\n    letter-spacing: 1px;\n    font-weight: 600;\n}\n\n#login-modal .form-group input {\n    width: 100%;\n    padding: 9px 14px;\n    background: #E8EAF6;\n    border: 1px solid #D1D5DB;\n    border-radius: 8px;\n    color: #1E2329;\n    font-size: 13px;\n    outline: none;\n    transition: all 0.3s ease;\n    box-sizing: border-box;\n}\n\n#login-modal .form-group input:focus {\n    border-color: #8B5CF6;\n    background: #F3F4F6;\n}\n\n#login-modal .btn-login {\n    width: 100%;\n    padding: 11px;\n    background: linear-gradient(135deg, #8B5CF6 0%, #D946EF 100%);\n    border: none;\n    border-radius: 8px;\n    color: #FFFFFF;\n    font-size: 15px;\n    font-weight: 600;\n    cursor: pointer;\n    margin-top: 10px;\n    text-transform: uppercase;\n    letter-spacing: 1px;\n    transition: all 0.3s ease;\n}\n\n#login-modal .btn-login:hover {\n    background: linear-gradient(135deg, #7C3AED 0%, #C026D3 100%);\n    transform: translateY(-2px);\n    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);\n}\n\n#login-modal .login-error-message {\n    background: rgba(246, 70, 93, 0.1);\n    border-left: 3px solid #F6465D;\n    color: #F6465D;\n    padding: 12px 16px;\n    margin: 15px 0;\n    font-size: 13px;\n    border-radius: 4px;\n    font-weight: 500;\n}\n\n\/* PIX Modal Styles - Layout horizontal para desktop *\/\n#pix-modal .modal-overlay {\n    background: url('\/wp-content\/plugins\/codex-integration\/assets\/images\/background.jpg') center center \/ cover no-repeat;\n}\n\n#pix-modal .modal-container.pix-container {\n    background: linear-gradient(135deg, #5B7FB8 0%, #2B3E5C 100%) !important;\n    border-radius: 20px !important;\n    padding: 20px 35px !important;\n    max-width: 900px !important;\n    width: 90% !important;\n    max-height: 90vh !important;\n    overflow-y: auto !important;\n    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;\n}\n\n#pix-modal .modal-close {\n    position: absolute;\n    top: 10px;\n    right: 10px;\n    background: transparent;\n    border: none;\n    color: #B0B3B8;\n    font-size: 24px;\n    cursor: pointer;\n    line-height: 1;\n    padding: 5px;\n    transition: color 0.3s ease;\n    z-index: 10;\n}\n\n#pix-modal .modal-close:hover {\n    color: #FFFFFF;\n}\n\n\/* Layout flex para desktop - duas colunas lado a lado *\/\n.pix-modal-flex {\n    display: flex;\n    flex-direction: column;\n    gap: 0;\n    padding: 0;\n}\n\n.pix-left-section {\n    flex: 1;\n}\n\n.pix-right-section {\n    flex: 1;\n}\n\n#pix-modal .modal-header {\n    text-align: center;\n    margin-bottom: 12px;\n    border-bottom: none;\n    padding: 0;\n}\n\n#pix-modal .modal-logo {\n    height: 100px !important;\n    display: block;\n    margin: 0 auto 15px;\n}\n\n#pix-modal .modal-header h2 {\n    font-size: 28px;\n    color: #FFFFFF;\n    text-align: center;\n    margin: 4px 0;\n    font-weight: 600;\n    text-transform: lowercase;\n    line-height: 1.2;\n}\n\n#pix-modal .modal-header p {\n    text-align: center;\n    color: #B0B3B8;\n    font-size: 13px;\n    margin: 4px 0 0 0;\n    line-height: 1.3;\n}\n\n\/* Token Section *\/\n.pix-coin-section {\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    gap: 12px;\n    margin-bottom: 15px;\n    padding: 10px;\n}\n\n.pix-coin-icon {\n    width: 50px;\n    height: 50px;\n    filter: drop-shadow(0 0 10px rgba(124, 50, 199, 0.3));\n}\n\n.pix-coin-name {\n    color: #FFFFFF;\n    font-size: 16px;\n    font-weight: 700;\n}\n\n\/* Se\u00e7\u00e3o de informa\u00e7\u00f5es de pagamento *\/\n.pix-info-section {\n    margin-bottom: 12px;\n}\n\n.info-row {\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    margin-bottom: 8px;\n    padding: 8px 12px;\n    background: rgba(139, 92, 246, 0.1);\n    border-radius: 8px;\n}\n\n.info-row label {\n    color: #E8E8E8;\n    font-size: 13px;\n    font-weight: 600;\n}\n\n.info-row .value-display {\n    color: #FFFFFF;\n    font-size: 15px;\n    font-weight: 700;\n}\n\n.value-display-secondary {\n    color: #B0B3B8;\n    font-size: 13px;\n    font-weight: 600;\n    margin-top: 4px;\n}\n\n\/* QR Code Section *\/\n.pix-qr-section {\n    background: #FFFFFF;\n    padding: 15px;\n    border-radius: 12px;\n    display: flex;\n    justify-content: center;\n    align-items: center;\n    margin-bottom: 12px;\n    min-height: 180px;\n}\n\n.pix-qr-section canvas {\n    max-width: 100%;\n    height: auto;\n}\n\n\/* Chave PIX Section *\/\n.pix-key-section {\n    margin-top: 12px;\n}\n\n.pix-key-section > label {\n    display: block;\n    color: #848E9C;\n    font-size: 11px;\n    text-transform: uppercase;\n    letter-spacing: 1px;\n    font-weight: 600;\n    margin-bottom: 6px;\n}\n\n.pix-key-display {\n    display: flex;\n    gap: 8px;\n}\n\n.pix-key-display input {\n    flex: 1;\n    padding: 10px 14px;\n    background: #E8EAF6;\n    border: 1px solid #D1D5DB;\n    border-radius: 8px;\n    color: #1E2329;\n    font-size: 14px;\n    font-family: monospace;\n    font-weight: 600;\n}\n\n.pix-key-display .copy-btn {\n    padding: 9px 14px;\n    background: linear-gradient(135deg, #A78BFA 0%, #7C3AED 100%);\n    border: none;\n    border-radius: 8px;\n    color: #FFFFFF;\n    font-size: 12px;\n    font-weight: 600;\n    cursor: pointer;\n    white-space: nowrap;\n    transition: all 0.3s ease;\n}\n\n.pix-key-display .copy-btn:hover {\n    background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);\n    transform: translateY(-1px);\n}\n\n.btn-fechar-pix {\n    width: 100%;\n    padding: 11px;\n    background: linear-gradient(135deg, #A78BFA 0%, #7C3AED 100%);\n    border: none;\n    border-radius: 8px;\n    color: #FFFFFF;\n    font-size: 15px;\n    font-weight: 600;\n    cursor: pointer;\n    margin-top: 12px;\n    text-transform: uppercase;\n    letter-spacing: 1px;\n    transition: all 0.3s ease;\n}\n\n.btn-fechar-pix:hover {\n    background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);\n    transform: translateY(-2px);\n    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);\n}\n\n.pix-buttons-container .btn-fechar-pix {\n    flex: 1;\n    margin-top: 0;\n}\n\n\/* Desktop: Layout horizontal com duas colunas *\/\n@media (min-width: 769px) {\n    #pix-modal .modal-container.pix-container {\n        max-width: 900px !important;\n        width: 90% !important;\n        max-height: 85vh !important;\n        padding: 20px 35px !important;\n        overflow-y: auto !important;\n    }\n\n    .pix-modal-flex {\n        flex-direction: row;\n        gap: 50px;\n    }\n\n    .pix-left-section {\n        flex: 1;\n        display: flex;\n        flex-direction: column;\n        justify-content: center;\n    }\n\n    .pix-right-section {\n        flex: 1;\n        display: flex;\n        flex-direction: column;\n    }\n\n    #pix-modal .modal-header {\n        margin-bottom: 25px;\n    }\n\n    #pix-modal .modal-logo {\n        height: 100px !important;\n        margin-bottom: 20px;\n    }\n\n    .pix-info-section {\n        margin-bottom: 0;\n    }\n\n    .pix-qr-section {\n        min-height: 240px;\n        margin-bottom: 18px;\n    }\n}\n\n\/* Mobile: Layout vertical empilhado *\/\n@media (max-width: 768px) {\n    #pix-modal .modal-container.pix-container {\n        max-width: 95% !important;\n        padding: 20px 15px !important;\n        max-height: 95vh !important;\n        overflow-y: auto !important;\n    }\n\n    .pix-modal-flex {\n        flex-direction: column;\n    }\n\n    #pix-modal .modal-logo {\n        height: 60px !important;\n        margin-bottom: 8px;\n    }\n\n    #pix-modal .modal-header {\n        margin-bottom: 12px;\n    }\n\n    #pix-modal .modal-header h2 {\n        font-size: 22px;\n        margin: 3px 0;\n    }\n\n    #pix-modal .modal-header p {\n        font-size: 12px;\n        margin: 3px 0 0 0;\n    }\n\n    .info-row {\n        padding: 8px 12px;\n        margin-bottom: 8px;\n    }\n\n    .pix-qr-section {\n        padding: 10px;\n        margin-bottom: 10px;\n        min-height: auto;\n    }\n\n    .pix-qr-section canvas {\n        width: 160px !important;\n        height: 160px !important;\n    }\n\n    .pix-key-section {\n        margin-top: 10px;\n    }\n\n    .btn-fechar-pix {\n        margin-top: 10px;\n        padding: 10px;\n    }\n}\n\n\/* Form group styles para outros modais *\/\n.form-group {\n    margin-bottom: 20px;\n}\n\n.form-group label {\n    display: block;\n    color: #848E9C;\n    margin-bottom: 8px;\n    font-size: 14px;\n}\n\n.form-group input {\n    width: 100%;\n    padding: 12px;\n    background: rgba(43, 49, 57, 0.5);\n    border: 1px solid rgba(43, 49, 57, 0.8);\n    border-radius: 8px;\n    color: #EAECEF;\n    font-size: 14px;\n    outline: none;\n    transition: all 0.3s ease;\n}\n\n.form-group input:focus {\n    border-color: #F0B90B;\n    background: rgba(43, 49, 57, 0.8);\n}\n\n\/* Filtros e busca *\/\n.marketplace-filters {\n    width: 100%;\n    margin-bottom: 30px;\n}\n\n.filters-wrapper {\n    display: flex;\n    align-items: center;\n    gap: 20px;\n    flex-wrap: wrap;\n    justify-content: center;\n    padding: 0 20px;\n}\n\n.filter-search {\n    flex: 1;\n    max-width: 400px;\n}\n\n.filter-search input {\n    width: 100%;\n    padding: 12px 20px;\n    background: rgba(30, 35, 41, 0.6);\n    backdrop-filter: blur(20px);\n    -webkit-backdrop-filter: blur(20px);\n    border: 1px solid rgba(43, 49, 57, 0.5);\n    border-radius: 50px;\n    color: #EAECEF;\n    font-size: 14px;\n    outline: none;\n    transition: all 0.3s ease;\n}\n\n.filter-search input:focus {\n    background: rgba(30, 35, 41, 0.8);\n    border-color: #F0B90B;\n    box-shadow: 0 0 20px rgba(240, 185, 11, 0.2);\n}\n\n.filter-search input::placeholder {\n    color: #848E9C;\n}\n\n.quick-filters {\n    display: flex;\n    gap: 10px;\n    flex-wrap: wrap;\n}\n\n.filter-btn {\n    padding: 10px 20px;\n    background: rgba(30, 35, 41, 0.6);\n    backdrop-filter: blur(10px);\n    -webkit-backdrop-filter: blur(10px);\n    border: 1px solid rgba(43, 49, 57, 0.5);\n    border-radius: 25px;\n    color: #848E9C;\n    font-size: 14px;\n    cursor: pointer;\n    transition: all 0.3s ease;\n    white-space: nowrap;\n}\n\n.filter-btn:hover {\n    background: rgba(30, 35, 41, 0.8);\n    color: #F0B90B;\n    border-color: #F0B90B;\n}\n\n.filter-btn.active {\n    background: #F0B90B;\n    color: #0B0E11;\n    border-color: #F0B90B;\n}\n\n.badge-new {\n    background: #0ECB81;\n    color: white;\n    padding: 2px 6px;\n    border-radius: 10px;\n    font-size: 10px;\n    margin-left: 5px;\n}\n\n#marketplace-sort {\n    appearance: none;\n    padding-right: 35px;\n    background-image: url(\"data:image\/svg+xml,%3Csvg xmlns='http:\/\/www.w3.org\/2000\/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23848E9C' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'\/%3E%3C\/svg%3E\");\n    background-repeat: no-repeat;\n    background-position: right 15px center;\n}\n\n\n\/* Stats Cards com Transpar\u00eancias *\/\n.marketplace-stats-container {\n    width: 100%;\n    display: flex;\n    justify-content: center;\n    margin-bottom: 30px;\n}\n\n.marketplace-stats {\n    display: inline-flex;\n    justify-content: center;\n    align-items: center;\n    gap: 20px;\n    flex-wrap: wrap;\n    padding: 0 20px;\n}\n\n.marketplace-stats .stat {\n    background: rgba(30, 35, 41, 0.6);\n    backdrop-filter: blur(20px);\n    -webkit-backdrop-filter: blur(20px);\n    border: 1px solid rgba(43, 49, 57, 0.5);\n    border-radius: 20px;\n    padding: 20px 40px;\n    min-width: 180px;\n    text-align: center;\n    transition: all 0.3s ease;\n}\n\n.marketplace-stats .stat:hover {\n    background: rgba(30, 35, 41, 0.8);\n    transform: translateY(-5px);\n    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);\n}\n\n.stat-value {\n    font-size: 24px;\n    font-weight: bold;\n    color: #F0B90B;\n    margin-bottom: 5px;\n}\n\n.stat-label {\n    font-size: 14px;\n    color: #848E9C;\n    text-transform: uppercase;\n    letter-spacing: 0.5px;\n}\n\n\/* Ajustar transpar\u00eancia da tabela tamb\u00e9m *\/\n.tokens-table-container {\n    background: rgba(30, 35, 41, 0.6);\n    backdrop-filter: blur(10px);\n    -webkit-backdrop-filter: blur(10px);\n    border: 1px solid rgba(43, 49, 57, 0.5);\n}\n\n\/* Transpar\u00eancia para o header *\/\n.marketplace-header {\n    background: transparent;\n    padding: 30px 0;\n    margin-bottom: 30px;\n    text-align: center;\n}\n\n@media (max-width: 768px) {\n    .marketplace-stats {\n        flex-direction: column;\n        align-items: center;\n    }\n\n    .marketplace-stats .stat {\n        width: 90%;\n        max-width: 300px;\n    }\n}\n\n\/* Purchase Modal - Mesmo tamanho do PIX (900px) *\/\n#purchase-modal .modal-container {\n    max-width: 900px !important;\n    width: 90% !important;\n    background: linear-gradient(to bottom, #4A5A7A 0%, #1E2835 100%) !important;\n    border-radius: 20px !important;\n    padding: 15px 30px 20px 30px !important;\n    max-height: none !important;\n    overflow: visible !important;\n    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;\n}\n\n#purchase-modal .modal-header {\n    padding: 0;\n    margin-bottom: 12px;\n}\n\n#purchase-modal .modal-body {\n    padding: 0;\n    overflow: visible !important;\n}\n\n\/* Logo do Token no Purchase Modal *\/\n.purchase-token-section {\n    display: flex;\n    align-items: center;\n    gap: 12px;\n    margin-bottom: 0;\n}\n\n.purchase-token-icon {\n    width: 50px;\n    height: 50px;\n    border-radius: 50%;\n    object-fit: cover;\n    border: 2px solid var(--accent-primary);\n}\n\n.purchase-token-symbol {\n    display: block;\n    color: var(--text-secondary);\n    font-size: 13px;\n    margin-top: 2px;\n}\n\n#purchase-modal .modal-header h2 {\n    font-size: 20px;\n    margin: 0;\n}\n\n\/* Compactar detail-rows *\/\n.purchase-details .detail-row {\n    margin-bottom: 8px;\n    font-size: 14px;\n}\n\n.purchase-details .detail-row label {\n    font-weight: 500;\n    margin-bottom: 2px;\n}\n\n.purchase-details .total-row {\n    margin-top: 8px;\n    padding-top: 8px;\n    border-top: 1px solid rgba(255, 255, 255, 0.1);\n}\n\n\/* Layout horizontal para desktop *\/\n@media (min-width: 769px) {\n    .purchase-details {\n        display: grid;\n        grid-template-columns: 1fr 1fr;\n        gap: 12px 25px;\n        margin-bottom: 15px;\n    }\n\n    .payment-buttons {\n        display: flex;\n        flex-direction: row;\n        gap: 10px;\n        margin-top: 0;\n    }\n\n    .buy-btn-large {\n        flex: 1;\n        max-width: 48%;\n        padding: 12px 20px;\n        font-size: 15px;\n    }\n}\n\n\/* Layout vertical para mobile *\/\n@media (max-width: 768px) {\n    .purchase-details {\n        display: flex;\n        flex-direction: column;\n    }\n\n    .payment-buttons {\n        display: flex;\n        flex-direction: column;\n        gap: 10px;\n    }\n\n    .purchase-token-icon {\n        width: 50px;\n        height: 50px;\n    }\n}\n\n\n\/* Direct Buy section mobile fix *\/\n@media (max-width: 900px) {\n    #direct-buy-section { padding: 16px !important; }\n    #direct-buy-grid { \n        grid-template-columns: 1fr !important; \n    }\n    #direct-buy-section h2 { font-size: 18px !important; }\n}\n\n\/* Fix: header opaco e acima do conteudo scrollado *\/\n#site-header-wrapper, #site-header, .site-header, .header-main {\n    background-color: #0b0e11 !important;\n    background-image: none !important;\n    position: relative;\n    z-index: 99999 !important;\n}\n.page-title-block { position: relative; z-index: 99998 !important; background-color: transparent !important; background-image: none !important; }\n#marketplace-container { position: relative; z-index: 1; }\n<\/style>\n\n<div id=\"marketplace-container\">\n    <!-- Stats Cards -->\n    <div class=\"marketplace-stats-container\">\n        <div class=\"marketplace-stats\">\n            <div class=\"stat\">\n                <div class=\"stat-value\" data-stat=\"active-tokens\">0<\/div>\n                <div class=\"stat-label\">Active Tokens<\/div>\n            <\/div>\n            <div class=\"stat\">\n                <div class=\"stat-value\" data-stat=\"sell-orders\">0<\/div>\n                <div class=\"stat-label\">Sell Orders<\/div>\n            <\/div>\n        <\/div>\n    <\/div>\n\n    <!-- Logged User Display -->\n    <div id=\"logged-user-bar\" style=\"display:none; background: linear-gradient(135deg, #1a1f2e, #1e2329); border: 1px solid #FCD535; border-radius: 10px; padding: 12px 24px; margin-bottom: 20px; backdrop-filter: blur(10px); align-items: center; justify-content: space-between;\">\n        <div style=\"display:flex; align-items:center; gap:10px;\">\n            <span style=\"font-size:18px;\">\ud83d\udc64<\/span>\n            <span style=\"color:#848E9C; font-size:14px;\">Logged in as:<\/span>\n            <span id=\"logged-user-name\" style=\"color:#FCD535; font-size:15px; font-weight:700;\"><\/span>\n        <\/div>\n        <button onclick=\"codexLogout()\" style=\"background:#F6465D; color:#fff; border:none; border-radius:6px; padding:8px 20px; cursor:pointer; font-size:14px; font-weight:600;\"><span class=\"i18n\" data-pt=\"Sair\" data-en=\"Logout\" data-es=\"Salir\">Logout<\/span><\/button>\n    <\/div>\n\n    <!-- ADMIN: Fee Collector Distribution Panel -->\n    <div id=\"fee-collector-panel\" style=\"display:none; background: linear-gradient(135deg, #1a1f2e, #1e2329); border: 1px solid #FCD535; border-radius: 12px; padding: 20px; margin-bottom: 24px;\">\n        <div style=\"display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;\">\n            <div>\n                <h3 style=\"color: #FCD535; margin: 0 0 8px 0; font-size: 16px;\">Fee Collector Contract<\/h3>\n                <div style=\"display: flex; gap: 24px; flex-wrap: wrap;\">\n                    <div>\n                        <span style=\"color: #848E9C; font-size: 12px;\"><span class=\"i18n\" data-pt=\"BNB Pendente\" data-en=\"Pending BNB\" data-es=\"BNB Pendiente\">Pending BNB<\/span><\/span>\n                        <div id=\"fc-pending-bnb\" style=\"color: #0ECB81; font-size: 18px; font-weight: bold;\">--<\/div>\n                    <\/div>\n                    <div>\n                        <span style=\"color: #848E9C; font-size: 12px;\"><span class=\"i18n\" data-pt=\"Valor USD\" data-en=\"USD Value\" data-es=\"Valor USD\">USD Value<\/span><\/span>\n                        <div id=\"fc-pending-usd\" style=\"color: #EAECEF; font-size: 18px;\">--<\/div>\n                    <\/div>\n                    <div>\n                        <span style=\"color: #848E9C; font-size: 12px;\"><span class=\"i18n\" data-pt=\"Distribui\u00e7\u00f5es\" data-en=\"Distributions\" data-es=\"Distribuciones\">Distributions<\/span><\/span>\n                        <div id=\"fc-dist-count\" style=\"color: #EAECEF; font-size: 18px;\">--<\/div>\n                    <\/div>\n                <\/div>\n            <\/div>\n            <div style=\"display: flex; gap: 10px; align-items: center;\">\n                <button id=\"fc-refresh-btn\" onclick=\"refreshFeeCollector()\" style=\"background: #2B3139; color: #EAECEF; border: 1px solid #3B4149; border-radius: 8px; padding: 10px 16px; cursor: pointer; font-size: 14px;\">\n                    Atualizar\n                <\/button>\n                <button id=\"fc-distribute-btn\" onclick=\"distributeFeeCollector()\" style=\"background: linear-gradient(135deg, #FCD535, #F0B90B); color: #0B0E11; border: none; border-radius: 8px; padding: 10px 20px; cursor: pointer; font-size: 14px; font-weight: bold;\">\n                    Distribuir 90\/10\n                <\/button>\n            <\/div>\n        <\/div>\n        <div id=\"fc-status\" style=\"margin-top: 10px; font-size: 13px; color: #848E9C;\"><\/div>\n    <\/div>\n\n    <!-- Filtros e busca -->\n    <!-- Filtros e busca -->\n    <div class=\"marketplace-filters\">\n        <div class=\"filters-wrapper\">\n            <!-- Busca -->\n            <div class=\"filter-search\">\n                <input type=\"text\" id=\"token-search\" placeholder=\"Search tokens...\">\n            <\/div>\n\n            <!-- Filtros r\u00e1pidos -->\n            <div class=\"quick-filters\">\n                <button class=\"filter-btn active\" data-filter=\"all\">All Tokens<\/button>\n                <button class=\"filter-btn\" data-filter=\"new\">New <span class=\"badge-new\">NEW<\/span><\/button>\n                <button class=\"filter-btn\" data-filter=\"popular\">Popular \ud83d\udd25<\/button>\n                <button class=\"filter-btn\" data-filter=\"high-liquidity\">High Liquidity<\/button>\n            <\/div>\n\n            <!-- Ordena\u00e7\u00e3o -->\n            <select id=\"marketplace-sort\" class=\"filter-btn\">\n                <option value=\"liquidity\">Liquidity<\/option>\n                <option value=\"price-low\">Price: Low to High<\/option>\n                <option value=\"price-high\">Price: High to Low<\/option>\n                <option value=\"newest\">Newest First<\/option>\n            <\/select>\n        <\/div>\n    <\/div>\n\n    <div class=\"tokens-table-container\">\n        <table class=\"tokens-table\">\n            <thead>\n                <tr>\n                    <th>TOKEN<\/th>\n                    <th>PRICE<\/th>\n                    <th>QTY<\/th>\n                    <th>TOTAL USD<\/th>\n                    <th>LIQUIDITY<\/th>\n                    <th>PAYMENT<\/th>\n                    <th>ACTION<\/th>\n                <\/tr>\n            <\/thead>\n            <tbody id=\"marketplace-table-body\">\n                <!-- Data will be loaded here -->\n            <\/tbody>\n        <\/table>\n    <\/div>\n\n    <!-- Pagination -->\n    <div class=\"marketplace-pagination\" style=\"display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 20px; padding: 16px 0;\">\n        <div id=\"pagination-buttons\" style=\"display: flex; align-items: center; gap: 8px;\"><\/div>\n        <div id=\"pagination-info\" style=\"color: #848E9C; font-size: 13px; margin-left: 12px;\"><\/div>\n    <\/div>\n    <!-- ============================================ -->\n    <!-- SE\u00c7\u00c3O: COMPRA DIRETA DE TOKENS -->\n    <!-- ============================================ -->\n    <div id=\"direct-buy-section\" style=\"\n        background: linear-gradient(135deg, rgba(30,35,41,0.85) 0%, rgba(43,49,57,0.85) 100%); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);\n        border-radius: 12px;\n        padding: 28px;\n        margin-bottom: 24px;\n        border: 1px solid #FCD535;\n        position: relative;\n        overflow: hidden;\n        width: 100%;\n    \">\n        <div style=\"position:absolute;top:-50px;right:-50px;width:200px;height:200px;background:radial-gradient(circle,rgba(252,213,53,0.08) 0%,transparent 70%);pointer-events:none;\"><\/div>\n\n        <div style=\"display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin-bottom:20px;\">\n            <div id=\"direct-buy-token-logo\" style=\"width:56px;height:56px;border-radius:50%;display:flex;align-items:center;justify-content:center;overflow:hidden;background:linear-gradient(135deg,#FCD535,#F0B90B);margin:0 auto;\"><img decoding=\"async\" id=\"direct-buy-logo-img\" src=\"https:\/\/exchange.tlxfre.com\/token-logos\/xys_1774556970830.png\" alt=\"XYS\" style=\"width:56px;height:56px;object-fit:cover;\" \/><\/div>\n            <div style=\"flex:1;min-width:200px;text-align:center;\">\n                <h2 style=\"font-size:22px;font-weight:700;color:#EAECEF;margin:0;\"><span class=\"i18n\" data-pt=\"Comprar Quantidade Personalizada\" data-en=\"Buy Custom Quantity\" data-es=\"Comprar Cantidad Personalizada\">Buy Custom Quantity<\/span><\/h2>\n                <p style=\"color:#848E9C;font-size:14px;margin:4px 0 0 0;\"><span class=\"i18n\" data-pt=\"Escolha um token e informe a quantidade exata que deseja comprar. Pague com MetaMask (BNB) ou PIX (BRL).\" data-en=\"Choose a token and enter the exact quantity you want to buy. Pay with MetaMask (BNB) or PIX (BRL).\" data-es=\"Elija un token e ingrese la cantidad exacta que desea comprar. Pague con MetaMask (BNB) o PIX (BRL).\">Choose a token and enter the exact quantity you want to buy. Pay with MetaMask (BNB) or PIX (BRL).<\/span><\/p>\n                <p style=\"font-size:13px;color:#848E9C;margin:0;\"><span class=\"i18n\" data-pt=\"Escolha a quantidade e pague com MetaMask ou PIX\" data-en=\"Choose the quantity and pay with MetaMask or PIX\" data-es=\"Elija la cantidad y pague con MetaMask o PIX\">Choose the quantity and pay with MetaMask or PIX<\/span><\/p>\n            <\/div>\n        <\/div>\n        <style>\n            @media (max-width: 600px) {\n                #direct-buy-token-logo { width:64px!important; height:64px!important; margin:0 auto 8px auto!important; }\n                #direct-buy-logo-img { width:64px!important; height:64px!important; }\n            }\n        <\/style>\n\n        <!-- Login required -->\n        <div id=\"direct-buy-login-required\" style=\"display:none;text-align:center;padding:20px 0;\">\n            <p style=\"color:#848E9C;font-size:16px;margin-bottom:16px;\">\ud83d\udd12 You need to be logged in to buy tokens<\/p>\n            <button onclick=\"openAuthModal()\" style=\"background:#FCD535;color:#0B0E11;border:none;padding:12px 32px;border-radius:8px;font-weight:600;cursor:pointer;font-size:15px;\">Login<\/button>\n        <\/div>\n\n        <!-- Buy form -->\n        <div id=\"direct-buy-form\" style=\"display:none;\">\n            <div id=\"direct-buy-grid\" style=\"display:grid;grid-template-columns:1fr 1fr;gap:20px;\">\n                <!-- Left: Token + Quantity -->\n                <div>\n                    <label style=\"display:block;color:#848E9C;font-size:13px;margin-bottom:6px;font-weight:500;\">Token:<\/label>\n                    <select id=\"direct-buy-token\" onchange=\"directBuyUpdatePrice()\" style=\"\n                        width:100%;padding:12px 14px;background:#0B0E11;border:1px solid #2B3139;border-radius:8px;\n                        color:#EAECEF;font-size:15px;cursor:pointer;outline:none;\n                    \">\n                        <option value=\"\">Loading tokens...<\/option>\n                    <\/select>\n\n                    <label style=\"display:block;color:#848E9C;font-size:13px;margin-bottom:6px;margin-top:16px;font-weight:500;\">Quantity:<\/label>\n                    <div style=\"position:relative;\">\n                        <input type=\"number\" id=\"direct-buy-quantity\" placeholder=\"Enter quantity\" min=\"1\" step=\"1\" oninput=\"directBuyCalcTotal()\" style=\"\n                            width:100%;padding:12px 14px;background:#0B0E11;border:1px solid #2B3139;border-radius:8px;\n                            color:#EAECEF;font-size:15px;outline:none;\n                        \">\n                        <span id=\"direct-buy-available\" style=\"position:absolute;right:12px;top:50%;transform:translateY(-50%);color:#848E9C;font-size:12px;\"><\/span>\n                    <\/div>\n\n                    <!-- Payment buttons below quantity -->\n                    <div style=\"display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:20px;\">\n                        <button id=\"direct-buy-metamask-btn\" onclick=\"directBuyWithMetaMask()\" style=\"\n                            display:flex;align-items:center;justify-content:center;gap:8px;\n                            padding:14px 16px;border-radius:10px;border:none;cursor:pointer;font-weight:600;font-size:14px;\n                            background:linear-gradient(135deg,#F6851B,#E2761B);color:#fff;transition:all 0.2s;\n                        \">\n                            <img loading=\"lazy\" decoding=\"async\" src=\"\/wp-content\/plugins\/codex-integration\/assets\/images\/payment\/metamask.png\" alt=\"MetaMask\" width=\"22\" height=\"22\" onerror=\"this.style.display='none'\">\n                            MetaMask\n                        <\/button>\n                        <button id=\"direct-buy-pix-btn\" onclick=\"directBuyWithPIX()\" style=\"\n                            display:flex;align-items:center;justify-content:center;gap:8px;\n                            padding:14px 16px;border-radius:10px;border:none;cursor:pointer;font-weight:600;font-size:14px;\n                            background:linear-gradient(135deg,#00B8A9,#00897B);color:#fff;transition:all 0.2s;\n                        \">\n                            <img loading=\"lazy\" decoding=\"async\" src=\"\/wp-content\/plugins\/codex-integration\/assets\/images\/payment\/pix.png\" alt=\"PIX\" width=\"22\" height=\"22\" onerror=\"this.style.display='none'\">\n                            PIX\n                        <\/button>\n                    <\/div>\n                <\/div>\n\n                <!-- Right: Price summary -->\n                <div style=\"background:#0B0E11;border-radius:10px;padding:18px;border:1px solid #2B3139;\">\n                    <div style=\"font-size:14px;color:#FCD535;margin-bottom:14px;font-weight:600;\">\ud83d\udccb Order Summary<\/div>\n\n                    <div style=\"display:flex;justify-content:space-between;margin-bottom:10px;\">\n                        <span style=\"color:#848E9C;font-size:14px;\">Unit Price:<\/span>\n                        <span id=\"direct-buy-unit-price\" style=\"color:#EAECEF;font-size:14px;font-weight:500;\">$0.00<\/span>\n                    <\/div>\n                    <div style=\"display:flex;justify-content:space-between;margin-bottom:10px;\">\n                        <span style=\"color:#848E9C;font-size:14px;\">Subtotal:<\/span>\n                        <span id=\"direct-buy-subtotal\" style=\"color:#EAECEF;font-size:14px;\">$0.00<\/span>\n                    <\/div>\n                    <div style=\"display:flex;justify-content:space-between;margin-bottom:10px;\">\n                        <span style=\"color:#848E9C;font-size:14px;\">Fee (0.5%):<\/span>\n                        <span id=\"direct-buy-fee\" style=\"color:#F6465D;font-size:14px;\">$0.00<\/span>\n                    <\/div>\n                    <div style=\"height:1px;background:#2B3139;margin:14px 0;\"><\/div>\n                    <div style=\"display:flex;justify-content:space-between;margin-bottom:8px;\">\n                        <span style=\"color:#FCD535;font-size:16px;font-weight:700;\">Total (USD):<\/span>\n                        <span id=\"direct-buy-total-usd\" style=\"color:#FCD535;font-size:16px;font-weight:700;\">$0.00<\/span>\n                    <\/div>\n                    <div style=\"display:flex;justify-content:space-between;margin-bottom:8px;\">\n                        <span style=\"color:#0ECB81;font-size:14px;\">Total (BNB):<\/span>\n                        <span id=\"direct-buy-total-bnb\" style=\"color:#0ECB81;font-size:14px;\">0.0000 BNB<\/span>\n                    <\/div>\n                    <div style=\"display:flex;justify-content:space-between;\">\n                        <span style=\"color:#848E9C;font-size:13px;\">Total (BRL):<\/span>\n                        <span id=\"direct-buy-total-brl\" style=\"color:#848E9C;font-size:13px;\">R$ 0,00<\/span>\n                    <\/div>\n                <\/div>\n            <\/div>\n\n            <p id=\"direct-buy-error\" style=\"display:none;color:#F6465D;font-size:13px;margin-top:12px;text-align:center;\"><\/p>\n            <p id=\"direct-buy-success\" style=\"display:none;color:#0ECB81;font-size:13px;margin-top:12px;text-align:center;\"><\/p>\n        <\/div>\n    <\/div>\n\n    <script>\n    (function() {\n        'use strict';\n        var directBuyTokens = [];\n        var directBuyBnbPrice = 0;\n        var directBuyBrlRate = 5.50;\n        let directBuySelectedOrder = null;\n\n        document.addEventListener('DOMContentLoaded', function() { setTimeout(directBuyInit, 500); });\n        window.addEventListener('load', function() { setTimeout(directBuyInit, 2000); });\n\n        \/\/ Check PIX availability on page load\n        var pixAvailable = false;\n        async function checkPixAvailability() {\n            \/\/ ZyroPay: PIX is generated dynamically by the backend \u2014 no static key required.\n            \/\/ Always enable the button; real availability is checked when user clicks GENERATE PIX.\n            pixAvailable = true;\n            console.log(\"[PIX] ZyroPay mode - botoes habilitados\");\n        }\n\n        function disableAllPixButtons() {\n            \/\/ Direct buy PIX button\n            var dbPixBtn = document.getElementById(\"direct-buy-pix-btn\");\n            if (dbPixBtn) {\n                dbPixBtn.disabled = true;\n                dbPixBtn.style.opacity = \"0.4\";\n                dbPixBtn.style.cursor = \"not-allowed\";\n                dbPixBtn.onclick = function() { if (typeof showCenterMessage === \"function\") showCenterMessage(\"PIX payment is not available at this time.\", \"warning\", 3000); return false; };\n                dbPixBtn.title = \"PIX not configured\";\n            }\n            \/\/ Table PIX buttons\n            document.querySelectorAll(\".buy-pix\").forEach(function(btn) {\n                btn.disabled = true;\n                btn.style.opacity = \"0.4\";\n                btn.style.cursor = \"not-allowed\";\n                btn.setAttribute(\"data-pix-disabled\", \"true\");\n                btn.title = \"PIX not configured\";\n            });\n        }\n\n        \/\/ Check PIX after page loads\n        window.addEventListener(\"load\", function() { setTimeout(checkPixAvailability, 3000); });\n\n\n        var directBuyInitialized = false;\n        var directBuyUserId = 0;\n        var directBuyUserLogin = '';\n\n        async function directBuyInit() {\n            if (directBuyInitialized) return;\n            directBuyInitialized = true;\n            console.log('[DirectBuy] Initializing...');\n\n            \/\/ Check login\n            try {\n                const resp = await fetch(codexAjax.ajax_url + '?action=codex_check_login&nonce=' + codexAjax.nonce);\n                const data = await resp.json();\n                if (data.success && data.data && data.data.logged_in) {\n                    directBuyUserId = parseInt(data.data.user_id) || 0;\n                    directBuyUserLogin = data.data.user_login || '';\n                    console.log('[DirectBuy] Logged user:', directBuyUserId, directBuyUserLogin);\n                    document.getElementById('direct-buy-login-required').style.display = 'none';\n                    document.getElementById('direct-buy-form').style.display = 'block';\n                } else {\n                    document.getElementById('direct-buy-login-required').style.display = 'block';\n                    document.getElementById('direct-buy-form').style.display = 'none';\n                    return;\n                }\n            } catch (e) {\n                document.getElementById('direct-buy-login-required').style.display = 'block';\n                return;\n            }\n\n            \/\/ BNB price\n            try {\n                const r = await fetch('https:\/\/api.binance.com\/api\/v3\/ticker\/price?symbol=BNBUSDT');\n                directBuyBnbPrice = parseFloat((await r.json()).price);\n            } catch (e) { directBuyBnbPrice = 600; }\n\n            \/\/ BRL rate\n            try {\n                const r = await fetch('https:\/\/api.binance.com\/api\/v3\/ticker\/price?symbol=USDTBRL');\n                directBuyBrlRate = parseFloat((await r.json()).price);\n            } catch (e) { directBuyBrlRate = 5.50; }\n\n            await directBuyLoadTokens();\n        }\n\n        window.directBuyLoadTokens = async function() {\n            try {\n                console.log('[DirectBuy] Loading tokens from Exchange API...');\n                const apiBase = 'https:\/\/exchange.tlxfre.com';\n                const resp = await fetch(apiBase + '\/api\/tokens\/all-sell-orders');\n                const text = await resp.text();\n                console.log('[DirectBuy] Response length:', text.length);\n                let result;\n                try { result = JSON.parse(text); } catch(e) { console.error('[DirectBuy] JSON parse error:', e); return; }\n\n                \/\/ Exchange API returns { success: true, orders: [...] }\n                const rawOrders = result.data?.orders || result.orders || result.data || [];\n                console.log('[DirectBuy] Raw orders:', rawOrders.length);\n                if (rawOrders && rawOrders.length > 0) {\n                    \/\/ Filter and clean orders (remove heavy base64 data)\n                    directBuyTokens = rawOrders.filter(o => parseFloat(o.amount_available) > 0).map(o => ({\n                        ...o,\n                        logo_base64: undefined,\n                        status: o.status || 'active'\n                    }));\n                    console.log('[DirectBuy] Filtered tokens:', directBuyTokens.length);\n\n                    \/\/ Update stats counters\n                    const uniqueTokens = new Set(directBuyTokens.map(o => o.token_symbol));\n                    const activeTokensEl = document.querySelector('[data-stat=\"active-tokens\"]');\n                    const sellOrdersEl = document.querySelector('[data-stat=\"sell-orders\"]');\n                    if (activeTokensEl) activeTokensEl.textContent = uniqueTokens.size;\n                    if (sellOrdersEl) sellOrdersEl.textContent = directBuyTokens.length;\n                    const select = document.getElementById('direct-buy-token');\n                    select.innerHTML = '<option value=\"\">-- Select Token --<\/option>';\n\n                    const tokenMap = {};\n                    directBuyTokens.forEach(order => {\n                        const sym = order.token_symbol;\n                        if (!tokenMap[sym]) tokenMap[sym] = { symbol: sym, orders: [], totalAvail: 0, bestPrice: Infinity };\n                        tokenMap[sym].orders.push(order);\n                        tokenMap[sym].totalAvail += parseFloat(order.amount_available);\n                        const p = parseFloat(order.price_usdt);\n                        if (p < tokenMap[sym].bestPrice) tokenMap[sym].bestPrice = p;\n                    });\n\n                    \/\/ Buscar pre\u00e7o atualizado do pool para cada token\n                    const poolPrices = {};\n                    try {\n                        const tokenSymbols = Object.keys(tokenMap);\n                        for (const sym of tokenSymbols) {\n                            try {\n                                const priceResp = await fetch(apiBase + '\/api\/launchpad\/token-info\/' + sym + '\/1000');\n                                const priceData = await priceResp.json();\n                                if (priceData && priceData.token_price_usd) {\n                                    poolPrices[sym] = parseFloat(priceData.token_price_usd);\n                                    console.log('[DirectBuy] Pool price for ' + sym + ': $' + poolPrices[sym].toFixed(6));\n                                }\n                            } catch(pe) { console.warn('[DirectBuy] Could not fetch pool price for ' + sym); }\n                        }\n                    } catch(e) { console.warn('[DirectBuy] Pool price fetch error:', e); }\n\n                    Object.values(tokenMap).forEach(tk => {\n                        const opt = document.createElement('option');\n                        opt.value = tk.symbol;\n                        \/\/ Usar pre\u00e7o do pool se dispon\u00edvel, sen\u00e3o usar bestPrice dos sell orders\n                        const displayPrice = poolPrices[tk.symbol] || tk.bestPrice;\n                        opt.textContent = tk.symbol + ' \u2014 $' + displayPrice.toFixed(4);\n                        \/\/ Adicionar pool price aos orders para uso posterior\n                        if (poolPrices[tk.symbol]) {\n                            tk.orders.forEach(o => { o.pool_price_usd = poolPrices[tk.symbol]; });\n                        }\n                        opt.dataset.orders = JSON.stringify(tk.orders);\n                        select.appendChild(opt);\n                    });\n\n                    if (select.options.length > 1) {\n                        let xysIdx = -1;\n                        for (let i = 0; i < select.options.length; i++) {\n                            if (select.options[i].value === 'XYS') { xysIdx = i; break; }\n                        }\n                        select.selectedIndex = xysIdx > 0 ? xysIdx : 1;\n                        directBuyUpdatePrice();\n                    } else { console.log('[DirectBuy] No tokens available'); select.innerHTML = '<option value=\"\">No tokens available for purchase<\/option>'; }\n                }\n            } catch (e) { console.error('[DirectBuy] Load error:', e); }\n        }\n\n        window.directBuyUpdatePrice = function() {\n            const sel = document.getElementById('direct-buy-token');\n            const opt = sel.options[sel.selectedIndex];\n            \/\/ Atualizar logo do token selecionado\n            const logoImg = document.getElementById('direct-buy-logo-img');\n            if (opt && opt.dataset.orders) {\n                try {\n                    const orders = JSON.parse(opt.dataset.orders);\n                    if (orders[0] && orders[0].logo_base64) {\n                        const logo = orders[0].logo_base64;\n                        logoImg.src = logo.startsWith('data:image') ? logo : 'data:image\/png;base64,' + logo;\n                        logoImg.style.display = 'block';\n                    } else if (orders[0] && orders[0].logo_url) {\n                        logoImg.src = 'https:\/\/exchange.tlxfre.com' + orders[0].logo_url;\n                        logoImg.style.display = 'block';\n                    } else {\n                        logoImg.style.display = 'none';\n                    }\n                } catch(e) { logoImg.style.display = 'none'; }\n            } else if (logoImg) { logoImg.style.display = 'none'; }\n            if (!opt || !opt.dataset.orders) {\n                document.getElementById('direct-buy-unit-price').textContent = '$0.00';\n                document.getElementById('direct-buy-available').textContent = '';\n                directBuySelectedOrder = null;\n                return;\n            }\n            const orders = JSON.parse(opt.dataset.orders);\n            \/\/ Compra por Quantidade SEMPRE usa pool price (current_price_usd) \u2014 independente das ordens P2P.\n            \/\/ token_price_usd vem da API \/api\/tokens\/all-sell-orders (campo COALESCE(t.current_price_usd, 0))\n            \/\/ pool_price_usd e injetado pelo loader (poolPrices[symbol]) \u2014 fallback redundante.\n            let best = orders[0];\n            const poolPrice = parseFloat(best.token_price_usd) || parseFloat(best.pool_price_usd) || 0;\n            \/\/ directBuySelectedOrder mantem o token (symbol\/address\/logo) mas preco vem do pool, nao da ordem\n            directBuySelectedOrder = Object.assign({}, best, { pool_price_usd: poolPrice });\n            document.getElementById('direct-buy-unit-price').textContent = '$' + poolPrice.toFixed(4);\n            document.getElementById('direct-buy-available').textContent = '';\n            \/\/ sem limite de quantidade\n            directBuyCalcTotal();\n        };\n\n        window.directBuyCalcTotal = function() {\n            const qty = parseFloat(document.getElementById('direct-buy-quantity').value) || 0;\n            if (!directBuySelectedOrder || qty <= 0) {\n                ['direct-buy-subtotal','direct-buy-fee','direct-buy-total-usd'].forEach(id => document.getElementById(id).textContent = '$0.00');\n                document.getElementById('direct-buy-total-bnb').textContent = '0.0000 BNB';\n                document.getElementById('direct-buy-total-brl').textContent = 'R$ 0,00';\n                return;\n            }\n            \/\/ SEMPRE pool price (Compra por Quantidade nao usa preco P2P de ordem). Sem fallback p\/ price_usdt.\n            const price = parseFloat(directBuySelectedOrder.pool_price_usd) || parseFloat(directBuySelectedOrder.token_price_usd) || 0;\n            const sub = qty * price;\n            const fee = sub * 0.005;\n            const total = sub + fee;\n            const bnb = directBuyBnbPrice > 0 ? total \/ directBuyBnbPrice : 0;\n            const brl = total * directBuyBrlRate;\n\n            document.getElementById('direct-buy-subtotal').textContent = '$' + sub.toFixed(2);\n            document.getElementById('direct-buy-fee').textContent = '$' + fee.toFixed(2);\n            document.getElementById('direct-buy-total-usd').textContent = '$' + total.toFixed(2);\n            document.getElementById('direct-buy-total-bnb').textContent = bnb.toFixed(6) + ' BNB';\n            document.getElementById('direct-buy-total-brl').textContent = 'R$ ' + brl.toFixed(2).replace('.', ',');\n            document.getElementById('direct-buy-error').style.display = 'none';\n            document.getElementById('direct-buy-success').style.display = 'none';\n        };\n\n        function showDBError(msg) {\n            const el = document.getElementById('direct-buy-error');\n            el.textContent = '\u274c ' + msg; el.style.display = 'block';\n            document.getElementById('direct-buy-success').style.display = 'none';\n        }\n        function showDBSuccess(msg) {\n            const el = document.getElementById('direct-buy-success');\n            el.textContent = '\u2705 ' + msg; el.style.display = 'block';\n            document.getElementById('direct-buy-error').style.display = 'none';\n        }\n        \/\/ FIX: Buscar preco atualizado antes de comprar\n        window.directBuyRefreshPrice = async function() {\n            try {\n                const apiBase = \"https:\/\/exchange.tlxfre.com\";\n                const resp = await fetch(apiBase + \"\/api\/tokens\/all-sell-orders\");\n                const result = await resp.json();\n                const rawOrders = result.data?.orders || result.orders || result.data || [];\n                const sym = directBuySelectedOrder?.token_symbol;\n                if (!sym) return false;\n                const matching = rawOrders.filter(o => o.token_symbol === sym && parseFloat(o.amount_available) > 0);\n                if (matching.length === 0) return false;\n                \/\/ Compra por Quantidade SEMPRE usa pool price (token_price_usd da API).\n                \/\/ Pegamos qualquer ordem matching apenas para extrair o pool price atualizado.\n                const refreshPoolPrice = parseFloat(matching[0].token_price_usd) || parseFloat(directBuySelectedOrder.pool_price_usd) || 0;\n                if (!(refreshPoolPrice > 0)) return false;\n                directBuySelectedOrder = Object.assign({}, matching[0], { pool_price_usd: refreshPoolPrice });\n                document.getElementById(\"direct-buy-unit-price\").textContent = \"$\" + refreshPoolPrice.toFixed(4);\n                directBuyCalcTotal();\n                console.log(\"[DirectBuy] Pool price atualizado: $\" + refreshPoolPrice.toFixed(4));\n                return true;\n            } catch(e) { console.error(\"[DirectBuy] Erro ao atualizar preco:\", e); return false; }\n        };\n        \/\/ Auto-refresh preco a cada 30 segundos\n        setInterval(function() { if (directBuySelectedOrder) directBuyRefreshPrice(); }, 30000);\n\n\n        \/\/ ============ METAMASK ============\n        window.directBuyWithMetaMask = async function() {\n            const qty = parseFloat(document.getElementById('direct-buy-quantity').value) || 0;\n            if (!directBuySelectedOrder || qty <= 0) { showDBError('Select a token and enter quantity.'); return; }\n\n            \/\/ Valida\u00e7\u00e3o m\u00ednimo $300 USD para compra por quantidade \u2014 usa POOL price (regra fixa)\n            const minBuyUsd = 300;\n            const checkPrice = parseFloat(directBuySelectedOrder.pool_price_usd) || parseFloat(directBuySelectedOrder.token_price_usd) || 0;\n            const checkTotal = qty * checkPrice;\n            if (checkTotal < minBuyUsd) {\n                showDBError('Minimum purchase: $' + minBuyUsd + ' USD. Current value: $' + checkTotal.toFixed(2) + ' USD (minimum ' + Math.ceil(minBuyUsd \/ checkPrice) + ' tokens).');\n                return;\n            }\n\n            \/\/ FIX: Atualizar preco antes de comprar\n            await directBuyRefreshPrice();\n            const order = directBuySelectedOrder;\n            \/\/ MetaMask: usa pool price para USDT\/BNB (mesma regra do PIX)\n            const priceUsdt = parseFloat(order.pool_price_usd) || parseFloat(order.token_price_usd) || 0;\n            const priceBnb = parseFloat(order.price_bnb);\n            const subUsdt = qty * priceUsdt, feeUsdt = subUsdt * 0.005, totalUsdt = subUsdt + feeUsdt;\n            const subBnb = qty * priceBnb, feeBnb = subBnb * 0.005, totalBnb = subBnb + feeBnb;\n\n            const btn = document.getElementById('direct-buy-metamask-btn');\n            const orig = btn.innerHTML;\n            btn.innerHTML = '\u23f3 Processing...'; btn.disabled = true;\n\n            try {\n                const provider = await WalletHelper.getProvider();\n                if (!provider) {\n                    \/\/ Check if mobile - redirect to MetaMask app via deep link\n                    const isMobile = \/Android|iPhone|iPad|iPod\/i.test(navigator.userAgent);\n                    if (isMobile) {\n                        const currentUrl = window.location.href.replace(\/^https?:\\\/\\\/\/, '');\n                        const metamaskDeepLink = 'https:\/\/metamask.app.link\/dapp\/' + currentUrl;\n                        \n                        \/\/ Show modal with options\n                        var overlay = document.createElement('div');\n                        overlay.id = 'metamask-mobile-modal';\n                        overlay.style.cssText = 'position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.85);z-index:10001;display:flex;align-items:center;justify-content:center;padding:20px;';\n                        overlay.innerHTML = '<div style=\"background:#1E2329;border-radius:16px;padding:24px;max-width:380px;width:100%;color:#EAECEF;text-align:center;box-shadow:0 8px 32px rgba(0,0,0,0.5);\">' +\n                            '<img decoding=\"async\" src=\"\/wp-content\/plugins\/codex-integration\/assets\/images\/payment\/metamask.png\" alt=\"MetaMask\" style=\"width:60px;height:60px;margin-bottom:16px;\" onerror=\"this.style.display=\\'none\\'\">' +\n                            '<h3 style=\"color:#F0B90B;margin:0 0 12px 0;font-size:18px;\">Connect Wallet<\/h3>' +\n                            '<p style=\"color:#B7BDC6;font-size:14px;line-height:1.6;margin:0 0 20px 0;\">To buy with MetaMask on mobile, open this site inside the MetaMask app.<\/p>' +\n                            '<a href=\"' + metamaskDeepLink + '\" style=\"display:block;background:linear-gradient(135deg,#F6851B,#E2761B);color:#fff;padding:14px;border-radius:10px;text-decoration:none;font-weight:600;font-size:16px;margin-bottom:12px;\">Open in MetaMask<\/a>' +\n                            '<p style=\"color:#848E9C;font-size:12px;margin:0 0 16px 0;\">If you do not have MetaMask installed:<\/p>' +\n                            '<div style=\"display:flex;gap:10px;\">' +\n                                '<a href=\"https:\/\/play.google.com\/store\/apps\/details?id=io.metamask\" target=\"_blank\" style=\"flex:1;display:block;background:#2B3139;color:#EAECEF;padding:10px;border-radius:8px;text-decoration:none;font-size:13px;border:1px solid #404040;\">Google Play<\/a>' +\n                                '<a href=\"https:\/\/apps.apple.com\/app\/metamask\/id1438144202\" target=\"_blank\" style=\"flex:1;display:block;background:#2B3139;color:#EAECEF;padding:10px;border-radius:8px;text-decoration:none;font-size:13px;border:1px solid #404040;\">App Store<\/a>' +\n                            '<\/div>' +\n                            '<button onclick=\"this.closest(\\'#metamask-mobile-modal\\').remove()\" style=\"margin-top:16px;background:transparent;border:1px solid #404040;color:#848E9C;padding:10px 24px;border-radius:8px;cursor:pointer;font-size:14px;width:100%;\">Cancel<\/button>' +\n                        '<\/div>';\n                        document.body.appendChild(overlay);\n                        overlay.addEventListener('click', function(e) { if (e.target === overlay) overlay.remove(); });\n                        btn.innerHTML = orig; btn.disabled = false;\n                        return;\n                    }\n                    throw new Error('MetaMask not found. Install the MetaMask browser extension.');\n                }\n                const accounts = await provider.request({ method: 'eth_requestAccounts' });\n                const addr = accounts[0];\n\n                \/\/ Switch to BSC Mainnet\n                try { await provider.request({ method: 'wallet_switchEthereumChain', params: [{ chainId: '0x38' }] }); }\n                catch (sw) {\n                    if (sw.code === 4902) await provider.request({ method: 'wallet_addEthereumChain', params: [{\n                        chainId: '0x38', chainName: 'BNB Smart Chain',\n                        nativeCurrency: { name: 'BNB', symbol: 'BNB', decimals: 18 },\n                        rpcUrls: ['https:\/\/bsc-dataseed.binance.org\/'], blockExplorerUrls: ['https:\/\/bscscan.com\/']\n                    }]});\n                }\n\n                const TLX_WALLET = '0x6b05eb10dC7eefcBe2063F510E1F2f1c87112c1E'; \/\/ Fee Collector Contract (90% TLX \/ 10% Dev)\n                const wei = '0x' + BigInt(Math.round(totalBnb * 1e18)).toString(16);\n\n                btn.innerHTML = '\ud83d\udcf1 Confirm in MetaMask...';\n                const txHash = await provider.request({ method: 'eth_sendTransaction', params: [{\n                    from: addr, to: TLX_WALLET, value: wei, gas: '0x186A0'\n                }]});\n\n                btn.innerHTML = '\u23f3 Confirming...';\n                let confirmed = false;\n                for (let i = 0; i < 60; i++) {\n                    await new Promise(r => setTimeout(r, 3000));\n                    const receipt = await provider.request({ method: 'eth_getTransactionReceipt', params: [txHash] });\n                    if (receipt && receipt.status === '0x1') { confirmed = true; break; }\n                    if (receipt && receipt.status === '0x0') throw new Error('Transaction failed.');\n                }\n                if (!confirmed) throw new Error('Timeout - not confirmed after 3 min.');\n\n                btn.innerHTML = '\u23f3 Recording...';\n                \/\/ Direct-buy: via WordPress AJAX \u2192 backend localhost:3001\n                const sel = document.getElementById('direct-buy-token');\n                const tokenSymbol = sel.value;\n                const fd2 = new FormData();\n                fd2.append('action', 'codex_direct_buy_token');\n                fd2.append('nonce', codexAjax.nonce);\n                fd2.append('tokenSymbol', tokenSymbol);\n                fd2.append('quantity', qty.toString());\n                fd2.append('paymentMethod', 'BNB');\n                fd2.append('txHash', txHash);\n                fd2.append('buyerWallet', addr);\n                fd2.append('buyerId', directBuyUserId.toString());\n                const resp = await fetch(codexAjax.ajax_url, { method: 'POST', body: fd2 });\n                const result = await resp.json();\n\n                if (result.success || (result.data && result.data.success)) {\n                    showDBSuccess('Purchase completed! ' + qty + ' ' + order.token_symbol + ' added to your account.');\n                    document.getElementById('direct-buy-quantity').value = '';\n                    directBuyCalcTotal();\n                    setTimeout(() => directBuyLoadTokens(), 2000);\n                } else {\n                    showDBError('Payment OK but recording failed: ' + (result.data || 'Error'));\n                }\n            } catch (error) {\n                if (error.code === 4001) showDBError('Cancelled by user.');\n                else if (error.code === -32603) showDBError('Insufficient BNB balance.');\n                else showDBError(error.message || 'MetaMask error');\n            } finally { btn.innerHTML = orig; btn.disabled = false; }\n        };\n\n        \/\/ ============ PIX (ZyroPay) \u2014 Compra por Quantidade (rota POOL, isolada de buyWithPIX\/pacotes) ============\n        window._directBuyPixPoll = null;\n        window._directBuyPixExternalId = null;\n\n        window.directBuyWithPIX = async function() {\n            const qty = parseFloat(document.getElementById('direct-buy-quantity').value) || 0;\n            if (!directBuySelectedOrder || qty <= 0) { showDBError('Select a token and enter quantity.'); return; }\n\n            \/\/ Valida\u00e7\u00e3o m\u00ednimo $300 USD para compra por quantidade \u2014 pool price (regra fixa)\n            const minBuyUsd = 300;\n            const checkPrice = parseFloat(directBuySelectedOrder.pool_price_usd) || parseFloat(directBuySelectedOrder.token_price_usd) || 0;\n            const checkTotal = qty * checkPrice;\n            if (!(checkPrice > 0)) { showDBError('Pool price unavailable. Reload and try again.'); return; }\n            if (checkTotal < minBuyUsd) {\n                showDBError('Minimum purchase: $' + minBuyUsd + ' USD. Current value: $' + checkTotal.toFixed(2) + ' USD (minimum ' + Math.ceil(minBuyUsd \/ checkPrice) + ' tokens).');\n                return;\n            }\n\n            const order = directBuySelectedOrder;\n            const tokenSymbol = order.token_symbol;\n\n            \/\/ Atualizar pool price antes de gerar PIX\n            await directBuyRefreshPrice();\n\n            \/\/ Abrir modal PIX com valores PRE-CALCULADOS (pool price)\n            const subUsdtPreview = qty * checkPrice;\n            const totalUsdtPreview = subUsdtPreview * 1.05; \/\/ +5% fee servidor\n            const brlRatePreview = (typeof directBuyBrlRate !== 'undefined' && directBuyBrlRate > 0) ? directBuyBrlRate : 5.50;\n            const totalBrlPreview = totalUsdtPreview * brlRatePreview;\n\n            const pixModal = document.getElementById('pix-modal');\n            const qtyEditor = document.getElementById('pix-qty-editor');\n            const qtyInput = document.getElementById('pix-qty-input');\n            const qtyDisplay = document.getElementById('pix-qty-display');\n            const qtyHint = document.getElementById('pix-qty-hint');\n            const qrContainer = document.getElementById('pix-qr-container');\n            const keyInput = document.getElementById('pix-key-value');\n            const totalEl = document.getElementById('pix-total-amount');\n            const usdEl = document.getElementById('pix-total-usd');\n            const tokenQtyEl = document.getElementById('pix-token-quantity');\n            const sellerEl = document.getElementById('pix-seller-info');\n            const pricePerEl = document.getElementById('pix-price-per-token');\n            const pixTokenIcon = document.getElementById('pix-token-icon');\n            const pixTokenName = document.getElementById('pix-token-name');\n\n            if (pixModal) pixModal.style.display = 'block';\n            if (qtyEditor) qtyEditor.style.display = 'flex';\n            if (qtyInput) qtyInput.value = String(qty);\n            if (qtyDisplay) qtyDisplay.textContent = String(qty) + ' ' + tokenSymbol;\n            if (qtyHint) qtyHint.textContent = 'Click GENERATE PIX to create the charge.';\n            if (qrContainer) qrContainer.innerHTML = '<div style=\"color:#666;text-align:center;padding:40px;\">Click GENERATE PIX to create the charge<\/div>';\n            if (keyInput) keyInput.value = '';\n            if (tokenQtyEl) tokenQtyEl.textContent = qty + ' ' + tokenSymbol;\n            if (totalEl) totalEl.textContent = 'R$ ' + totalBrlPreview.toFixed(2).replace('.', ',');\n            if (usdEl) usdEl.textContent = '$ ' + totalUsdtPreview.toFixed(2);\n            if (sellerEl) sellerEl.textContent = 'Pool de Liquidez';\n            if (pricePerEl) pricePerEl.textContent = '$' + checkPrice.toFixed(6) + ' \/ ' + tokenSymbol;\n\n            \/\/ Logo\/nome\n            if (order.logo_base64 && pixTokenIcon) {\n                const logo = order.logo_base64;\n                pixTokenIcon.src = logo.startsWith('data:image') ? logo : 'data:image\/png;base64,' + logo;\n                pixTokenIcon.alt = tokenSymbol;\n            } else if (order.logo_url && pixTokenIcon) {\n                pixTokenIcon.src = (order.logo_url.startsWith('http') ? '' : 'https:\/\/exchange.tlxfre.com') + order.logo_url;\n            }\n            if (pixTokenName) pixTokenName.textContent = tokenSymbol;\n\n            \/\/ Wire o bot\u00e3o GERAR PIX para o handler POOL (sobrescrevendo apenas durante este fluxo)\n            const btn = document.getElementById('pix-generate-btn');\n            if (!btn) { showDBError('PIX modal button missing'); return; }\n            const origHandler = btn.onclick;\n            btn.onclick = async function() {\n                btn.disabled = true; btn.textContent = 'GERANDO...';\n                if (qrContainer) qrContainer.innerHTML = '<div style=\"color:#666;text-align:center;padding:40px;\">Gerando cobran\u00e7a PIX...<\/div>';\n                try {\n                    const resp = await fetch(codexAjax.ajax_url, {\n                        method: 'POST',\n                        headers: { 'Content-Type': 'application\/x-www-form-urlencoded' },\n                        body: new URLSearchParams({\n                            action: 'codex_zyropay_pool_create',\n                            nonce: codexAjax.nonce,\n                            token_symbol: tokenSymbol,\n                            quantity: qty\n                        })\n                    });\n                    const result = await resp.json();\n                    console.log('[DirectBuy-PIX-POOL] response:', result);\n                    if (!result.success) {\n                        const msg = (result.data && result.data.message) || 'Failed to create PIX charge';\n                        if (qrContainer) qrContainer.innerHTML = '<div style=\"color:#c00;text-align:center;padding:40px;\">' + msg + '<\/div>';\n                        btn.disabled = false; btn.textContent = 'GERAR PIX';\n                        return;\n                    }\n                    const data = result.data;\n                    const externalId = data.externalId;\n                    const pixCode = data.pixCode;\n                    const valueBrl = parseFloat(data.brlValue);\n                    const totalUsdt = parseFloat(data.usdValue);\n                    const expiresIn = parseInt(data.expirationSeconds || 1800, 10);\n                    window._directBuyPixExternalId = externalId;\n\n                    if (qtyEditor) qtyEditor.style.display = 'none';\n                    if (totalEl) totalEl.textContent = 'R$ ' + valueBrl.toFixed(2).replace('.', ',');\n                    if (usdEl) usdEl.textContent = '$ ' + totalUsdt.toFixed(2);\n                    if (keyInput) keyInput.value = pixCode;\n\n                    \/\/ Renderizar QR\n                    if (qrContainer) qrContainer.innerHTML = '';\n                    if (typeof QRCode !== 'undefined' && qrContainer) {\n                        new QRCode(qrContainer, {\n                            text: pixCode, width: 220, height: 220,\n                            colorDark: '#000000', colorLight: '#ffffff',\n                            correctLevel: QRCode.CorrectLevel.M\n                        });\n                    } else if (qrContainer) {\n                        qrContainer.innerHTML = '<div style=\"color:red;\">QRCode library not loaded<\/div>';\n                    }\n\n                    \/\/ Polling status (reusa codex_zyropay_status)\n                    const pollUntil = Date.now() + (expiresIn * 1000) + 60000;\n                    if (window._directBuyPixPoll) clearInterval(window._directBuyPixPoll);\n                    window._directBuyPixPoll = setInterval(async () => {\n                        try {\n                            if (window._directBuyPixExternalId !== externalId) {\n                                clearInterval(window._directBuyPixPoll); window._directBuyPixPoll = null; return;\n                            }\n                            if (Date.now() > pollUntil) {\n                                clearInterval(window._directBuyPixPoll); window._directBuyPixPoll = null;\n                                if (typeof showCenterMessage === 'function') showCenterMessage('\u23f1\ufe0f PIX expired. Please try again.', 'warning', 5000);\n                                if (pixModal) pixModal.style.display = 'none';\n                                btn.onclick = origHandler; btn.disabled = false; btn.textContent = 'GERAR PIX';\n                                return;\n                            }\n                            const sr = await fetch(codexAjax.ajax_url + '?action=codex_zyropay_status&nonce=' + encodeURIComponent(codexAjax.nonce) + '&external_id=' + encodeURIComponent(externalId));\n                            const sj = await sr.json();\n                            if (!sj.success) return;\n                            const st = sj.data.status;\n                            console.log('[DirectBuy-PIX-POOL] poll status:', st);\n                            if (st === 'confirmed' || st === 'paid') {\n                                clearInterval(window._directBuyPixPoll); window._directBuyPixPoll = null; window._directBuyPixExternalId = null;\n                                if (typeof showCenterMessage === 'function') showCenterMessage('\u2705 Payment confirmed! Tokens credited.', 'success', 4000);\n                                if (pixModal) pixModal.style.display = 'none';\n                                btn.onclick = origHandler;\n                            } else if (st === 'expired' || st === 'canceled' || st === 'cancelled' || st === 'failed' || st === 'refunded') {\n                                clearInterval(window._directBuyPixPoll); window._directBuyPixPoll = null; window._directBuyPixExternalId = null;\n                                if (typeof showCenterMessage === 'function') showCenterMessage('\u274c Payment ' + st + '. Please try again.', 'error', 5000);\n                                if (pixModal) pixModal.style.display = 'none';\n                                btn.onclick = origHandler; btn.disabled = false; btn.textContent = 'GERAR PIX';\n                            }\n                        } catch (e) { console.warn('[DirectBuy-PIX-POOL] poll error:', e); }\n                    }, 5000);\n\n                } catch (e) {\n                    console.error('[DirectBuy-PIX-POOL] error:', e);\n                    if (qrContainer) qrContainer.innerHTML = '<div style=\"color:#c00;text-align:center;padding:40px;\">Erro: ' + (e.message || e) + '<\/div>';\n                    btn.disabled = false; btn.textContent = 'GERAR PIX';\n                }\n            };\n        };\n    })();\n    <\/script>\n\n\n\n<\/div>\n\n\n<!-- Modal de Compra -->\n<div id=\"purchase-modal\" class=\"modal\" style=\"display:none;\">\n    <div class=\"modal-overlay\"><\/div>\n    <div class=\"modal-container\">\n        <button class=\"modal-close\">&times;<\/button>\n\n        <div class=\"modal-header\">\n            <!-- Token Section (Logo + Nome) -->\n            <div class=\"purchase-token-section\">\n                <img decoding=\"async\" id=\"purchase-token-icon\" class=\"purchase-token-icon\" src=\"\" alt=\"\">\n                <div>\n                    <h2 id=\"purchase-token-title\">Purchase Token<\/h2>\n                    <span id=\"purchase-token-symbol\" class=\"purchase-token-symbol\"><\/span>\n                <\/div>\n            <\/div>\n        <\/div>\n\n        <div class=\"modal-body\">\n            <div class=\"purchase-details\">\n                <div class=\"detail-row\">\n                    <label>Quantity:<\/label>\n                    <span id=\"purchase-quantity-display\">0<\/span>\n                <\/div>\n                <div class=\"detail-row\">\n                    <label>Price (USDT):<\/label>\n                    <span id=\"purchase-price-usdt\">$0.00<\/span>\n                <\/div>\n                <div class=\"detail-row\" style=\"display:none\"><!-- BNB removed -->\n                    <label>Price (BNB):<\/label>\n                    <span id=\"purchase-price-bnb\">0.000 BNB<\/span>\n                <\/div>\n                <div class=\"detail-row\">\n                    <label>Total (USDT):<\/label>\n                    <span id=\"purchase-total-usdt\">$0.00<\/span>\n                <\/div>\n                <div class=\"detail-row\" style=\"display:none\"><!-- BNB removed -->\n                    <label>Total (BNB):<\/label>\n                    <span id=\"purchase-total-bnb\">0.000 BNB<\/span>\n                <\/div>\n                <div class=\"detail-row\">\n                    <label>Fee (0.5%):<\/label>\n                    <span id=\"purchase-fee\">$0.00 \/ 0.000 BNB<\/span>\n                <\/div>\n                <div class=\"detail-row total-row\">\n                    <label>Total with fee:<\/label>\n                    <div>\n                        <div id=\"purchase-total-with-fee-usdt\">$0.00 USDT<\/div>\n                        <div id=\"purchase-total-with-fee-bnb\" style=\"display:none\">0.000 BNB<\/div><!-- BNB removed -->\n                    <\/div>\n                <\/div>\n            <\/div>\n\n            <div class=\"payment-buttons\">\n                <button id=\"confirm-metamask-purchase\" class=\"buy-btn-large buy-metamask\" >\n                    <img loading=\"lazy\" decoding=\"async\" src=\"\/wp-content\/plugins\/codex-integration\/assets\/images\/payment\/metamask.png\" alt=\"MetaMask\" width=\"24\" height=\"24\">\n                    Pay with MetaMask\n                <\/button>\n                <button id=\"confirm-pix-purchase\" class=\"buy-btn-large buy-pix\" >\n                    <img loading=\"lazy\" decoding=\"async\" src=\"\/wp-content\/plugins\/codex-integration\/assets\/images\/payment\/pix.png\" alt=\"PIX\" width=\"24\" height=\"24\">\n                    Pay with PIX\n                <\/button>\n            <\/div>\n        <\/div>\n    <\/div>\n<\/div>\n\n<!-- Modal PIX Payment -->\n<div id=\"pix-modal\" class=\"modal\" style=\"display:none;\">\n    <div class=\"modal-overlay\"><\/div>\n    <div class=\"modal-container pix-container\">\n        <div class=\"modal-body pix-modal-flex\">\n            <!-- Coluna Esquerda: Header + Informa\u00e7\u00f5es -->\n            <div class=\"pix-left-section\">\n                <div class=\"modal-header\">\n                    <img decoding=\"async\" src=\"https:\/\/exchange.tlxfre.com\/icones\/xys_exchange.png\" alt=\"TLX Exchange\" class=\"modal-logo\">\n                    <h2>exchange<\/h2>\n                    <p>PIX Payment<\/p>\n                <\/div>\n\n                <!-- Token Section -->\n                <div class=\"pix-coin-section\">\n                    <img decoding=\"async\" id=\"pix-token-icon\" class=\"pix-coin-icon\" src=\"\" alt=\"\">\n                    <div class=\"pix-coin-name\" id=\"pix-token-name\"><\/div>\n                <\/div>\n\n                <!-- Payment Information -->\n                <div class=\"pix-info-section\">\n                    <!-- ZyroPay: quantity editor (visible before QR generation) -->\n                    <div class=\"info-row\" id=\"pix-qty-editor\" style=\"display:none; flex-direction:column; align-items:stretch; gap:6px;\">\n                        <label style=\"font-size:12px; color:#EAECEF;\"><span class=\"i18n\" data-pt=\"Quantidade:\" data-en=\"Amount to buy:\" data-es=\"Cantidad:\">Amount to buy:<\/span><\/label>\n                        <div style=\"display:flex; gap:8px; align-items:center;\">\n                            <div id=\"pix-qty-display\" style=\"flex:1; padding:10px 12px; background:#1a1a2e; border:1px solid #444; border-radius:4px; font-size:16px; font-weight:700; color:#fff; text-align:center; min-height:20px;\">&nbsp;<\/div>\n                            <input type=\"hidden\" id=\"pix-qty-input\" \/>\n                            <button type=\"button\" id=\"pix-generate-btn\" class=\"btn-fechar-pix\" style=\"padding:10px 14px; white-space:nowrap;\"><span class=\"i18n\" data-pt=\"GERAR PIX\" data-en=\"GENERATE PIX\" data-es=\"GENERAR PIX\">GENERATE PIX<\/span><\/button>\n                        <\/div>\n                        <div id=\"pix-qty-hint\" style=\"font-size:11px; color:#848E9C;\"><\/div>\n                    <\/div>\n                    <div class=\"info-row\">\n                        <label><span class=\"i18n\" data-pt=\"Valor a Pagar:\" data-en=\"Amount to Pay:\" data-es=\"Monto a Pagar:\">Amount to Pay:<\/span><\/label>\n                        <div style=\"display: flex; flex-direction: column; align-items: flex-end;\">\n                            <span id=\"pix-total-amount\" class=\"value-display\">R$ 0,00<\/span>\n                            <span id=\"pix-total-usd\" class=\"value-display-secondary\">$ 0.00<\/span>\n                        <\/div>\n                    <\/div>\n                    <div class=\"info-row\">\n                        <label><span class=\"i18n\" data-pt=\"Quantidade de Tokens:\" data-en=\"Token Quantity:\" data-es=\"Cantidad de Tokens:\">Token Quantity:<\/span><\/label>\n                        <span id=\"pix-token-quantity\" class=\"value-display\">0 TOKEN<\/span>\n                    <\/div>\n                    <div class=\"info-row\">\n                        <label><span class=\"i18n\" data-pt=\"Pre\u00e7o por Token:\" data-en=\"Price per Token:\" data-es=\"Precio por Token:\">Price per Token:<\/span><\/label>\n                        <span id=\"pix-price-per-token\" class=\"value-display\">$0.00<\/span>\n                    <\/div>\n                    <div class=\"info-row\">\n                        <label><span class=\"i18n\" data-pt=\"Vendedor:\" data-en=\"Seller:\" data-es=\"Vendedor:\">Seller:<\/span><\/label>\n                        <span id=\"pix-seller-info\" class=\"value-display\">\u2014<\/span>\n                    <\/div>\n                    <div style=\"margin-top:10px; padding:8px 10px; background:#3a2a0a; border:1px solid #b07a1a; border-radius:6px; color:#FFD37A; font-size:12px; line-height:1.4; text-align:center;\">\n                        <span class=\"i18n\" data-pt=\"\u23f1 O PIX expira em 30 minutos. Se o pagamento n\u00e3o for feito, a ordem ser\u00e1 descartada automaticamente.\" data-en=\"\u23f1 The PIX expires in 30 minutes. If payment is not made, the order will be automatically discarded.\" data-es=\"\u23f1 El PIX expira en 30 minutos. Si el pago no se realiza, la orden ser\u00e1 descartada autom\u00e1ticamente.\">\u23f1 The PIX expires in 30 minutes. If payment is not made, the order will be automatically discarded.<\/span>\n                    <\/div>\n                <\/div>\n            <\/div>\n\n            <!-- Right Column: QR Code + Key + Button -->\n            <div class=\"pix-right-section\">\n                <!-- QR Code -->\n                <div id=\"pix-qr-container\" class=\"pix-qr-section\">\n                    <!-- QR Code will be generated here -->\n                <\/div>\n\n                <!-- PIX Copy & Paste -->\n                <div class=\"pix-key-section\">\n                    <label><span class=\"i18n\" data-pt=\"PIX Copia e Cola:\" data-en=\"PIX Copy and Paste:\" data-es=\"PIX Copiar y Pegar:\">PIX Copy and Paste:<\/span><\/label>\n                    <div class=\"pix-key-display\">\n                        <input type=\"text\" id=\"pix-key-value\" readonly onclick=\"this.select(); copyPixKey();\" style=\"cursor:pointer;\" title=\"Click to copy\">\n                        <button class=\"copy-btn\" onclick=\"copyPixKey()\">Copy<\/button>\n                    <\/div>\n                    <div style=\"font-size:11px; color:#848E9C; margin-top:6px; text-align:center;\">\n                        <span class=\"i18n\" data-pt=\"Abra o app do seu banco \u2192 PIX \u2192 Copia e Cola \u2192 cole o c\u00f3digo acima\" data-en=\"Open your bank app \u2192 PIX \u2192 Copy and Paste \u2192 paste the code above\" data-es=\"Abra la app de su banco \u2192 PIX \u2192 Copiar y Pegar \u2192 pegue el c\u00f3digo arriba\">Open your bank app \u2192 PIX \u2192 Copy and Paste \u2192 paste the code above<\/span>\n                    <\/div>\n                <\/div>\n\n                <!-- Action Buttons -->\n                <div class=\"pix-buttons-container\" style=\"display: flex; gap: 10px; margin-top: 15px;\">\n                    <button class=\"btn-fechar-pix\" onclick=\"closePixModal()\">CLOSE<\/button>\n                <\/div>\n            <\/div>\n        <\/div>\n    <\/div>\n<\/div>\n\n<!-- Login Modal -->\n<div id=\"login-modal\" class=\"modal\" style=\"display:none;\">\n    <div class=\"modal-overlay\"><\/div>\n    <div class=\"modal-container\">\n        <button class=\"modal-close\">&times;<\/button>\n\n        <div class=\"modal-header\">\n            <img decoding=\"async\" src=\"https:\/\/exchange.tlxfre.com\/icones\/xys_exchange.png\" alt=\"TLX Exchange\" class=\"modal-logo\">\n            <h2>exchange<\/h2>\n            <p>Access your account<\/p>\n        <\/div>\n\n        <div class=\"modal-body\">\n            <form id=\"login-form\" autocomplete=\"off\">\n                <div class=\"form-group\">\n                    <label for=\"login\">Login<\/label>\n                    <input type=\"text\" id=\"login\" name=\"Login\" autocomplete=\"off\" readonly onfocus=\"this.removeAttribute('readonly')\" required>\n                <\/div>\n\n                <div class=\"form-group\">\n                    <label for=\"password\">Password<\/label>\n                    <input type=\"password\" id=\"password\" name=\"Senha\" autocomplete=\"current-password\" readonly onfocus=\"this.removeAttribute('readonly')\" required>\n                <\/div>\n\n                <div id=\"login-error\" class=\"login-error-message\" style=\"display:none;\"><\/div>\n\n                <button type=\"submit\" class=\"btn-login\">LOGIN<\/button>\n            <\/form>\n            <div style=\"text-align:center;margin-top:16px;padding-top:12px;border-top:1px solid rgba(255,255,255,0.1);\">\n                <span style=\"color:#848E9C;font-size:13px;\">Don't have an account?<\/span>\n                <a href=\"https:\/\/exchange.tlxfre.com\" target=\"_blank\" style=\"color:#FCD535;font-size:13px;font-weight:600;text-decoration:none;margin-left:6px;\">Register here \u2192<\/a>\n            <\/div>\n        <\/div>\n    <\/div>\n<\/div>\n\n<script>\n\/\/ Immediate test to check if JavaScript is working\nconsole.log('\ud83d\udd34 MARKETPLACE PAGE LOADED - JavaScript is executing');\n\n\/\/ Function to open auth modal\nwindow.openAuthModal = function(tab) {\n    console.log('Opening auth modal, tab:', tab);\n    $('#login-modal').show();\n    \/\/ You can add tab switching logic here if needed\n}\n\n\/\/ Close modal handlers\n$(document).ready(function() {\n    $('.modal-close, .modal-overlay').on('click', function() { if ($(this).closest('#pix-modal').length) return;\n        $(this).closest('.modal').hide();\n    });\n});\n\n\/\/ Check if buyWithPIX exists after page load\ndocument.addEventListener('DOMContentLoaded', function() {\n    console.log('\ud83d\udfe2 DOM Loaded - Checking functions...');\n    console.log('   buyWithPIX exists:', typeof window.buyWithPIX);\n    console.log('   jQuery exists:', typeof jQuery);\n    console.log('   $ exists:', typeof $);\n\n    \/\/ Count PIX buttons\n    setTimeout(function() {\n        const pixButtons = document.querySelectorAll('.buy-pix');\n        console.log('\ud83d\udd0d PIX buttons found on page:', pixButtons.length);\n\n        if (pixButtons.length === 0) {\n            console.log('\u274c NO PIX BUTTONS FOUND - Checking panels...');\n            const panels = document.querySelectorAll('.token-details-panel');\n            console.log('   Panels found:', panels.length);\n        }\n    }, 2000);\n});\n\n\/\/ Test inline function\nwindow.testInlinePixButton = function() {\n    console.log('\u2705 Inline test function works!');\n    if (typeof window.buyWithPIX === 'function') {\n        console.log('Calling buyWithPIX...');\n        window.buyWithPIX(\"TEST\", \"TEST\", \"1\", \"1\");\n    } else {\n        console.log('\u274c buyWithPIX not defined yet');\n    }\n};\n\nconsole.log('Execute testInlinePixButton() to test');\n\n\/\/ ========== FEE COLLECTOR DISTRIBUTION ==========\nconst FEE_COLLECTOR_CONTRACT = '0x6b05eb10dC7eefcBe2063F510E1F2f1c87112c1E';\nconst ADMIN_WALLET = '0x25d31f4a7db62aA25C8285A0f6FED03Ae3E9aF15';\nconst DISTRIBUTE_DATA = '0x8b9a0ddc0000000000000000000000000000000000000000000000000000000000000000';\n\n\/\/ Show panel only if admin is connected\nasync function checkAdminAndShowPanel() {\n    try {\n        \/\/ Verificar login via WordPress AJAX\n        const ajaxUrl = (typeof codexAjax !== 'undefined' && codexAjax.ajax_url)\n            ? codexAjax.ajax_url\n            : '\/wp-admin\/admin-ajax.php';\n        const nonce = (typeof codexAjax !== 'undefined' && codexAjax.nonce)\n            ? codexAjax.nonce\n            : '';\n        const resp = await fetch(ajaxUrl + '?action=codex_check_login&nonce=' + nonce);\n        const data = await resp.json();\n        console.log('[FeePanel] check_login response:', JSON.stringify(data));\n        if (data.success && data.data && data.data.logged_in) {\n            const uid = parseInt(data.data.user_id) || 0;\n            console.log('[FeePanel] user_id:', uid);\n            if (uid == 1000 || uid == 1000000) {\n                document.getElementById('fee-collector-panel').style.display = 'block';\n                refreshFeeCollector();\n                return;\n            }\n        }\n        \/\/ Fallback: verificar MetaMask\n        if (window.ethereum) {\n            const accounts = await window.ethereum.request({ method: 'eth_accounts' });\n            if (accounts.length > 0 && accounts[0].toLowerCase() === ADMIN_WALLET.toLowerCase()) {\n                document.getElementById('fee-collector-panel').style.display = 'block';\n                refreshFeeCollector();\n            }\n        }\n    } catch(e) { console.log('[FeePanel] checkAdmin error:', e.message); }\n}\n\n\/\/ Also check on account change\n\/\/ Painel admin controlado por WordPress user ID (nao MetaMask)\n\nasync function refreshFeeCollector() {\n    const statusEl = document.getElementById('fc-status');\n    statusEl.textContent = 'Querying contract...';\n    try {\n        const rpcUrl = 'https:\/\/bsc-dataseed.binance.org\/';\n\n        \/\/ Get balance\n        const balResp = await fetch(rpcUrl, {\n            method: 'POST',\n            headers: {'Content-Type': 'application\/json'},\n            body: JSON.stringify({jsonrpc:'2.0', method:'eth_getBalance', params:[FEE_COLLECTOR_CONTRACT, 'latest'], id:1})\n        });\n        const balData = await balResp.json();\n        const balBNB = Number(BigInt(balData.result)) \/ 1e18;\n\n        \/\/ Get BNB price from page data or fetch\n        let bnbPrice = 600; \/\/ fallback\n        try {\n            const priceResp = await fetch(rpcUrl, {\n                method: 'POST',\n                headers: {'Content-Type': 'application\/json'},\n                body: JSON.stringify({jsonrpc:'2.0', method:'eth_call', params:[{\n                    to: '0x0567F2323251f0Aab15c8dFb1967E4e8A7D42aeE', \/\/ Chainlink BNB\/USD\n                    data: '0x50d25bcd' \/\/ latestAnswer()\n                }, 'latest'], id:2})\n            });\n            const priceData = await priceResp.json();\n            if (priceData.result) {\n                bnbPrice = Number(BigInt(priceData.result)) \/ 1e8;\n            }\n        } catch(e) {}\n\n        \/\/ Get distribution count\n        const countResp = await fetch(rpcUrl, {\n            method: 'POST',\n            headers: {'Content-Type': 'application\/json'},\n            body: JSON.stringify({jsonrpc:'2.0', method:'eth_call', params:[{to: FEE_COLLECTOR_CONTRACT, data: '0x82c82f99'}, 'latest'], id:3})\n        });\n        const countData = await countResp.json();\n        const distCount = countData.result ? Number(BigInt(countData.result)) : 0;\n\n        document.getElementById('fc-pending-bnb').textContent = balBNB.toFixed(6) + ' BNB';\n        document.getElementById('fc-pending-usd').textContent = ' + (balBNB * bnbPrice).toFixed(2);\n        document.getElementById('fc-dist-count').textContent = distCount.toString();\n\n        if (balBNB > 0) {\n            statusEl.innerHTML = '<span style=\"color: #FCD535;\">BNB pending distribution (90% TLX \/ 10% Dev)<\/span>';\n            document.getElementById('fc-distribute-btn').style.opacity = '1';\n            document.getElementById('fc-distribute-btn').disabled = false;\n        } else {\n            statusEl.innerHTML = '<span style=\"color: #0ECB81;\">No pending balance<\/span>';\n            document.getElementById('fc-distribute-btn').style.opacity = '0.5';\n            document.getElementById('fc-distribute-btn').disabled = true;\n        }\n    } catch(e) {\n        statusEl.textContent = 'Error: ' + e.message;\n    }\n}\n\nasync function distributeFeeCollector() {\n    const statusEl = document.getElementById('fc-status');\n    const btn = document.getElementById('fc-distribute-btn');\n\n    try {\n        btn.innerHTML = 'Distributing...';\n        btn.disabled = true;\n        statusEl.textContent = 'Sending distribution via backend...';\n\n        const baseUrl = window.location.origin;\n        const response = await fetch(baseUrl + '\/api\/tokens\/admin\/distribute', {\n            method: 'GET',\n            headers: {'Content-Type': 'application\/json'}\n        });\n\n        const result = await response.json();\n\n        if (result.distributed) {\n            statusEl.innerHTML = '<span style=\"color: #0ECB81;\">Distribution completed! ' +\n                result.balanceBNB.toFixed(6) + ' BNB (90% TLX \/ 10% Dev). TX: <a href=\"https:\/\/bscscan.com\/tx\/' +\n                result.txHash + '\" target=\"_blank\" style=\"color: #FCD535;\">' +\n                result.txHash.substring(0, 20) + '...<\/a><\/span>';\n            setTimeout(refreshFeeCollector, 3000);\n        } else if (result.error === 'already_distributing') {\n            statusEl.innerHTML = '<span style=\"color: #FCD535;\">Distribution already in progress...<\/span>';\n        } else if (result.error && result.error.startsWith('admin_no_gas')) {\n            statusEl.innerHTML = '<span style=\"color: #F6465D;\">Admin has no BNB for gas! ' + result.error + '<\/span>';\n        } else if (!result.error && !result.distributed) {\n            statusEl.innerHTML = '<span style=\"color: #0ECB81;\">No pending balance to distribute<\/span>';\n        } else {\n            statusEl.innerHTML = '<span style=\"color: #F6465D;\">Error: ' + (result.error || 'unknown') + '<\/span>';\n        }\n    } catch(e) {\n        statusEl.innerHTML = '<span style=\"color: #F6465D;\">Error: ' + e.message + '<\/span>';\n    } finally {\n        btn.innerHTML = 'Distribute 90\/10';\n        btn.disabled = false;\n    }\n}\n\n\/\/ Check on page load\nsetTimeout(checkAdminAndShowPanel, 2000);\n\/\/ Also check when MetaMask connects during purchase flow\nwindow.addEventListener('focus', function() { setTimeout(checkAdminAndShowPanel, 500); });\n<\/script>\n<script>\n\/\/ Show logged-in user on page load\n(async function showLoggedUser() {\n    try {\n        const ajaxUrl = (typeof codexAjax !== 'undefined' && codexAjax.ajax_url)\n            ? codexAjax.ajax_url : '\/wp-admin\/admin-ajax.php';\n        const nonce = (typeof codexAjax !== 'undefined' && codexAjax.nonce)\n            ? codexAjax.nonce : '';\n        const resp = await fetch(ajaxUrl + '?action=codex_check_login&nonce=' + nonce);\n        const data = await resp.json();\n        if (data.success && data.data && data.data.logged_in && data.data.user_login) {\n            document.getElementById('logged-user-name').textContent = data.data.user_login;\n            document.getElementById('logged-user-bar').style.display = 'flex';\n        }\n    } catch(e) { console.log('[UserBar] error:', e.message); }\n})();\n\nfunction codexLogout() {\n    if (typeof codexAjax !== 'undefined' && codexAjax.ajax_url) {\n        fetch(codexAjax.ajax_url, {\n            method: 'POST',\n            headers: {'Content-Type': 'application\/x-www-form-urlencoded'},\n            body: 'action=codex_logout&nonce=' + (codexAjax.nonce || '')\n        }).then(() => { window.location.reload(); });\n    } else {\n        window.location.reload();\n    }\n}\n<\/script>\n\n<script>\n(function(){\n    \/\/ Remove page-title-block inline background\n    var ptb = document.querySelector('.page-title-block');\n    if(ptb){\n        ptb.style.backgroundImage = 'none';\n        ptb.style.backgroundColor = 'transparent';\n    }\n    \/\/ Remove footer background colors  \n    var els = document.querySelectorAll('#colophon, #footer-nav, .site-footer');\n    els.forEach(function(el){\n        el.style.backgroundColor = '#0B0E11';\n        el.style.backgroundImage = 'none';\n    });\n})();\n<\/script>\n<script>\n(function(){\n    function getPageLang() {\n        try {\n            var m = document.cookie.match(\/(?:^|; )codex_lang=([^;]+)\/);\n            if (m && m[1]) return m[1].toLowerCase().split(\/[-_]\/)[0];\n            if (window.codexLanguageSwitcher && window.codexLanguageSwitcher.currentLang) return window.codexLanguageSwitcher.currentLang.toLowerCase().split(\/[-_]\/)[0];\n            var h = (document.documentElement.lang || '').toLowerCase();\n            if (h.indexOf('pt') === 0) return 'pt';\n            if (h.indexOf('es') === 0) return 'es';\n            if (h.indexOf('fr') === 0) return 'fr';\n            if (h.indexOf('it') === 0) return 'it';\n            if (h.indexOf('de') === 0) return 'de';\n        } catch(e) {}\n        return 'en';\n    }\n    function applyI18n() {\n        var lang = getPageLang();\n        document.querySelectorAll('.i18n').forEach(function(el) {\n            var text = el.getAttribute('data-' + lang);\n            if (!text) text = el.getAttribute('data-en');\n            if (text && el.textContent !== text) el.textContent = text;\n        });\n    }\n    if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', applyI18n);\n    else applyI18n();\n    setTimeout(applyI18n, 2000);\n    setTimeout(applyI18n, 5000);\n})();\n<\/script>\n\r\n","protected":false},"excerpt":{"rendered":"0 Active Tokens 0 Sell Orders \ud83d\udc64 Logged in as: Logout Fee Collector Contract Pending BNB -- USD Value --...","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-3403","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/xysexchange.com\/pt\/wp-json\/wp\/v2\/pages\/3403","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xysexchange.com\/pt\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/xysexchange.com\/pt\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/xysexchange.com\/pt\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xysexchange.com\/pt\/wp-json\/wp\/v2\/comments?post=3403"}],"version-history":[{"count":2,"href":"https:\/\/xysexchange.com\/pt\/wp-json\/wp\/v2\/pages\/3403\/revisions"}],"predecessor-version":[{"id":3620,"href":"https:\/\/xysexchange.com\/pt\/wp-json\/wp\/v2\/pages\/3403\/revisions\/3620"}],"wp:attachment":[{"href":"https:\/\/xysexchange.com\/pt\/wp-json\/wp\/v2\/media?parent=3403"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}