Restricting Camera movement along the x axis

I’m using an orthographic camera which I control left and right movement like such:

void Update () {

//amount to move	
float amountToMove = Input.GetAxisRaw("Horizontal") * CameraSpeed * Time.deltaTime;

//move the camera
transform.Translate(Vector3.right * amountToMove);

}

I need to restrict the camera so it cannot move past certain point of the x axis. I tried using clampf but I can’t seem to get it to work. Any suggestions?

At the end of all that, do something like

transform.position = new Vector3(
Mathf.Clamp(transform.position.x, minimum, maximum), 
transform.position.y, transform.position.z);

where minimum and maxium are floats you defined earlier in the script.