/* Main Menu da Home: ajustes de navegação e responsividade, preservando o header E4.002 v3.
 * Escopo isolado: não afeta estilos das páginas internas nem o SVG oficial. */

.mm-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 50;
    border: 0;
    border-bottom: 1px solid transparent;
    color: #fff;
    background: transparent;
    box-shadow: none;
    transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
/* No topo não há fundo; após a rolagem, o azul torna o menu legível. */
.mm-header.mm-is-scrolled {
    background: #0b2742;
    border-bottom-color: rgba(255,255,255,.12);
    box-shadow: 0 6px 20px rgba(2,18,35,.22);
}
/* Catálogo sem fotografia atrás do menu: contraste desde o primeiro pixel.
   Na Home permanece o cabeçalho transparente até o primeiro scroll. */
.mm-header.mm-header--catalog,
.mm-header.mm-header--catalog.mm-is-scrolled {
    background: #0b2742;
    border-bottom-color: rgba(255,255,255,.12);
    box-shadow: 0 6px 20px rgba(2,18,35,.16);
}
html:has(.mm-header) { scroll-padding-top: 78px; }
.mm-header .mm-header-inner {
    min-height: 58px;
    width: min(calc(100% - clamp(40px, 9vw, 110px)), 1340px);
    display: flex;
    align-items: center;
    gap: clamp(13px, 1.85vw, 28px);
    justify-content: space-between;
}
.mm-header .mm-brand {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #fff;
    flex: 0 0 auto;
    white-space: nowrap;
    letter-spacing: 0;
}
.mm-header .mm-official-logo-frame {
    position: relative;
    display: block;
    flex: 0 0 auto;
    width: 121px;
    height: 45px;
    overflow: hidden;
}
.mm-header .mm-official-logo {
    display: block;
    position: absolute;
    width: 137px;
    height: 53px;
    max-width: none;
    top: -4px;
    left: -8px;
    object-fit: contain;
}
.mm-header .mm-nav {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex: 1 1 auto;
    gap: clamp(9px, 1.32vw, 23px);
    padding-left: 14px;
    min-width: 0;
}
.mm-header .mm-nav > a {
    display: inline-flex;
    align-items: center;
    color: rgba(255,255,255,.95);
    font-size: clamp(10px, .91vw, 12px);
    line-height: 1.4;
    font-weight: 500;
    letter-spacing: -.015em;
    white-space: nowrap;
    text-decoration: none;
}
.mm-header .mm-nav > a:hover, .mm-header .mm-nav > a:focus-visible { color: #ffd18a; }
.mm-header .mm-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}
.mm-header .mm-search-link {
    display: grid;
    place-items: center;
    width: 36px; height: 36px;
    color: #fff;
    background: rgba(11, 29, 48, .46);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 50%;
}
.mm-header .mm-search-link:hover { background: rgba(11,29,48,.82); }
.mm-header .mm-search-link svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mm-header .mm-action {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 750;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid rgba(255,255,255,.68);
    box-shadow: 0 1px 6px rgba(1,15,29,.12);
    transition: background-color .15s ease, box-shadow .15s ease;
}
.mm-header .mm-action-login { color: #fff; background: rgba(31,35,41,.35); }
.mm-header .mm-action-login:hover { background: rgba(31,35,41,.7); }
/* Somente no menu desktop: círculo rígido de 38px, sem herdar padding
   e largura dos botões retangulares da navegação. O menu móvel mantém o rótulo. */
.mm-header .mm-actions .mm-action-login.mm-action-avatar {
    box-sizing: border-box;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    flex: 0 0 38px;
    width: 38px;
    min-width: 38px;
    max-width: 38px;
    height: 38px;
    min-height: 38px;
    max-height: 38px;
    padding: 0;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.78);
    background: #0b2742;
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
}
.mm-header .mm-action-login.mm-action-avatar:hover { background: #173f65; }
.mm-header .mm-action-avatar .mm-avatar-initial { display: inline-block; }
.mm-header .mm-actions .mm-action-avatar .mm-avatar-initial {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
}
.mm-header .mm-action-avatar .mm-avatar-fallback {
    width: 19px; height: 19px; fill: none;
    stroke: currentColor; stroke-width: 1.8;
    stroke-linecap: round; stroke-linejoin: round;
}
.mm-header .mm-mobile-account-label, .mm-header .mm-mobile-avatar-icon { display: none; }

.mm-header .mm-action-subscribe { color: #fff; border-color: #edc57b; background: #c99643; }
.mm-header .mm-action-subscribe:hover { background: #b98535; }
.mm-header .mm-action-dash { color: #fff; background: #081828; border-color: rgba(255,255,255,.72); }
.mm-header .mm-action-dash:hover { background: #173553; }
.mm-header .mm-nav > a:focus-visible,
.mm-header .mm-search-link:focus-visible,
.mm-header .mm-action:focus-visible,
.mm-header .mm-mobile > summary:focus-visible,
.mm-header .mm-mobile-panel > a:focus-visible {
    outline: 2px solid #ffd18a;
    outline-offset: 3px;
}
.mm-header .mm-mobile { display: none; }
/* O novo header se sobrepõe ao topo da Home, como na referência.
 * Enquanto o banner da Etapa 2 não é instalado, o gradiente mantém contraste. */
body:has(.mm-header) .hero { padding-top: 76px; }
body:has(.mm-header) .search-shell { scroll-margin-top: 18px; }

@media (max-width: 1250px) {
    .mm-header .mm-header-inner { gap: 14px; }
    .mm-header .mm-nav { gap: 12px; }
    .mm-header .mm-action { padding-inline: 11px; font-size: 10.7px; }
    .mm-header .mm-search-link { width: 33px; height: 33px; }
    .mm-header .mm-actions { gap: 6px; }
}
@media (max-width: 1030px) {
    .mm-header .mm-header-inner { min-height: 64px; gap: 8px; }
    .mm-header .mm-official-logo-frame { width: 118px; height: 44px; }
    .mm-header .mm-official-logo { width: 134px; height: 52px; top: -4px; left: -8px; }
    .mm-header .mm-nav { gap: 9px; padding-left: 0; }
    .mm-header .mm-nav > a { font-size: 10px; }
    .mm-header .mm-action { min-height: 35px; padding-inline: 9px; font-size: 10px; }
    .mm-header .mm-search-link { width: 30px; height: 30px; }
}
@media (max-width: 920px) {
    .mm-header { position: fixed; background: transparent; }
    .mm-header .mm-header-inner { width: min(calc(100% - 28px), var(--container)); min-height: 70px; }
    .mm-header .mm-nav, .mm-header .mm-actions { display: none; }
    .mm-header .mm-mobile { display: block; margin-left: auto; position: relative; }
    .mm-header:has(.mm-mobile[open]) { background: #0b2742; }
    .mm-header .mm-mobile > summary {
        display: flex; gap: 8px; align-items: center; justify-content: center;
        min-width: 86px; min-height: 42px; padding: 0 10px; cursor: pointer;
        border: 1px solid rgba(255,255,255,.55); border-radius: 7px; list-style: none;
        color: #fff; font-size: 13px; font-weight: 650;
    }
    .mm-header .mm-mobile > summary::-webkit-details-marker { display: none; }
    .mm-header .mm-hamburger { display: inline-flex; flex-direction: column; gap: 4px; }
    .mm-header .mm-hamburger i { display: block; width: 16px; height: 2px; border-radius: 2px; background: currentColor; }
    .mm-header .mm-mobile:not([open]) > .mm-mobile-panel { display: none; }
    .mm-header .mm-mobile-panel {
        position: absolute; top: calc(100% + 12px); right: 0; z-index: 80;
        display: flex; flex-direction: column; align-items: stretch; gap: 0;
        width: min(340px, calc(100vw - 28px));
        max-height: calc(100vh - 110px); max-height: calc(100dvh - 110px); overflow-y: auto;
        background: #0b2742; padding: 12px; border-radius: 12px;
        border: 1px solid rgba(255,255,255,.18); box-shadow: 0 14px 32px rgba(0,0,0,.28);
    }
    .mm-header .mm-mobile-panel > a {
        display: flex; justify-content: space-between; align-items: center;
        padding: 11px 12px; color: #fff; text-decoration: none; font-size: 14px;
        border-radius: 7px;
    }
    .mm-header .mm-mobile-panel > a:hover { background: rgba(255,255,255,.09); }
    .mm-header .mm-mobile-actions { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 8px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.15); }
    .mm-header .mm-mobile-actions .mm-action { min-height: 39px; font-size: 12px; }
    /* No painel móvel, o avatar acompanha o rótulo para facilitar a navegação. */
    .mm-header .mm-mobile-actions .mm-action-login.mm-action-avatar {
        display: flex;
        width: 100%;
        height: auto;
        min-width: 0;
        min-height: 42px;
        flex: none;
        padding: 5px 12px;
        border-radius: 7px;
        justify-content: flex-start;
        gap: 10px;
        font-size: 12px;
        text-transform: none;
    }
    .mm-header .mm-mobile-actions .mm-action-avatar .mm-mobile-avatar-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 30px;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        background: rgba(255,255,255,.13);
        text-transform: uppercase;
        font-size: 14px;
    }
    .mm-header .mm-mobile-actions .mm-action-avatar .mm-mobile-account-label { display: inline; }

    body:has(.mm-header) .hero { padding-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .mm-header, .mm-header .mm-action { transition: none; }
}
