/* =========================================================
   CAREKA DIGITAL — V48 HEADER FIXO NO TOPO
   Mantém o padrão visual aprovado e corrige fixação/offset global.
   ========================================================= */
:root{
  --ck-fixed-header-top-gap:clamp(8px,1vw,16px);
  --ck-fixed-header-bottom-gap:clamp(12px,1.4vw,24px);
  --ck-fixed-header-shell-height:clamp(76px,5.2vw,104px);
  --ck-fixed-header-offset:calc(var(--ck-fixed-header-top-gap) + var(--ck-fixed-header-shell-height) + var(--ck-fixed-header-bottom-gap));
}

html{
  scroll-padding-top:calc(var(--ck-fixed-header-offset) + 18px)!important;
}

body{
  padding-top:var(--ck-fixed-header-offset)!important;
}

body.menu-open{
  padding-top:var(--ck-fixed-header-offset)!important;
}

.topbar,
.blogEditorial .topbar,
.ckOfficialHeader{
  position:fixed!important;
  top:0!important;
  left:0!important;
  right:0!important;
  width:100%!important;
  z-index:1000!important;
  padding:var(--ck-fixed-header-top-gap) 0 0!important;
  margin:0!important;
  background:linear-gradient(180deg,rgba(5,8,13,.88),rgba(5,8,13,.34) 72%,transparent)!important;
  -webkit-backdrop-filter:blur(10px)!important;
  backdrop-filter:blur(10px)!important;
  transform:translateZ(0)!important;
}

.topbar > .container{
  width:min(100% - clamp(14px,5vw,126px),1850px)!important;
  margin-inline:auto!important;
}

.topbar__in,
.ckOfficialHeader__in,
.ckOfficialHeader .topbar__in{
  min-height:var(--ck-fixed-header-shell-height)!important;
  margin:0!important;
}

/* Mantém a barra de progresso integrada no próprio header */
.topbar__in::after,
.ckOfficialHeader__in::after{
  height:2px!important;
  bottom:-1px!important;
}

/* Garante que o mega menu sempre abra abaixo do header fixo */
.ckMegaOfficial,
.megaMenu.ckMegaOfficial{
  z-index:990!important;
  padding-top:calc(var(--ck-fixed-header-offset) + 10px)!important;
}

.ckMegaOfficial__shell{
  max-height:calc(100dvh - var(--ck-fixed-header-offset) - 22px)!important;
}

/* Evita que âncoras internas fiquem escondidas sob o header */
section[id],
[id="sobre"],
[id="pilares"],
[id="portfolio"],
[id="blog"],
[id="contato"],
.ckArticleProse h2,
.ckArticleProse h3{
  scroll-margin-top:calc(var(--ck-fixed-header-offset) + 20px)!important;
}

/* Ajuste refinado por breakpoint — sem espremer conteúdo */
@media (max-width:1160px){
  :root{
    --ck-fixed-header-top-gap:10px;
    --ck-fixed-header-bottom-gap:16px;
    --ck-fixed-header-shell-height:82px;
  }
  .topbar > .container{width:min(100% - 28px,1180px)!important;}
}

@media (max-width:820px){
  :root{
    --ck-fixed-header-top-gap:10px;
    --ck-fixed-header-bottom-gap:14px;
    --ck-fixed-header-shell-height:76px;
  }
  .topbar > .container{width:min(100% - 22px,100%)!important;}
  .topbar__in,.ckOfficialHeader__in{border-radius:24px!important;}
  .ckMegaOfficial,.megaMenu.ckMegaOfficial{padding-top:calc(var(--ck-fixed-header-offset) + 8px)!important;}
}

@media (max-width:560px){
  :root{
    --ck-fixed-header-top-gap:8px;
    --ck-fixed-header-bottom-gap:12px;
    --ck-fixed-header-shell-height:68px;
  }
  .topbar > .container{width:min(100% - 14px,100%)!important;}
  .topbar__in,.ckOfficialHeader__in{border-radius:20px!important;}
  .ckMegaOfficial,.megaMenu.ckMegaOfficial{padding-top:calc(var(--ck-fixed-header-offset) + 6px)!important;}
}

/* Tema claro: mantém o header fixo premium sem sombra pesada */
html[data-theme="light"] .topbar,
html[data-theme="light"] .blogEditorial .topbar,
html[data-theme="light"] .ckOfficialHeader{
  background:linear-gradient(180deg,rgba(246,234,216,.88),rgba(246,234,216,.42) 72%,transparent)!important;
  box-shadow:none!important;
}
