The best way to judge the capacitive and inductive load
The most popular method to obtain harmonics from a signal is digital filtering. Most method use Fast Fourier Transformation (FFT). You can google it, because the theory is quite broad.

The discipline which covers transforming analogue to digital signals and use them later is called Digital Signal Processing (DSP). The literature in this topic is also broad, there are some free books available online (you may start with this one).

The main idea of this approach is to use Taylor series to obtain all harmonics, including DC component (the 0th harmonic). The highest harmonic one can measure is determined by sampling rate (see Shannon theorem).

You should convert samples of voltage and current to their complex form (see phasor) and divide one by another, so you can get the complex impedance, which is easy to calculate the angle. If the phase shift is the only thing you are interested in, you can just subtract the phase angles of voltage and current.

For any n-harmonic (for $$n \geq 1$$) the characteristic of load does not change. So for any capacitor, for any harmonic, current is always leading, and for any inductor the current is always lagging. There will be differences between the phase shifts for each harmonic. The reactance of an inductor, for n-th harmonic is $$X = n \omega L $$, while for a capacitor it is always $$X = \frac {1}{n \omega C}$$.

Because it is numerically easier to handle higher values than lower ones, you may check for each harmonic (for example first 10), for which one the voltage and current are the largest and then divide them. However, you should get correct results even for the 1st harmonic.

UPDATE

In your case the zero-cross method is not valid. In general, there is a possibility that each harmonic has different phase angle. If they are combined, there can be many zero crossings in a single period. You will not know which one crosses the zero in which moment, if you do not decompose them. You can also miss the zero crossing, for example there is large DC component (say 10 Volts), and low 1st harmonic (say 1 Volt). You will never get a zero-crossing in this case, but it is possible to measure the impedance for the 1st harmonic (and thus its angle).