/*
 * CSP-1829 - Redesigned consolidatedtenders.com main navigation.
 * Only applies when tenders.common.header.version = 3; the original header.css is untouched.
 */

:root {
    --ctnav-hover-bg: var(--content-primary-surface);
    --ctnav-cta-pink: #DE0D83;
    --ctnav-badge-new-bg: #CDF1CC;
    --ctnav-badge-new-text: #10730E;
    --ctnav-badge-premium-bg: #FACFE8;
    --ctnav-badge-premium-text: #DE0D83;
    --ctnav-accent-blue: #00AEEF;
    --ctnav-accent-blue-dark: #0090C7;
    --ctnav-avatar-bg: var(--ctnav-accent-blue);
    --ctnav-hero-bg: #CCEEFB;
    --ctnav-search-blue: #f1fbff;
    --ctnav-search-blue-dark: var(--content-primary);
    --ctnav-item-title: #191919;
    --ctnav-item-description: #545454;
    --ctnav-border: #E5E7EB;
    --ctnav-max-width: 1440px;
    --ctnav-panel-grid-padding: 24px;
    --ctnav-panel-link-padding: 12px;
}

#headerV3 {
    background: #FFF;
    font-family: "Inter", "Montserrat", "Apercu Pro", Helvetica, sans-serif;
    position: relative;
    /*stay under the blockUI overlay (jquery.blockUI baseZ defaults to 1000)*/
    z-index: 999;
}

#headerV3 .ctnav-container {
    max-width: var(--ctnav-max-width);
    margin: 0 auto;
    padding: 0 32px;
}

/* ------------------------------------------------------------------ Utility strip */

#headerV3 .ctnav-utility__inner {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    min-height: 40px;
}

#headerV3 .ctnav-utility__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ctnav-item-title);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
}

#headerV3 .ctnav-utility__link:hover,
#headerV3 .ctnav-utility__link:focus-visible {
    color: var(--ctnav-accent-blue-dark);
}

#headerV3 .ctnav-utility__link--accent {
    color: var(--ctnav-cta-pink);
}

#headerV3 .ctnav-utility__link--accent:hover,
#headerV3 .ctnav-utility__link--accent:focus-visible {
    color: #B80A6C;
}

#headerV3 .ctnav-utility__divider {
    width: 1px;
    height: 18px;
    background: var(--ctnav-border);
}

#headerV3 .ctnav-utility__circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--ctnav-avatar-bg);
    color: #FFF;
    font-size: 13px;
    line-height: 1;
    text-decoration: none;
}

#headerV3 .ctnav-utility__circle:hover,
#headerV3 .ctnav-utility__circle:focus-visible {
    background: var(--ctnav-accent-blue-dark);
    color: #FFF;
}

/* ------------------------------------------------------------------ Return to tenant (CSP-1916) */

/* Pushed to the left of the utility strip, away from the account links. The accent
   picks up the tenant's brand colour (same values as the original header's
   btn-tenant-* classes); tenants without one fall back to the nav blue. */
#headerV3 .ctnav-return {
    --ctnav-return-accent: var(--ctnav-accent-blue-dark);
    --ctnav-return-accent-hover: var(--ctnav-accent-blue);

    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
    margin-right: auto;
    padding: 4px 16px 4px 4px;
    border: none;
    border-radius: 999px;
    background: var(--ctnav-return-accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    color: #FFF;
    font-size: 15px;
    line-height: 20px;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

#headerV3 .ctnav-return--act,
#headerV3 .ctnav-return--vic {
    --ctnav-return-accent: #3F2583;
    --ctnav-return-accent-hover: #A23790;
}

#headerV3 .ctnav-return--sa {
    --ctnav-return-accent: #D62D27;
    --ctnav-return-accent-hover: #C74E4A;
}

#headerV3 .ctnav-return--nz {
    --ctnav-return-accent: #121619;
    --ctnav-return-accent-hover: #3A4148;
}

#headerV3 .ctnav-return:hover,
#headerV3 .ctnav-return:focus-visible {
    background: var(--ctnav-return-accent-hover);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.24);
    transform: translateY(-1px);
}

#headerV3 .ctnav-return:focus-visible {
    outline: 2px solid var(--ctnav-return-accent);
    outline-offset: 2px;
}

#headerV3 .ctnav-return:active {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
    transform: none;
}

/* White disc so the arrow reads as the action at a glance */
#headerV3 .ctnav-return__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #FFF;
    color: var(--ctnav-return-accent);
    font-size: 12px;
    transition: transform 0.15s ease;
}

#headerV3 .ctnav-return:hover .ctnav-return__icon {
    transform: translateX(-2px);
}

#headerV3 .ctnav-return__tenant {
    font-weight: 700;
}

/* The message is free text from the originating portal, so it gives way first */
#headerV3 .ctnav-return__msg {
    min-width: 0;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.85;
}

#headerV3 .ctnav-return__msg::before {
    content: "\00B7";
    margin-right: 8px;
}

/* ------------------------------------------------------------------ Main bar */

/* Padding is split evenly so the row sits centred between the utility strip and
   the divider rather than riding high with the dead space below it. */
#headerV3 .ctnav-main {
    border-bottom: 1px solid var(--ctnav-border);
    padding: 10px 0;
}

#headerV3 .ctnav-main__inner {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 72px;
}

#headerV3 .ctnav-toggle {
    display: inline-flex;
    align-items: center;
    background: none;
    border: none;
    padding: 0;
    color: var(--ctnav-item-title);
}

#headerV3 .ctnav-brand {
    display: inline-block;
    flex: 0 0 auto;
}

#headerV3 .ctnav-brand img {
    max-width: 100%;
    height: 52px;
    width: auto;
}

#headerV3 .ctnav-collapse {
    display: flex;
    flex: 1 1 auto;
    justify-content: center;
}

#headerV3 .ctnav-collapse__body {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
}

#headerV3 .ctnav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

#headerV3 .ctnav-links__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    color: var(--ctnav-item-title);
    font-size: 17px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

#headerV3 .ctnav-links__link:hover,
#headerV3 .ctnav-links__link:focus-visible,
#headerV3 .ctnav-links__link.show {
    background: var(--ctnav-hover-bg);
}

/* Signed in, Search is the primary action in the bar, so it is filled with the
   primary blue and darkens to the tender search page button blue on hover. */
#headerV3 .ctnav-links__link--hero,
#headerV3 .ctnav-links__link--hero:hover,
#headerV3 .ctnav-links__link--hero:focus-visible {
    background: var(--ctnav-search-blue);
    /* Same as my opportunities */
    color: var(--ctnav-item-title);
    font-weight: 400;
}

#headerV3 .ctnav-links__link--hero i {
    font-size: 15px;
}

#headerV3 .ctnav-links__caret {
    font-size: 12px;
    transition: transform 0.2s ease;
}

#headerV3 .ctnav-links__link.show .ctnav-links__caret {
    transform: rotate(180deg);
}

/* Bootstrap adds its own caret to dropdown toggles - we supply our own icon */
#headerV3 .dropdown-toggle::after,
#headerV3 .ctnav-links__link--toggle::after {
    content: none;
}

#headerV3 #ctnavNotificationDropdown {
    min-width: 296px;
    border: none;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

/* ------------------------------------------------------------------ Resources panel */

#headerV3 .ctnav-panel {
    width: min(680px, calc(100vw - 32px));
    padding: 0;
    border: none;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

#headerV3 .ctnav-panel__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: var(--ctnav-panel-grid-padding, 24px);
}

#headerV3 .ctnav-panel__link {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: var(--ctnav-panel-link-padding, 12px);
    border-radius: 12px;
    text-decoration: none;
}

#headerV3 .ctnav-panel__link:hover,
#headerV3 .ctnav-panel__link:focus-visible {
    background: var(--ctnav-hover-bg);
}

#headerV3 .ctnav-panel__icon {
    flex: 0 0 auto;
    width: 20px;
    text-align: center;
    color: var(--ctnav-avatar-bg);
    line-height: 22px;
}

#headerV3 .ctnav-panel__body {
    display: block;
}

#headerV3 .ctnav-panel__title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ctnav-item-title);
    font-size: 15px;
    font-weight: 600;
    line-height: 22px;
}

#headerV3 .ctnav-panel__description {
    display: block;
    margin-top: 2px;
    color: var(--ctnav-item-description);
    font-size: 14px;
    font-weight: 400;
    line-height: 19px;
}

#headerV3 .ctnav-panel__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px calc(var(--ctnav-panel-grid-padding) + var(--ctnav-panel-link-padding));
    background: var(--ctnav-hover-bg);
}

#headerV3 .ctnav-panel__footer-copy {
    margin: 0;
    max-width: 320px;
    color: var(--ctnav-item-title);
    font-size: 15px;
    font-weight: 600;
    line-height: 21px;
}

/* Single column panel - used by the My Opportunities and Company Profile menus,
   which are short stacked lists rather than the two column Resources grid. */
#headerV3 .ctnav-panel--single {
    width: min(455px, calc(100vw - 32px));
}

#headerV3 .ctnav-panel--single .ctnav-panel__grid {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px;
}

/* ------------------------------------------------------------------ Badges */

#headerV3 .ctnav-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 16px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
}

#headerV3 .ctnav-badge--new {
    background: var(--ctnav-badge-new-bg);
    color: var(--ctnav-badge-new-text);
}

#headerV3 .ctnav-badge--premium {
    background: var(--ctnav-badge-premium-bg);
    color: var(--ctnav-badge-premium-text);
}

#headerV3 .ctnav-badge i {
    font-size: 10px;
}

/* ------------------------------------------------------------------ Actions */

#headerV3 .ctnav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

#headerV3 .ctnav-btn + .ctnav-actions__item {
    margin-left: 8px;
}

#headerV3 .ctnav-actions--stacked {
    flex-direction: column;
    align-items: stretch;
    margin: 24px 0 0;
}

#headerV3 .ctnav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 22px;
    border: 2px solid transparent;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
}

#headerV3 .ctnav-btn--primary {
    background: var(--ctnav-cta-pink);
    border-color: var(--ctnav-cta-pink);
    color: #FFF;
}

#headerV3 .ctnav-btn--primary:hover,
#headerV3 .ctnav-btn--primary:focus-visible {
    background: #B80A6C;
    border-color: #B80A6C;
    color: #FFF;
}

#headerV3 .ctnav-btn--outline {
    background: #FFF;
    border-color: var(--ctnav-cta-pink);
    color: var(--ctnav-cta-pink);
}

#headerV3 .ctnav-btn--outline:hover,
#headerV3 .ctnav-btn--outline:focus-visible {
    background: var(--ctnav-cta-pink);
    color: #FFF;
}

#headerV3 .ctnav-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #b4b4b4;
    text-decoration: none;
}

#headerV3 .ctnav-icon-btn i {
    font-size: 20px;
    line-height: 1;
}

#headerV3 .ctnav-icon-btn:hover,
#headerV3 .ctnav-icon-btn:focus-visible {
    background: var(--ctnav-hover-bg);
    color: var(--ctnav-accent-blue-dark);
}

/* Hidden until headerV3.js finds the person has notifications waiting. The white ring keeps it
   legible where the dot overlaps the bell glyph. */
#headerV3 .ctnav-icon-btn__dot {
    display: none;
    position: absolute;
    top: 6px;
    right: 6px;
    width: 9px;
    height: 9px;
    border: 2px solid #FFF;
    border-radius: 50%;
    background: #D92D20;
    box-sizing: content-box;
}

#headerV3 .ctnav-icon-btn__dot--active {
    display: block;
}

#headerV3 .ctnav-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ctnav-avatar-bg);
    color: #FFF;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
}

#headerV3 .ctnav-avatar:hover,
#headerV3 .ctnav-avatar:focus-visible {
    background: var(--ctnav-accent-blue-dark);
    color: #FFF;
}

#headerV3 .ctnav-menu {
    min-width: 260px;
    border: none;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    padding: 8px;
}

#headerV3 .ctnav-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--ctnav-item-title);
    font-size: 15px;
}

#headerV3 .ctnav-menu .dropdown-item:hover,
#headerV3 .ctnav-menu .dropdown-item:focus-visible {
    background: var(--ctnav-hover-bg);
}

#headerV3 .ctnav-menu .dropdown-item i {
    width: 18px;
    text-align: center;
    color: var(--ctnav-avatar-bg);
}

#headerV3 .ctnav-menu hr {
    margin: 8px 4px;
    border-color: var(--ctnav-border);
}

/* Text only menu - the base width is sized for the icon led account menu */
#headerV3 .ctnav-menu--compact {
    min-width: 180px;
}

/* ------------------------------------------------------------------ Account menu */

/* The avatar dropdown leads with the signed in person and their business before
   the account links (CSP-1832). */
#headerV3 .ctnav-account {
    min-width: 296px;
    padding: 16px;
}

#headerV3 .ctnav-account__header {
    padding: 0 12px;
}

#headerV3 .ctnav-account__name {
    margin: 0;
    color: var(--ctnav-item-title);
    font-size: 16px;
    font-weight: 700;
    line-height: 22px;
}

#headerV3 .ctnav-account__business {
    margin: 2px 0 0;
    color: var(--ctnav-item-description);
    font-size: 15px;
    font-weight: 400;
    line-height: 21px;
}

/* Inset so the rules line up with the header copy rather than the item highlight */
#headerV3 .ctnav-account hr {
    margin: 16px 12px;
}

#headerV3 .ctnav-account .dropdown-item {
    gap: 12px;
    font-weight: 500;
}

/* Log out sits below the second rule and is deliberately quieter than the account links */
#headerV3 .ctnav-account .ctnav-account__logout,
#headerV3 .ctnav-account .ctnav-account__logout i {
    color: var(--ctnav-item-description);
}

/* ------------------------------------------------------------------ Below lg: offcanvas */

@media (max-width: 1199.98px) {
    #headerV3 .ctnav-container {
        padding: 0 16px;
    }

    #headerV3 .ctnav-main__inner {
        min-height: 64px;
        gap: 12px;
    }

    #headerV3 .ctnav-brand img {
        height: 40px;
    }

    #headerV3 .ctnav-collapse {
        width: min(340px, 88vw);
        background: #FFF;
    }

    #headerV3 .ctnav-collapse__body {
        display: block;
        padding: 0 20px 24px;
        overflow-y: auto;
    }

    #headerV3 .ctnav-links {
        display: block;
    }

    #headerV3 .ctnav-links__link {
        justify-content: space-between;
        padding: 12px 8px;
    }

    /* space-between pushes the caret to the right on the dropdown toggles, but it
       would split the search icon off from its label */
    #headerV3 .ctnav-links__link--hero {
        justify-content: flex-start;
        padding: 12px 16px;
    }

    #headerV3 .ctnav-panel {
        width: 100%;
        box-shadow: none;
        border-radius: 8px;
        background: var(--ctnav-hover-bg);
    }

    #headerV3 .ctnav-panel__grid {
        grid-template-columns: minmax(0, 1fr);
        padding: 8px;
    }

    #headerV3 .ctnav-panel__footer {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        background: transparent;
        padding: 8px 16px 16px;
    }

    #headerV3 .ctnav-panel__footer-copy {
        max-width: none;
    }

    /* Notifications, help and the account menu stay in the bar below the collapse
       breakpoint, so they are tightened up to leave room for the brand. */
    #headerV3 .ctnav-actions:not(.ctnav-actions--stacked) {
        gap: 4px;
    }

    /* The CTA is display:none here, so its separator would just be dead space */
    #headerV3 .ctnav-btn + .ctnav-actions__item {
        margin-left: 0;
    }

    #headerV3 .ctnav-icon-btn,
    #headerV3 .ctnav-avatar {
        width: 36px;
        height: 36px;
    }

    #headerV3 .ctnav-avatar {
        font-size: 14px;
    }

    #headerV3 .ctnav-actions__item .dropdown-menu {
        max-width: calc(100vw - 24px);
    }

    #headerV3 #ctnavNotificationDropdown {
        width: min(360px, calc(100vw - 24px));
    }
}

@media (max-width: 575.98px) {
    #headerV3 .ctnav-brand img {
        height: 32px;
    }

    /* Tenant name plus arrow is enough on a phone, and leaves room for Log in / Contact Us */
    #headerV3 .ctnav-return__msg {
        display: none;
    }

    #headerV3 .ctnav-main__inner {
        gap: 8px;
    }

    #headerV3 .ctnav-icon-btn,
    #headerV3 .ctnav-avatar {
        width: 32px;
        height: 32px;
    }

    #headerV3 .ctnav-icon-btn i {
        font-size: 17px;
    }

    /* Scoped to the bar menus - the in offcanvas dropdowns must stay panel width */
    #headerV3 .ctnav-actions__item .ctnav-menu {
        min-width: 0;
        width: calc(100vw - 24px);
    }
}

@media (min-width: 1200px) {
    #headerV3 .ctnav-toggle {
        display: none;
    }

    /* The brand and the actions take equal shares of the free space, so the links
       centre on the header rather than on the gap between them - that gap is a
       different width for premium, free and logged out users, which would leave
       the nav sitting in a different place on different pages. The side columns
       keep min-width: auto, so if the actions ever outgrow their share they push
       the nav across rather than squashing the logo. */
    #headerV3 .ctnav-brand,
    #headerV3 .ctnav-actions {
        flex: 1 1 0;
    }

    #headerV3 .ctnav-actions {
        justify-content: flex-end;
        margin-left: 0;
    }

    #headerV3 .ctnav-collapse {
        flex: 0 1 auto;
    }

    /* The trailing icon button is a 40px circle around a 25px glyph, so its box
       overhangs the ink by about 8px. Pulling it out lines the glyph up with the
       container edge and with the utility strip copy above it. */
    #headerV3 .ctnav-actions > .ctnav-actions__item:last-child .ctnav-icon-btn {
        margin-right: -8px;
    }
}

/* Just above the collapse breakpoint the signed in nav is tight, so tighten it rather than wrap */
@media (min-width: 1200px) and (max-width: 1399.98px) {
    #headerV3 .ctnav-container {
        padding: 0 16px;
    }

    #headerV3 .ctnav-main__inner {
        gap: 12px;
    }

    #headerV3 .ctnav-links {
        gap: 4px;
    }

    #headerV3 .ctnav-links__link {
        padding: 10px 10px;
        font-size: 15px;
    }

    #headerV3 .ctnav-btn {
        padding: 10px 16px;
        font-size: 15px;
    }
}
