The zero set of a trigonometric polynomial $P$ in 3 variables $x,y,z$ is a two-dimensional manifold which we view as being inside the torus $\mathbb T^3$. For example, here is the zero set of $P(x,y,z) = \cos(2\pi x) + 2\sin(2\pi 2y) - 3\cos(2\pi z) + \cos(2\pi y)$, which I plotted in Mathematica:

My goal is to prove the following:
Proposition. The amount of connected components in the intersection of the above zero set and any plane is bounded by $O(D^2)$ where $D = \deg P$. (*)
For example, in the above picture we can clearly see the intersection of the zero set with a plane (the transparent plane with the black frame "near us"). This intersection seems to have 4 components but they are actually 1 component because we're in the torus.
I am not familiar with algebraic geometry and Bézout's inequality, so I ran into some problems trying to prove this.
First question: I tried to follow an approach where the trigonometric polynomial $P$ is converted to a regular polynomial in 6 variables by introducing $c_x = \cos(2\pi x)$, $s_x = \sin(2\pi x)$ and similarly with $y,z$, with the conditions $c_x^2 + s_x^2 = 1$ and similarly with $y,z$. However, it is unclear to me now how to intersect it with a plane, which takes the form $Ax + By + Cz = D$ in the "old" variables and not something in the "new" variables. Maybe if $A,B,C$ are integers then this can be converted to a trigonometric polynomial by taking a cosine or something, but they might not be integers.
Second question: Okay, forget the intersection with a plane for a minute. Can Bézout's inequality be used to bound the number of components of the entire zero set by, let's say, $O(D^3)$? The formulation I've seen of Bézout's inequality counts the number of points in a finite set of points, but here there are 4 equations on 6 variables and the set is 2-dimensional, and I want to count components, not points.
(*) I am generally interested in $d \ge 3$ variables and then it should be $O(D\,^{d-1})$, but for the sake of the question and the ability to draw pictures, it suffices to assume $d = 3$.
Edit - I think I know how to answer the second question:
In the interior of each connected component of the zero set of $P$ there is a minimum or maximum point of $P$ and this must be a critical point, so the number of components is bounded by the number of critical points.
Counting the critical points: We get 3 equations from $c_x^2 + s_x^2 = 1$ (and similarly for $y,z$), and 3 equations from $\frac {\partial P}{\partial x} = 0$ (and similarly for $y,z$) which are polynomials of degree less than $D$ in $c_x, s_x, \ldots$.
These are 6 equations in 6 variables of which 3 are degree 2 and 3 are degree $O(D)$, and critical points are always isolated, so their number may be bounded using Bézout's inequality by $O(D^3)$.
Could you please tell me if my answer is correct or if I made a mistake in using Bézout's inequality? (And how to answer the first question?)
Unless I made a mistake, I answered my second question in the edit I made yesterday, and I since discovered that the embedding of the torus in the 6-dimensional space is related to something called the Clifford torus.
About the first question, I "solved" it by changing my approach to my bigger problem (not described here) in which this is a sub-problem:
Instead of counting the intersections between the zero set and a 2-dimensional plane before making the "Clifford" transformation to 6 dimensions, I first transform to 6 dimensions and then intersect with a 5-dimensional hyperplane. This is much better suited for using Bézout's inequality, because it yields a simple degree-1 algebraic equation, $(c_x, s_x, c_y, s_y, c_z, s_z) \cdot v = 0$ where $v$ is some vector perpendicular to the hyperplane.