The 2D fourier-cosine series on $(-\pi,\pi)\times(-\pi,\pi)$ is given by \begin{equation*} f(x_1,x_2) = \sum_{n_1=0}^{\infty} \sum_{n_2=0}^{\infty} a_{n_1,n_2} \cos(n_1x_1)\cos(n_2x_2) \end{equation*} with \begin{equation*} a_{n_1,n_2} = \frac{1}{\pi^2}\int_{-\pi}^{\pi}\int_{-\pi}^{\pi} f(x_1,x_2) \cos(n_1x_1)\cos(n_2x_2) dx_1dx_2 \end{equation*} and where $a_{0,0}=\frac{1}{4}a_{0,0}$, $a_{n_1,0}=\frac{1}{2}a_{n_1,0}$ $\forall n_1\in\{1,2,\ldots\}$ and $a_{0,n_2}=\frac{1}{2}a_{0,n_2}$ $\forall n_2\in\{1,2,\ldots\}$ (re-using the coefficients for convenience).
The 3D version has the form \begin{equation*} f(x_1,x_2,x_3) = \sum_{n_1=0}^{\infty} \sum_{n_2=0}^{\infty} \sum_{n_3=0}^{\infty} a_{n_1,n_2,n_3} \cos(n_1x_1)\cos(n_2x_2)\cos(n_3x_3) \end{equation*} with \begin{equation*} a_{n_1,n_2,n_3} = \frac{1}{\pi^3}\int_{-\pi}^{\pi}\int_{-\pi}^{\pi}\int_{-\pi}^{\pi} f(x_1,x_2,x_3) \cos(n_1x_1)\cos(n_2x_2) \cos(n_3x_3)dx_1dx_2dx_3. \end{equation*} I am not sure of the coefficients when $n_1$ or $n_2$ or $n_3$ are zero. From the form of the 1D and 2D versions I guess that they are $a_{0,0,0}=\frac{1}{8}a_{0,0,0}$, $a_{n_1,0,0}=\frac{1}{2}a_{n_1,0,0}$ $\forall n_1\in\{1,2,\ldots\}$, $a_{0,n_2,0}=\frac{1}{2}a_{0,n_2,0}$ $\forall n_2\in\{1,2,\ldots\}$ and $a_{0,0,n_3}=\frac{1}{2}a_{0,0,n_3}$ $\forall n_3\in\{1,2,\ldots\}$. Is this correct? What is the general multidimensional form for the Fourier-cosine series?
I have looked for online references of the multidimensional case but can only find it in terms of the exponential Fourier series. Cheers...
EDIT. We also have $a_{0,n_2,n_3} = \frac{1}{4}a_{0,n_2,n_3}$ for $n_2,n_3\in\{1,2,\ldots\}$, $a_{n_1,0,n_3} = \frac{1}{4}a_{n_1,0,n_3}$ for $n_1,n_3\in\{1,2,\ldots\}$ and $a_{n_1,n_2,0} = \frac{1}{4}a_{n_1,n_2,0}$ for $n_1,n_3\in\{1,2,\ldots\}$ (see answer below).