/**
 * Fundraiser Sub-Navigation Bar
 *
 * Contextual navigation for nonprofit and participant users.
 * Rendered via wp_footer hook; repositioned below header with JS.
 */

/* Hide the main navigation row on fundraiser pages (desktop only).
   Target the header container that holds the nav menu widget. */
@media (min-width: 769px) {
    .ssb-fundraiser-page .elementor-location-header .e-con:has(.elementor-widget-nav-menu) {
        display: none !important;
    }
}

/* ── Bar Container ── */
.ssb-subnav {
    position: sticky;
    top: 0;
    z-index: 999;
    background: #faf7fc;
    border-bottom: 1px solid #e3d2ef;
    box-shadow: 0 1px 4px rgba(120, 80, 160, 0.06);
    font-family: inherit;
    transition: box-shadow 0.2s ease;
}

.ssb-subnav.ssb-subnav--scrolled {
    box-shadow: 0 2px 8px rgba(120, 80, 160, 0.12);
}

.ssb-subnav__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1em;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ── Role Badge ── */
.ssb-subnav__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

.ssb-subnav__badge--nonprofit {
    background: #ede4f5;
    color: #7a54a0;
}

.ssb-subnav__badge--participant {
    background: #e0f0e4;
    color: #2e7d32;
}

.ssb-subnav__badge-icon {
    font-size: 0.8rem;
    line-height: 1;
}

/* ── Navigation Links ── */
.ssb-subnav__links {
    display: flex;
    align-items: stretch;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.ssb-subnav__links::-webkit-scrollbar {
    display: none;
}

.ssb-subnav__links li {
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}

.ssb-subnav__links a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.7em 1em;
    font-size: 0.82rem;
    font-weight: 500;
    color: #5c4a6e;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    transition: color 0.15s ease, background-color 0.15s ease;
    border-bottom: 2px solid transparent;
}

.ssb-subnav__links a:hover {
    color: #9f76be;
    background: rgba(159, 118, 190, 0.06);
}

.ssb-subnav__links a.ssb-subnav--active {
    color: #7a54a0;
    font-weight: 600;
    border-bottom-color: #9f76be;
}

.ssb-subnav__link-icon {
    font-size: 0.95rem;
    line-height: 1;
    opacity: 0.7;
}

.ssb-subnav__links a.ssb-subnav--active .ssb-subnav__link-icon {
    opacity: 1;
}

/* ── Mobile Toggle ── */
.ssb-subnav__toggle {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 0.55em 0.85em;
    border: 1px solid #d4c2e3;
    border-radius: 6px;
    background: #fff;
    color: #5c4a6e;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
    font-family: inherit;
    margin: 0.5em 0;
}

.ssb-subnav__toggle:hover {
    border-color: #9f76be;
    background: rgba(159, 118, 190, 0.04);
}

.ssb-subnav__toggle-icon {
    font-size: 1.1rem;
    line-height: 1;
    transition: transform 0.2s ease;
}

.ssb-subnav__toggle.ssb-subnav--open .ssb-subnav__toggle-icon {
    transform: rotate(180deg);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .ssb-subnav__inner {
        flex-wrap: wrap;
    }

    .ssb-subnav__toggle {
        display: inline-flex;
    }

    .ssb-subnav__links {
        display: none;
        flex-direction: column;
        width: 100%;
        padding-bottom: 0.5em;
        border-top: 1px solid #e3d2ef;
        margin-top: 0.25em;
    }

    .ssb-subnav__links.ssb-subnav--open {
        display: flex;
    }

    .ssb-subnav__links a {
        padding: 0.65em 1em;
        border-bottom: none;
        border-left: 3px solid transparent;
        border-radius: 0;
    }

    .ssb-subnav__links a.ssb-subnav--active {
        border-left-color: #9f76be;
        background: rgba(159, 118, 190, 0.06);
    }
}
