Rotation clamp not working

Hello all,

I have been trying for hours and I still have not figured out how to clamp the visor so that the camera will not be able to do a full 360 degree turn. Here is my code:

using System;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.InputSystem;

public class Player : MonoBehaviour
{
    /*Things player needs:
    - Movement speed
    - Crouch
    - Prone
    - Interact
    - Drag and Drop
    - Pick up
    */
    // Start is called once before the first execution of Update after the MonoBehaviour is created
    Vector2 movementInput;

    Vector2 lookInput;

    [SerializeField] float movementSpeed = 5f;

    [SerializeField] float viewSpeed = 2f;

    [SerializeField] bool isInverted = false;

    GameObject visor;

    private float xRotation = 0f;

    private float yRotation = 0f;

    Rigidbody rb;

    void OnMove(InputValue value)
    {
        movementInput = value.Get<Vector2>();
    }

    void OnLook(InputValue value)
    {
        xRotation = value.Get<Vector2>().x;
        yRotation = value.Get<Vector2>().y;
    }

    void Start()
    {
        visor = GameObject.Find("Visor");
        rb = GetComponent<Rigidbody>();
    }

    // Update is called once per frame
    void Update()
    {
        //Movement

        transform.Translate(new Vector3(movementInput.x, 0, movementInput.y) * movementSpeed * Time.fixedDeltaTime);

        //Aiming
        transform.Rotate(Vector3.up * xRotation * viewSpeed * Time.fixedDeltaTime);


        if(isInverted)
            visor.transform.Rotate(Vector3.right * -yRotation * viewSpeed * Time.fixedDeltaTime);
        else{
            visor.transform.Rotate(Vector3.left * yRotation * viewSpeed * Time.fixedDeltaTime);
        }
        
    }
}

To note I have been trying to use the clamping method and no matter how I do it it gives me varying results.