/**
 * Header - 3 Camadas
 * 1. Barra de Anúncios (announcement-bar)
 * 2. Header Principal (Astra customizado)
 * 3. Menu de Categorias (category-menu)
 */

/* ==========================================================================
   Camada 1 - Barra de Anúncios (Ticker Marquee)
   ========================================================================== */
.brd-announcement-bar {
    background-color: #1f3e68;
    overflow: hidden;
    height: 36px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brd-announcement-track {
    overflow: hidden;
    width: 100%;
}

.brd-announcement-inner {
    display: flex;
    align-items: center;
    width: max-content;
    will-change: transform;
    touch-action: pan-y;
}

.brd-ann-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.3px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-right: 28px;
}

.brd-ann-item svg {
    flex-shrink: 0;
    opacity: 0.9;
}

.brd-ann-dot {
    color: rgba(255, 255, 255, 0.35);
    font-size: 14px;
    flex-shrink: 0;
    line-height: 1;
    margin-right: 28px;
}

/* ==========================================================================
   Camada 2 - Header Principal
   ========================================================================== */
.brd-header {
    background: #183357;
    position: sticky;
    top: 0;
    z-index: 200;
    height: var(--brd-header-h);
    transition: height 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s ease;
    border-top: 1px solid #f4eed7;
    border-bottom: 1px solid #f4eed7;
}

html.brd-scrolled .brd-header {
    height: var(--brd-header-h-sm);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}


/* WordPress Admin Bar (32px desktop / 46px mobile) */
body.admin-bar .brd-header        { top: 32px; }
body.admin-bar .brd-category-menu { top: calc(var(--brd-header-h) + 32px); }
html.brd-scrolled body.admin-bar .brd-category-menu { top: calc(var(--brd-header-h-sm) + 32px); }

@media (max-width: 782px) {
    body.admin-bar .brd-header        { top: 46px; }
    body.admin-bar .brd-category-menu { top: calc(var(--brd-header-h-sm) + 46px); }
}

.brd-hdr-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
}

/* Hamburger (só mobile) */
.brd-hdr-hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--brd-off-white);
    cursor: pointer;
    padding: 4px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Busca */
.brd-hdr-search-wrap { display: flex; align-items: center; }

.brd-hdr-search-form {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 9999px;
    overflow: hidden;
}

.brd-hdr-search-form input[type="search"] {
    flex: 1;
    border: none;
    background: transparent;
    padding: 9px 14px 9px 20px;
    font-family: var(--brd-font-family);
    font-size: 14px;
    color: #fff;
    outline: none;
}

.brd-hdr-search-form input[type="search"]::placeholder { color: rgba(255, 255, 255, 0.5); }

.brd-hdr-search-form button {
    background: none;
    border: none;
    padding: 0 14px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    height: 100%;
}

/* Ícone lupa mobile (só mobile) */
.brd-hdr-search-icon {
    display: none;
    background: none;
    border: none;
    color: var(--brd-off-white);
    cursor: pointer;
    padding: 4px;
    align-items: center;
    flex-shrink: 0;
}

/* Logo */
.brd-hdr-logo {
    justify-self: center;
    display: flex;
    align-items: center;
    text-decoration: none;
    position: relative;
}

/* Logo completa — estado normal */
.brd-logo-full {
    display: block;
    width: 247px;
    height: auto;
    margin: 20px 0;
    opacity: 1;
    transition:
        width   0.35s cubic-bezier(0.4, 0, 0.2, 1),
        margin  0.35s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.25s ease;
}

html.brd-scrolled .brd-logo-full {
    width: 44px;
    margin: 8px 0;
    opacity: 0;
    pointer-events: none;
}

/* Logo compacta (águia + slogan) — estado scrolled */
.brd-logo-scrolled {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(5px);
    transition:
        opacity   0.35s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

html.brd-scrolled .brd-logo-scrolled {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.brd-logo-sm {
    height: 40px;
    width: auto;
    display: block;
    flex-shrink: 0;
}

/* Slogan */
.brd-logo-slogan {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.brd-slogan-name {
    display: block;
    font-family: var(--brd-font-family);
    font-size: 15px;
    font-weight: 600;
    color: var(--brd-off-white);
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.brd-slogan-tagline {
    display: block;
    font-family: var(--brd-font-family);
    font-size: 13px;
    font-weight: 400;
    font-style: italic;
    color: rgba(244, 238, 215, 0.7);
    letter-spacing: 0.5px;
    line-height: 1.3;
}

/* Ações */
.brd-hdr-actions {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 24px;
    transition: opacity 0.15s ease;
    padding-top: 12px;
}

html.brd-scrolled .brd-hdr-actions {
    padding-top: 10px;
}

.brd-hdr-actions.brd-layout-changing {
    opacity: 0;
}

.brd-hdr-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--brd-off-white);
    padding: 4px 8px;
    font-family: var(--brd-font-family);
    border-radius: 0;
    opacity: 0.85;
    position: relative;
    transition: opacity 0.2s ease, gap 0.25s ease, background 0.25s ease, color 0.25s ease, border-radius 0.2s ease;
}

.brd-hdr-action-btn:hover { opacity: 1; }

/* Efeito aba integrada — superfície contínua com o painel
   Desktop: via :hover / :focus-within (CSS nativo)
   Mobile: via .is-open (classe gerenciada por JS para toggle no clique) */
@media (min-width: 922px) {
    .brd-hdr-dropdown:hover .brd-hdr-action-btn,
    .brd-hdr-dropdown:focus-within .brd-hdr-action-btn {
        background: #fff;
        color: #183357;
        border-radius: 8px 8px 0 0;
        opacity: 1;
    }

    .brd-hdr-dropdown:hover .brd-hdr-btn-label,
    .brd-hdr-dropdown:focus-within .brd-hdr-btn-label {
        color: #183357;
    }
}

.brd-hdr-dropdown.is-open .brd-hdr-action-btn {
    background: #fff;
    color: #183357;
    border-radius: 8px 8px 0 0;
    opacity: 1;
}

.brd-hdr-dropdown.is-open .brd-hdr-btn-label {
    color: #183357;
}

.brd-hdr-action-btn svg {
    transition: transform 0.2s ease;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

.brd-hdr-action-btn:hover svg {
    transform: scale(1.1);
}

/* Scrolled: ícone volta para a lateral esquerda */
html.brd-scrolled .brd-hdr-action-btn {
    flex-direction: row;
    gap: 8px;
}

.brd-hdr-cart svg {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
}

.brd-hdr-btn-label {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    text-transform: none;
}

/* Dropdowns */
.brd-hdr-dropdown {
    position: relative;
    padding-bottom: 12px; /* estende área de hover até o painel */
}

.brd-hdr-panel {
    position: absolute;
    top: calc(100% - 12px); /* alinha ao fundo do botão, sobrepõe o padding de hover */
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    min-width: 280px;
    z-index: 300;
    padding: 8px 16px;
    /* hover state */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease, border-radius 0.2s ease, box-shadow 0.2s ease;
    pointer-events: none;
}

@media (min-width: 922px) {
    .brd-hdr-dropdown:hover .brd-hdr-panel,
    .brd-hdr-dropdown:focus-within .brd-hdr-panel {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
        border-radius: 10px 0 10px 10px; /* top-left convexo, top-right flat (encosta no botão) */
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
    }
}

.brd-hdr-dropdown.is-open .brd-hdr-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    border-radius: 10px 0 10px 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
}


/* Painel Atendimento */
.brd-panel-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.brd-panel-row:last-child { border-bottom: none; }

.brd-panel-label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 3px;
}

.brd-panel-value {
    display: block;
    color: #0d0d0d;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.brd-panel-value:hover { color: #206bb3; }

/* Rastreio */
.brd-track-wrap { width: 100%; }

.brd-track-form {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1.5px solid #206bb3;
    border-radius: 9999px;
    overflow: hidden;
    margin-top: 6px;
    padding: 3px 3px 3px 14px;
    gap: 6px;
    outline: none;
}

.brd-track-form:focus,
.brd-track-form:focus-within {
    outline: none !important;
    box-shadow: none !important;
}

.brd-track-form input,
.brd-track-form input:focus,
.brd-track-form input:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    border-style: none !important;
    border-color: transparent !important;
    border-width: 0 !important;
}

.brd-track-form input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 6px 0;
    font-size: 13px;
    color: #333;
    outline: none;
    font-family: var(--brd-font-family);
    min-width: 0;
}

.brd-track-form input::placeholder { color: #aaa; }

.brd-track-form button {
    background: #206bb3;
    border: none;
    padding: 0 14px;
    height: 32px;
    border-radius: 9999px;
    cursor: pointer;
    color: #fff;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.brd-track-form button:hover { background: #183357; }

.brd-track-form--error {
    border-color: #d93025;
    animation: brd-track-shake 0.35s ease;
}

.brd-track-form--error input::placeholder { color: #d93025; }

@keyframes brd-track-shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-5px); }
    40%       { transform: translateX(5px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}

/* Painel Minha Conta */
.brd-conta-panel { min-width: 200px; padding: 12px 16px; }

.brd-btn-entrar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #206bb3;
    color: #fff !important;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 9999px;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    transition: background 0.2s;
}

.brd-btn-entrar:hover { background: #183357; }

.brd-panel-link {
    display: block;
    padding: 8px 4px;
    color: #333;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s;
    font-family: var(--brd-font-family);
}

.brd-panel-link:hover { color: #206bb3; }

.brd-panel-link--cadastrar { font-size: 15px; font-weight: 700; }
.brd-panel-link--sair { color: #999; font-size: 13px; }
.brd-panel-link--sair:hover { color: #dc2626; }

/* Carrinho */
.brd-hdr-cart {
    position: relative;
    color: var(--brd-off-white);
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.brd-cart-count {
    position: absolute;
    top: -10px;
    right: -12px;
    background: #f4eed7;
    color: #000;
    font-size: 12px;
    font-weight: 700;
    min-width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Busca mobile expansível */
.brd-mobile-search {
    background: #183357;
    padding: 10px 16px;
    border-top: 1px solid rgba(244, 238, 215, 0.1);
}

.brd-mobile-search[hidden] { display: none; }

.brd-mobile-search form {
    display: flex;
    background: #fff;
    border: 2px solid #206bb3;
    border-radius: 9999px;
    overflow: hidden;
}

.brd-mobile-search input {
    flex: 1;
    border: none;
    padding: 10px 14px;
    font-size: 14px;
    color: #000;
    background: transparent;
    outline: none;
    font-family: var(--brd-font-family);
}

.brd-mobile-search button {
    background: none;
    border: none;
    padding: 0 14px;
    cursor: pointer;
    color: #206bb3;
    display: flex;
    align-items: center;
}

/* ==========================================================================
   Camada 3 - Menu de Categorias
   ========================================================================== */
.brd-category-menu {
    background: #183357;
    border-top: 1px solid #f4eed7;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: var(--brd-header-h);
    z-index: 199;
    transition: top 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

html.brd-scrolled .brd-category-menu { top: var(--brd-header-h-sm); }

.brd-cat-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: stretch;
    overflow: visible;
}

/* --- "Todas as Categorias" --- */
.brd-cat-all-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: none;
    border: none;
    outline: none;
    color: var(--brd-off-white);
    font-family: var(--brd-font-family);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s, border-radius 0.2s;
}

.brd-cat-all-btn:focus,
.brd-cat-all-btn:focus-visible { outline: none; box-shadow: none; background: none; }

.brd-cat-all-btn:hover,
.brd-cat-all-btn[aria-expanded="true"] {
    background: #fff;
    color: #183357;
    border-radius: 6px 6px 0 0;
}

.brd-cat-all-btn svg { flex-shrink: 0; width: 18px; height: 18px; }

/* --- Mobile hamburger (oculto no desktop) --- */
.brd-cat-toggle { display: none; }

/* --- Lista de categorias --- */
.brd-cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: stretch;
    flex: 1;
}

.brd-cat-item {
    position: relative;
    display: flex;
    align-items: stretch;
    flex: 1; /* cada item ocupa fração igual — autoadjusta com qualquer qtd de categorias */
}

.brd-cat-item > a {
    display: flex;
    align-items: center;
    justify-content: center; /* texto centralizado dentro da fração */
    gap: 5px;
    padding: 10px 8px;
    width: 100%;
    color: var(--brd-off-white);
    font-size: 16px;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    border-radius: 0;
    transition: color 0.2s, background 0.25s, border-radius 0.2s;
}

/* Hover: itens sem flyout */
.brd-cat-item:not(.has-children):hover > a {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

/* Hover: itens com flyout — efeito aba integrada */
.brd-cat-item.has-children:hover > a {
    background: #fff;
    color: #183357;
    border-radius: 6px 6px 0 0;
}

.brd-chevron {
    flex-shrink: 0;
    opacity: 0.6;
    transition: transform 0.2s, opacity 0.2s;
}

.brd-cat-item:hover .brd-chevron { transform: rotate(180deg); opacity: 1; }

/* A chevron escurece junto com o texto no efeito aba */
.brd-cat-item.has-children:hover .brd-chevron { opacity: 1; }

/* --- Flyout --- */
.brd-flyout {
    position: absolute;
    top: 100%;
    left: 0;
    display: flex;
    background: #fff;
    border-radius: 0 8px 8px 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    min-width: 480px;
    max-height: 75vh;
    overflow: hidden;
    z-index: 500;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    pointer-events: none;
}

.brd-cat-item:hover > .brd-flyout {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
}

.brd-flyout-left { flex: 1; padding: 20px 22px; min-width: 0; overflow-y: auto; max-height: 75vh; }

.brd-flyout-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.brd-flyout-title {
    font-size: 16px;
    font-weight: 700;
    color: #0d0d0d;
    font-family: var(--brd-font-family);
}

.brd-flyout-btn-all {
    display: inline-flex;
    align-items: center;
    padding: 4px 14px;
    background: #206bb3;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    border-radius: 9999px;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: var(--brd-font-family);
    transition: background 0.2s;
}

.brd-flyout-btn-all:hover { background: #183357; }

.brd-flyout-list { list-style: none; margin: 0; padding: 0; }

.brd-flyout-list > li > a {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #0d0d0d;
    text-decoration: none;
    padding: 5px 4px 5px 16px;
    position: relative;
    transition: color 0.15s;
}

.brd-flyout-list > li > a::before { content: '•'; position: absolute; left: 4px; color: #206bb3; }
.brd-flyout-list > li > a:hover { color: #206bb3; }

.brd-flyout-sub { list-style: none; margin: 0; padding: 0 0 6px 16px; }

.brd-flyout-sub li a {
    display: block;
    font-size: 14px;
    font-weight: 400;
    color: #666;
    text-decoration: none;
    padding: 3px 4px 3px 18px;
    position: relative;
    transition: color 0.15s;
}

.brd-flyout-sub li a::before { content: '••'; position: absolute; left: 0; color: #bbb; font-size: 10px; }
.brd-flyout-sub li a:hover { color: #206bb3; }

/* Flyout — lado direito (imagem da categoria) */
.brd-flyout-right {
    width: 220px;
    flex-shrink: 0;
    background: #f8f9fb;
    border-left: 1px solid #eee;
    position: relative;
    overflow: hidden;
    min-height: 120px;
}

.brd-flyout-img {
    position: absolute;
    inset: 16px;
    width: calc(100% - 32px);
    height: calc(100% - 32px);
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
    display: block;
    transition: opacity 0.18s ease;
}

.brd-flyout-img.brd-fading { opacity: 0; }

.brd-flyout-wa {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1.5px solid #206bb3;
    border-radius: 9999px;
    color: #206bb3;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    font-family: var(--brd-font-family);
    transition: background 0.2s, color 0.2s;
}

.brd-flyout-wa:hover { background: #206bb3; color: #fff; }

/* --- Mega Menu --- */
.brd-mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    z-index: 500;
    max-height: 80vh;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.brd-mega-menu[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.brd-mega-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px 32px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
}

.brd-mega-col-title {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #0d0d0d;
    text-decoration: none;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #206bb3;
    font-family: var(--brd-font-family);
    transition: color 0.15s;
}

.brd-mega-col-title:hover { color: #206bb3; }

.brd-mega-col ul { list-style: none; margin: 0; padding: 0; }

.brd-mega-col > ul > li > a {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #0d0d0d;
    text-decoration: none;
    padding: 4px 4px 4px 14px;
    position: relative;
    transition: color 0.15s;
}

.brd-mega-col > ul > li > a::before { content: '•'; position: absolute; left: 3px; color: #206bb3; }
.brd-mega-col > ul > li > a:hover { color: #206bb3; }

.brd-mega-l3 { list-style: none; margin: 0; padding: 0 0 4px 14px; }

.brd-mega-l3 li a {
    display: block;
    font-size: 14px;
    color: #666;
    text-decoration: none;
    padding: 2px 4px 2px 16px;
    position: relative;
    transition: color 0.15s;
}

.brd-mega-l3 li a::before { content: '••'; position: absolute; left: 0; color: #bbb; font-size: 10px; }
.brd-mega-l3 li a:hover { color: #206bb3; }

/* --- Flyout RTL (itens da 2ª metade — abre da direita para a esquerda) --- */
.brd-cat-item.brd-cat-rtl > .brd-flyout {
    left: auto;
    right: 0;
    border-radius: 8px 0 8px 8px;
}

/* --- Overlay de foco (escurece o conteúdo abaixo do nav ao hover) --- */
.brd-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 190;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.brd-category-menu:has(.brd-cat-item.has-children:hover) + .brd-nav-overlay,
.brd-category-menu:has(.brd-cat-all-btn:hover) + .brd-nav-overlay,
.brd-category-menu:has(.brd-cat-all-btn[aria-expanded="true"]) + .brd-nav-overlay {
    opacity: 1;
}

/* ==========================================================================
   Mobile
   ========================================================================== */
@media (max-width: 921px) {
    /* Tarja */
    .brd-ann-item { font-size: 11px; }
    .brd-ann-item svg { width: 13px !important; height: 13px !important; }

    /* Header mobile — Logo | Atendimento | Minha Conta
       (Hamburger, Busca e Carrinho migram para a bottom nav) */
    .brd-hdr-hamburger,
    .brd-hdr-search-wrap,
    .brd-hdr-search-icon,
    .brd-hdr-search-form,
    .brd-hdr-cart,
    .brd-category-menu { display: none !important; }
    .brd-mobile-search[hidden] { display: none !important; }

    /* Altura compacta no mobile sem depender de html.brd-scrolled */
    .brd-header { height: var(--brd-header-h-sm); }

    .brd-hdr-inner {
        display: flex;
        align-items: center;
        padding: 0 16px;
        height: var(--brd-header-h-sm);
        gap: 12px;
    }

    /* Distribuição: logo ocupa o espaço flexível, ações alinham à direita */
    .brd-hdr-logo { flex: 1 1 auto; justify-self: unset; justify-content: flex-start; min-width: 0; }
    .brd-logo-full { width: auto; max-height: 44px; margin: 0; }
    .brd-hdr-actions { flex: 0 0 auto; justify-self: unset; gap: 22px; padding-top: 0; }

    /* Neutraliza troca de logo por scroll no mobile — o gatilho passa a ser login */
    html.brd-scrolled .brd-logo-full {
        opacity: 1;
        pointer-events: auto;
        width: auto;
        margin: 0;
    }
    html.brd-scrolled .brd-logo-scrolled {
        opacity: 0;
        pointer-events: none;
        transform: translateY(5px);
    }

    /* Mantém ícone+label em coluna ao rolar (desktop inverte para row, mobile não deve) */
    html.brd-scrolled .brd-hdr-action-btn {
        flex-direction: column;
        gap: 4px;
    }
    /* Sem padding-top extra ao rolar — evita empurrar botões para a borda inferior */
    html.brd-scrolled .brd-hdr-actions { padding-top: 0; }
    /* Neutraliza o fade (.brd-layout-changing) usado para mascarar a transição column→row
       do desktop — no mobile o layout não muda, então o fade fica como "pisca" indesejado */
    .brd-hdr-actions.brd-layout-changing { opacity: 1; }

    /* No mobile o header rola junto com a página — sem sticky, sem auto-hide. */
    .brd-header { position: static; }

    /* Logado: mostrar logo compacta (águia + slogan) no lugar da completa */
    body.logged-in .brd-logo-full {
        opacity: 0;
        pointer-events: none;
    }
    body.logged-in .brd-logo-scrolled {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
        justify-content: flex-start;
    }
    body.logged-in .brd-logo-sm { height: 30px; }

    /* Slogan logado no mobile: tagline em duas linhas ("seu parceiro" / "de crescimento") */
    body.logged-in .brd-slogan-tagline-part { display: block; }
    body.logged-in .brd-slogan-name { font-size: 13px; line-height: 1.2; }
    body.logged-in .brd-slogan-tagline { font-size: 11px; line-height: 1.25; }

    /* Ícones de ação no mobile: ícone em cima, label embaixo, sempre em coluna */
    /* Conjunto ícone+label dimensionado para bater com a altura da logo (44px): 28 + 4 + 12 = 44 */
    html .brd-hdr-action-btn { flex-direction: column; gap: 4px; padding: 0 2px; }
    .brd-hdr-action-btn svg { width: 24px; height: 24px; }
    .brd-hdr-btn-label {
        display: block;
        font-size: 12px;
        font-weight: 500;
        line-height: 1;
        letter-spacing: 0.2px;
        color: var(--brd-off-white);
    }
    /* Remove o padding-bottom do dropdown (usado só para hover desktop) — centraliza o botão no header */
    .brd-hdr-dropdown { padding-bottom: 0; display: flex; }

    /* Esticar ações e botões até a altura total do header — retângulo ativo conecta ao painel
       margin-top deixa um respiro no topo para o retângulo não encostar no topo do header */
    .brd-hdr-actions { align-self: stretch; align-items: stretch; }
    .brd-hdr-action-btn { justify-content: center; margin-top: 6px; }

    /* Reset agressivo no estado não-ativo — vence override do Astra / tap highlight iOS */
    .brd-hdr-dropdown:not(.is-open) .brd-hdr-action-btn {
        background: transparent !important;
        color: var(--brd-off-white) !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        -webkit-tap-highlight-color: transparent;
        -webkit-appearance: none;
        appearance: none;
    }
    .brd-hdr-dropdown:not(.is-open) .brd-hdr-btn-label {
        color: var(--brd-off-white) !important;
    }

    /* Bege sutil (derivado do off-white da marca) no painel aberto e no retângulo ativo */
    .brd-hdr-panel { background: #FAF7EC; }
    .brd-hdr-dropdown.is-open .brd-hdr-action-btn { background: #FAF7EC !important; }

    /* Dropdown panels no mobile: 80% da largura, flutuante com sombra,
       borda direita do painel alinha 5px após a borda direita do botão Minha Conta.
       Como .brd-hdr-inner tem padding 16px, right: 11px deixa o painel 5px "além" do botão.
       top: tarja 36px + header 60px (quando não rolado); só 60px quando rolado. */
    .brd-hdr-panel {
        position: fixed;
        top: calc(36px + var(--brd-header-h-sm));
        left: auto;
        right: 11px;
        width: 80%;
        border-radius: 8px;
        min-width: unset;
    }
    html.brd-scrolled .brd-hdr-panel { top: var(--brd-header-h-sm); }

    /* Garante border-radius uniforme e sombra mais visível no estado aberto */
    .brd-hdr-dropdown.is-open .brd-hdr-panel {
        border-radius: 8px;
        box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
    }

    /* Backdrop escurecido enquanto o painel estiver aberto (mobile apenas).
       z-index: 150 fica ABAIXO do header (200) — o painel (contido no contexto do header)
       permanece visível. A tarja é promovida abaixo para também ficar acima.
       Usa :has() — suportado em iOS Safari 15.4+ / Chrome 105+. */
    body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 150;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }
    body:has(.brd-hdr-dropdown.is-open)::before,
    body:has(#brd-mobile-search:not([hidden]))::before {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    /* Tarja acima do backdrop (fica visível junto com o header) */
    .brd-announcement-bar { position: relative; z-index: 220; }

    /* Painel Minha Conta (não logado): Entrar + Cadastrar lado a lado, pesos visuais equilibrados */
    .brd-conta-panel:has(.brd-btn-entrar) {
        display: flex;
        gap: 8px;
        padding: 12px;
    }
    .brd-conta-panel .brd-btn-entrar {
        flex: 1;
        margin-bottom: 0;
        padding: 10px 14px;
        font-size: 14px;
    }
    .brd-conta-panel .brd-panel-link--cadastrar {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 10px 14px;
        font-size: 14px;
        font-weight: 600;
        border-radius: 9999px;
        border: 1.5px solid #206bb3;
        color: #206bb3;
        background: transparent;
    }

    /* "Todas as Categorias" — oculto no mobile */
    .brd-cat-all-btn { display: none; }
    .brd-mega-menu { display: none; }

    /* Hamburger mobile */
    .brd-cat-toggle {
        display: flex;
        align-items: center;
        gap: 8px;
        background: none;
        border: none;
        color: var(--brd-off-white);
        padding: 12px 0;
        font-size: 14px;
        font-weight: 600;
        font-family: var(--brd-font-family);
        cursor: pointer;
        width: 100%;
    }

    .brd-hamburger {
        display: block;
        width: 20px;
        height: 2px;
        background: var(--brd-off-white);
        position: relative;
        transition: background 0.3s;
    }

    .brd-hamburger::before,
    .brd-hamburger::after {
        content: '';
        display: block;
        width: 20px;
        height: 2px;
        background: var(--brd-off-white);
        position: absolute;
        left: 0;
        transition: transform 0.3s;
    }

    .brd-hamburger::before { top: -6px; }
    .brd-hamburger::after  { top: 6px; }

    .brd-cat-toggle[aria-expanded="true"] .brd-hamburger { background: transparent; }
    .brd-cat-toggle[aria-expanded="true"] .brd-hamburger::before { transform: rotate(45deg); top: 0; }
    .brd-cat-toggle[aria-expanded="true"] .brd-hamburger::after  { transform: rotate(-45deg); top: 0; }

    .brd-cat-inner { padding: 0 16px; }

    .brd-cat-list {
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding-bottom: 8px;
        width: 100%;
    }

    .brd-cat-list.open { display: flex; }

    .brd-cat-item { display: block; }

    .brd-cat-item > a {
        padding: 10px 0;
        justify-content: space-between;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        background: none !important;
    }

    /* Flyout vira acordeão no mobile */
    .brd-flyout {
        position: static;
        display: none;
        flex-direction: column;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.03);
        border-radius: 0;
        min-width: unset;
        max-height: none;
        pointer-events: auto;
        padding: 0 0 0 16px;
    }

    .brd-cat-item.sub-open > .brd-flyout { display: flex; }
    .brd-flyout-right { display: none; }
    .brd-flyout-head { padding-bottom: 8px; margin-bottom: 8px; }
    .brd-flyout-title { color: #fff; font-size: 14px; }
    .brd-flyout-btn-all { display: none; }

    .brd-flyout-list > li > a { color: rgba(255,255,255,0.8); }
    .brd-flyout-list > li > a::before { color: #206bb3; }
    .brd-flyout-sub li a { color: rgba(255,255,255,0.55); }

    .brd-cat-item.sub-open .brd-chevron { transform: rotate(180deg); opacity: 1; }
}

/* ── Header minimal — Carrinho / Checkout ─────────────────── */
.brd-header--minimal {
    height: 64px;
    background: #ffffff;
    border-bottom: 1px solid #e8e8e8;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
}

.brd-header--minimal .brd-hdr-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    max-width: 1170px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Logo — versão escura via filtro CSS (fundo branco) */
.brd-minimal-logo {
    display: flex;
    text-decoration: none;
    flex-shrink: 0;
}

.brd-minimal-logo img {
    display: block;
    max-height: 38px;
    width: auto;
}

/* Impede que os estados de scroll do header principal afetem o header minimal */
html.brd-scrolled .brd-header--minimal {
    height: 64px;
    background: #ffffff;
}

html.brd-scrolled .brd-header--minimal .brd-hdr-inner {
    height: 64px;
}

html.brd-scrolled .brd-minimal-logo img {
    max-height: 38px;
    width: auto;
    opacity: 1 !important;
    pointer-events: auto !important;
    margin: 0 !important;
}

/* Botão de segurança */
.brd-secure-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 1.5px solid rgba(32, 107, 179, 0.35);
    border-radius: 9999px;
    padding: 7px 14px 7px 10px;
    cursor: pointer;
    color: #206BB3;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    position: relative;
    overflow: hidden;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.2s;
}

/* Shimmer — raio de luz que varre o botão periodicamente */
.brd-secure-trigger::before {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        105deg,
        transparent 20%,
        rgba(32, 107, 179, 0.18) 50%,
        transparent 80%
    );
    animation: brd-secure-shimmer 3.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes brd-secure-shimmer {
    0%        { left: -120%; }
    40%, 100% { left: 160%; }
}

.brd-secure-trigger:hover {
    background: #206BB3;
    border-color: #206BB3;
    color: #ffffff;
    box-shadow: 0 0 0 3px rgba(32, 107, 179, 0.18);
}

/* Ícone cadeado com pulso de segurança */
.brd-secure-lock {
    flex-shrink: 0;
    animation: brd-lock-pulse 2.4s ease-in-out infinite;
}

@keyframes brd-lock-pulse {
    0%, 100% { filter: drop-shadow(0 0 0px rgba(32, 107, 179, 0)); }
    50%       { filter: drop-shadow(0 0 5px rgba(32, 107, 179, 0.7)); }
}

@media (max-width: 600px) {
    .brd-header--minimal .brd-hdr-inner { padding: 0 16px; }
    .brd-secure-trigger span { display: none; }
    .brd-secure-trigger { padding: 8px; border-radius: 50%; }
}

/* ==========================================================================
   Camada 4 - Bottom Nav (Mobile ≤921px)
   Botões visuais — comportamento será definido depois.
   ========================================================================== */
.brd-bottom-nav { display: none; }

@media (max-width: 921px) {
    .brd-bottom-nav {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: 64px;
        background: #183357;
        border-top: 1px solid rgba(244, 238, 215, 0.12);
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.22);
        z-index: 210;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .brd-bn-btn {
        background: none;
        border: none;
        cursor: pointer;
        color: var(--brd-off-white);
        font-family: var(--brd-font-family);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 6px 4px;
        opacity: 0.9;
        transition: opacity 0.15s ease, transform 0.15s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .brd-bn-btn:hover,
    .brd-bn-btn:focus,
    .brd-bn-btn:focus-visible {
        outline: none !important;
        box-shadow: none !important;
        background: transparent !important;
        background-color: transparent !important;
        color: var(--brd-off-white) !important;
        border-color: transparent !important;
        opacity: 0.9;
        -webkit-tap-highlight-color: transparent;
    }
    .brd-bn-btn:active { opacity: 0.75; transform: scale(0.92); }

    .brd-bn-btn svg { width: 26px; height: 26px; flex-shrink: 0; }
    .brd-bn-btn--cart svg { width: 40px; height: 40px; transform: translateY(7px); }
    .brd-bn-btn--cart .brd-bn-icon-wrap { transform: translateX(-4px); }

    .brd-bn-label {
        font-size: 11px;
        font-weight: 400;
        letter-spacing: 0.2px;
        line-height: 1;
    }

    @keyframes brd-label-slide-a {
        0%, 30%   { opacity: 1; transform: translateY(0); }
        42%       { opacity: 0; transform: translateY(-100%); }
        43%       { opacity: 0; transform: translateY(100%); }
        87%       { opacity: 0; transform: translateY(100%); }
        98%, 100% { opacity: 1; transform: translateY(0); }
    }
    @keyframes brd-label-slide-b {
        0%, 35%   { opacity: 0; transform: translateX(-50%) translateY(100%); }
        47%       { opacity: 1; transform: translateX(-50%) translateY(0); }
        80%       { opacity: 1; transform: translateX(-50%) translateY(0); }
        91%       { opacity: 0; transform: translateX(-50%) translateY(-100%); }
        92%, 100% { opacity: 0; transform: translateX(-50%) translateY(100%); }
    }
    .brd-bn-label--alt {
        position: relative;
        height: 1em;
        clip-path: inset(0 -50vw);
    }
    .brd-bn-label-a,
    .brd-bn-label-b {
        display: block;
        white-space: nowrap;
    }
    .brd-bn-label-a {
        animation: brd-label-slide-a 4s ease-in-out infinite;
    }
    .brd-bn-label-b {
        position: absolute;
        top: 0;
        left: 50%;
        animation: brd-label-slide-b 4s ease-in-out infinite;
    }

    /* Wrap com altura igual aos ícones menores (26px); ícone maior do carrinho
       alinha pela base e overflow para cima — mantém os labels na mesma linha. */
    .brd-bn-icon-wrap {
        position: relative;
        display: inline-flex;
        align-items: flex-end;
        justify-content: center;
        height: 26px;
    }

    /* Quantidade de itens exibida dentro do cesto do carrinho.
       Cesto do carrinho Tabler (viewBox 0-24): centro ≈ (13, 9.25).
       SVG 40px alinhado pela base do wrap (26px) → overflow de 14px para cima.
       Centro do cesto: x = 13/24 × 40 = 21.7px (54%); y = 9.25/24 × 40 - 14 = 1.4px. */
    .brd-bn-count {
        position: absolute;
        top: 3.5px;
        left: 56%;
        transform: translate(-50%, calc(-50% + 7px));
        font-family: var(--brd-font-family);
        font-size: 10px;
        font-weight: 400;
        line-height: 1;
        letter-spacing: -0.3px;
        color: #fff;
        pointer-events: none;
    }

    /* Espaço para o conteúdo não ficar coberto pela bottom nav */
    body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

    /* ── Botão WhatsApp no nav ── */
    .brd-bn-btn--wa {
        text-decoration: none;
        color: #25D366;
    }

    .brd-bn-btn--wa svg { fill: #25D366; width: 22px; height: 22px; }

    .brd-bn-btn--wa .brd-bn-label { color: #25D366; font-size: 13px; }

    .brd-bn-btn--wa:hover,
    .brd-bn-btn--wa:focus,
    .brd-bn-btn--wa:focus-visible {
        color: #25D366 !important;
        opacity: 0.9;
    }
}
