The problem here is that you want the drop-down to "escape" its parent, while staying relative to it's parent. This is AFAIK not possible.
If you position the drop-down absolutely, you "bind" it to the nearest element with position: relative
in its direct parent chain, or if no such element to the html
element. There is a "trick" where if you do not provide any top/bottom/left/right
-values, the element will still position itself where it would have started if it was inline.
This is why when we remove the relatively positioned wrapper the absolutely positioned drop-down "escapes" the overflow-y: hidden;
value on .main
(because it attaches to the html
-element instead). This also means that its position will not be affected as long as the html-element is not being scrolled.
When you have a relatively positioned wrapper inside the .main
the drop-down gets cut off like anything else inside it.