﻿/* ==============================
   Search Page - Modern UI
   ============================== */

:root {
    /* فونت اصلی سایت؛ اگر IRANSansWeb لود نشد به Tahoma برمی‌گردد */
    --font-main: "IRANSansWeb", Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    font-family: var(--font-main);
    background: #f7f8fc;
    color: #24262d;
    margin: 0;
    padding: 0;
}

.search-page {
    min-height: calc(100vh - 40px);
    padding: 45px 15px 60px;
}

.search-wrapper {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
}

/* Header */
.search-header {
    text-align: center;
    margin-bottom: 28px;
}

.brand-title {
    font-size: 34px;
    font-weight: 800;
    color: #262a5e;
    margin: 0 0 10px;
}

.brand-subtitle {
    font-size: 14px;
    color: #777b88;
    margin: 0;
}

/* Main Card */
.search-card {
    background: #ffffff;
    border: 1px solid #e9eaf0;
    border-radius: 24px;
    padding: 22px;
    box-shadow: 0 12px 35px rgba(35, 39, 80, .08);
}

/* Search */
.search-main {
    position: relative;
    margin-bottom: 18px;
}

.search-box {
    width: 100%;
    height: 56px;
    border: 2px solid #e5e6ed;
    border-radius: 18px;
    background: #fafbfc;
    padding: 0 58px 0 18px;
    font-family: var(--font-main);
    font-size: 16px;
    color: #252733;
    outline: none;
    transition: all .2s ease;
    box-sizing: border-box;
}

    .search-box::placeholder { color: #a1a4ae; }

    .search-box:focus {
        background: #ffffff;
        border-color: #7a2b8c;
        box-shadow: 0 0 0 4px rgba(122, 43, 140, .08);
    }

.search-icon-button {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: #7a2b8c;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none !important;
    transition: all .2s ease;
}

    .search-icon-button:hover {
        background: #652273;
        color: #ffffff;
        transform: scale(1.04);
    }

    .search-icon-button i { font-size: 17px; }

/* Tabs */
.search-tabs {
    display: flex;
    gap: 8px;
    background: #f3f4f7;
    border-radius: 15px;
    padding: 5px;
    margin-bottom: 18px;
}

.search-tab {
    flex: 1;
    min-width: 0;
    text-align: center;
    border-radius: 11px;
    padding: 11px 8px;
    font-size: 13px;
    color: #696c78;
    text-decoration: none !important;
    transition: all .2s ease;
    white-space: nowrap;
}

    .search-tab.active {
        background: #ffffff;
        color: #7a2b8c;
        font-weight: 700;
        box-shadow: 0 3px 10px rgba(0,0,0,.06);
    }

    .search-tab:hover { color: #7a2b8c; }

/* Filters */
.filter-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 0 4px;
}

    .filter-title span {
        font-size: 13px;
        color: #777b88;
    }

.filter-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: #fafbfc;
    border: 1px solid #e7e8ee;
    border-radius: 18px;
}

.filter-select {
    height: 45px;
    min-width: 0;
    flex: 1;
    border: 1px solid #e0e1e7;
    border-radius: 12px;
    background-color: #ffffff;
    padding: 0 10px;
    font-family: var(--font-main);
    font-size: 13px;
    color: #4a4d58;
    outline: none;
    cursor: pointer;
    transition: all .2s ease;
}

    .filter-select:focus {
        border-color: #7a2b8c;
        box-shadow: 0 0 0 3px rgba(122,43,140,.07);
    }

.filter-separator {
    color: #c5c7cf;
    font-size: 16px;
}

.filter-button {
    height: 45px;
    min-width: 82px;
    border: 0;
    border-radius: 12px;
    background: #292d63;
    color: #ffffff;
    font-family: var(--font-main);
    font-size: 13px;
    cursor: pointer;
    transition: all .2s ease;
}

    .filter-button:hover {
        background: #1f234e;
        transform: translateY(-1px);
    }

/* Results */
.results-wrapper { margin-top: 18px; }

.results-header {
    font-size: 14px;
    font-weight: 700;
    color: #464955;
    margin-bottom: 10px;
    padding: 0 5px;
    text-align: right;
}

/* =========================================
   Search Results
   ========================================= */

#result_div {
    width: 100%;
    max-width: 720px;
    min-height: 80px;
    margin: 0 auto;
    padding: 8px;
    box-sizing: border-box;
    background: #ffffff;
    border: 1px solid #e9eaf0;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(35, 39, 80, .06);
    text-align: right;
    direction: rtl;
}

    #result_div:empty { display: none; }

    /* دسته بندی */
    #result_div .search_break {
        display: flex;
        align-items: center;
        width: 100%;
        box-sizing: border-box;
        margin: 10px 0 5px;
        padding: 8px 12px;
        font-family: var(--font-main);
        font-size: 13px;
        font-weight: 700;
        color: #7a2b8c;
        background: #faf7fb;
        border-radius: 10px;
        text-align: right;
    }

        #result_div .search_break::before {
            content: "";
            display: inline-block;
            width: 4px;
            height: 18px;
            margin-left: 8px;
            background: #7a2b8c;
            border-radius: 5px;
        }

        #result_div .search_break:first-child { margin-top: 2px; }

        /* «نتایج مشابه» */
        #result_div .search_break.partial {
            color: #8a6d00;
            background: #fff8e1;
        }

            #result_div .search_break.partial::before { background: #e0a800; }

    #result_div li {
        display: block;
        list-style: none;
        margin: 0;
        padding: 0;
    }

    /* هر نتیجه */
    #result_div .search_sug_tooltip {
        position: relative;
        display: flex;
        align-items: center;
        width: 100%;
        min-height: 44px;
        box-sizing: border-box;
        padding: 10px 42px 10px 14px;
        margin: 3px 0;
        background: #ffffff;
        border-radius: 12px;
        color: #3d404a;
        font-family: var(--font-main);
        font-size: 14px;
        text-decoration: none;
        transition: background-color .18s ease, transform .18s ease, box-shadow .18s ease, color .18s ease;
    }

        #result_div .search_sug_tooltip::before {
            content: "\f002";
            position: absolute;
            right: 14px;
            font-family: "Font Awesome 5 Free";
            font-weight: 900;
            font-size: 13px;
            color: #a4a6af;
            transition: color .18s ease;
        }

        #result_div .search_sug_tooltip::after {
            content: "\f104";
            position: absolute;
            left: 14px;
            font-family: "Font Awesome 5 Free";
            font-weight: 900;
            font-size: 12px;
            color: #c1c3ca;
            transition: all .18s ease;
        }

        #result_div .search_sug_tooltip:hover,
        #result_div .search_sug_tooltip.active {
            background: #faf7fb;
            color: #7a2b8c;
            transform: translateX(-2px);
            box-shadow: 0 4px 12px rgba(122, 43, 140, .07);
        }

            #result_div .search_sug_tooltip:hover::before,
            #result_div .search_sug_tooltip.active::before { color: #7a2b8c; }

            #result_div .search_sug_tooltip:hover::after,
            #result_div .search_sug_tooltip.active::after {
                color: #7a2b8c;
                left: 10px;
            }

    /* کلمات جستجو شده */
    #result_div mark {
        background: none;
        color: #7a2b8c;
        font-weight: 800;
    }

    /* پیام‌ها: در حال جستجو / نتیجه‌ای نیست / خطا */
    #result_div .result-msg {
        margin: 0;
        padding: 14px 12px;
        font-size: 13px;
        color: #777b88;
        text-align: center;
    }

/* =========================================
   Mobile
   ========================================= */

@media (max-width: 576px) {

    .search-page { padding: 25px 10px 40px; }

    .brand-title { font-size: 27px; }

    .brand-subtitle { font-size: 12px; }

    .search-card {
        padding: 14px;
        border-radius: 20px;
    }

    .search-box {
        height: 52px;
        font-size: 14px;
        border-radius: 16px;
    }

    .search-icon-button {
        width: 40px;
        height: 40px;
        top: 6px;
        right: 6px;
        border-radius: 12px;
    }

    .search-tabs { gap: 5px; }

    .search-tab {
        font-size: 11px;
        padding: 10px 4px;
    }

    .filter-box {
        overflow: hidden;
        padding: 8px;
        gap: 5px;
    }

    .filter-select {
        width: auto;
        flex: 1;
        font-size: 11px;
        padding: 0 5px;
    }

    .filter-separator { display: none; }

    .filter-button {
        min-width: 58px;
        height: 43px;
        font-size: 11px;
    }

    #result_div {
        margin-top: 0;
        padding: 6px;
        border-radius: 17px;
    }

        #result_div .search_break {
            margin: 8px 0 4px;
            padding: 7px 10px;
            font-size: 12px;
        }

            #result_div .search_break::before {
                width: 3px;
                height: 16px;
                margin-left: 7px;
            }

        #result_div .search_sug_tooltip {
            min-height: 42px;
            padding: 9px 38px 9px 12px;
            font-size: 12px;
            border-radius: 10px;
        }

            #result_div .search_sug_tooltip::before {
                right: 12px;
                font-size: 11px;
            }

            #result_div .search_sug_tooltip::after {
                left: 12px;
                font-size: 10px;
            }
}

/* Very small screens */
@media (max-width: 360px) {

    .filter-box { flex-wrap: wrap; }

    .filter-select { flex: 1 1 30%; }

    .filter-button { flex: 0 0 100%; }
}


.search-header {
    text-align: center;
    padding-top: 35px;
    margin-bottom: 32px;
}

.search-logo {
    display: block;
    width: min(680px, 78vw);
    max-height: 210px;
    height: auto;
    margin: 0 auto 18px;
    object-fit: contain;
}

.brand-subtitle {
    margin: 0 auto;
    max-width: 600px;
    color: #6b7280;
    font-size: 15px;
    line-height: 2;
}

@media (max-width: 576px) {
    .search-header {
        padding-top: 20px;
        margin-bottom: 22px;
    }

    .search-logo {
        width: min(260px, 70vw);
        margin-bottom: 12px;
    }

    .brand-subtitle {
        font-size: 13px;
        padding: 0 15px;
    }
}
/* =========================================
   Result Cards (متن پیدا شده، فاصله، قیمت، امتیاز، عکس)
   ========================================= */

.result-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    width: 100%;
    min-height: 0;
    box-sizing: border-box;
    padding: 12px;
    margin: 6px 0;
    background: #ffffff;
    border: 1px solid #eef0f5;
    border-radius: 16px;
    color: #3d404a;
    text-decoration: none;
    transition: background-color .18s ease, transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

    .result-card:hover, .result-card.active {
        background: #faf7fb;
        border-color: #eadcf0;
        transform: translateY(-1px);
        box-shadow: 0 6px 18px rgba(122, 43, 140, .1);
    }

/* بند عکس / آیکون پیش‌فرض */
.result-thumb {
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    border-radius: 12px;
    overflow: hidden;
    background: #f3f4f7;
}

    .result-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.result-thumb-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 22px;
}

/* گرادیان‌های دسته‌بندی برای آیکون پیش‌فرض */
.grad-hotel      { background: linear-gradient(135deg, #7a2b8c, #4e2470); }
.grad-cinema     { background: linear-gradient(135deg, #b3282d, #7a1620); }
.grad-tiwall     { background: linear-gradient(135deg, #b3282d, #7a1620); }
.grad-museum     { background: linear-gradient(135deg, #8a6d00, #5c4700); }
.grad-pool       { background: linear-gradient(135deg, #0f8fa3, #0a5c6b); }
.grad-medical    { background: linear-gradient(135deg, #1f8a5c, #14603f); }
.grad-legal      { background: linear-gradient(135deg, #2d3f8f, #1c2a63); }
.grad-education  { background: linear-gradient(135deg, #c96b16, #8f4a0d); }
.grad-technical  { background: linear-gradient(135deg, #4a4d58, #2b2d35); }
.grad-sport      { background: linear-gradient(135deg, #d9480f, #8a2e0a); }
.grad-fun        { background: linear-gradient(135deg, #e0a800, #a06f00); }
.grad-beauty     { background: linear-gradient(135deg, #d6336c, #8a1f47); }
.grad-shop       { background: linear-gradient(135deg, #5c3b8a, #38235a); }
.grad-food       { background: linear-gradient(135deg, #b3651a, #7a4310); }
.grad-default    { background: linear-gradient(135deg, #292d63, #16183a); }

/* بدنه‌ی نتیجه */
.result-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.result-title {
    font-size: 14px;
    font-weight: 700;
    color: #292d33;
    line-height: 1.6;
}

/* قطعه‌ی متنی که عبارت در آن پیدا شده (آدرس/توضیحات) */
.result-snippet {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 12.5px;
    color: #767a86;
    line-height: 1.9;
}

    .result-snippet .snippet-tag {
        flex: 0 0 auto;
        padding: 1px 8px;
        border-radius: 20px;
        background: #f3f0f6;
        color: #7a2b8c;
        font-size: 11px;
        font-weight: 700;
        white-space: nowrap;
    }

/* ردیف اطلاعات تکمیلی: دسته، امتیاز، قیمت، فاصله */
.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 20px;
    background: #f6f6f9;
    color: #62656f;
    font-size: 11.5px;
    white-space: nowrap;
}

    .meta-chip i { font-size: 10px; }

    .meta-chip.rating { background: #fff6df; color: #9a7500; }
    .meta-chip.rating i { color: #f0a500; }

    .meta-chip.price { background: #eaf7ef; color: #1f8a5c; font-weight: 700; }

    .meta-chip.distance { background: #eaf1ff; color: #2d5fc9; }

/* پررنگ کردن عبارت جستجو */
.result-title mark,
.result-snippet mark {
    background: none;
    color: #7a2b8c;
    font-weight: 800;
}

/* گروه‌بندی و پیام‌ها داخل نتیجه در حالت کارت */
#result_div .search_break,
#result_div .result-msg {
    /* از استایل قبلی به ارث می‌رسد؛ همین‌جا کافی است فاصله‌ی بالای اولین کارت را کم کنیم */
    margin-top: 8px;
}

#result_div {
    display: flex;
    flex-direction: column;
}

@media (max-width: 576px) {
    .result-thumb { width: 52px; height: 52px; border-radius: 10px; }
    .result-title { font-size: 13px; }
    .result-snippet { font-size: 11.5px; }
    .meta-chip { font-size: 11px; padding: 2px 8px; }
}

/* =========================================
   اطلاعات آدرس / توضیحات نتیجه
   ========================================= */

.result-snippet {
    min-width: 0;
    max-width: 100%;
}

    .result-snippet > i {
        flex: 0 0 auto;
        width: 16px;
        margin-top: 5px;
        color: #7a2b8c;
        font-size: 11px;
        text-align: center;
    }

    .result-snippet .snippet-text {
        min-width: 0;
        overflow: hidden;
    }


/* =========================================
   فاصله از کاربر
   ========================================= */

.meta-chip.distance {
    background: #eaf1ff;
    color: #2d5fc9;
}

    .meta-chip.distance i {
        color: #2d5fc9;
    }


/* =========================================
   قیمت
   ========================================= */

.meta-chip.price {
    background: #eaf7ef;
    color: #1f8a5c;
}


/* =========================================
   هایلایت عبارت جستجو
   ========================================= */

.result-title mark,
.result-snippet mark {
    background: transparent;
    color: #7a2b8c;
    font-weight: 800;
    padding: 0;
}


/* =========================================
   موبایل
   ========================================= */

@media (max-width: 576px) {

    .result-card {
        gap: 10px;
        padding: 10px;
        border-radius: 14px;
    }

    .result-thumb {
        width: 54px;
        height: 54px;
        border-radius: 10px;
    }

    .result-title {
        font-size: 13.5px;
    }

    .result-snippet {
        font-size: 12px;
        line-height: 1.8;
    }

    .meta-chip {
        font-size: 11px;
        padding: 3px 8px;
    }

   
}

.search-result-meta {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 4px;
}

.search-result-address,
.search-result-details {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.search-distance {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #7a2b8c;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    direction: rtl;
}

    .search-distance i.fas.fa-location-arrow {
        font-family: "Font Awesome 5 Free" !important;
        font-weight: 600 !important;
        font-style: normal !important;
        display: inline-block;
        /* رنگ آیکن */
        color: #7a2b8c !important;
        font-size: 10px;
    }
.search-result-address {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    color: #9a9dab;
    font-size: 11.5px;
    line-height: 1.8;
}

    .search-result-address i {
        flex: 0 0 auto;
        margin-top: 5px;
        color: #7a2b8c !important;
        font-family: "Font Awesome 5 Free" !important;
        font-weight: 600 !important;
        font-size: 11px;
    }

.search-highlight {
    color: #7a2b8c !important;
    font-weight: 800 !important;
    background: transparent !important;
}


/* =========================================
   ساختار جدید هر نتیجه
   خط ۱: عنوان + شهر (راست) ... فاصله (چپ)
   خط ۲: آدرس / قطعه‌ی توضیحات (کمرنگ‌تر و کوچک‌تر)
   ========================================= */

.search-result-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
    gap: 2px;
}

.search-result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.search-result-titlewrap {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 8px;
    flex: 1 1 auto;
    min-width: 0;
}

.search-result-title {
    min-width: 0;
    font-size: 14px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

/* فاصله: همان استایل قبلی، فقط انتهای خط اول (سمت چپ) */
.search-result-head .search-distance {
    flex: 0 0 auto;
    margin: 0;
}

/* شهر: برچسب ظریف و کم‌رنگ کنار عنوان */
.search-city {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    padding: 1px 8px 1px 7px;
    color: #8f6a9b;
    background: #f7f2f9;
    border: 1px solid #efe6f3;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 500;
    line-height: 1.7;
    white-space: nowrap;
}

    .search-city i.fas.fa-city {
        font-family: "Font Awesome 5 Free" !important;
        font-weight: 900 !important;
        font-style: normal !important;
        color: #b391bf !important;
        font-size: 9px;
    }

/* آدرس / توضیحات زیر عنوان */
.search-result-meta {
    min-width: 0;
}

    .search-result-meta .meta-text {
        min-width: 0;
        overflow-wrap: anywhere;
    }

.search-result-details i {
    color: #b391bf !important;
}

.search-result-address i {
    color: #b391bf !important;
    font-size: 10px;
}

/* هایلایت داخل خط دوم کمی ملایم‌تر از عنوان */
.search-result-meta .search-highlight {
    font-weight: 700 !important;
}

@media (max-width: 576px) {
    .search-result-title { font-size: 13.5px; }
    .search-result-address { font-size: 11px; }
    .search-city { font-size: 10px; padding: 0 7px 0 6px; }
    .search-result-head .search-distance { font-size: 11px; }
}


/* =========================================
   آیکن دسته‌بندی کنار عنوان
   رنگ‌ها از جاوااسکریپت (--cat-bg / --cat-fg) می‌آیند
   ========================================= */

.search-cat {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-left: 11px;
    border-radius: 11px;
    background: var(--cat-bg, #f1f2f5);
    color: var(--cat-fg, #7b7f8c);
    font-size: 14px;
    transition: transform .18s ease;
}

    .search-cat i.fas {
        font-family: "Font Awesome 5 Free" !important;
        font-weight: 900 !important;
        font-style: normal !important;
        line-height: 1;
        color: inherit !important;
    }

/* نتیجه‌ای که آیکن دسته دارد، به‌جای ذره‌بین قدیمی */
#result_div .search_sug_tooltip.has-cat {
    padding: 9px 10px 9px 14px;
}

    #result_div .search_sug_tooltip.has-cat::before {
        display: none;
    }

    #result_div .search_sug_tooltip.has-cat:hover .search-cat,
    #result_div .search_sug_tooltip.has-cat.active .search-cat {
        transform: scale(1.06);
    }

@media (max-width: 576px) {
    .search-cat {
        width: 32px;
        height: 32px;
        margin-left: 9px;
        border-radius: 10px;
        font-size: 13px;
    }

    #result_div .search_sug_tooltip.has-cat {
        padding: 8px 8px 8px 12px;
    }
}


/* =========================================
   تب‌ها (اطراف من) و غیرفعال شدن لیست‌ها
   ========================================= */

.search-tab {
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

    .search-tab:focus-visible {
        outline: 2px solid #c9a3d4;
        outline-offset: 2px;
    }

.filter-select:disabled {
    background-color: #f3f4f7;
    color: #a9acb8;
    border-color: #ececf1;
    cursor: not-allowed;
    opacity: .75;
}

.filter-box.nearby-mode .filter-separator {
    opacity: .4;
}


/* =========================================
   تعداد نتایج + حالت در حال بارگذاری
   ========================================= */

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.results-count {
    font-size: 12px;
    font-weight: 500;
    color: #9a9dab;
}

    .results-count:empty {
        display: none;
    }

#result_div.is-loading {
    opacity: .55;
    pointer-events: none;
    transition: opacity .15s ease;
}


/* =========================================
   صفحه‌بندی
   ========================================= */

#result_div .search-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
    margin: 12px 0 4px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f4;
    direction: rtl;
}

.pg-btn {
    min-width: 34px;
    height: 34px;
    padding: 0 9px;
    border: 1px solid #e6e7ee;
    border-radius: 10px;
    background: #ffffff;
    color: #5b5e6b;
    font-family: var(--font-main);
    font-size: 12.5px;
    line-height: 1;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

    .pg-btn:hover:not(:disabled):not(.active) {
        background: #faf7fb;
        border-color: #e3d2ea;
        color: #7a2b8c;
    }

    .pg-btn.active {
        background: #7a2b8c;
        border-color: #7a2b8c;
        color: #ffffff;
        font-weight: 700;
        cursor: default;
    }

    .pg-btn:disabled {
        opacity: .4;
        cursor: not-allowed;
    }

    .pg-btn i {
        font-size: 10px;
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
    }

.pg-gap {
    min-width: 18px;
    text-align: center;
    color: #b3b5c0;
    font-size: 13px;
}

@media (max-width: 576px) {
    #result_div .search-pager { gap: 4px; }

    .pg-btn {
        min-width: 30px;
        height: 32px;
        padding: 0 7px;
        font-size: 12px;
        border-radius: 9px;
    }
}


/* =========================================
   لودینگ: نوار پیشرفت + اسکلت لیست (Skeleton)
   ========================================= */

.results-wrapper {
    position: relative;
}

.search-progress {
    position: absolute;
    top: -9px;
    left: 50%;
    width: 100%;
    max-width: 720px;
    height: 3px;
    transform: translateX(-50%);
    border-radius: 3px;
    overflow: hidden;
    background: transparent;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
}

    .search-progress span {
        position: absolute;
        top: 0;
        bottom: 0;
        width: 38%;
        border-radius: 3px;
        background: linear-gradient(90deg, rgba(122, 43, 140, 0), #7a2b8c 45%, #b391bf 80%, rgba(179, 145, 191, 0));
        animation: sk-progress 1.15s cubic-bezier(.4, 0, .2, 1) infinite;
    }

.results-wrapper.is-busy .search-progress {
    opacity: 1;
}

@keyframes sk-progress {
    0% { right: -40%; }
    100% { right: 102%; }
}

.sk-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 10px 9px 14px;
    margin-bottom: 4px;
    border-radius: 12px;
    animation: sk-in .28s ease both;
}

.sk-badge,
.sk-line {
    display: block;
    background: linear-gradient(90deg, #f1f2f6 25%, #e7e9f0 40%, #f1f2f6 60%);
    background-size: 300% 100%;
    animation: sk-shimmer 1.3s ease-in-out infinite;
}

.sk-badge {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 11px;
}

.sk-lines {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sk-line {
    height: 11px;
    border-radius: 6px;
}

    .sk-line.sm {
        height: 8px;
        opacity: .8;
    }

.sk-caption {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 8px 8px;
    color: #8f6a9b;
    font-size: 12.5px;
}

.sk-pulse {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #f5eef8;
    color: #7a2b8c;
    font-size: 11px;
}

    .sk-pulse::after {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: 50%;
        border: 2px solid #b391bf;
        animation: sk-ping 1.4s ease-out infinite;
    }

    .sk-pulse i {
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
    }

@keyframes sk-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

@keyframes sk-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}

@keyframes sk-ping {
    0% { transform: scale(1); opacity: .7; }
    100% { transform: scale(1.9); opacity: 0; }
}

@media (max-width: 576px) {
    .sk-item { padding: 8px 8px 8px 12px; }
    .sk-badge { width: 32px; height: 32px; border-radius: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .search-progress span,
    .sk-badge,
    .sk-line,
    .sk-pulse::after,
    .sk-item {
        animation: none !important;
    }

    .search-progress span { width: 100%; right: 0; opacity: .6; }
}


/* دکمه‌ها و فیلدها به‌طور پیش‌فرض فونت را ارث نمی‌برند */
button,
input,
select,
textarea {
    font-family: var(--font-main);
}

/* تگ picture لوگو مثل بلوک رفتار کند تا فاصله‌ی اضافه‌ی خط ایجاد نشود */
.search-header picture { display: block; }

/* فاصله‌ی بالای نتایج هنگام اسکرول خودکار */
.results-wrapper { scroll-margin-top: 14px; }
