Sticky header below product section

Hello to evryone, I’ve been trying to change my header for a certain product template. So far I’ve been able (using chat GPT and other shopify forum posts) to change the theme. The only problem I can’t solve is that the header now is below the product informations.

My procedure was:

  • Add an IF cycle to the theme.liquid to define the new header for the new template

  • Copy and past the basic header JSON and renaming it as said in the if cycle

I can’t find the problem because if I use the standard “header-group.json” file it remains on top, while if i create the “header-custom.json” file by copying and paste it goes under the product info while scrolling

(Header group first, header custom below)

It is just a css problem of z-index and margin.