Consider an infinite uniform surface current $\mathbf{K} = K\mathbf{\hat{x}}$ flowing over the xy plane. To find the magnetic field $\mathbf{B}$ it produces, I first argue that $\mathbf{B}$ must solely consist of a y component. To find this component, I consider an Amperian loop that is parallel to the yz plane and that extends an equal distance above and below the xy plane. Applying Ampere's law, I deduce that
$$2Bl = \mu_0I_{\text{enc}}$$
where l denotes the length of the loop in the y direction.
Here comes my question: how do I arrive at $I_{\text{enc}} = Kl$? By my logic, if I take $\mathbf{J}$ to represent the current flow, then $\mathbf{J} = 0$ for $x\neq 0$ and $K\mathbf{\hat{x}}$ for $x = 0$. Thus, since $I_{\text{enc}}$ is defined as the flow of $\mathbf{J}$ through the surface enclosed by the Amperian loop, and this latter quantity is 0, $I_{\text{enc}} = 0$.
I'm feel like I'm messing up something very basic.