/* ============================================================
   NS HEADER 1.0.0
   Extraído de ns-homepage — agora sitewide (loja/categoria/produto/
   carrinho/checkout usavam o header do Astra, visualmente diferente).
   position: sticky (não fixed) — reserva o próprio espaço no fluxo
   normal da página, sem precisar de padding-top de compensação em
   cada tipo de template (arquivo de loja, produto, carrinho...).
   ============================================================ */

/* Reforço: o filtro astra_header_enabled (ns-header.php) não chega a
   suprimir o header do Astra fora da homepage (lá nunca chegava a
   desenhar-se, porque o template é 100% nosso; nas outras páginas o Astra
   segue o fluxo normal dele e continua a desenhar o header). #masthead é o
   contentor universal do header em qualquer tema baseado no Astra/_s.
   IMPORTANTE: `.ast-header-break-point` NÃO é um elemento do cabeçalho — o
   Astra coloca esta classe no próprio <body> em todas as páginas (é um
   marcador interno do breakpoint responsivo do tema, não um contentor
   visual). Incluí-la aqui escondia a página inteira (display:none no
   <body>), causando página em branco em todos os dispositivos — bug
   encontrado em produção (2026-07-08) via inspeção do body_class(). */
#masthead,
.site-header {
  display: none !important;
}

.ns-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 2000;
  background: #046BD2;
  color: #fff;
  padding: 10px 18px;
  border-radius: 0 0 8px 0;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  text-decoration: none;
}
.ns-skip-link:focus { left: 0; }

.ns-site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(248, 249, 252, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    height: 64px;
    display: flex;
    align-items: center;
}

.ns-header-inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 32px;
}

.ns-logo-link {
    text-decoration: none;
    flex-shrink: 0;
}

.ns-logo-link img,
.ns-logo-link .ns-logo-img {
    height: 36px !important;
    max-width: 140px !important;
    width: auto !important;
    display: block;
}

.ns-logo-text {
    /* Sem font-family própria — herda a fonte do tema (Astra). */
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
    color: #0a0a0a;
}

.ns-nav {
    flex: 1;
}

.ns-nav-list {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ns-nav-list li a {
    /* Sem font-family própria — herda a fonte do tema (Astra). */
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
    display: block;
}

.ns-nav-list li a:hover {
    background: rgba(4, 107, 210, 0.07);
    color: #046BD2;
}

.ns-nav-list li.current-menu-item > a,
.ns-nav-list li.current-menu-parent > a,
.ns-nav-list li.current-menu-ancestor > a {
    color: #046BD2;
    font-weight: 600;
}

/* Dropdown */
.ns-nav-list .sub-menu {
    position: absolute;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 6px;
    min-width: 200px;
    list-style: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    display: none;
    z-index: 100;
}

.ns-nav-list li:hover > .sub-menu,
.ns-nav-list li:focus-within > .sub-menu { display: block; }

.ns-nav-list .sub-menu li a {
    font-size: 13px;
    padding: 7px 12px;
    color: #374151;
    border-radius: 6px;
}

.ns-nav-list li.menu-item-has-children {
    position: relative;
}

.ns-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.ns-cart-btn {
    position: relative;
    color: #046BD2;
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 8px;
    border: 1.5px solid #046BD2;
    border-radius: 10px;
    transition: background 0.15s;
}

.ns-cart-btn:hover { background: rgba(4,107,210,0.07); }

.ns-cart-count {
    position: absolute;
    top: 2px; right: 2px;
    background: #E0344C;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    width: 16px; height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ns-nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 8px;
    color: #374151;
    cursor: pointer;
    flex-shrink: 0;
}
.ns-nav-toggle:hover { background: rgba(4,107,210,0.07); color: #046BD2; }

.ns-search-wrap {
    position: relative;
}

.ns-search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 8px;
    color: #374151;
    cursor: pointer;
    flex-shrink: 0;
}
.ns-search-toggle:hover { background: rgba(4,107,210,0.07); color: #046BD2; }

.ns-search-form {
    display: none;
    position: absolute;
    top: 52px; right: 0;
    width: 280px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    padding: 10px;
    z-index: 100;
}
.ns-search-form.is-open { display: block; }

.ns-search-input {
    width: 100%;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #0a0a0a;
    background: #F8F9FC;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 9px 12px;
    box-sizing: border-box;
}
.ns-search-input:focus { outline: 2px solid #046BD2; outline-offset: 1px; }

@media (max-width: 480px) {
    .ns-search-form { width: calc(100vw - 32px); right: -8px; }
}

/* Responsivo header */
@media (max-width: 768px) {
    .ns-nav-toggle { display: flex; }
    .ns-header-inner { gap: 16px; }

    .ns-nav {
        display: none;
        position: absolute;
        top: 64px; left: 0; right: 0;
        max-height: calc(100vh - 64px);
        overflow-y: auto;
        background: #fff;
        border-bottom: 1px solid rgba(0,0,0,0.08);
        box-shadow: 0 12px 24px rgba(0,0,0,0.08);
    }
    .ns-nav.is-open { display: block; }

    .ns-nav-list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px;
    }
    .ns-nav-list li a { padding: 12px 14px; }

    /* Sem segundo toggle para sub-menus — mantém sempre visíveis e indentados */
    .ns-nav-list .sub-menu {
        position: static;
        display: block;
        box-shadow: none;
        border: none;
        padding: 0 0 0 14px;
        min-width: 0;
    }
}
