/* ─── Filter Section ─────────────────────────────────── */
.filter-section {
    padding: 20px;
}

/* Pill bar */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1.5px solid #e8e0d5;
    border-radius: 50px;
    padding: 8px 8px 8px 16px;
    box-shadow: 0 2px 16px rgba(0,0,0,.06);
    flex-wrap: nowrap;          /* keeps pill shape on desktop */
    transition: box-shadow .2s;
}

.filter-bar:focus-within {
    box-shadow: 0 4px 24px rgba(249,115,22,.13);
    border-color: #f97316;
}

/* Individual select wrapper */
.select-filter-wrap {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.filter-emoji { font-size: 16px; margin-right: 6px; }

.select-filter {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    width: 100%;
    padding-right: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.select-filter option { color: #333; }

.filter-arrow {
    position: absolute;
    right: 2px;
    font-size: 11px;
    color: #bbb;
    pointer-events: none;
    flex-shrink: 0;
}

/* Divider */
.f-divider {
    width: 1px;
    height: 28px;
    background: #e8e0d5;
    flex-shrink: 0;
}

/* Location input */
.search-wrap {
    flex: 1.2;
    width: 100%;
    position: relative;
}

.search-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border-radius: 10px;
    padding: 10px 14px;
    transition: border-color .2s;
}
.search-inner.focused { border-color: var(--primary); }

.filter-location {
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: #333;
    width: 100%;
    padding-right: 26px;
}

.filter-location::placeholder { color: #aaa; }

.search-clear-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #aaa;
    font-size: 1.1rem;
    line-height: 1;
    display: none;
    padding: 0 2px;
}
.search-clear-btn.visible { display: block; }

.search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0; right: 0;
    background: #fff;
    border-radius: 14px;
    border: 1.5px solid #eee;
    box-shadow: 0 16px 40px rgba(0,0,0,.12);
    overflow: hidden;
    z-index: 999;
    display: none;
    max-height: 380px;
    overflow-y: auto;
    scrollbar-width: thin;
    animation: dropIn .18s ease;
}
.search-dropdown.open { display: block; }

@keyframes dropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.sd-section-label {
    padding: 10px 16px 4px;
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #aaa;
    background: #fafafa;
}

.sd-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background .12s;
}
.sd-item:last-child { border-bottom: none; }
.sd-item:hover, .sd-item.active { background: #fef6f0; }

.sd-icon {
    width: 34px; height: 34px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .85rem;
    flex-shrink: 0;
}
.sd-icon.business  { background: #fff5ec; color: var(--primary); }
.sd-icon.job       { background: #eaf3de; color: #3B6D11; }
.sd-icon.realestate{ background: #e6f1fb; color: #185FA5; }
.sd-icon.shopping  { background: #faeeda; color: #854F0B; }
.sd-icon.fundraiser{ background: #fbeaf0; color: #993556; }

.sd-body { flex: 1; min-width: 0; }
.sd-name {
    font-size: .82rem;
    font-weight: 700;
    color: #111;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sd-name mark { background: transparent; color: var(--primary); font-weight: 800; }
.sd-sub { font-size: .7rem; color: #888; font-weight: 500; }

.sd-badge {
    font-size: .6rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    flex-shrink: 0;
}
.sd-badge.business  { background: #fff5ec; color: var(--primary); }
.sd-badge.job       { background: #eaf3de; color: #3B6D11; }
.sd-badge.realestate{ background: #e6f1fb; color: #185FA5; }
.sd-badge.shopping  { background: #faeeda; color: #854F0B; }
.sd-badge.fundraiser{ background: #fbeaf0; color: #993556; }

.sd-state {
    padding: 28px 16px;
    text-align: center;
    color: #aaa;
    font-size: .82rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.sd-spinner {
    width: 20px; height: 20px;
    border: 2px solid #eee;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.view-details-btn {
    padding: 0.5rem 0.85rem;
    border-radius: 20px;
    background: var(--gradient);
    border: none;
    color: var(--white);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

/* Find button */
.btn-find {
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 28px;
    font-size: .82rem;
    font-weight: 800;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background .2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-find:hover { opacity: .9; transform: translateY(-1px); }

.block-title {
    font-size: 24px;
    font-weight: 800;
    color: #fff !important;
    text-align: center;
    margin: 20px 0;
}

.block-underline {
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
    margin-bottom: 20px;
}

.posts-block {
    background: var(--card);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: var(--card-border);
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
    transition: border-color 0.25s, transform 0.25s, background 0.25s;
    border-radius: 10px;
    margin-bottom: 25px;
}

/* Scrollable track */
.posts-track-wrap {
    position: relative;
    margin-bottom: 32px;
}

.posts-track {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    overflow: visible;
}

.posts-track::-webkit-scrollbar { display: none; }

/* Filter card */
.filter-card {
    width: 100%;   /* FIX */
    border: 2px solid var(--primary);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
    background: #fff;
    position: relative;
}

.filter-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(232,114,12,.2);
}

.featured-badge {
    position: absolute;
    top: 8px; left: 0;
    background: var(--primary);
    color: white;
    font-size: .6rem;
    font-weight: 800;
    padding: 3px 10px 3px 8px;
    border-radius: 0 12px 12px 0;
    z-index: 1;
    letter-spacing: .5px;
}

.logo-area {
    width: 100%; height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.img { width: 100%; height: 100%; object-fit: contain; }

.text-logo {
    font-size: .85rem;
    font-weight: 900;
    text-align: center;
    padding: 8px;
    line-height: 1.3;
    font-style: italic;
}

.name {
    padding: 8px 10px;
    font-size: .7rem;
    font-weight: 700;
    color: #222;
    text-align: center;
    border-top: 1px solid #f0f0f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Empty state ── */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: #bbb;
}

.empty-state i { font-size: 48px; margin-bottom: 16px; display: block; }
.empty-state h3 { font-size: 18px; color: #fff !important; margin-bottom: 8px; }
.empty-state p  { font-size: 14px; }

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 900px) {
    .btn-find { width: 100%; justify-content: center; }
}

/* Tablet  ≤ 768px : stack into a card */
@media (max-width: 768px) {
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        border-radius: 18px;
        padding: 14px 16px;
        gap: 0;
    }

    .select-filter-wrap,
    .search-wrap {
        padding: 10px 0;
        flex: 2;
        width: 100%;
    }

    .f-divider {
        width: 100%;
        height: 1px;
        margin: 0;
    }

    .btn-find {
        margin-top: 12px;
        justify-content: center;
        padding: 12px 0;
        border-radius: 12px;
        width: 100%;
    }

    .select-filter    { font-size: 15px; }
    .filter-location  { font-size: 15px; }
}

/* Mobile  ≤ 480px : a bit more breathing room */
@media (max-width: 480px) {
    .filter-section { padding: 16px; }

    .select-filter-wrap,
    .search-wrap {
        padding: 9px 0;
    }
}
