/* V1-4 global shell: brand, navigation, search, drawer and footer only. */
:root {
    --mc-header-offset: var(--mc-header-scroll-offset);
}

.mc-site-header {
    box-sizing: border-box;
    position: sticky;
    top: 0;
    z-index: 1040;
    height: var(--mc-header-height);
    border-bottom: var(--mc-border-width) solid var(--mc-border);
    background: color-mix(in srgb, var(--mc-surface) 94%, transparent);
    color: var(--mc-text-primary);
    backdrop-filter: blur(12px);
}

.mc-site-header__inner,
.mc-shell-panel__inner,
.mc-site-footer__inner,
.mc-site-footer__copyright {
    width: min(calc(100% - 32px), var(--mc-width-page));
    margin-inline: auto;
}

.mc-site-header__inner {
    display: flex;
    align-items: center;
    min-height: calc(var(--mc-header-height) - 1px);
    gap: var(--mc-space-5);
}

.mc-site-brand,
.mc-site-footer__brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 10px;
    color: var(--mc-text-primary);
    text-decoration: none;
}

.mc-site-brand__mark,
.mc-site-footer__mark {
    display: block;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    background: url("/brand/brand-mark.svg") center / contain no-repeat;
}

:root[data-theme="dark"] .mc-site-brand__mark,
:root[data-theme="dark"] .mc-site-footer__mark {
    background-image: url("/brand/brand-mark-dark.svg");
}

.mc-site-brand__wordmark {
    font-size: 17px;
    line-height: 24px;
    font-weight: 720;
    letter-spacing: -0.03em;
    white-space: nowrap;
}

.mc-site-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    margin-left: auto;
    gap: 2px;
}

.mc-site-nav__link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 9px;
    border: 0;
    border-radius: var(--mc-radius-sm);
    background: transparent;
    color: var(--mc-text-secondary);
    font: inherit;
    font-size: 14px;
    font-weight: 620;
    line-height: 20px;
    text-decoration: none;
    white-space: nowrap;
}

.mc-site-nav__link:hover,
.mc-site-nav__link[aria-expanded="true"] {
    background: var(--mc-surface-subtle);
    color: var(--mc-interactive);
}

.mc-site-nav__chevron {
    width: 6px;
    height: 6px;
    margin-left: 7px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
}

.mc-site-header__actions {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: var(--mc-space-2);
}

.mc-shell-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    padding: 0;
    border: var(--mc-border-width) solid var(--mc-border);
    border-radius: var(--mc-radius-md);
    background: var(--mc-surface);
    color: var(--mc-text-secondary);
}

.mc-shell-icon-button:hover,
.mc-shell-icon-button[aria-expanded="true"] {
    border-color: var(--mc-border-strong);
    background: var(--mc-surface-subtle);
    color: var(--mc-interactive);
}

.mc-shell-icon-button svg,
.mc-shell-search__control svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mc-theme-icon--sun,
:root[data-theme="dark"] .mc-theme-icon--moon {
    display: none;
}

:root[data-theme="dark"] .mc-theme-icon--sun {
    display: block;
}

.mc-site-header__menu {
    display: none;
}

.mc-shell-panel {
    position: absolute;
    top: calc(var(--mc-header-height) - 1px);
    left: 0;
    width: 100%;
    border-bottom: var(--mc-border-width) solid var(--mc-border);
    background: var(--mc-surface);
    box-shadow: var(--mc-shadow-overlay);
}

.mc-shell-panel[hidden],
.mc-shell-search__results[hidden] {
    display: none;
}

.mc-shell-panel__inner {
    padding-block: var(--mc-space-6);
}

.mc-category-menu {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: var(--mc-border-width) solid var(--mc-border);
}

.mc-category-menu__group {
    min-width: 0;
    padding: var(--mc-space-4) var(--mc-space-5);
    border-bottom: var(--mc-border-width) solid var(--mc-border);
}

.mc-category-menu__group:not(:nth-child(3n + 1)) {
    border-left: var(--mc-border-width) solid var(--mc-border);
}

.mc-category-menu__heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--mc-space-3);
    color: var(--mc-text-primary);
    font-size: 15px;
    line-height: 22px;
    font-weight: 680;
    text-decoration: none;
}

.mc-category-menu__heading:hover,
.mc-category-menu__group li a:hover,
.mc-shell-panel__all-link:hover {
    color: var(--mc-interactive);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.mc-category-menu__count {
    color: var(--mc-text-muted);
    font-size: 13px;
    font-weight: 540;
}

.mc-category-menu__group p {
    margin: 4px 0 8px;
    color: var(--mc-text-muted);
    font-size: 13px;
    line-height: 20px;
}

.mc-category-menu__group ul {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mc-category-menu__group li a,
.mc-shell-panel__all-link {
    color: var(--mc-text-secondary);
    font-size: 13px;
    line-height: 20px;
    text-decoration: none;
}

.mc-shell-panel__all-link {
    display: flex;
    justify-content: flex-end;
    gap: var(--mc-space-2);
    margin-top: var(--mc-space-4);
    font-weight: 650;
}

.mc-shell-panel__inner--search {
    max-width: 720px;
}

.mc-shell-search {
    position: relative;
}

.mc-shell-search > label {
    display: block;
    margin-bottom: var(--mc-space-2);
    color: var(--mc-text-primary);
    font-size: 14px;
    line-height: 20px;
    font-weight: 650;
}

.mc-shell-search__control {
    display: flex;
    align-items: center;
    gap: var(--mc-space-3);
    min-height: 48px;
    padding: 0 var(--mc-space-4);
    border: var(--mc-input-border-width) solid var(--mc-border-strong);
    border-radius: var(--mc-radius-md);
    background: var(--mc-surface);
    color: var(--mc-text-muted);
}

.mc-shell-search__control:focus-within {
    border-color: var(--mc-focus);
    box-shadow: 0 0 0 4px var(--mc-focus-ring);
}

.mc-shell-search__control input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--mc-text-primary);
    font: inherit;
    font-size: 16px;
}

.mc-shell-search__control input::placeholder {
    color: var(--mc-text-muted);
}

.mc-shell-search__results {
    max-height: min(432px, 52vh);
    margin-top: var(--mc-space-2);
    overflow-y: auto;
    border: var(--mc-border-width) solid var(--mc-border);
    border-radius: var(--mc-radius-md);
    background: var(--mc-surface);
    box-shadow: var(--mc-shadow-subtle);
}

.mc-shell-search__result {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px var(--mc-space-4);
    padding: 11px var(--mc-space-4);
    border-bottom: var(--mc-border-width) solid var(--mc-border);
    color: var(--mc-text-primary);
    text-decoration: none;
}

.mc-shell-search__result:last-child {
    border-bottom: 0;
}

.mc-shell-search__result:hover,
.mc-shell-search__result:focus-visible {
    background: var(--mc-surface-subtle);
}

.mc-shell-search__result-name {
    font-size: 14px;
    line-height: 20px;
    font-weight: 650;
}

.mc-shell-search__result-category {
    color: var(--mc-text-muted);
    font-size: 13px;
    line-height: 20px;
}

.mc-shell-search__result-description {
    grid-column: 1 / -1;
    color: var(--mc-text-muted);
    font-size: 13px;
    line-height: 20px;
}

.mc-shell-search__empty {
    margin: 0;
    padding: var(--mc-space-4);
    color: var(--mc-text-muted);
    font-size: 14px;
    line-height: 22px;
}

.mc-mobile-drawer {
    width: min(88vw, 448px);
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0 0 0 auto;
    padding: 0;
    border: 0;
    border-left: var(--mc-border-width) solid var(--mc-border);
    background: var(--mc-surface);
    color: var(--mc-text-primary);
    box-shadow: var(--mc-shadow-overlay);
}

.mc-mobile-drawer[open] {
    display: flex;
    flex-direction: column;
}

.mc-mobile-drawer::backdrop {
    background: rgba(14, 21, 34, 0.48);
}

.mc-mobile-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--mc-header-height);
    padding: 0 var(--mc-space-4);
    border-bottom: var(--mc-border-width) solid var(--mc-border);
}

.mc-site-brand--drawer .mc-site-brand__mark {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
}

.mc-mobile-drawer__body {
    display: flex;
    flex-direction: column;
    gap: var(--mc-space-6);
    padding: var(--mc-space-5) var(--mc-space-4) var(--mc-space-8);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.mc-mobile-drawer__section {
    display: flex;
    flex-direction: column;
    margin: 0;
    border-top: var(--mc-border-width) solid var(--mc-border);
}

.mc-mobile-drawer__section h2 {
    margin: 0;
    padding: var(--mc-space-3) 0 var(--mc-space-2);
    color: var(--mc-text-muted);
    font-size: 13px;
    line-height: 20px;
    font-weight: 650;
    letter-spacing: 0.02em;
}

.mc-mobile-drawer__section a,
.mc-mobile-drawer__theme button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: 8px 0;
    border: 0;
    border-bottom: var(--mc-border-width) solid var(--mc-border);
    background: transparent;
    color: var(--mc-text-secondary);
    font: inherit;
    font-size: 15px;
    line-height: 22px;
    text-align: left;
    text-decoration: none;
}

.mc-mobile-drawer__section a:hover,
.mc-mobile-drawer__theme button:hover {
    color: var(--mc-interactive);
}

.mc-mobile-drawer__category-meta {
    display: inline-flex;
    align-items: center;
    gap: var(--mc-space-3);
    color: var(--mc-text-muted);
    font-size: 13px;
}

body.mc-shell-drawer-open {
    overflow: hidden;
}

/* The global modal drawer replaces the legacy Bootstrap offcanvas trigger.
   Its Catalog-backed fragment remains as a compatibility/regression source. */
.mc-site-header ~ .mc-offcanvas {
    display: none !important;
}

.mc-site-footer {
    margin-top: var(--mc-space-16);
    border-top: var(--mc-border-width) solid var(--mc-border);
    background: transparent;
    color: var(--mc-text-secondary);
}

.mc-site-footer__inner {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(320px, auto);
    gap: var(--mc-space-8);
    padding-block: var(--mc-space-8);
}

.mc-site-footer__identity p {
    margin: var(--mc-space-2) 0 3px;
    color: var(--mc-text-muted);
    font-size: 13px;
    line-height: 20px;
}

.mc-site-footer__brand {
    gap: var(--mc-space-2);
    font-size: 14px;
    line-height: 20px;
    font-weight: 680;
    letter-spacing: -0.02em;
}

.mc-site-footer__mark {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
}

.mc-site-footer__nav {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: flex-end;
    gap: 8px 20px;
}

.mc-site-footer__link {
    color: var(--mc-text-muted);
    font-size: 13px;
    line-height: 20px;
    text-decoration: none;
}

.mc-site-footer__link:hover {
    color: var(--mc-text-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.mc-site-footer__copyright {
    padding-block: var(--mc-space-4);
    border-top: var(--mc-border-width) solid var(--mc-border);
    color: var(--mc-text-muted);
    font-size: 12px;
    line-height: 20px;
}

@media (max-width: 1080px) {
    .mc-site-header__inner {
        gap: var(--mc-space-3);
    }

    .mc-site-nav,
    .mc-site-header__theme,
    .mc-shell-panel {
        display: none !important;
    }

    .mc-site-header__actions {
        margin-left: auto;
    }

    .mc-site-header__menu {
        display: inline-flex;
    }

    .mc-site-brand__mark {
        width: 28px;
        height: 28px;
        flex-basis: 28px;
    }

    .mc-site-brand__wordmark {
        font-size: 15px;
        line-height: 22px;
    }
}

@media (max-width: 640px) {
    .mc-site-header__inner,
    .mc-site-footer__inner,
    .mc-site-footer__copyright {
        width: min(calc(100% - 24px), var(--mc-width-page));
    }

    .mc-site-footer__inner {
        grid-template-columns: 1fr;
        gap: var(--mc-space-6);
    }

    .mc-site-footer__nav {
        justify-content: flex-start;
    }
}

@media (max-width: 340px) {
    .mc-site-header__inner {
        width: calc(100% - 16px);
        gap: var(--mc-space-2);
    }

    .mc-site-brand {
        gap: var(--mc-space-2);
    }
}

@media (prefers-reduced-motion: reduce) {
    .mc-site-header *,
    .mc-mobile-drawer *,
    .mc-site-footer * {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
