@font-face {
    font-family: "Archivo Navegación";
    src: url("archivo-variable-latin.woff2") format("woff2");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

.mg-header {
    --mg-header-ink: #171719;
    --mg-header-accent: #610904;
    --mg-header-pink: #fbf4f2;
    --mg-header-line: #ead9d6;
    position: fixed;
    inset: 0 0 auto;
    z-index: 3;
    background: #fff;
    box-shadow: 0 4px 14px rgb(52 14 12 / 12%);
    border-block-end: 2px solid #b31007;
    color: var(--mg-header-ink);
    font: 700 .9rem/1.2 "Archivo Navegación", system-ui, sans-serif;
}

.mg-header__bar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "brand navigation actions";
    align-items: center;
    gap: clamp(.5rem, 1.4vw, 1.4rem);
    width: min(1240px, 100% - 2rem);
    min-height: 55px;
    margin-inline: auto;
}

.mg-header__brand {
    grid-area: brand;
    justify-self: start;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.mg-header__brand img {
    display: block;
    width: min(163px, 38vw);
    height: auto;
}

.mg-header__navigation { grid-area: navigation; }

.mg-header__navigation ul {
    display: flex;
    justify-content: center;
    gap: clamp(.1rem, .45vw, .45rem);
    margin: 0;
    padding: 0;
    list-style: none;
}

.mg-header__navigation a,
.mg-header__control {
    display: flex;
    align-items: center;
    min-height: 44px;
    border-radius: 8px;
    color: var(--mg-header-ink);
}

.mg-header__navigation a {
    padding-inline: clamp(.45rem, .85vw, .85rem);
    white-space: nowrap;
    text-decoration: none;
}

.mg-header__navigation a[aria-current],
.mg-header__navigation a:hover,
.mg-header__control:hover,
.mg-header__toggle[aria-expanded="true"] {
    background: var(--mg-header-pink);
    color: var(--mg-header-accent);
}

.mg-header__navigation a[aria-current] {
    box-shadow: inset 0 -2px var(--mg-header-accent);
    font-weight: 800;
}

.mg-header :is(a, button):focus-visible {
    outline: 2px solid var(--mg-header-accent);
    outline-offset: -2px;
}

.mg-header__actions {
    grid-area: actions;
    display: flex;
    justify-content: end;
}

.mg-header__control {
    justify-content: center;
    box-sizing: border-box;
    width: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.mg-header__toggle {
    grid-area: toggle;
    display: none;
}

.mg-header__menu-icon {
    width: 18px;
    height: 2px;
    background: currentColor;
    box-shadow: 0 -5px currentColor, 0 5px currentColor;
}

.mg-header__search-icon,
.mg-header__account-icon {
    position: relative;
    display: block;
    box-sizing: border-box;
}

.mg-header__search-icon {
    width: 13px;
    height: 13px;
    margin: -4px 4px 0 0;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.mg-header__search-icon::after {
    content: "";
    position: absolute;
    top: 9px;
    left: 8px;
    width: 7px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transform: rotate(45deg);
    transform-origin: left center;
}

.mg-header__account-icon {
    align-self: center;
    width: 16px;
    height: 8px;
    margin-top: 9px;
    border: 2px solid currentColor;
    border-radius: 7px 7px 3px 3px;
}

.mg-header__account-icon::before {
    content: "";
    position: absolute;
    bottom: 7px;
    left: 2px;
    width: 8px;
    height: 8px;
    box-sizing: border-box;
    border: 2px solid currentColor;
    border-radius: 50%;
}

@media (max-width: 61.999rem) {
    .mg-header__bar {
        grid-template-columns: minmax(44px, 1fr) auto minmax(88px, 1fr);
        grid-template-areas: "toggle brand actions";
        gap: 0;
        width: calc(100% - 1rem);
    }

    .mg-header__brand { justify-self: center; }

    .mg-header__navigation {
        position: absolute;
        inset: 100% max(.5rem, calc((100% - 1240px) / 2)) auto;
        max-height: calc(100dvh - 57px);
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: .45rem;
        border: 1px solid var(--mg-header-line);
        border-block-start: 0;
        border-radius: 0 0 12px 12px;
        background: #fff;
        box-shadow: 0 12px 24px rgb(52 14 12 / 16%);
    }

    .mg-header__navigation ul {
        flex-direction: column;
        gap: .15rem;
        text-align: start;
    }

    .mg-header__navigation a { padding-inline: .85rem; }
    .mg-header__navigation a[aria-current] { box-shadow: inset 3px 0 var(--mg-header-accent); }

    .mg-header--interactive .mg-header__toggle { display: flex; }
    .mg-header--interactive .mg-header__toggle[aria-expanded="false"] ~ .mg-header__navigation { display: none; }

    .mg-header:not(.mg-header--interactive) { position: relative; }
    .mg-header:not(.mg-header--interactive) .mg-header__navigation {
        position: static;
        grid-column: 1 / -1;
        max-height: none;
    }
}
