How to get distance from position to transform bounds

Hey guys, this has been bugging me for some days now. Quite new to Unity, and it is possible that I misunderstood some concepts, so bear with me, please :).

I am trying to script a camera so that it can orbit a transform and zoom in right to the edge. The focal point of the camera is the transform pivot.
The transform does not have the pivot right in the center, so I have to set the minimum distance of the camera as the max(distances between pivot and object bounds).

Is there any way to calculate this?

Do you use Renderer.bounds? Because it has center property which is the mesh’s geometrical center. So you could orbit around it with max(bounds.extents.x, bounds.extents.y, bounds.extents.x) radius.