/* ==========================================================================
   CABEÇALHO — barra flutuante em vidro + menu mobile
   ========================================================================== */

.cabecalho {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: fixed;
  top: 14px;
  left: 0;
  width: 100%;
  z-index: 100;
}

.cabecalho .barra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 960px;
  max-width: calc(100% - 40px);
  height: 66px;
  padding: 0 14px 0 26px;
  background: color-mix(in srgb, var(--fundo) 82%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  backdrop-filter: blur(22px) saturate(140%);
  transition: border-radius .3s cubic-bezier(.4, 0, .2, 1);
}

.cabecalho .logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: opacity .3s;
}

.cabecalho .logo img {
  width: auto;
  height: 32px;
  filter: drop-shadow(0 6px 14px rgba(20, 5, 60, .6));
}

.cabecalho .logo:hover {
  opacity: .85;
}

.cabecalho .links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cabecalho .links a {
  font-size: var(--f2);
  color: var(--cor-texto);
  padding: 10px 16px;
  border-radius: 12px;
  transition: all .3s;
}

.cabecalho .links a:hover {
  color: var(--cor-roxo-claro);
  background-color: #ffffff0f;
}

.cabecalho .acoes {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.cabecalho .acoes .entrar {
  font-size: var(--f2);
  color: var(--cor-texto);
  padding: 11px 16px;
  border-radius: 14px;
  transition: color .3s;
}

.cabecalho .acoes .entrar:hover {
  color: var(--cor-roxo-claro);
}

.cabecalho .acoes .assinar {
  height: 44px;
  padding: 0 22px;
  font-size: var(--f2);
  border-radius: var(--raio-pilula);
}

/* Botão hambúrguer */
.cabecalho .gatilho {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
}

.cabecalho .gatilho .linhas {
  position: relative;
  width: 20px;
  height: 20px;
}

.cabecalho .gatilho .linhas span {
  position: absolute;
  left: 1px;
  display: block;
  width: 18px;
  height: 2px;
  background-color: var(--cor-texto);
  border-radius: 2px;
  transition: all .4s cubic-bezier(.4, 0, .2, 1);
}

.cabecalho .gatilho .linhas span:first-child {
  top: 7px;
}

.cabecalho .gatilho .linhas span:last-child {
  top: 11px;
}

/* Painel mobile */
.cabecalho .painel {
  display: none;
  flex-direction: column;
  gap: 4px;
  width: 960px;
  max-width: calc(100% - 40px);
  max-height: 0;
  padding: 0 18px;
  opacity: 0;
  overflow: hidden;
  border-top: none;
  border-radius: 0 0 26px 26px;
  background: color-mix(in srgb, var(--fundo) 88%, transparent);
  visibility: hidden;
  transition: max-height .4s cubic-bezier(.4, 0, .2, 1), opacity .35s cubic-bezier(.4, 0, .2, 1), padding .4s cubic-bezier(.4, 0, .2, 1), visibility .4s;
}

.cabecalho .painel .item-menu {
  font-size: var(--f4);
  color: var(--cor-texto);
  padding: 14px 6px;
  border-bottom: 1px solid var(--bolha-borda);
  transition: color .3s;
}

.cabecalho .painel .item-menu:hover {
  color: var(--cor-roxo-claro);
}

.cabecalho .painel .acoes-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 18px;
}

.cabecalho .painel .acoes-menu .entrar {
  display: inline-flex;
  align-items: center;
  height: 48px;
  font-size: var(--f2);
  color: var(--cor-texto);
  padding: 0 22px;
  border: 1px solid var(--bolha-borda);
  border-radius: var(--raio-controle);
  transition: all .3s;
}

.cabecalho .painel .acoes-menu .entrar:hover {
  color: var(--cor-roxo-claro);
  border-color: var(--bolha-borda-forte);
}

.cabecalho .painel .acoes-menu .assinar {
  flex: 1;
  height: 48px;
  padding: 0 26px;
  font-size: var(--f2);
}

/* ---------- Mobile ---------- */
@media screen and (max-width: 1000px) {
  .cabecalho {
    top: 10px;
  }

  .cabecalho .barra {
    width: calc(100% - 32px);
    max-width: none;
    height: 58px;
    padding: 0 8px 0 18px;
  }

  .cabecalho .logo img {
    height: 26px;
  }

  .cabecalho .links,
  .cabecalho .acoes .entrar,
  .cabecalho .acoes .assinar {
    display: none;
  }

  .cabecalho .gatilho,
  .cabecalho .painel {
    display: flex;
  }

  .cabecalho .painel {
    width: calc(100% - 32px);
    max-width: none;
  }

  .cabecalho.aberto .barra {
    border-radius: 26px 26px 0 0;
  }

  .cabecalho.aberto .gatilho .linhas span:first-child {
    top: 9px;
    transform: rotate(45deg);
  }

  .cabecalho.aberto .gatilho .linhas span:last-child {
    top: 9px;
    transform: rotate(-45deg);
  }

  .cabecalho.aberto .painel {
    padding: 8px 18px 4px;
    max-height: calc(100dvh - 90px);
    opacity: 1;
    visibility: visible;
    overflow-y: auto;
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
  }
}
