/* ============================================================
   Gallery toolbar — filter dropdowns + sort bar
   ============================================================ */

/* ── Toolbar strip ─────────────────────────────────────────── */
@media (min-width: 992px) {

    .gallery-toolbar {
        display: flex;
        align-items: center;
        border-top: 1px solid #2a2a2a;
        border-bottom: 1px solid #2a2a2a;
        padding: 10px 0;
        margin-bottom: 28px;
    }

    .gallery-toolbar .filter {
        display: flex;
        flex-direction: row;
        align-items: center;
        flex: 0 0 auto;
        position: relative !important;
        left: 0 !important;
        width: auto;
        margin: 0;
        padding: 0;
        overflow-y: visible;
        height: auto;
        z-index: 100;
        background-color: transparent;
        gap: 6px;
    }

    .gallery-toolbar .filter-close { display: none !important; }

    /* ── Filter trigger buttons ─────────────────────────────── */
    .gallery-toolbar .dropdown-filter-btn {
        background-color: #111;
        border: 1px solid #333;
        border-radius: 6px;
        font-size: 13px;
        font-weight: 400;
        color: #ddd;
        padding: 7px 30px 7px 14px;
        white-space: nowrap;
        position: relative;
        transition: border-color .15s, color .15s, background-color .15s;
    }

    .gallery-toolbar .dropdown-filter-btn:hover {
        border-color: #666;
        color: #fff;
        background-color: #1a1a1a;
    }

    .gallery-toolbar .dropdown-filter-btn[aria-expanded="true"] {
        border-color: #e00;
        color: #fff;
        background-color: #1a1a1a;
    }

    .gallery-toolbar .dropdown-filter-btn::after {
        top: 50%;
        transform: translateY(-50%);
        right: 10px;
        width: 10px;
        height: 6px;
        transition: transform .2s;
    }

    .gallery-toolbar .dropdown-filter-btn[aria-expanded="true"]::after {
        transform: translateY(-50%) rotate(180deg);
    }

    /* ── Dropdown panel ─────────────────────────────────────── */
    .gallery-toolbar .filter-dropdown-menu {
        background-color: #141414;
        border: 1px solid #2e2e2e;
        border-radius: 8px;
        box-shadow: 0 8px 32px rgba(0,0,0,.6);
        padding: 16px;
        min-width: 220px;
        margin-top: 6px !important;
    }

    .gallery-toolbar .filter-dropdown-menu .tag-clouds {
        display: flex !important;
        flex-wrap: wrap;
        gap: 8px;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .gallery-toolbar .filter-dropdown-menu .tag-clouds li {
        margin: 0;
        padding: 0;
    }

    /* ── Pills (unchecked) ──────────────────────────────────── */
    .gallery-toolbar .filter-dropdown-menu .tag-clouds li label {
        display: inline-block;
        padding: 6px 16px;
        font-size: 13px;
        font-weight: 400;
        color: #ccc;
        background-color: #1e1e1e;
        border: 1px solid #3a3a3a;
        border-radius: 20px;
        cursor: pointer;
        transition: background-color .15s, border-color .15s, color .15s;
        white-space: nowrap;
        user-select: none;
    }

    .gallery-toolbar .filter-dropdown-menu .tag-clouds li label:hover {
        background-color: #2a2a2a;
        border-color: #888;
        color: #fff;
    }

    /* ── Pills (checked / active) ───────────────────────────── */
    .gallery-toolbar .filter-dropdown-menu .tag-clouds li input:checked + label {
        background-color: #cc0000;
        border-color: #cc0000;
        color: #fff;
        box-shadow: 0 0 0 2px rgba(204,0,0,.25);
    }

    /* ── Sort by wrapper ────────────────────────────────────── */
    .gallery-toolbar .ms-auto {
        border-left: 1px solid #2a2a2a !important;
    }

    .gallery-toolbar .short {
        float: none;
        max-width: none;
    }
}

/* ── Active-filter count badge ──────────────────────────────── */
.filter-active-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #cc0000;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    min-width: 17px;
    height: 17px;
    border-radius: 9px;
    padding: 0 5px;
    margin-left: 7px;
    vertical-align: middle;
}

/* ── Filter panel: fix invisible pill labels ────────────────── */
.filter .tag-clouds li label {
    color: #ccc;
    background-color: #1e1e1e;
    border-color: #3a3a3a !important;
}

.filter .tag-clouds li label:hover {
    background-color: #2a2a2a;
    border-color: #777 !important;
    color: #fff;
}

.filter .tag-clouds li input:checked + label {
    background-color: #cc0000 !important;
    border-color: #cc0000 !important;
    color: #fff !important;
}

/* ================================================================
   Mobile: filter pill row + sort row (max-width 991px)
   ================================================================ */
@media (max-width: 991px) {

    /* ── Force dropdown menus to float over content (not in-flow) ── */
    /* CSS !important overrides Popper.js inline styles              */
    .filter {
        --mob-dropdown-top: 130px;
    }

    .filter .dropdown-filter .dropdown-menu.show,
    .filter .dropdown-filter .filter-dropdown-menu.show {
        position: fixed !important;
        top: var(--mob-dropdown-top) !important;
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        transform: none !important;
        margin: 0 !important;
        z-index: 99999 !important;
    }

    /* Also handle the "Find an Escort" dropdown in the mobile sort row */
    .mobile-sort-row .dropdown-filter .dropdown-menu.show,
    .mobile-sort-row .dropdown-filter .filter-dropdown-menu.show {
        position: fixed !important;
        top: var(--mob-dropdown-top) !important;
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        transform: none !important;
        z-index: 99999 !important;
    }


    /* ── Filter pill trigger buttons (Price / Service / Type / Find) ── */
    .dropdown-filter-btn {
        display: inline-block;
        position: relative;
        background: rgba(255,255,255,0.07) !important;
        border: 1px solid rgba(255,255,255,0.2) !important;
        border-radius: 50px !important;
        font-size: 13px;
        font-weight: 400;
        color: #fff !important;
        padding: 8px 30px 8px 16px;
        white-space: nowrap;
        cursor: pointer;
        line-height: 1.4;
        transition: border-color .15s, background-color .15s;
        box-shadow: none !important;
        outline: none;
    }

    /* Lock the Bootstrap caret inside the pill */
    .dropdown-filter-btn::after {
        position: absolute !important;
        top: 50% !important;
        right: 12px !important;
        transform: translateY(-50%) !important;
        margin: 0 !important;
        vertical-align: 0 !important;
    }

    .dropdown-filter-btn[aria-expanded="true"] {
        border-color: #cc0000 !important;
        background: rgba(204,0,0,0.13) !important;
        color: #fff !important;
    }

    .dropdown-filter-btn:focus {
        box-shadow: none !important;
        outline: none;
    }

    /* Dropdown panels on mobile — dark floating panel */
    .dropdown-filter .filter-dropdown-menu,
    .dropdown-filter .dropdown-menu {
        background-color: #141414;
        border: 1px solid #2a2a2a;
        border-radius: 12px;
        box-shadow: 0 12px 40px rgba(0,0,0,.8);
        padding: 6px 0;
        min-width: 0;
        z-index: 9999 !important;
        max-height: 62vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Items as list rows — override pill chip style */
    .dropdown-filter .filter-dropdown-menu .tag-clouds,
    .dropdown-filter .dropdown-menu .tag-clouds {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        gap: 0 !important;
        padding: 0;
        margin: 0;
        list-style: none;
    }

    .dropdown-filter .filter-dropdown-menu .tag-clouds li,
    .dropdown-filter .dropdown-menu .tag-clouds li {
        margin: 0;
        padding: 0;
    }

    /* Hide real checkbox inputs — label handles click */
    .dropdown-filter .filter-dropdown-menu .tag-clouds li input,
    .dropdown-filter .dropdown-menu .tag-clouds li input {
        position: absolute;
        opacity: 0;
        width: 0;
        height: 0;
        pointer-events: none;
    }

    /* Row label with custom checkbox */
    .dropdown-filter .filter-dropdown-menu .tag-clouds li label,
    .dropdown-filter .dropdown-menu .tag-clouds li label {
        display: flex !important;
        align-items: center;
        gap: 12px;
        width: 100%;
        padding: 13px 16px !important;
        font-size: 14px !important;
        font-weight: 400;
        color: #bbb !important;
        background: transparent !important;
        border: none !important;
        border-radius: 0 !important;
        cursor: pointer;
        transition: background .12s, color .12s;
        box-shadow: none !important;
        white-space: normal;
        user-select: none;
    }

    /* Custom checkbox box via ::before */
    .dropdown-filter .filter-dropdown-menu .tag-clouds li label::before,
    .dropdown-filter .dropdown-menu .tag-clouds li label::before {
        content: '';
        flex-shrink: 0;
        width: 18px;
        height: 18px;
        border: 1.5px solid #555;
        border-radius: 4px;
        background: transparent;
        transition: border-color .15s, background .15s;
    }

    .dropdown-filter .filter-dropdown-menu .tag-clouds li label:hover,
    .dropdown-filter .dropdown-menu .tag-clouds li label:hover {
        background: rgba(255,255,255,0.05) !important;
        color: #fff !important;
    }

    /* Checked state — red filled checkbox */
    .dropdown-filter .filter-dropdown-menu .tag-clouds li input:checked + label,
    .dropdown-filter .dropdown-menu .tag-clouds li input:checked + label {
        color: #fff !important;
        background: rgba(204,0,0,0.08) !important;
        box-shadow: none !important;
    }

    .dropdown-filter .filter-dropdown-menu .tag-clouds li input:checked + label::before,
    .dropdown-filter .dropdown-menu .tag-clouds li input:checked + label::before {
        background-color: #cc0000;
        border-color: #cc0000;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' d='M2 8l4 4 8-8'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: center;
        background-size: 11px;
    }

    /* Thin divider between rows */
    .dropdown-filter .filter-dropdown-menu .tag-clouds li + li,
    .dropdown-filter .dropdown-menu .tag-clouds li + li {
        border-top: 1px solid rgba(255,255,255,0.05);
    }

    /* ── Sort row: hide label, pill-ify the sort button ─────── */
    .mobile-sort-row {
        gap: 10px;
    }

    /* Equal-width columns */
    .mobile-sort-row .dropdown-filter,
    .mobile-sort-row .short {
        flex: 1 1 0;
        min-width: 0;
    }

    .mobile-sort-row .short {
        float: none;
        margin-left: 0;
    }

    /* "Find an Escort" pill fills its column */
    .mobile-sort-row .dropdown-filter .dropdown-filter-btn {
        width: 100%;
        text-align: center;
    }

    .mobile-sort-row .short label {
        display: none;
    }

    .mobile-sort-row .dropdown-short {
        display: block;
    }

    .mobile-sort-row #short-by {
        display: block;
        width: 100%;
        text-align: center;
        position: relative;
        background: rgba(255,255,255,0.07) !important;
        border: 1px solid rgba(255,255,255,0.2) !important;
        border-radius: 50px !important;
        font-size: 13px;
        font-weight: 400;
        color: #fff !important;
        padding: 8px 30px 8px 16px;
        white-space: nowrap;
        cursor: pointer;
        line-height: 1.4;
        transition: border-color .15s, background-color .15s;
        box-shadow: none !important;
    }

    /* Lock the Bootstrap caret inside the sort pill */
    .mobile-sort-row #short-by::after {
        position: absolute !important;
        top: 50% !important;
        right: 12px !important;
        transform: translateY(-50%) !important;
        margin: 0 !important;
        vertical-align: 0 !important;
    }

    .mobile-sort-row #short-by[aria-expanded="true"] {
        border-color: #cc0000 !important;
        background: rgba(204,0,0,0.13) !important;
    }

    .mobile-sort-row #short-by:focus {
        box-shadow: none !important;
        outline: none;
    }

    .mobile-sort-row .dropdown-short .dropdown-menu {
        background-color: #141414;
        border: 1px solid #2e2e2e;
        border-radius: 8px;
        box-shadow: 0 8px 32px rgba(0,0,0,.7);
        padding: 8px 0;
        z-index: 2000 !important;
        min-width: 180px;
        right: 0;
        left: auto;
    }

    .mobile-sort-row .dropdown-short .dropdown-menu .dropdown-item {
        color: #ccc;
        font-size: 13px;
        padding: 8px 16px;
    }

    .mobile-sort-row .dropdown-short .dropdown-menu .dropdown-item:hover,
    .mobile-sort-row .dropdown-short .dropdown-menu .dropdown-item:focus,
    .mobile-sort-row .dropdown-short .dropdown-menu .dropdown-item.active {
        background-color: #1e1e1e;
        color: #fff;
    }
}
