﻿
.search-wrapper {
    width: 100%;
    margin: 0 auto;
    position: relative;
}

.search-box {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 12px;
    padding: 0 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
    transition: box-shadow .2s, border .2s;
    border: 2px solid #eee;
}

    .search-box:focus-within {
        border-color: #2c4beb;
        box-shadow: 0 4px 16px rgba(44, 75, 235, 0.1);
    }

.search-icon {
    color: #999;
    flex-shrink: 0;
}

#searchInput {
    flex: 1;
    border: none;
    outline: none;
    padding: 14px 12px;
    font-size: 15px;
    background: transparent;
    font-family: inherit;
}

.loader {
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-top-color: #2c4beb;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: none;
}

    .loader.active {
        display: block;
    }

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    overflow: hidden;
    z-index: 100;
    animation: fadeIn .15s ease;
    max-height: 75vh;
    overflow-y: auto;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

    .section:last-child {
        border-bottom: none;
    }

.section-title {
    font-size: 12px;
    color: #888;
    padding: 8px 16px 4px;
    font-weight: 600;
}

/* لیست یکپارچه */
.result-list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
}

    .result-list li a {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 16px;
        text-decoration: none;
        color: #333;
        font-size: 14px;
        transition: background .15s;
    }

        .result-list li a:hover,
        .result-list li a.active {
            background: #f7f7f7;
        }

.result-thumb {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

    /* آیکون مخصوص صفحه لندینگ */
    .result-thumb.is-page {
        background: #e8f0ff;
        color: #3b6fd4;
    }

.result-name {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.result-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .result-title mark {
        background: transparent;
        color: #2c4beb;
        font-weight: bold;
    }

.result-sub {
    font-size: 11px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    background: #e8f0ff;
    color: #3b6fd4;
    white-space: nowrap;
    flex-shrink: 0;
}

.empty {
    padding: 24px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 16px 12px;
}

.chip {
    background: #f5f5f5;
    border: none;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s;
    display: flex;
    align-items: center;
    gap: 6px;
}

    .chip:hover {
        background: rgba(44, 75, 235, 0.1);
        color: #2c4beb;
    }

    .chip .remove {
        color: #999;
        font-size: 16px;
        line-height: 1;
    }

        .chip .remove:hover {
            color: #2c4beb;
        }
.section-history {
    display: flex;
    justify-content: space-between;
}
.clear-history {
    display: block;
    margin: 0 16px 12px;
    padding: 8px;
    background: transparent;
    border: 1px solid #eee;
    border-radius: 8px;
    color: #999;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
}

    .clear-history:hover {
        color: #2c4beb;
        border-color: #2c4beb;
    }

.result-list li.active > a {
    background: #eef2ff40 !important;
    outline: 2px solid #6366f120 !important;
    
}


/* ============================================================
 *  بنر جستجو
 * ============================================================ */
.banner-section {
    padding: 8px 12px 12px;
    margin-top: 4px;
}

.search-banner {
    display: block;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    aspect-ratio: 16 / 5; /* نسبت بنر — می‌تونی عوض کنی */
    background: #f5f5f5; /* پلیسهولدر تا لود تصویر */
}

.search-banner:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.search-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.search-banner:hover img {
    transform: scale(1.03);
}

/* ===== جستجو در موبایل داخل هدر ===== */
/*@media (max-width: 991px) {*/
    /* هدر وسط: لوگو + جستجو در یک ردیف، جستجو زیر آن تمام عرض */
    /*.header-middle .container {
        flex-wrap: wrap;
    }

    .header-middle .header-left {
        width: 100%;
        flex-wrap: wrap;
        gap: 10px;
    }

    .header-middle .logo {
        margin-left: 0 !important;
        margin-right: auto !important;
    }*/

    /* پنل جستجو تمام عرض در موبایل */
    /*.header-middle .input-wrapper.header-search.hs-expanded {
        flex: 0 0 100%;
        max-width: 100%;
        min-width: 0;
        margin: 8px 0 10px;
        order: 10;
    }*/

    /* عرض کامل جعبه جستجو */
    /*.header-middle .search-wrapper {
        width: 100%;
    }*/

    /* فونت و پدینگ مناسب موبایل */
    /*.header-middle #searchInput {
        font-size: 14px;
        padding: 12px 10px;
    }*/

    /* پیشنهادها در موبایل */
    /*.header-middle .suggestions {
        max-height: 65vh;
        border-radius: 10px;
    }
}

@media (max-width: 575px) {*/
    /* دیگر جستجو مخفی نشود */
    /*.header .header-search {
        display: block !important;
    }

    .container {
        padding: 0 1.3rem;
    }

    .header-middle .header-logo {
        margin-left: auto;
    }

    .header-middle .dropdown {
        margin-left: 0;
    }*/

    /* فشرده‌تر کردن جستجو در گوشی‌های کوچک */
    /*.header-middle .input-wrapper.header-search.hs-expanded {
        margin: 6px 0 8px;
    }

    .header-middle #searchInput {
        font-size: 13px;
        padding: 11px 10px;
    }

    .header-middle .suggestions {
        max-height: 60vh;
    }
}*/