/* Member shell layout overrides.
   These selectors intentionally outrank the legacy CRM #wrapper/#sidebar rules
   while leaving all menu data, permissions and links untouched. */
body.member-layout {
    min-width: 1180px;
    background: #fff;
    color: var(--is2-text);
}

/* Keep selected text readable without the legacy solid-colour selection mask. */
body.member-layout *::selection {
    background-color: rgba(8, 102, 238, .14) !important;
    color: inherit !important;
    text-shadow: none !important;
}

body.member-layout *::-moz-selection {
    background-color: rgba(8, 102, 238, .14) !important;
    color: inherit !important;
    text-shadow: none !important;
}

body.member-layout .member-topbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    width: 100% !important;
    grid-template-columns: 240px minmax(280px, 1fr) auto !important;
    background: #fff !important;
}

/* Wall enables this control only inside its responsive breakpoint. Keeping it
   hidden in the head-loaded shell CSS prevents a desktop reload flash. */
.member-shell-wall-drawer-button {
    display: none !important;
}

body.member-layout .member-topbar .is2-top-actions {
    position: relative;
    z-index: 101;
    overflow: visible !important;
}

body.member-layout .member-topbar .is2-top-nav {
    min-width: 72px;
    padding-right: 10px;
    padding-left: 10px;
}

body.member-layout .member-profile-menu {
    position: relative !important;
    display: block !important;
    flex: 0 0 156px;
    width: 156px;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 8px 0 12px !important;
    overflow: visible !important;
}

body.member-layout .member-profile-menu > summary {
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
    width: 100%;
    height: 100%;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    cursor: pointer;
    user-select: none;
}

body.member-layout .member-profile-menu > summary::-webkit-details-marker {
    display: none;
}

body.member-layout .member-profile-menu > summary::marker {
    content: '';
}

body.member-layout .member-profile-menu .is2-avatar {
    flex: 0 0 40px;
}

body.member-layout .member-profile-menu .is2-profile-copy {
    display: block !important;
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.3 !important;
}

body.member-layout .member-profile-menu .is2-profile-copy strong,
body.member-layout .member-profile-menu .is2-profile-copy small {
    display: block !important;
    max-width: 83px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.member-layout .member-profile-caret {
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
    margin-left: auto;
    fill: none;
    stroke: #526079;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .18s ease;
}

body.member-layout .member-profile-menu[open] .member-profile-caret {
    transform: rotate(180deg);
}

body.member-layout .member-profile-dropdown {
    position: absolute !important;
    z-index: 250 !important;
    top: calc(100% - 5px) !important;
    right: 8px !important;
    display: block !important;
    width: 180px !important;
    margin: 0 !important;
    padding: 6px !important;
    border: 1px solid var(--is2-line) !important;
    border-radius: 7px !important;
    background: #fff !important;
    box-shadow: 0 10px 28px rgba(20, 37, 68, .16) !important;
}

body.member-layout .member-profile-menu:not([open]) > .member-profile-dropdown {
    display: none !important;
}

body.member-layout .member-profile-dropdown a {
    display: block !important;
    width: 100% !important;
    padding: 9px 10px !important;
    border-radius: 5px !important;
    color: #31405c !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
    white-space: nowrap !important;
    text-decoration: none !important;
}

body.member-layout .member-profile-dropdown a:hover {
    background: #eef5ff !important;
    color: var(--is2-blue) !important;
}

/* Compact account access used when the desktop navigation is hidden. */
body.member-layout .member-mobile-profile-menu {
    display: none;
}

body.member-layout #wrapper.member-shell {
    position: relative !important;
    display: grid !important;
    grid-template-columns: 240px minmax(0, 1fr) !important;
    width: 100% !important;
    min-height: calc(100vh - 78px) !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-wrap: nowrap !important;
    background: #fff !important;
}

body.member-layout #sidebar.member-sidebar {
    position: sticky !important;
    top: 78px !important;
    align-self: start !important;
    z-index: 5;
    float: none !important;
    width: 240px !important;
    height: calc(100vh - 78px) !important;
    margin: 0 !important;
    padding: 18px 17px !important;
    border-right: 1px solid var(--is2-line) !important;
    background: #fff !important;
    color: #121a31 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

body.member-layout #sidebarMobile.is2-side-nav {
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;
    width: 100% !important;
    min-height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    color: #121a31 !important;
}

body.member-layout #sidebarMobile .is2-side-item {
    display: flex !important;
    align-items: center !important;
    gap: 11px !important;
    width: 100% !important;
    min-height: 41px !important;
    margin: 0 !important;
    padding: 0 12px !important;
    border: 0 !important;
    border-radius: 6px !important;
    background: transparent !important;
    color: #121a31 !important;
    font-family: Inter, Arial, sans-serif !important;
    font-size: 13px !important;
    font-weight: 650 !important;
    line-height: 1.25 !important;
    opacity: 1 !important;
    white-space: nowrap !important;
    text-decoration: none !important;
}

body.member-layout #sidebarMobile .is2-side-item:hover {
    background: #f4f7fc !important;
    color: var(--is2-blue) !important;
}

body.member-layout #sidebarMobile .is2-side-item.active {
    background: #eaf2ff !important;
    color: var(--is2-blue) !important;
}

body.member-layout #sidebarMobile .member-section-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 12px 0 4px;
    padding: 0 10px;
    color: #61708a;
    font-family: Inter, Arial, sans-serif;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .11em;
    text-transform: uppercase;
}

body.member-layout #sidebarMobile .member-section-heading::after {
    content: '';
    flex: 1 1 auto;
    height: 1px;
    background: #d5deeb;
}

body.member-layout #sidebarMobile .member-sociohub-heading {
    margin-top: 13px;
    padding-top: 13px;
    border-top: 1px solid #d5deeb;
}

body.member-layout #sidebarMobile .member-section-separator {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: 50px;
    padding: 0 10px;
    overflow: hidden;
    pointer-events: none;
}

body.member-layout #sidebarMobile .member-section-separator img {
    position: absolute;
    top: -80px;
    left: -22px;
    display: block;
    width: 206px;
    max-width: none;
    height: auto;
}

body.member-layout #sidebarMobile .member-section-separator.member-sociohub-separator img {
    position: static;
    width: 150px;
    max-width: 100%;
    max-height: 42px;
    margin: 0;
    object-fit: contain;
}

body.member-layout #sidebarMobile .is2-side-item.indent {
    padding-left: 37px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
}

body.member-layout .member-menu-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 19px !important;
    width: 19px !important;
    height: 19px !important;
    color: inherit !important;
    font-size: 16px !important;
}

body.member-layout .member-menu-icon i {
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    color: inherit !important;
    font-size: 15px !important;
    line-height: 1 !important;
}

/* Keep the Live Bids status dot green; the generic icon rule above otherwise
   makes the Font Awesome circle inherit the sidebar's dark text colour. */
body.member-layout #sidebarMobile .member-live-bids .member-menu-icon .live-bids-pulse,
body.member-layout #sidebarMobile a[href*="bids_new/open_projects"] .member-menu-icon i.fa-circle {
    display: inline-block !important;
    width: 10px !important;
    min-width: 10px !important;
    height: 10px !important;
    border-radius: 50% !important;
    background: #20c997 !important;
    color: #20c997 !important;
    font-size: 0 !important;
    animation: member-sidebar-bid-pulse 1.6s infinite;
}

body.member-layout #sidebarMobile .member-live-bids .member-menu-icon .live-bids-pulse::before,
body.member-layout #sidebarMobile a[href*="bids_new/open_projects"] .member-menu-icon i.fa-circle::before {
    content: none !important;
}

@keyframes member-sidebar-bid-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(32, 201, 151, .5);
    }
    70% {
        transform: scale(1.2);
        box-shadow: 0 0 0 10px rgba(32, 201, 151, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(32, 201, 151, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    body.member-layout #sidebarMobile .member-live-bids .member-menu-icon .live-bids-pulse,
    body.member-layout #sidebarMobile a[href*="bids_new/open_projects"] .member-menu-icon i.fa-circle {
        animation: none;
    }
}

body.member-layout .member-menu-icon .is2-icon {
    width: 19px !important;
    height: 19px !important;
}

body.member-layout #sidebarMobile .is2-caret {
    width: 12px !important;
    height: 12px !important;
    flex: 0 0 12px !important;
    margin-left: auto !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 1.7 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
    transition: transform .18s ease;
}

body.member-layout .member-submenu {
    display: none;
}

body.member-layout .member-submenu.open {
    display: block;
}

body.member-layout #sidebarMobile .member-static-menu {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 3px;
    margin-top: auto;
    padding: 14px 0;
    border-top: 1px solid var(--is2-line);
    border-bottom: 1px solid var(--is2-line);
}

body.member-layout #sidebarMobile .member-static-menu .member-static-menu-item {
    flex: 0 0 auto;
}

body.member-layout .member-demo-page {
    min-height: calc(100vh - 114px);
    padding: 18px;
    border: 1px solid var(--is2-line);
    border-radius: 12px;
    background: #f7f9fc;
}

body.member-layout .member-demo-heading,
body.member-layout .member-demo-card {
    border: 1px solid var(--is2-line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(19, 33, 60, .05);
}

body.member-layout .member-demo-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    padding: 20px;
}

body.member-layout .member-demo-heading-icon {
    display: grid;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 10px;
    background: #e8f0ff;
    color: #0866ee;
}

body.member-layout .member-demo-heading-icon .is2-icon {
    width: 25px;
    height: 25px;
}

body.member-layout .member-demo-heading h1 {
    margin: 0 0 4px;
    color: #111a31;
    font-size: 24px;
}

body.member-layout .member-demo-heading p,
body.member-layout .member-demo-card p {
    margin: 0;
    color: #69758d;
}

body.member-layout .member-demo-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

body.member-layout .member-demo-card {
    padding: 20px;
}

body.member-layout .member-demo-card h2 {
    margin: 0 0 8px;
    color: #111a31;
    font-size: 17px;
}

body.member-layout .member-demo-action {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    margin-top: 16px;
    padding: 0 16px;
    border: 1px solid #0866ee;
    border-radius: 7px;
    color: #0866ee;
    font-weight: 700;
    text-decoration: none;
}

@media (max-width: 700px) {
    body.member-layout .member-demo-page {
        padding: 10px;
    }

    body.member-layout .member-demo-grid {
        grid-template-columns: 1fr;
    }

    body.member-layout .member-demo-heading,
    body.member-layout .member-demo-card {
        padding: 16px;
    }
}

body.member-layout .member-parent-menu.expanded .is2-caret {
    transform: rotate(180deg);
}

body.member-layout #sidebarMobile .member-website-links {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 12px;
    margin: 12px 14px 18px;
    padding: 14px 4px 0;
    border-top: 1px solid #e3eaf4;
}

body.member-layout #sidebarMobile .member-website-links strong {
    flex: 0 0 100%;
    color: #667085;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    line-height: 1.3;
    text-transform: uppercase;
}

body.member-layout #sidebarMobile .member-website-links a {
    color: #526078;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
}

body.member-layout #sidebarMobile .member-website-links a:hover,
body.member-layout #sidebarMobile .member-website-links a:focus {
    color: var(--is2-blue);
    text-decoration: underline;
}

body.member-layout #content.member-content {
    display: block !important;
    float: none !important;
    width: auto !important;
    min-width: 0 !important;
    min-height: calc(100vh - 78px) !important;
    margin: 0 !important;
    padding: 14px 17px 22px !important;
    background: #fff !important;
    vertical-align: initial !important;
}

body.member-layout .member-content-wrapper {
    float: none !important;
    width: 100% !important;
    min-height: calc(100vh - 114px) !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
}

body.member-layout .member-ajax-loader {
    position: fixed !important;
    z-index: 9999 !important;
    inset: 0 !important;
    display: none;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    height: 100% !important;
    background: rgba(255, 255, 255, .72) !important;
}

body.member-layout .member-ajax-loader img {
    width: 48px !important;
    height: 48px !important;
    margin: 0 !important;
}

body.member-layout #sidebar.member-sidebar::-webkit-scrollbar {
    width: 7px;
}

body.member-layout #sidebar.member-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

body.member-layout #sidebar.member-sidebar::-webkit-scrollbar-thumb {
    border-radius: 8px;
    background: #9b9b9b;
}

@media (max-width: 900px) {
    body.member-layout {
        min-width: 0;
    }

    body.member-layout #wrapper.member-shell {
        grid-template-columns: 210px minmax(0, 1fr) !important;
    }

    body.member-layout #sidebar.member-sidebar {
        width: 210px !important;
    }
}

@media (max-width: 1200px) {
    body.member-layout .member-mobile-profile-menu {
        position: absolute !important;
        z-index: 260 !important;
        top: 50%;
        right: 12px;
        display: block !important;
        width: 42px;
        height: 42px;
        margin: 0;
        transform: translateY(-50%);
    }

    body.member-layout.s3-mobile-page-shell .member-mobile-profile-menu {
        right: 100px;
    }

    body.member-layout .member-mobile-profile-menu > summary {
        display: grid;
        width: 42px;
        height: 42px;
        place-items: center;
        padding: 0;
        border: 1px solid #d8e0eb;
        border-radius: 50%;
        background: #fff;
        list-style: none;
        cursor: pointer;
        box-shadow: 0 4px 12px rgba(19, 33, 60, .08);
    }

    body.member-layout .member-mobile-profile-menu > summary::-webkit-details-marker {
        display: none;
    }

    body.member-layout .member-mobile-profile-menu > summary::marker {
        content: '';
    }

    body.member-layout .member-mobile-profile-menu .is2-avatar {
        width: 34px;
        height: 34px;
        font-size: 11px;
    }

    body.member-layout .member-mobile-profile-dropdown {
        position: absolute;
        z-index: 270;
        top: calc(100% + 8px);
        right: 0;
        display: block;
        width: 190px;
        padding: 7px;
        border: 1px solid var(--is2-line);
        border-radius: 9px;
        background: #fff;
        box-shadow: 0 12px 30px rgba(20, 37, 68, .18);
    }

    body.member-layout .member-mobile-profile-menu:not([open]) > .member-mobile-profile-dropdown {
        display: none;
    }

    body.member-layout .member-mobile-profile-dropdown > strong,
    body.member-layout .member-mobile-profile-dropdown > small {
        display: block;
        padding: 2px 10px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.member-layout .member-mobile-profile-dropdown > strong {
        color: #1c2940;
        font-size: 12px;
    }

    body.member-layout .member-mobile-profile-dropdown > small {
        margin-bottom: 5px;
        padding-bottom: 8px;
        border-bottom: 1px solid var(--is2-line);
        color: #6b768a;
        font-size: 10px;
    }

    body.member-layout .member-mobile-profile-dropdown > a {
        display: block;
        padding: 9px 10px;
        border-radius: 6px;
        color: #31405c;
        font-size: 12px;
        line-height: 1.35;
        text-decoration: none;
    }

    body.member-layout .member-mobile-profile-dropdown > a:hover,
    body.member-layout .member-mobile-profile-dropdown > a:focus {
        background: #eef5ff;
        color: var(--is2-blue);
        outline: none;
    }
}

@media (max-width: 640px) {
    body.member-layout.s3-mobile-page-shell .member-mobile-profile-menu {
        right: 62px;
    }
}

@media (max-width: 768px) {
    body.member-layout.member-account-page .member-topbar {
        min-height: 62px !important;
        grid-template-columns: 44px minmax(0, 1fr) !important;
        gap: 6px !important;
        padding: 7px 58px 7px 10px !important;
    }

    body.member-layout.member-account-page .member-shell-drawer-button {
        position: relative !important;
        inset: auto !important;
        z-index: 2 !important;
        display: inline-flex !important;
        width: 42px !important;
        height: 42px !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 1px solid #d8e0eb !important;
        border-radius: 9px !important;
        background: #fff !important;
        color: #26334a !important;
        box-shadow: 0 4px 12px rgba(19, 33, 60, .08) !important;
    }

    body.member-layout.member-account-page .member-shell-drawer-button svg {
        display: block !important;
        width: 22px !important;
        height: 22px !important;
        fill: none !important;
        stroke: currentColor !important;
        stroke-width: 1.8 !important;
        stroke-linecap: round !important;
    }

    body.member-layout.member-account-page .member-shell-drawer-button span {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
    }

    body.member-layout.member-account-page .member-topbar .is2-brand {
        min-width: 0;
        justify-content: center;
        border-right: 0;
    }

    body.member-layout.member-account-page .member-topbar .is2-brand-sub,
    body.member-layout.member-account-page .member-topbar .is2-global-search,
    body.member-layout.member-account-page .member-topbar .is2-top-actions {
        display: none !important;
    }

    body.member-layout.member-account-page #wrapper.member-shell {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        min-height: calc(100dvh - 62px) !important;
    }

    body.member-layout.member-account-page #sidebar.member-sidebar.member-account-drawer {
        position: fixed !important;
        z-index: 420 !important;
        top: 62px !important;
        bottom: 0 !important;
        left: 0 !important;
        display: block !important;
        width: min(280px, 86vw) !important;
        height: calc(100dvh - 62px) !important;
        max-height: none !important;
        box-sizing: border-box !important;
        padding: 12px 10px 24px !important;
        overflow-y: auto !important;
        background: #fff !important;
        box-shadow: 18px 0 45px rgba(16, 30, 58, .18) !important;
        transform: translateX(-105%) !important;
        transition: transform .22s ease !important;
    }

    body.member-layout.member-account-page.member-account-sidebar-open #sidebar.member-sidebar.member-account-drawer {
        transform: translateX(0) !important;
    }

    body.member-layout.member-account-page .member-account-drawer-overlay {
        position: fixed;
        z-index: 410;
        inset: 62px 0 0;
        display: block;
        padding: 0;
        border: 0;
        background: rgba(13, 25, 49, .46);
        opacity: 0;
        visibility: hidden;
        transition: opacity .2s ease, visibility .2s ease;
    }

    body.member-layout.member-account-page.member-account-sidebar-open .member-account-drawer-overlay {
        opacity: 1;
        visibility: visible;
    }

    body.member-layout.member-account-page #content.member-content {
        width: 100% !important;
        min-width: 0 !important;
        min-height: calc(100dvh - 62px) !important;
        padding: 8px !important;
        box-sizing: border-box !important;
    }

    body.member-layout.member-account-page .member-content-wrapper {
        min-height: 0 !important;
    }
}

@media (min-width: 769px) {
    body.member-layout.member-account-page .member-shell-drawer-button,
    body.member-layout.member-account-page .member-account-drawer-overlay {
        display: none !important;
    }
}

/* Keep the complete member brand consistent in every compact member header. */
@media (max-width: 768px) {
    body.member-layout .member-topbar .is2-brand {
        min-width: 0 !important;
        gap: 7px !important;
        justify-content: center !important;
        border-right: 0 !important;
    }

    body.member-layout .member-topbar .is2-brand-mark {
        width: 29px !important;
        height: 25px !important;
        flex: 0 0 29px !important;
    }

    body.member-layout .member-topbar .is2-brand-mark .is2-icon {
        width: 29px !important;
        height: 25px !important;
    }

    body.member-layout .member-topbar .is2-brand-name {
        display: block !important;
        font-size: 18px !important;
        line-height: 1 !important;
        white-space: nowrap !important;
    }

    body.member-layout .member-topbar .is2-brand-sub {
        display: block !important;
        margin-top: 2px !important;
        font-size: 7px !important;
        line-height: 1.05 !important;
        letter-spacing: .035em !important;
        white-space: nowrap !important;
    }

    body.member-layout.member-account-page .member-topbar .is2-brand-sub {
        display: block !important;
    }

    body.member-layout.member-account-page .member-shell-drawer-button {
        width: 34px !important;
        min-width: 34px !important;
        height: 34px !important;
        border: 0 !important;
        border-radius: 8px !important;
        background: #edf4ff !important;
        color: #0868f2 !important;
        box-shadow: none !important;
    }

    body.member-layout.member-account-page .member-shell-drawer-button svg {
        width: 18px !important;
        height: 18px !important;
        stroke-width: 2 !important;
    }
}
