/* ═══════════════════════════════════════════════════════════════
   Divar App - Shared Styles
   ═══════════════════════════════════════════════════════════════ */

        @font-face { font-family: 'DivarFont'; src: url('../fonts/Yekan.ttf') format('truetype'); font-weight: normal; }
        :root {
            --divar-red: #a62626; --divar-red-dark: #8a1f1f; --divar-red-light: #be3737;
            --bg-primary: #ffffff; --bg-secondary: #f5f5f5; --bg-tertiary: #eeeeee;
            --text-primary: #000000; --text-secondary: #707070; --text-tertiary: #a0a0a0;
            --border-color: #e0e0e0; --success: #4caf50; --warning: #ff9800;
            --shadow: 0 1px 3px rgba(0,0,0,0.08); --shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
        }
        * { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
        body { font-family: 'DivarFont', -apple-system, BlinkMacSystemFont, sans-serif; background: var(--bg-secondary); color: var(--text-primary); line-height: 1.5; overflow-x: hidden; padding-bottom: 70px; }
        .header { background: var(--bg-primary); padding: 12px 16px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 100; }
        .location-btn { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: var(--bg-tertiary); border-radius: 20px; font-size: 13px; color: var(--text-primary); cursor: pointer; border: none; font-family: inherit; }
        .location-btn svg { width: 16px; height: 16px; fill: var(--text-secondary); }
        .search-box { flex: 1; display: flex; align-items: center; background: var(--bg-tertiary); border-radius: 8px; padding: 10px 14px; gap: 10px; }
        .search-box svg { width: 20px; height: 20px; fill: var(--text-tertiary); flex-shrink: 0; }
        .search-box input { border: none; background: none; outline: none; font-family: inherit; font-size: 14px; width: 100%; color: var(--text-primary); }
        .search-box input::placeholder { color: var(--text-tertiary); }
        .categories-scroll { background: var(--bg-primary); padding: 12px 0; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; border-bottom: 1px solid var(--border-color); }
        .categories-scroll::-webkit-scrollbar { display: none; }
        .category-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; margin-right: 8px; background: var(--bg-tertiary); border-radius: 20px; font-size: 13px; cursor: pointer; border: none; font-family: inherit; color: var(--text-primary); transition: all 0.2s; }
        .category-chip:first-child { margin-right: 16px; }
        .category-chip.active { background: var(--divar-red); color: white; }
        .category-chip svg { width: 16px; height: 16px; fill: currentColor; }
        .filter-bar { background: var(--bg-primary); padding: 10px 16px; display: flex; gap: 10px; border-bottom: 1px solid var(--border-color); overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
        .filter-bar::-webkit-scrollbar { display: none; }
        .filter-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: 8px; font-size: 13px; cursor: pointer; font-family: inherit; color: var(--text-primary); white-space: nowrap; }
        .filter-btn svg { width: 14px; height: 14px; fill: var(--text-secondary); }
        .post-list { padding: 8px 16px; }
        .post-card { background: var(--bg-primary); border-radius: 12px; margin-bottom: 12px; overflow: hidden; box-shadow: var(--shadow); cursor: pointer; transition: transform 0.2s; }
        .post-card:active { transform: scale(0.98); }
        .post-image { width: 100%; height: 220px; object-fit: cover; background: var(--bg-tertiary); }
        .post-content { padding: 14px; }
        .post-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; line-height: 1.5; }
        .post-details { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-secondary); margin-bottom: 10px; }
        .post-details .dot { width: 3px; height: 3px; background: var(--text-tertiary); border-radius: 50%; }
        .post-footer { display: flex; justify-content: space-between; align-items: center; }
        .post-price { font-size: 15px; font-weight: 700; color: var(--text-primary); }
        .post-price.urgent { color: var(--divar-red); }
        .post-actions { display: flex; gap: 12px; }
        .action-btn { background: none; border: none; padding: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
        .action-btn svg { width: 22px; height: 22px; fill: var(--text-tertiary); transition: fill 0.2s; }
        .action-btn:hover svg, .action-btn.active svg { fill: var(--divar-red); }
        .fab { position: fixed; bottom: 90px; left: 20px; width: 56px; height: 56px; background: var(--divar-red); border-radius: 50%; border: none; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-lg); cursor: pointer; z-index: 90; transition: transform 0.2s; }
        .fab:active { transform: scale(0.95); }
        .fab svg { width: 24px; height: 24px; fill: white; }
        .bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: var(--bg-primary); border-top: 1px solid var(--border-color); display: flex; justify-content: space-around; padding: 8px 0 12px; z-index: 100; }
        .nav-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 12px; background: none; border: none; cursor: pointer; color: var(--text-tertiary); font-family: inherit; font-size: 11px; transition: color 0.2s; text-decoration: none; }
        .nav-item.active { color: var(--divar-red); }
        .nav-item svg { width: 24px; height: 24px; fill: currentColor; }
        .toast { position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%) translateY(100px); background: rgba(0,0,0,0.8); color: white; padding: 12px 24px; border-radius: 8px; font-size: 14px; z-index: 200; opacity: 0; transition: all 0.3s; pointer-events: none; }
        .toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
        @media (min-width: 768px) { body { max-width: 480px; margin: 0 auto; border-left: 1px solid var(--border-color); border-right: 1px solid var(--border-color); } .bottom-nav, .fab { max-width: 480px; left: 50%; transform: translateX(-50%); } .fab:active { transform: translateX(-50%) scale(0.95); } }
        @media (prefers-color-scheme: dark) { :root { --bg-primary: #1a1a1a; --bg-secondary: #121212; --bg-tertiary: #2a2a2a; --text-primary: #ffffff; --text-secondary: #b0b0b0; --text-tertiary: #707070; --border-color: #333333; } }
    

/* ═══════════════════════════════════════════════════════════════
   Widget-Based Styles (Divar-Style)
   ═══════════════════════════════════════════════════════════════ */

/* ─── POST_ROW Widget ─────────────────────────────────────────── */
.post-card {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    background: var(--bg-primary);
    transition: background 0.15s;
}
.post-card:active {
    background: var(--bg-secondary);
}
.post-card:last-child {
    border-bottom: none;
}

.post-image-wrap {
    position: relative;
    width: 120px;
    height: 90px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-tertiary);
}
.post-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.post-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
}
.post-image-placeholder svg {
    width: 32px;
    height: 32px;
    fill: var(--text-tertiary);
    opacity: 0.4;
}
.image-count {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0,0,0,0.7);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
}

.image-top-left-tag {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(0,0,0,0.65);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
}

.post-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}
.post-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
    color: var(--text-primary);
}
.post-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--divar-red);
    margin-bottom: 4px;
}
.post-desc {
    font-size: 12px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}
.post-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-tertiary);
}
.post-meta .chat-icon svg {
    width: 14px;
    height: 14px;
    fill: var(--text-tertiary);
}
.post-badge {
    display: inline-block;
    background: var(--divar-red);
    color: white;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 4px;
}

/* ─── LEGEND_TITLE_ROW Widget ────────────────────────────────── */
.widget-legend-title {
    padding: 16px;
    background: var(--bg-primary);
}
.widget-legend-title h1 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.4;
    color: var(--text-primary);
}
.widget-legend-title p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ─── IMAGE_CAROUSEL Widget ────────────────────────────────── */
.widget-image-carousel {
    position: relative;
    width: 100%;
    height: 280px;
    background: var(--bg-tertiary);
    overflow: hidden;
}
.carousel-container {
    width: 100%;
    height: 100%;
    position: relative;
}
.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s;
}
.carousel-slide.active {
    opacity: 1;
}
.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.carousel-nav {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 2;
}
.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    transition: all 0.2s;
    cursor: pointer;
}
.carousel-dot.active {
    background: white;
    width: 20px;
    border-radius: 4px;
}
.carousel-counter {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    z-index: 2;
}

/* ─── PRICE_ROW Widget ─────────────────────────────────────── */
.widget-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}
.price-label {
    font-size: 14px;
    color: var(--text-secondary);
}
.price-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--divar-red);
}

/* ─── GROUP_INFO_ROW Widget ────────────────────────────────── */
.widget-group-info {
    padding: 16px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}
.info-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}
.info-item:last-child {
    border-bottom: none;
}
.info-label {
    color: var(--text-secondary);
}
.info-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* ─── UNEXPANDABLE_ROW Widget ──────────────────────────────── */
.widget-unexpandable {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}
.unex-title {
    color: var(--text-secondary);
}
.unex-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* ─── DESCRIPTION_ROW Widget ───────────────────────────────── */
.widget-description {
    padding: 16px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}
.widget-description h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}
.widget-description p {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-secondary);
    white-space: pre-wrap;
}

/* ─── SELLER_INFO Widget ───────────────────────────────────── */
.widget-seller-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}
.seller-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--divar-red);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}
.seller-details {
    flex: 1;
}
.seller-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.verified-badge {
    width: 16px;
    height: 16px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    font-size: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.seller-meta {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* ─── ACTION_ROW Widget ──────────────────────────────────── */
.widget-action-row {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}
.widget-action-row .btn-phone,
.widget-action-row .btn-chat {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.widget-action-row .btn-phone {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.widget-action-row .btn-chat {
    background: var(--divar-red);
    color: white;
}
.widget-action-row svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* ─── SAFETY_TIPS_ROW Widget ──────────────────────────────── */
.widget-safety-tips {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    margin: 12px 16px;
    font-size: 12px;
    color: #f57c00;
}
.widget-safety-tips svg {
    width: 20px;
    height: 20px;
    fill: #f57c00;
    flex-shrink: 0;
}

/* ─── Loading & Empty States ──────────────────────────────── */
.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-top-color: var(--divar-red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
}
.empty-state svg {
    width: 64px;
    height: 64px;
    fill: var(--text-tertiary);
    margin-bottom: 16px;
    opacity: 0.5;
}

/* ─── Filter Styles ───────────────────────────────────────── */
.filter-group {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}
.filter-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.filter-chip {
    cursor: pointer;
}
.filter-chip input {
    display: none;
}
.filter-chip span {
    display: inline-block;
    padding: 6px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-primary);
    transition: all 0.2s;
}
.filter-chip input:checked + span {
    background: var(--divar-red);
    color: white;
    border-color: var(--divar-red);
}
.range-inputs {
    display: flex;
    gap: 12px;
}
.range-inputs input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
}
.filter-actions {
    display: flex;
    gap: 12px;
    padding: 16px;
    position: sticky;
    bottom: 0;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}
.btn-primary, .btn-secondary {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.btn-primary {
    background: var(--divar-red);
    color: white;
}
.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}


/* ═══════════════════════════════════════════════════════════════
   Divar-Style Filter UI (List → Sub-View)
   ═══════════════════════════════════════════════════════════════ */

/* ─── Filter List (Main View) ─────────────────────────────── */
.filter-list { background: var(--bg-primary); }
.filter-row {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    background: var(--bg-primary);
    transition: background 0.15s;
}
.filter-row:active { background: var(--bg-tertiary); }
.filter-row-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
    text-align: right;
}
.filter-row-value {
    font-size: 13px;
    color: var(--divar-red);
    margin-left: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 50%;
    text-align: left;
}
.filter-row-chev {
    width: 20px;
    height: 20px;
    fill: var(--text-tertiary);
    flex-shrink: 0;
    transform: rotate(180deg);
}

/* ─── Toggle Row (shown directly in list) ─────────────────── */
.filter-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
}
.filter-toggle-row .toggle-label {
    font-size: 15px;
    color: var(--text-primary);
}
.filter-toggle-row .toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}
.filter-toggle-row .toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.filter-toggle-row .toggle-switch.active {
    background: var(--divar-red);
}
.filter-toggle-row .toggle-switch.active::after {
    transform: translateX(-20px);
}

/* ─── Sub-View Overlay ────────────────────────────────────── */
.filter-sub-view {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: var(--bg-secondary);
    z-index: 200;
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.2s ease;
}
.filter-sub-view.closing {
    animation: slideOutRight 0.2s ease forwards;
}
@keyframes slideInRight {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}
@keyframes slideOutRight {
    from { transform: translateX(0); }
    to   { transform: translateX(100%); }
}
.filter-sub-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.filter-sub-header .back-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
}
.filter-sub-header .back-btn svg {
    width: 24px;
    height: 24px;
    fill: var(--text-primary);
}
.filter-sub-header .title {
    font-size: 16px;
    font-weight: 700;
    flex: 1;
    text-align: right;
    margin: 0;
    color: var(--text-primary);
}
.filter-sub-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    background: var(--bg-secondary);
}

/* ─── Option Items (Checkbox rows in sub-view) ────────────── */
.filter-option-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    background: var(--bg-primary);
    transition: background 0.15s;
}
.filter-option-item:active { background: var(--bg-tertiary); }
.filter-option-item .opt-label {
    font-size: 15px;
    color: var(--text-primary);
}
.filter-option-item .opt-check {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    background: var(--bg-primary);
}
.filter-option-item.active .opt-check {
    background: var(--divar-red);
    border-color: var(--divar-red);
}
.filter-option-item .opt-check svg {
    width: 14px;
    height: 14px;
    fill: #fff;
    display: none;
}
.filter-option-item.active .opt-check svg {
    display: block;
}

/* Multi-select count badge */
.filter-row-value {
    font-size: 13px;
    color: var(--divar-red);
    margin-left: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 50%;
    text-align: left;
    direction: ltr;
}

/* ─── Range Inputs in Sub-View ────────────────────────────── */
.filter-range-wrap {
    padding: 20px 16px;
    background: var(--bg-primary);
}
.filter-range-wrap .range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.filter-range-inputs {
    display: flex;
    gap: 10px;
    align-items: center;
}
.filter-range-inputs input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    background: var(--bg-primary);
    outline: none;
    text-align: center;
    color: var(--text-primary);
}
.filter-range-inputs input:focus {
    border-color: var(--divar-red);
}
.filter-range-inputs span {
    color: var(--text-tertiary);
    font-size: 13px;
    flex-shrink: 0;
}

/* ─── Select / Dropdown in Sub-View ───────────────────────── */
.filter-select-wrap {
    background: var(--bg-primary);
}
.filter-select {
    width: 100%;
    padding: 14px 16px;
    border: none;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
    font-family: inherit;
    font-size: 15px;
    color: var(--text-primary);
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%23707070' d='M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    background-size: 20px;
    padding-left: 40px;
}

/* ─── Neighborhood Grid in Sub-View ───────────────────────── */
.neighborhood-grid-sub {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 12px 16px;
}
.neighborhood-chip-sub {
    padding: 10px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.15s;
}
.neighborhood-chip-sub:active { transform: scale(0.97); }
.neighborhood-chip-sub.active {
    border-color: var(--divar-red);
    color: var(--divar-red);
    font-weight: 700;
    background: rgba(166, 15, 15, 0.06);
}

/* ─── Bottom Action Bar (Divar Style) ─────────────────────── */
.filter-action-bar {
    position: fixed;
    bottom: 56px;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: 10px 16px;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
}
.filter-action-bar .btn-show-ads {
    width: 100%;
    padding: 14px;
    background: var(--divar-red);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}
.filter-action-bar .btn-show-ads:active {
    background: var(--divar-red-dark);
}
.filter-action-bar .btn-show-ads:disabled {
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    cursor: not-allowed;
}

/* ─── Section Divider in Filter List ──────────────────────── */
.filter-section-divider {
    height: 8px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

/* ─── Filter Group Title in Sub-View ──────────────────────── */
.filter-group-title {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-secondary);
}

/* ─── Motorcycle brand tree selector (API-driven) ─────────────── */
.brand-tree-search { padding: 12px 16px; }
.brand-tree-search input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border, #e5e5e5);
    background: var(--bg-secondary, #fff);
    color: var(--text-primary, #111);
    font-family: inherit;
    font-size: 14px;
}
.brand-tree-crumb {
    padding: 0 16px 10px;
    font-size: 12px;
    color: var(--text-tertiary, #888);
}
.brand-tree-crumb a { color: var(--text-secondary, #666); text-decoration: none; }
.brand-tree-list { max-height: 60vh; overflow-y: auto; }
.brand-drill {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    color: var(--text-tertiary, #888);
}
.brand-drill svg { width: 18px; height: 18px; fill: currentColor; }

/* ─── SUBTITLE_ROW Widget ──────────────────────────────────── */
.widget-subtitle {
    padding: 4px 16px 12px;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-primary);
}

/* ─── BREADCRUMB Widget ────────────────────────────────────── */
.widget-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}
.widget-breadcrumb .breadcrumb-item {
    cursor: pointer;
    transition: color .15s ease;
}
.widget-breadcrumb .breadcrumb-item:hover {
    color: var(--primary-color, #a62626);
}
.widget-breadcrumb .breadcrumb-sep {
    color: var(--text-secondary);
    opacity: .6;
}

/* ─── GROUP_INFO_ROW title ─────────────────────────────────── */
.widget-group-info .group-title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}
.widget-group-info .group-title svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* ─── EXPANDABLE_ROW Widget ────────────────────────────────── */
.widget-expandable {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}
.widget-expandable > summary {
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.widget-expandable > summary::after {
    content: '›';
    transform: rotate(90deg);
    transition: transform .2s ease;
    color: var(--text-secondary);
}
.widget-expandable[open] > summary::after {
    transform: rotate(-90deg);
}
.widget-expandable > p {
    margin: 0;
    padding: 0 16px 14px;
    font-size: 13px;
    line-height: 1.9;
    color: var(--text-secondary);
}

/* ─── MAP_ROW Widget ───────────────────────────────────────── */
.widget-map {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 16px;
}
.widget-map .map-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 140px;
    border-radius: 10px;
    background: var(--bg-secondary, #f5f5f5);
    border: 1px dashed var(--border-color);
}
.widget-map .map-placeholder svg {
    width: 30px;
    height: 30px;
    fill: var(--primary-color, #a62626);
}
.widget-map .map-placeholder p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}


/* ─── Notification badge ─────────────────────────────────────── */
.badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff4444;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

/* ─── Boost (نردبان) badge ───────────────────────────────────── */
.boost-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fff3e0;
    color: #e65100;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    padding: 2px 6px;
}
.boost-badge svg { width: 12px; height: 12px; fill: currentColor; }
.boost-btn {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
    border-radius: 6px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    cursor: pointer;
}
.notif-bell { position: relative; background: none; border: none; padding: 6px; cursor: pointer; display: flex; }
.notif-bell svg { width: 24px; height: 24px; fill: var(--text-primary); }

/* ── Payment result page ─────────────────────────────────── */
.payment-result { padding: 48px 16px; text-align: center; }
.payment-result .loading { display: flex; flex-direction: column; align-items: center; gap: 12px; color: #666; }
.payment-result .spinner {
    width: 36px; height: 36px; border: 3px solid #eee; border-top-color: #a62626;
    border-radius: 50%; animation: payspin .8s linear infinite;
}
@keyframes payspin { to { transform: rotate(360deg); } }
.payment-result .result-success svg,
.payment-result .result-error svg { width: 64px; height: 64px; }
.payment-result .result-success svg { fill: #1aa053; }
.payment-result .result-error svg { fill: #e02020; }
.payment-result h2 { font-size: 18px; margin: 12px 0 6px; }
.payment-result p { color: #666; font-size: 14px; margin-bottom: 20px; }
.payment-result .btn-primary {
    display: inline-block; padding: 10px 24px; border-radius: 6px;
    background: #a62626; color: #fff; text-decoration: none; font-size: 14px;
}


/* ═══════════════════════════════════════════════════════════════
   DARK MODE
   ═══════════════════════════════════════════════════════════════ */
html.dark, html.dark body {
    --bg-primary: #1a1a1a;
    --bg-secondary: #121212;
    --bg-tertiary: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-tertiary: #707070;
    --border-color: #333333;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.5);
}
html.dark .post-card { border-bottom-color: #333; }
html.dark .filter-btn { background: #2a2a2a; border-color: #333; }
html.dark input, html.dark textarea, html.dark select {
    background: #2a2a2a; color: #fff; border-color: #333;
}
html.dark .modal-content { background: #1a1a1a; }
html.dark .chat-bubble.me { background: #2a4a3a; }
html.dark .chat-bubble.other { background: #2a2a2a; }
html.dark .skeleton { background: linear-gradient(90deg, #2a2a2a 25%, #333 50%, #2a2a2a 75%); }

/* ─── v58 widgets: safe transaction notice + showcase row ───── */
.widget-safe-transaction {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 14px 16px;
    margin: 8px 0;
    background: var(--bg-secondary, #f7f7f7);
    border-radius: 12px;
}
.widget-safe-transaction svg { width: 22px; height: 22px; flex: 0 0 22px; fill: currentColor; opacity: .7; }
.widget-safe-transaction strong { display: block; margin-bottom: 4px; font-size: 14px; }
.widget-safe-transaction p { margin: 0; font-size: 12px; line-height: 1.9; color: var(--text-secondary, #666); }

.widget-showcase { padding: 12px 0; }
.widget-showcase-title { font-size: 15px; font-weight: 700; padding: 0 16px 10px; }
.widget-showcase-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    padding: 0 12px;
}
.widget-call-button, .widget-chat-button { display: inline-block; padding: 6px 8px; }
