/* Public navigation: single source of truth. Loaded after app.css and public-fixes.css. */
:root {
    --nav-height-desktop: 76px;
    --nav-height-compact: 64px;
    --nav-control-size: 38px;
    --nav-control-gap: 8px;
}

.site-header .icon-btn,
.site-header .icon-btn i {
    line-height: 1 !important;
}

/* Legacy button pseudo-elements must never render a second mobile menu glyph. */
body.public-site .public-site-header .public-menu-button::before,
body.public-site .public-site-header .mobile-menu-button::before {
    content: none !important;
    display: none !important;
}

body.public-site .public-site-header .menu-glyph {
    position: static !important;
    display: grid !important;
    place-items: center !important;
    align-self: center !important;
    justify-self: center !important;
    width: 1em !important;
    height: 1em !important;
    transform: translateY(-1px) !important;
}

/* The first public hero starts directly below the fixed header. */
body.public-site .content-wrap > .marketing-hero:first-child {
    margin-top: 0 !important;
}

body.public-site .content-wrap:has(> .marketing-hero:first-child) {
    padding-top: 0 !important;
}

body.public-site .content-wrap:has(> .contact-hero-solace:first-child) {
    padding-top: 0 !important;
}

body.public-site .content-wrap > .contact-hero-solace:first-child {
    margin-top: 0 !important;
}

body.public-site .main-panel {
    padding-top: 0 !important;
}

.theme-glyph {
    display: grid !important;
    place-items: center !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    color: currentColor;
    font-family: Arial, sans-serif;
    font-size: 0;
    font-weight: 700;
    line-height: 1 !important;
    transform: translateY(-1px);
}

.theme-glyph::after {
    content: "\263e";
    display: grid;
    place-items: center;
    font-family: Arial, sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
}

[data-theme="dark"] .theme-glyph::after {
    content: "\2600";
}

.menu-glyph {
    display: grid !important;
    place-items: center !important;
    width: 1em !important;
    height: 1em !important;
    margin: 0 !important;
    color: currentColor;
    font-family: Arial, sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1 !important;
    transform: translateY(-1px);
}

.admin-topbar .icon-btn {
    position: relative;
    display: grid !important;
    place-items: center !important;
    padding: 0 !important;
}

.admin-topbar .icon-btn i {
    position: absolute !important;
    inset: 0 !important;
    display: grid !important;
    place-items: center !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    transform: none !important;
}

.site-header .icon-btn {
    position: relative;
    display: grid !important;
    place-items: center !important;
    padding: 0 !important;
    text-align: center !important;
}

.site-header .icon-btn i {
    position: absolute !important;
    inset: 0 !important;
    display: grid !important;
    place-items: center !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    transform: none !important;
}

/* Large desktop: full navigation, one centered theme control, login and register actions. */
@media (min-width: 1024px) {
    body.public-site .public-site-header {
        position: sticky !important;
        top: 0 !important;
        z-index: 3000 !important;
        display: grid !important;
        grid-template-columns: auto minmax(0, 1fr) auto !important;
        align-items: center !important;
        gap: 28px !important;
        min-height: var(--nav-height-desktop) !important;
        padding: 12px clamp(32px, 5vw, 72px) !important;
        overflow: visible !important;
    }

    body.public-site .public-site-header .site-brand {
        grid-column: 1;
        grid-row: 1;
        margin: 0 !important;
        max-width: none !important;
    }

    body.public-site .public-site-header .desktop-nav {
        grid-column: 2;
        grid-row: 1;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        overflow: visible !important;
    }

    body.public-site .public-site-header > .public-desktop-actions {
        grid-column: 3;
        grid-row: 1;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 10px !important;
        white-space: nowrap;
    }

    body.public-site .public-site-header > .public-desktop-actions .icon-btn {
        width: var(--nav-control-size) !important;
        height: var(--nav-control-size) !important;
        flex: 0 0 var(--nav-control-size) !important;
    }

    body.public-site .public-site-header > .public-compact-actions,
    body.public-site .public-site-header > .header-actions {
        display: none !important;
    }
}

/* Tablet and phone: logo left, theme plus one menu icon at the extreme right. */
@media (max-width: 1023px) {
    body.public-site .public-site-header {
        position: sticky !important;
        top: 0 !important;
        z-index: 3000 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 12px !important;
        min-height: var(--nav-height-compact) !important;
        padding: 10px 14px !important;
        overflow: visible !important;
    }

    body.public-site .public-site-header .site-brand {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        max-width: calc(100% - 106px) !important;
        margin: 0 !important;
    }

    body.public-site .public-site-header .desktop-nav,
    body.public-site .public-site-header > .public-desktop-actions,
    body.public-site .public-site-header > .header-actions {
        display: none !important;
    }

    body.public-site .public-site-header > .public-compact-actions {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: var(--nav-control-gap) !important;
        flex: 0 0 auto !important;
        margin-left: auto !important;
    }

    body.public-site .public-site-header > .public-compact-actions .icon-btn {
        width: var(--nav-control-size) !important;
        height: var(--nav-control-size) !important;
        min-width: var(--nav-control-size) !important;
        min-height: var(--nav-control-size) !important;
        flex: 0 0 var(--nav-control-size) !important;
        color: #101827 !important;
        background: #fff !important;
        border: 1px solid rgba(15,23,42,.16) !important;
        border-radius: 11px !important;
        box-shadow: 0 8px 20px rgba(15,23,42,.12) !important;
    }

    body.public-site .public-site-header > .public-compact-actions .public-menu-button {
        position: static !important;
        inset: auto !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;
        display: grid !important;
        place-items: center !important;
        margin: 0 !important;
        transform: none !important;
    }

    [data-theme="dark"] body.public-site .public-site-header > .public-compact-actions .icon-btn {
        color: #f8fafc !important;
        background: #0f172a !important;
        border-color: rgba(255,255,255,.16) !important;
    }
}

.mobile-drawer.open,
.sidebar.mobile-drawer.open,
.customer-authenticated .mobile-drawer.open,
.public-site .mobile-drawer.open {
    z-index: 5000 !important;
}

.sidebar-backdrop.open,
.customer-authenticated .sidebar-backdrop.open,
.public-site .sidebar-backdrop.open {
    z-index: 4990 !important;
}
