With all the knowledge that I have secured reading about resonance, I know that delocalisation of pi electrons is possible only with the p orbitals being in the same plane.
So for two consecutive double bonds, the orbitals wouldn't be in the same plane. So there shouldn't be any hybridization, right? Like in $\ce{CO2}$, the O's are $Sp^2$ hybrids and C is sp, as per the structure, the three unhybridized p orbitals wouldn't be in the same plane, making it not possible to have resonance in it. But that isn't the case with it. It does have resonance structures in it. What am I missing?