Hold down the Shift key as you drag a component to move a whole subtree - that is, the selected component and everything linked to it to the right.
An empty socket will highlight green if you can move the selected component to that location. The cursor will show a crossed-out socket if it cannot be moved to that location. Components cannot be moved past any component it is linked to, to the left or right. If you are moving a subtree, there must be enough room for the whole subtree as it currently appears.