/* ==========================================================================
   HEADER — totalmente transparente sobre o hero + menu mobile
   Comportamento ao rolar (header.js):
   - rolando para baixo  → o header some (.is-hidden)
   - rolando para cima   → o header volta (com fundo, se não estiver no topo)
   - no topo da página   → transparente, sem fundo nem borda
   ========================================================================== */

.site-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  transition: transform var(--dur-slow) var(--ease);
}

.site-top.is-hidden {
  transform: translateY(-100%);
}

.header {
  height: var(--header-h);
  background: transparent;
  transition: background-color var(--dur), box-shadow var(--dur);
}

/* Fora do topo (ou com o menu aberto) ganha fundo para manter a leitura */
.site-top.is-scrolled .header,
.site-top.is-solid .header {
  /* Fundo quase opaco sem desfoque: o blur no header fixo pesava a rolagem no celular */
  background: rgba(3, 29, 90, 0.97);
  box-shadow: var(--shadow-sm);
}

.header__inner {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-4);
}

.header__left,
.header__right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.header__right {
  justify-content: flex-end;
}

/* Links de texto (Produtos, Sobre, Contato, Orçamento) */
.header-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--white);
  transition: color var(--dur-fast);
}

.header-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--dur) var(--ease);
}

.header-link:hover {
  color: var(--accent);
}

.header-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav {
  display: none;
}

.nav__list {
  display: flex;
  gap: var(--space-5);
}

/* Marca central */
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding-block: 10px;   /* área de toque confortável no celular */
}

.brand__word {
  height: 28px;
  width: auto;
}

/* No celular só a logo (o subtítulo ficaria pequeno demais para ler) */
.brand__tag {
  display: none;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

@media (min-width: 768px) {
  .brand__word {
    height: 40px;
  }

  .brand__tag {
    display: block;
    font-size: 10px;
    letter-spacing: 0.3em;
  }
}

/* Celular/tablet: botões um pouco menores para logo + ícones caberem em 360px */
@media (max-width: 959px) {
  .header__inner {
    gap: var(--space-2);
  }

  .header__left,
  .header__right {
    gap: 0;
  }

  .header .icon-btn,
  .search-pill {
    width: 40px;
    height: 40px;
  }
}

/* Busca em formato "pílula" */
.search-pill {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  color: var(--white);
  transition: border-color var(--dur-fast), color var(--dur-fast), background-color var(--dur-fast);
}

.search-pill span {
  display: none;
}

.search-pill:hover {
  color: var(--accent);
}

/* Carrinho: ícone + contador (sempre ícone, em qualquer tela) */
.header-cart .counter-badge {
  top: 2px;
  right: 0;
}

/* Computador (a partir de 960px): links separados no cabeçalho, sem botão ☰ */
@media (min-width: 960px) {
  .nav {
    display: block;
  }

  .menu-toggle {
    display: none;
  }

  .header__right {
    gap: var(--space-3);
  }
}

/* Telas largas: busca em formato pílula com texto */
@media (min-width: 1200px) {
  .nav__list {
    gap: var(--space-6);
  }

  .search-pill {
    display: inline-flex;
    gap: var(--space-2);
    width: 180px;
    height: 40px;
    padding: 0 var(--space-4);
    justify-content: flex-start;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.04);
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
  }

  .search-pill span {
    display: inline;
  }

  .search-pill:hover {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
  }

  .header__right {
    gap: var(--space-6);
  }
}

/* ---------- Menu mobile ---------- */

.menu-toggle .icon--close {
  display: none;
}

.menu-toggle[aria-expanded="true"] .icon--menu {
  display: none;
}

.menu-toggle[aria-expanded="true"] .icon--close {
  display: block;
}

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-header) - 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--header-h) + var(--space-5)) var(--gutter) var(--space-7);
  background: var(--navy-950);
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility var(--dur);
}

.mobile-nav.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.mobile-nav__link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block: var(--space-5);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color var(--dur-fast);
}

.mobile-nav__link:hover {
  color: var(--accent);
}

.mobile-nav__foot {
  margin-top: var(--space-6);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

@media (min-width: 960px) {
  .mobile-nav {
    display: none;
  }
}

/* ---------- Conta: Entrar / Olá, Nome / Painel do dono ---------- */

/* No celular a conta fica dentro do menu ☰ (não cabe no cabeçalho) */
.header-account {
  display: none;
  align-items: center;
  gap: var(--space-5);
}

@media (min-width: 960px) {
  .header-account {
    display: flex;
  }
}

/* Ícone de conta: atalho no celular/tablet (no computador há o "Entrar / Olá") */
.header-user {
  position: relative;
}

.header-user__avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--yellow-500);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 800;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85);
}

.header-user__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header-user.is-logged::after {
  content: "";
  position: absolute;
  right: 7px;
  bottom: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 2px var(--navy-900);
}

@media (min-width: 960px) {
  .header-user {
    display: none;
  }
}

.header-login .icon {
  margin-right: 2px;
}

/* "● PAINEL" — só aparece para o dono */
.header-panel {
  color: var(--accent);
}

.header-panel__dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

/* Anel pulsando só com transform/opacity (não redesenha o cabeçalho a cada quadro) */
.header-panel__dot.is-live::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
  animation: panel-pulse 1.6s ease-out infinite;
}

@keyframes panel-pulse {
  from { transform: scale(1); opacity: 0.7; }
  to { transform: scale(3.3); opacity: 0; }
}

.header-panel__count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: var(--radius-pill);
}

/* Menu "Olá, Nome" */
.account-menu {
  position: relative;
}

.account-menu__panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 240px;
  padding: var(--space-2);
  background: var(--white);
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: toast-in var(--dur) var(--ease);
}

.account-menu__who {
  display: grid;
  gap: 2px;
  padding: var(--space-3);
  margin-bottom: var(--space-1);
  border-bottom: 1px solid var(--gray-100);
  font-size: var(--fs-sm);
}

.account-menu__who span {
  color: var(--gray-500);
  font-size: var(--fs-xs);
  word-break: break-all;
}

.account-menu__panel a,
.account-menu__panel button {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-3);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-align: left;
  border-radius: var(--radius-sm);
  transition: background-color var(--dur-fast);
}

.account-menu__panel a:hover,
.account-menu__panel button:hover {
  background: var(--gray-50);
}

/* Bolinha amarela no ☰ quando o dono tem pedidos novos (celular) */
.menu-toggle.has-alert::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--navy-900);
}

/* Conta dentro do menu mobile */
.mobile-nav__account {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.mobile-nav__hello {
  font-size: var(--fs-lg);
  color: var(--text-muted);
}

.mobile-nav__hello strong {
  color: var(--white);
}
