Help with AABB Collision Logic

I’m trying to make a viewport frame act as a button. So I am deciding to use AABB collision. The issue is that I think I am getting the logic wrong. Here is my code. How do I fix my if statement?

mouse.Move:Connect(function()
	if script.Parent.InventoryBackground.Visible then
	for _, v in ipairs(script.Parent.InventoryBackground.InventoryContainer:GetDescendants()) do
		if v:IsA("ViewportFrame") then
			if v.Position.X.Offset < mouse.X and v.Position.X.Offset + v.Size.X.Offset > mouse.X and v.Position.Y.Offset < mouse.Y and v.Position.Y.Offset + v.Size.Y.Offset > mouse.Y then
				print("Over")
			end
		end
		end
	end
end)

Does this work?

local a = v.AbsolutePosition
local b = a + v.AbsoluteSize
if (mouse.X > a.X and mouse.X < b.X and mouse.Y > a.Y and mouse.Y < b.Y) then
	print("Over")
end

collide

I decided to use InputBegan instead, sorry.