/* =========================================================
 * FindSex - Unified Directory Filters
 * Neutral pill style + blue focus
 * ========================================================= */


/* ---------- Base typography ---------- */

.bb-template-v2 .widget.bp-profile-search-widget .bps-label,
.widget.bp-profile-search-widget .bps-label {
    font-size: 13px !important;
    font-weight: 400 !important;
}

.bp-profile-search-widget .bp-checkbox-wrap label {
    font-size: 14px;
    font-weight: 400;
}


/* ---------- Shared colors / pill styling ---------- */

.bp-secondary-header .push-right {
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    align-items: center !important;
    gap: 14px 16px !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
}

/* The grid owns spacing; native BuddyBoss filters use the same box model. */
.bp-secondary-header {
    width: 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
}

.bp-secondary-header .push-right > div {
    margin: 0 !important;
}

.bp-secondary-header .select-wrap,
.bp-secondary-header .component-filters .select-wrap {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}


/* ---------- Desktop filter controls ---------- */

.bp-secondary-header .push-right select,
#fs-options-filter .fs-filter-button {
    height: 36px !important;
    min-height: 36px !important;

    margin: 0 !important;
    padding: 0 34px 0 16px !important;

    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 999px !important;

    color: #667085 !important;
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    line-height: 34px !important;
    text-align: left !important;
    text-transform: none !important;

    box-shadow: none !important;
    outline: none !important;
    cursor: pointer !important;
}

/* Every visible pill fills only its own grid cell, including native ordering. */
@media (min-width: 769px) {
    .bp-secondary-header .push-right > div {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        flex: none !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    .bp-secondary-header .push-right .component-filters,
    .bp-secondary-header .push-right .filter,
    .bp-secondary-header .push-right .select-wrap,
    #fs-options-filter .fs-dropdown {
        display: block !important;
        float: none !important;
        position: relative !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    .bp-secondary-header .push-right select,
    #fs-options-filter .fs-filter-button {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        transform: none !important;
    }
}

/* Three aligned columns on tablets; desktop always shows six per row. */
@media (min-width: 769px) and (max-width: 1024px) {
    .bp-secondary-header .push-right {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

.bp-secondary-header .push-right select:hover,
#fs-options-filter .fs-filter-button:hover {
    border-color: #d0d5dd !important;
}

.bp-secondary-header .push-right select:focus,
.bp-secondary-header .push-right select:focus-visible,
#fs-options-filter .fs-filter-button:focus,
#fs-options-filter .fs-filter-button:focus-visible,
#fs-options-filter .fs-filter-button.is-open {
    border-color: #00AEEF !important;
    box-shadow: 0 0 0 2px rgba(0,174,239,.10) !important;
}


/* ---------- Reset filters ---------- */

#fs-reset-filters {
    display: none !important;
}

#fs-reset-filters.is-visible {
    display: block !important;
}

#fs-reset-filters .fs-reset-filter-button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;

    height: 36px !important;
    min-height: 36px !important;
    margin: 0 !important;
    padding: 0 15px !important;

    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 999px !important;

    color: #667085 !important;
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    line-height: 34px !important;
    text-transform: none !important;
    white-space: nowrap;

    box-shadow: none !important;
    outline: none !important;
    cursor: pointer !important;
}

#fs-reset-filters .fs-reset-filter-button:hover,
#fs-reset-filters .fs-reset-filter-button:focus-visible {
    border-color: #00AEEF !important;
    color: #00AEEF !important;
}

#fs-reset-filters .fs-reset-filter-icon {
    display: inline-block;
    font-size: 16px;
    font-weight: 300;
    line-height: 1;
    transform: translateY(-1px);
}

@media (min-width: 769px) {
    .bp-secondary-header .push-right > #fs-reset-filters {
        grid-column: 1 / -1;
        justify-self: start;
    }
}


/* ---------- Options dropdown ---------- */

#fs-options-filter .fs-dropdown {
    position: relative;
}

#fs-options-filter .fs-filter-button {
    position: relative !important;
}

#fs-options-filter .fs-filter-arrow {
    position: absolute;
    right: 16px;
    top: 50%;

    width: 5px;
    height: 5px;

    border-right: 2px solid #98a2b3;
    border-bottom: 2px solid #98a2b3;

    transform: translateY(-70%) rotate(45deg);
    transition: transform .18s ease;
}

#fs-options-filter .fs-filter-button.is-open .fs-filter-arrow {
    transform: translateY(-20%) rotate(225deg);
    border-right-color: #00AEEF !important;
    border-bottom-color: #00AEEF !important;
}

#fs-options-filter .fs-options-panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;

    width: 275px;
    max-height: 400px;

    background: #fff;
    border: 1px solid #e2e5e8;
    border-radius: 8px;
    box-shadow: 0 10px 32px rgba(0,0,0,.12);

    overflow: hidden;
    z-index: 999999;
}

#fs-options-filter .fs-options-panel.is-open {
    display: block;
}

#fs-options-filter .fs-options-list {
    max-height: 320px;
    overflow-y: auto;
    padding: 8px 0;
}

#fs-options-filter .fs-option-item {
    display: flex;
    align-items: center;
    gap: 10px;

    width: 100%;
    margin: 0 !important;
    padding: 10px 14px;

    color: #12263f;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
}

#fs-options-filter .fs-option-item:hover {
    background: #f5f7f9;
}

#fs-options-filter .fs-option-item input {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    margin: 0 !important;
    cursor: pointer;
}

#fs-options-filter .fs-options-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    padding: 10px 12px;
    border-top: 1px solid #eceff1;
    background: #fff;
}

#fs-options-filter .fs-options-clear,
#fs-options-filter .fs-options-apply {
    min-height: 36px !important;
    margin: 0 !important;
    padding: 7px 14px !important;

    border-radius: 6px !important;
    box-shadow: none !important;

    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    text-transform: none !important;
    cursor: pointer !important;
}

#fs-options-filter .fs-options-clear {
    background: transparent !important;
    border: 1px solid transparent !important;
    color: #667085 !important;
}

#fs-options-filter .fs-options-clear:hover {
    background: #f5f7f9 !important;
}

#fs-options-filter .fs-options-apply {
    background: #00AEEF !important;
    border: 1px solid #00AEEF !important;
    color: #fff !important;
}


/* ---------- Upper search fields ---------- */

.subnav-search input[type="search"],
.subnav-search select {
    height: 36px !important;
    min-height: 36px !important;

    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 999px !important;

    color: #667085 !important;
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: 400 !important;

    box-shadow: none !important;
    outline: none !important;
}

#dir-members-search {
    padding-left: 38px !important;
    padding-right: 34px !important;
}

#dir-members-search-form .nouveau-search-submit,
#dir-members-search-form .search-form_reset,
#gmw-address-field-bpmdg-wrapper .gmw-locator-button,
#gmw-bpmdg-radius-wrapper .select-arrow {
    color: #98a2b3 !important;
}

#dir-members-search-form .nouveau-search-submit {
    background: transparent !important;
    border: 0 !important;
}

#gmw-address-field-bpmdg {
    padding-left: 38px !important;
    padding-right: 14px !important;
}

#gmw-distance-field-bpmdg {
    padding: 0 34px 0 16px !important;
}

#dir-members-search::placeholder,
#gmw-address-field-bpmdg::placeholder {
    color: #98a2b3 !important;
    opacity: 1;
}

#dir-members-search:hover,
#gmw-address-field-bpmdg:hover,
#gmw-distance-field-bpmdg:hover {
    border-color: #d0d5dd !important;
}

#dir-members-search:focus,
#gmw-address-field-bpmdg:focus,
#gmw-distance-field-bpmdg:focus {
    border-color: #00AEEF !important;
    box-shadow: 0 0 0 2px rgba(0,174,239,.10) !important;
}

#dir-members-search-form,
#gmw-bpmdg-form,
#gmw-address-field-bpmdg-wrapper,
#gmw-bpmdg-radius-wrapper {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.subnav-search.members-search {
    margin-left: 4px !important;
    margin-right: 4px !important;
}


/* ---------- Mobile toggle hidden on desktop ---------- */

#fs-mobile-filter-toggle {
    display: none !important;
}


/* ---------- Mobile ---------- */

@media (max-width: 768px) {

    .bp-secondary-header {
        display: block !important;
        width: 100% !important;
    }

    body #fs-mobile-filter-toggle,
    body #fs-mobile-filter-toggle:hover,
    body #fs-mobile-filter-toggle:focus,
    body #fs-mobile-filter-toggle:active {
        display: flex !important;
        align-items: center;
        justify-content: space-between;

        width: 100% !important;
        height: 38px !important;
        min-height: 38px !important;

        margin: 8px 0 10px !important;
        padding: 0 16px !important;

        background: #fff !important;
        border: 1px solid #e5e7eb !important;
        border-radius: 999px !important;

        color: #667085 !important;
        font-family: inherit !important;
        font-size: 13px !important;
        font-weight: 400 !important;
        line-height: 38px !important;
        text-align: left !important;
        text-transform: none !important;

        box-shadow: none !important;
        outline: none !important;
    }

    body #fs-mobile-filter-toggle:hover {
        border-color: #d0d5dd !important;
    }

    body #fs-mobile-filter-toggle:focus,
    body #fs-mobile-filter-toggle:active,
    body #fs-mobile-filter-toggle.is-open {
        border-color: #00AEEF !important;
        box-shadow: 0 0 0 2px rgba(0,174,239,.10) !important;
    }

    .fs-mobile-filter-arrow {
        flex: 0 0 auto;
        width: 6px;
        height: 6px;
        margin-right: 3px;

        border-right: 2px solid #98a2b3;
        border-bottom: 2px solid #98a2b3;

        transform: rotate(45deg);
        transition: transform .18s ease;
    }

    #fs-mobile-filter-toggle.is-open .fs-mobile-filter-arrow {
        transform: rotate(225deg);
        border-right-color: #00AEEF !important;
        border-bottom-color: #00AEEF !important;
    }

    .bp-secondary-header .push-right {
        display: none !important;
        width: 100% !important;

        margin: 0 !important;
        padding: 0 !important;

        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .bp-secondary-header .push-right.fs-mobile-filters-open {
        display: flex !important;
    }

    .bp-secondary-header .push-right > div,
    .bp-secondary-header .component-filters,
    .bp-secondary-header .filter,
    .bp-secondary-header .select-wrap {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        float: none !important;
        transform: none !important;
        box-sizing: border-box !important;
    }

    .bp-secondary-header .push-right select,
    #fs-options-filter .fs-filter-button {
        width: 100% !important;
        min-width: 100% !important;
        max-width: none !important;
        box-sizing: border-box !important;
    }

    #fs-options-filter .fs-options-panel {
        left: 0;
        right: auto;
        width: 100%;
        max-width: 100%;
    }

    #fs-reset-filters,
    #fs-reset-filters .fs-reset-filter-button {
        width: 100% !important;
        min-width: 100% !important;
        max-width: none !important;
    }
}
