Second click animation

Hello, I am relatively new to Webflow but have have been playing around for a bit. I’ve been trying to up my animation game, and I’ve done a lot on this little one-pager I built.

My issue is with the search icon. I can get it to expand out to show the search bar and then the “x” will close it, but on a second click, everything disappears. It looks like opacity is just 0 because when you hover over the section the cursor changes so it seems like the search bar is there, just not visible.

I’m quite stumped here and not sure why the second click is different than the first. Any help would be much appreciated.