/* =========================================================
   NAVBAR PREMIUM - NEW REPUBLIC
========================================================= */

.topo,
header.topo,
.topo-transparent,
.topo-premium {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.topo::before,
header.topo::before,
.topo-transparent::before,
.topo-premium::before {
  display: none !important;
  content: none !important;
}

.topo-premium {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: min(96%, 1320px);
  z-index: 2000;
  padding: 0;
}

.topo-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 18px;
  min-height: 74px;
  padding: 0 18px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.025)),
    linear-gradient(135deg, rgba(35, 17, 56, 0.78), rgba(71, 28, 116, 0.64));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255,255,255,0.05);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand-premium {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  justify-self: start;
  flex-shrink: 0;
}

/* Fallback para páginas que ainda usam a classe legada .brand. */
.topo-premium .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  justify-self: start;
  flex-shrink: 0;
}

.topo-premium .brand .logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(168, 85, 247, 0.22));
}

.topo-premium .brand .brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.topo-premium .brand .brand-text strong {
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 1.4px;
}

.topo-premium .brand .brand-text small {
  color: #f2ebff;
  font-size: 13px;
  font-weight: 600;
  opacity: 0.9;
  margin-top: 4px;
}

.brand-premium .logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(168, 85, 247, 0.22));
}

.brand-premium .brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-premium .logo-text {
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 1.4px;
}

.brand-premium .logo-sub {
  color: #f2ebff;
  font-size: 13px;
  font-weight: 600;
  opacity: 0.9;
  margin-top: 4px;
}

.menu-premium {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.menu-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.menu-center a {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: rgba(255,255,255,0.78);
  font-size: 15px;
  font-weight: 700;
  transition:
    background 0.25s ease,
    color 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.menu-center a:hover {
  color: #fff;
  background: rgba(255,255,255,0.04);
}

.menu-center a.ativo {
  color: #fff;
  background: rgba(255,255,255,0.10);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

/* Catálogo e FAQ continuam acessíveis pelas páginas próprias, mas não
   duplicam os itens da navbar principal da home. */
.store-mode .menu-center a[href="catalogo.html"],
.store-mode .menu-center a[href="faq.html"] {
  display: none !important;
}

/* Estas opções ficam agrupadas no menu da conta para manter a barra limpa. */
.menu-center [data-characters-link],
.menu-center [data-admin-link] {
  display: none !important;
}

.menu-center .admin-link {
  color: #b985ff;
}

.menu-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  justify-self: end;
}

/* Mantém os links visualmente centralizados no cabeçalho, sem deslocá-los
   pelo tamanho variável da marca ou da área de conta. */
@media (min-width: 981px) {
  .topo-wrap {
    position: relative;
    grid-template-columns: minmax(0, 1fr);
  }

  .brand-premium {
    position: absolute;
    top: 50%;
    left: 18px;
    transform: translateY(-50%);
  }

  .menu-premium {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .menu-center {
    grid-column: 2;
  }

  .menu-right {
    grid-column: 3;
  }
}

.nav-cart-btn {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  transition:
    transform 0.25s ease,
    background 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease;
}

.nav-cart-btn:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.12);
  color: #fff;
}

.nav-user-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-auth-link {
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  font-weight: 700;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  transition: background 0.25s ease, color 0.25s ease;
}

.nav-auth-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.05);
}

.nav-auth-btn {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed 0%, #9333ea 55%, #a855f7 100%);
  border: 1px solid rgba(168, 85, 247, 0.28);
  box-shadow: 0 10px 22px rgba(147, 51, 234, 0.26);
  transition: transform 0.25s ease, filter 0.25s ease;
}

.nav-auth-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.nav-user-dropdown {
  position: relative;
}

.nav-user-trigger {
  min-height: 52px;
  padding: 0 14px 0 10px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  cursor: pointer;
  transition:
    background 0.25s ease,
    transform 0.25s ease,
    border-color 0.25s ease;
}

.nav-user-trigger:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.12);
}

.nav-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  flex-shrink: 0;
}

.nav-user-name {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.nav-user-chevron {
  width: 16px;
  height: 16px;
  opacity: 0.8;
  transition: transform 0.25s ease;
}

.nav-user-dropdown.open .nav-user-chevron {
  transform: rotate(180deg);
}

.nav-user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 220px;
  padding: 12px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03)),
    linear-gradient(135deg, rgba(31, 15, 49, 0.96), rgba(57, 22, 95, 0.92));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 22px 48px rgba(0,0,0,0.28);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition:
    opacity 0.22s ease,
    visibility 0.22s ease,
    transform 0.22s ease;
}

.nav-user-dropdown.open .nav-user-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-user-menu a,
.nav-user-menu button {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(255,255,255,0.88);
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-user-menu a:hover,
.nav-user-menu button:hover {
  background: rgba(255,255,255,0.05);
  color: #fff;
}

.nav-user-menu svg {
  opacity: 0.9;
  flex-shrink: 0;
}

/* A home usa a mesma estrutura visual da Store; o menu continua acessível no mobile. */
@media (max-width: 980px) {
  .menu-premium.is-open { display: grid; }
}

.menu-toggle {
  display: none;
  position: relative;
  z-index: 3;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  border-radius: 14px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  transition: 0.25s ease;
}

.menu-toggle span {
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: #fff;
  transition: 0.25s ease;
}

.menu-toggle.ativo span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.ativo span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.ativo span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 980px) {
  .topo-premium {
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: min(96%, 1000px);
  }

  .topo-wrap {
    grid-template-columns: auto auto;
    min-height: 64px;
    padding: 0 14px;
  }

  .menu-toggle {
    display: inline-flex;
    justify-self: end;
  }

  .menu-premium {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    padding: 16px;
    border-radius: 20px;
    background:
      linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.025)),
      linear-gradient(135deg, rgba(35, 17, 56, 0.92), rgba(71, 28, 116, 0.88));
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 18px 40px rgba(0,0,0,0.24);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: none;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 14px;
  }

  .menu-premium.ativo {
    display: grid;
  }

  .menu-center {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .menu-center a {
    justify-content: flex-start;
    padding: 0 14px;
  }

  .menu-right {
    justify-content: space-between;
    width: 100%;
    flex-wrap: wrap;
  }

  .brand-premium .logo-text {
    font-size: 13px;
  }

  .brand-premium .logo-sub {
    font-size: 12px;
  }
}

@media (max-width: 640px) {
  .brand-premium .logo-text {
    font-size: 12px;
    letter-spacing: 1px;
  }

  .brand-premium .logo-sub {
    font-size: 11px;
  }

  .brand-premium .logo-img {
    width: 38px;
    height: 38px;
  }

  .nav-user-name {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
