.edition-demo {
    min-height: 29px;
    font-size: max(12px, .75rem);
    letter-spacing: .065em;
}

.edition-header.commerce-masthead {
    --menu-surface: color-mix(in srgb, var(--accent) 23%, #131820);
    --menu-text: #fff;
    min-height: clamp(72px, 5.9vw, 86px);
    gap: clamp(1rem, 3vw, 3.5rem);
    color: var(--ink);
    background: var(--paper);
    border-color: var(--rule);
}

.commerce-masthead .edition-nav {
    justify-content: flex-end;
    gap: clamp(1rem, 2.25vw, 2.6rem);
}

.commerce-masthead .edition-nav a:first-child { color: inherit; }
.commerce-masthead .edition-brand {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}
.commerce-masthead summary { list-style: none; cursor: pointer; }
.commerce-masthead summary::-webkit-details-marker { display: none; }
.commerce-masthead .edition-menu-toggle { display: none; }
.commerce-masthead .edition-tools { gap: .2rem; }
.commerce-masthead .edition-tools span { display: none; }
.commerce-masthead .edition-tools :is(a, summary) {
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
    text-decoration: none;
}
.commerce-masthead .edition-tools i { font-size: 1.24rem; }

.edition-categories { position: relative; }
.commerce-masthead .edition-nav > a, .edition-categories > summary {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font: 600 .94rem/1.3 var(--ui);
    white-space: nowrap;
}
.edition-categories > summary { gap: .5em; }
.edition-categories > summary::after {
    content: "";
    width: .42em;
    height: .42em;
    border: solid currentColor;
    border-width: 0 1.5px 1.5px 0;
    transform: translateY(-.1em) rotate(45deg);
}
.edition-categories[open] > summary::after {
    transform: translateY(.1em) rotate(225deg);
}
.edition-categories > summary:hover, .edition-categories[open] > summary {
    text-decoration: underline;
    text-underline-offset: .35em;
}
.commerce-masthead :is(a, summary):focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}
.edition-category-links {
    position: absolute;
    top: 100%;
    z-index: 3;
    width: max-content;
    min-width: 15rem;
    max-width: 22rem;
    max-height: 70vh;
    overflow-y: auto;
    padding: .5rem;
    background: var(--menu-surface);
    color: var(--menu-text);
}
.commerce-masthead .edition-category-links a {
    display: flex;
    padding: .55rem .9rem;
    min-height: 44px;
    line-height: 1.35;
    color: inherit;
}
.edition-category-links a:is(:hover,:focus-visible) {
    background: #ffffff18;
}
.edition-category-links a:focus-visible {
    outline-offset: -3px;
}
.edition-category-links .edition-collections-index {
    border-top: 1px solid #ffffff40;
    margin-top: .25rem;
}

@media (max-width: 800px) {
    .edition-header.commerce-masthead {
        grid-template-columns: minmax(0, 1fr) auto auto;
        gap: 0;
        padding: .35rem clamp(8px, 3vw, 20px);
        min-height: 60px;
    }
    .commerce-masthead .edition-brand {
        width: fit-content;
        max-width: 100%;
        font-size: clamp(1.25rem, 5.9vw, 2.15rem);
    }
    .commerce-masthead .edition-tools {
        grid-row: 1;
        grid-column: 2;
        gap: 0;
    }
    .commerce-masthead .edition-menu {
        grid-row: 1;
        grid-column: 3;
    }
    .commerce-masthead .edition-menu-toggle {
        display: grid;
        place-items: center;
        width: 44px;
        min-height: 44px;
        font-size: 1.55rem;
    }
    .edition-menu[open] > .edition-menu-toggle .bi::before {
        content: "\f659"; /* Bootstrap Icons x-lg */
        font-size: 1.15rem;
    }
    .commerce-masthead .edition-nav {
        position: absolute;
        grid-area: auto;
        inset: 100% 0 auto;
        z-index: 3;
        display: block;
        max-height: calc(100dvh - 100px);
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: .55rem max(20px, var(--gutter)) 1rem;
        border: 0;
        background: var(--menu-surface);
        color: var(--menu-text);
    }
    .commerce-masthead .edition-nav > a, .edition-categories > summary {
        display: flex;
        justify-content: space-between;
        width: 100%;
        min-height: 50px;
        border-bottom: 1px solid #ffffff35;
        font-size: 1.08rem;
    }
    .edition-category-links {
        position: static;
        min-width: 0;
        width: auto;
        max-width: none;
        max-height: none;
        padding: .25rem 0 .5rem .65rem;
    }
}
