  We give a $K$-theoretic and geometric interpretation for a generalized
weighted Ehrhart theory of a full-dimensional lattice polytope $P$, depending
on a given homogeneous polynomial function $\varphi$ on $P$, and with Laurent
polynomial weights $f_Q(y)\in \mathbb{Z}[y^{\pm 1}]$ associated to the faces $Q
\preceq P$ of the polytope. For this purpose, we calculate equivariant
$K$-theoretic Hodge-Chern classes of an equivariant mixed Hodge module
$\mathcal{M}$ on the toric variety $X_P$ associated to $P$ (defined via an
equivariant embedding of $X_P$ into an ambient smooth variety). For any integer
$\ell$, we introduce a corresponding equivariant Hodge $\chi_y$-polynomial
$\chi_y(X_P, \ell D_P; [\mathcal{M}])$, with $D_P$ the corresponding ample
Cartier divisor on $X_P$ (defined by the facet presentation of $P$). Motivic
properties of the Hodge-Chern classes are used to express this equivariant
Hodge polynomial in terms of weighted character sums fitting with a generalized
weighted Ehrhart theory. The equivariant Hodge polynomials are shown to satisfy
a reciprocity and purity formula fitting with the duality for equivariant mixed
Hodge modules, and implying the corresponding properties for the generalized
weighted Ehrhart polynomials. In the special case of the equivariant
intersection cohomology mixed Hodge module, with the weight function
corresponding to Stanley's $g$-function of the polar polytope of $P$, we
recover in geometric terms a recent combinatorial formula of
Beck--Gunnells--Materov.
