/* loja-header.css — cabeçalho, busca, menu de conta, mini-carrinho e navegação de categorias (dividido de loja.css na Etapa 9) */

.cabecalho-loja {
  --hdr-bg-1: #0d2440;
  --hdr-bg-2: #081627;
  --hdr-borda: rgba(231, 192, 82, 0.2);
  --hdr-texto: #f3f6f9;
  --hdr-texto-suave: #93a9bd;
  --hdr-dourado: #e7c052;
  --hdr-dourado-escuro: #c79f34;
  background: linear-gradient(180deg, var(--hdr-bg-1) 0%, var(--hdr-bg-2) 100%);
  border-bottom: 1px solid var(--hdr-borda);
  box-shadow: 0 4px 18px rgba(3, 12, 22, 0.35);
  position: sticky; top: 0; z-index: 30;
}
.cabecalho-conteudo {
  max-width: 1200px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.logo-loja { font-family: var(--fonte-titulo); font-weight: 800; font-size: 18px; white-space: nowrap; order: 1; display: inline-flex; }
.logo-loja .total { color: #fff; }
.logo-loja .shopping { color: var(--hdr-dourado); }
[data-tema="escuro"] .logo-loja .total { color: #fff; }
.logo-loja img { transition: transform 0.2s ease, filter 0.2s ease; }
.logo-loja:hover img { transform: scale(1.04); filter: brightness(1.05); }

.busca-loja {
  flex: 1; max-width: 460px; display: flex; align-items: center; gap: 8px; min-width: 0;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--hdr-borda); border-radius: 999px;
  padding: 5px 5px 5px 18px;
  order: 2;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.busca-loja:focus-within {
  border-color: var(--hdr-dourado); background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 3px rgba(231, 192, 82, 0.15);
}
.busca-loja svg { flex-shrink: 0; }
.busca-loja input { border: none; background: none; outline: none; flex: 1; min-width: 0; color: var(--hdr-texto); font-size: 14px; }
.busca-loja input::placeholder { color: var(--hdr-texto-suave); }
.botao-busca-loja {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: var(--hdr-dourado); color: var(--navy-900);
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.botao-busca-loja:hover { background: var(--hdr-dourado-escuro); transform: scale(1.08); box-shadow: 0 4px 14px rgba(231, 192, 82, 0.45); }
.botao-busca-loja:active { transform: scale(0.94); }

.acoes-cabecalho { display: flex; align-items: center; gap: 8px; margin-left: auto; order: 3; }

.redes-cabecalho { display: flex; align-items: center; gap: 4px; }
.link-rede-cabecalho {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; color: var(--hdr-texto-suave);
  border: 1px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.link-rede-cabecalho:hover {
  background: rgba(231, 192, 82, 0.12); color: var(--hdr-dourado); border-color: var(--hdr-borda);
  transform: translateY(-2px);
}

/* Ícone de conta/login que fica sempre visível no topo (fora do menu hambúrguer).
   No desktop o menu-conta já mostra "Entrar"/conta em texto, então este ícone
   só aparece no mobile, onde o menu-conta fica escondido dentro do hambúrguer. */
.link-conta-topo { display: none; padding: 9px; }

.botao-fale-conosco {
  display: flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 999px;
  background: #25D366; color: #fff; font-size: 13px; font-weight: 700; white-space: nowrap;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.botao-fale-conosco:hover { background: #1ebe57; transform: translateY(-2px); box-shadow: 0 8px 18px rgba(37, 211, 102, 0.32); }
.botao-fale-conosco:active { transform: translateY(0) scale(0.97); }

.link-cabecalho {
  display: flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 999px;
  font-size: 13.5px; font-weight: 700; color: var(--hdr-texto); position: relative;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--hdr-borda);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.link-cabecalho svg { color: var(--hdr-dourado); flex-shrink: 0; transition: transform 0.2s ease; }
.link-cabecalho:hover {
  background: rgba(231, 192, 82, 0.14); border-color: var(--hdr-dourado);
  transform: translateY(-2px); box-shadow: 0 8px 18px rgba(3, 12, 22, 0.35);
}
.link-cabecalho:hover svg { transform: scale(1.12); }
.link-carrinho { padding: 9px 16px 9px 12px; }
.rotulo-link-cabecalho { white-space: nowrap; }
.contador-carrinho {
  position: absolute; top: 0; right: 2px; background: var(--hdr-dourado); color: var(--navy-900);
  font-size: 10.5px; font-weight: 800; width: 17px; height: 17px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--hdr-bg-1);
}

.mini-carrinho-wrap { position: relative; }

.mini-carrinho-popup {
  display: none; position: absolute; top: calc(100% + 10px); right: 0; z-index: 45;
  width: 340px; max-width: calc(100vw - 32px);
  background: var(--superficie); border: 1px solid var(--borda); border-radius: 14px;
  box-shadow: 0 14px 36px rgba(6, 34, 55, 0.16);
  padding: 14px;
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.mini-carrinho-wrap.aberto .mini-carrinho-popup {
  display: block; opacity: 1; transform: translateY(0);
}
.mini-carrinho-popup::before {
  content: ''; position: absolute; top: -6px; right: 18px; width: 12px; height: 12px;
  background: var(--superficie); border-left: 1px solid var(--borda); border-top: 1px solid var(--borda);
  transform: rotate(45deg);
}

.mini-carrinho-vazio { padding: 20px 4px; text-align: center; color: var(--texto-suave); font-size: 13.5px; }

.mini-carrinho-lista { display: flex; flex-direction: column; gap: 10px; max-height: 320px; overflow-y: auto; padding-right: 2px; }

.mini-carrinho-item { display: flex; align-items: center; gap: 10px; }
.mini-carrinho-item img {
  width: 48px; height: 48px; object-fit: cover; border-radius: 8px; border: 1px solid var(--borda);
  background: var(--fundo); flex-shrink: 0;
}
.mini-carrinho-item-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.mini-carrinho-item-nome {
  font-size: 13px; font-weight: 600; color: var(--texto);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mini-carrinho-item-qtd { font-size: 12px; color: var(--texto-suave); }
.mini-carrinho-item-preco { font-size: 13px; font-weight: 700; color: var(--texto); white-space: nowrap; }

.mini-carrinho-rodape { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--borda); }
.mini-carrinho-subtotal {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14px; color: var(--texto); margin-bottom: 10px;
}
.mini-carrinho-subtotal strong { font-size: 16px; }
.mini-carrinho-btn { display: flex; align-items: center; justify-content: center; width: 100%; text-align: center; }

.botao-fab-carrinho {
  display: none;
  position: fixed; right: 18px; bottom: 18px; z-index: 50;
  width: 54px; height: 54px; border-radius: 50%; border: none;
  background: var(--navy-900); color: #fff;
  align-items: center; justify-content: center;
  box-shadow: 0 10px 26px rgba(6, 34, 55, 0.32);
  transition: transform 0.15s ease;
}
.botao-fab-carrinho:active { transform: scale(0.93); }
.contador-carrinho-fab { top: -4px; right: -4px; border: 2px solid var(--superficie); }

.mini-carrinho-backdrop {
  display: none; position: fixed; inset: 0; z-index: 44;
  background: rgba(6, 20, 32, 0.45); opacity: 0;
  transition: opacity 0.2s ease;
}
.mini-carrinho-backdrop.visivel { display: block; opacity: 1; }

.toast-carrinho {
  position: fixed; top: 18px; left: 50%; z-index: 60;
  display: flex; align-items: center; gap: 8px;
  background: var(--navy-900); color: #fff;
  padding: 12px 20px; border-radius: 30px;
  font-size: 13.5px; font-weight: 600; white-space: nowrap;
  max-width: calc(100vw - 32px);
  overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 12px 30px rgba(6, 34, 55, 0.3);
  opacity: 0; pointer-events: none;
  transform: translate(-50%, -16px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.toast-carrinho svg { flex-shrink: 0; color: #37d67a; }
.toast-carrinho.visivel { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1024px) {
  .botao-fab-carrinho { display: flex; }

  .mini-carrinho-popup {
    display: block; position: fixed; inset: auto 0 0 0;
    width: 100%; max-width: 100%; border-radius: 18px 18px 0 0;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
    max-height: 75vh; overflow-y: auto;
    opacity: 1; transform: translateY(100%);
    box-shadow: 0 -14px 36px rgba(6, 34, 55, 0.22);
    transition: transform 0.25s ease;
  }
  .mini-carrinho-popup::before { display: none; }
  .mini-carrinho-wrap.aberto .mini-carrinho-popup { transform: translateY(0); }
}

@media (max-width: 640px) {
  .toast-carrinho { top: 12px; font-size: 13px; padding: 10px 16px; }
}

.barra-fixa-mobile {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 48;
  align-items: center; gap: 12px;
  background: var(--superficie); border-top: 1px solid var(--borda);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 24px rgba(6, 34, 55, 0.12);
}
.barra-fixa-mobile img { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; background: var(--fundo); flex-shrink: 0; }
.barra-fixa-mobile-precos { display: flex; flex-direction: column; min-width: 0; flex-shrink: 0; }
.barra-fixa-mobile-preco { font-family: var(--fonte-dado); font-weight: 700; font-size: 15px; white-space: nowrap; }
.barra-fixa-mobile-preco-original { font-size: 11px; color: var(--texto-suave); text-decoration: line-through; }
.barra-fixa-mobile .botao-grande { width: auto; flex: 1; padding: 12px 18px; font-size: 14px; }

@media (max-width: 1024px) {
  .barra-fixa-mobile.ativa { display: flex; animation: fadeInSuave 0.25s ease; }
  body.tem-barra-fixa .botao-fab-carrinho { display: none; }
  body.tem-barra-fixa .container-loja { padding-bottom: 90px; }
}

.botao-menu-mobile {
  display: none; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid transparent;
  background: transparent; color: var(--hdr-texto, #f3f6f9); flex-shrink: 0;
  position: relative; z-index: 41;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.botao-menu-mobile:hover { background: rgba(231, 192, 82, 0.12); border-color: var(--hdr-borda, rgba(231,192,82,0.2)); transform: translateY(-2px); }
.botao-menu-mobile.aberto { background: rgba(231, 192, 82, 0.12); }
.botao-menu-mobile .icone-menu-fechar { display: none; }
.botao-menu-mobile.aberto .icone-menu-abrir { display: none; }
.botao-menu-mobile.aberto .icone-menu-fechar { display: block; }

.menu-conta { display: flex; align-items: center; gap: 8px; }

.fundo-menu-mobile {
  display: none; position: fixed; inset: 0; background: rgba(6, 34, 55, 0.45);
  z-index: 25; opacity: 0; transition: opacity 0.2s ease;
}
.fundo-menu-mobile.visivel { display: block; opacity: 1; }
body.travar-scroll { overflow: hidden; }

.categorias-nav {
  background: linear-gradient(180deg, #081627 0%, #050f1c 100%);
  border-top: 1px solid rgba(231, 192, 82, 0.14);
}

.categorias-nav-lista { max-width: 1200px; margin: 0 auto; padding: 12px 24px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.chip-categoria {
  padding: 8px 18px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(231, 192, 82, 0.2); color: #cdd9e2;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.chip-categoria:hover {
  background: rgba(231, 192, 82, 0.16); border-color: #e7c052; color: #f3f6f9;
  transform: translateY(-2px); box-shadow: 0 8px 18px rgba(3, 12, 22, 0.4);
}
.chip-categoria.ativo { background: #e7c052; color: #10222f; border-color: #e7c052; box-shadow: 0 6px 16px rgba(231, 192, 82, 0.35); }
.chip-categoria.ativo:hover { background: #c79f34; border-color: #c79f34; color: #10222f; transform: translateY(-2px); }

.mais-categorias-wrap { position: relative; }
.botao-mais-categorias { display: inline-flex; align-items: center; gap: 6px; }
.seta-mais-categorias { font-size: 11px; transition: transform 0.2s ease; }
.painel-mais-categorias {
  display: none; position: absolute; top: calc(100% + 8px); left: 0; z-index: 20;
  background: #0d2440; border: 1px solid rgba(231, 192, 82, 0.2); border-radius: 14px;
  padding: 10px; min-width: 200px; width: max-content; max-width: min(280px, calc(100vw - 32px));
  max-height: 320px; overflow-y: auto;
  flex-direction: column; gap: 6px; box-shadow: 0 14px 34px rgba(3, 12, 22, 0.5);
}
.painel-mais-categorias.aberto { display: flex; animation: fadeInSuave 0.18s ease; }
.painel-mais-categorias .chip-categoria { width: 100%; text-align: left; border-radius: 10px; }
