Limit transform position

I have next setup:
-GameObject
– Camera

I have a script attached to this GameObject.
And I have this code, that I use to move Camera.

var vertical = -_touchDelta.y * Time.deltaTime;
_cameraTransform.position += _cameraTransform.forward * vertical;

Basically, I move Camera using its transform.forward (because camera is rotated). So object moves along Y and Z axis. It’s a zoom feature for my camera.

Now, how can I limit this movement to min/max?

Assuming Camera is a child gameobject of ‘GameObject’ you can do your translations using localPosition which will allow you to keep a reference position for min/max