<% if (pagination && pagination.totalPages > 1) { %>
   <div style="display:flex; justify-content:center; gap:8px; margin-top:30px; flex-wrap:wrap;">
      <% const buildUrl = (p) => {
         const params = new URLSearchParams(Object.assign({}, typeof filters !== 'undefined' ? filters : {}));
         params.set('page', p);
         return baseUrl + '?' + params.toString();
      }; %>
      <% if (pagination.page > 1) { %>
         <a href="<%= buildUrl(pagination.page - 1) %>" class="tp-btn" style="padding:8px 16px; font-size:13px;">&laquo; Prev</a>
      <% } %>
      <% for (let p = 1; p <= pagination.totalPages; p++) { %>
         <a
            href="<%= buildUrl(p) %>"
            style="display:inline-flex; align-items:center; justify-content:center; width:36px; height:36px; border-radius:6px; border:1px solid #eee; font-size:13px; <%= p === pagination.page ? 'background:#DC2626; color:#fff; border-color:#DC2626;' : 'color:#333;' %>"
         ><%= p %></a>
      <% } %>
      <% if (pagination.page < pagination.totalPages) { %>
         <a href="<%= buildUrl(pagination.page + 1) %>" class="tp-btn" style="padding:8px 16px; font-size:13px;">Next &raquo;</a>
      <% } %>
   </div>
<% } %>
