/**
 * =================================================================
 * COMPONENT: Results Count & Filter Bar (Refactored Version)
 * File: component.results-bar.css
 * =================================================================
 */

/* =================================================================
   1. Base Styles for the Bar
   ================================================================= */
.count-search {
    display: flex;
    align-items: center;
    /*
     * این استایل برای حالت موبایل است که دکمه فیلتر و متن را در دو طرف قرار می‌دهد.
     * این بخش به حالت اولیه بازگردانده شد.
     */
    justify-content: space-between;

    padding: 0; /* Padding is handled by responsive rules */
    font-size: 075rem;
    color: var(--color-black-soft);
    /* border-radius: 0 0 5px 5px; */
    /* box-shadow: 0 5px 10px -3px rgba(0, 0, 0, 0.3); */
}

/* =================================================================
   2. Inner Text Styles
   ================================================================= */
.search-result-text {
    /*
     * مارجین راست برای ایجاد فاصله در حالت موبایل به حالت اولیه بازگردانده شد.
     */
    margin-right: 10px;
    font-size: 0.625rem;
}

.search-result-name-text {
    font-size: 12px;
    font-weight: bold;
}

/* =================================================================
   3. Filter Button Styles (Mobile)
   ================================================================= */
/* This is the primary style for the mobile filter button */
.custom-filter-badge {
    padding: 8px 15px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-navy-deep);
    background-color: var(--color-white-aqua);
    border: 1px solid var(--color-gray-dark);
    border-radius: 5px; /* Overwrites default badge radius */
    vertical-align: middle;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.custom-filter-badge:hover {
    color: var(--color-white-soft);
    background-color: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Legacy style, also used as a JS hook. Kept for safety. */
.filter-icon {
    padding: 6px 12px;
    font-size: 14px;
    background-color: var(--color-white-aqua);
    border: 1px solid var(--color-gray-mid);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.filter-icon:hover {
    background-color: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
}

/* =================================================================
   4. Responsive Layout Adjustments
   ================================================================= */

/* --- Mobile & Small Tablets (< 992px) --- */
@media (max-width: 991.98px) {
    #mobile-sticky-wrapper .count-search {
        height: 55px;
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* --- Desktops (>= 992px) --- */
@media (min-width: 992px) {
    .count-search {
        position: -webkit-sticky;
        /* position: sticky; */
        top: var(--sticky-top-offset); /* Uses global variable */
            margin-top: 3px;
    margin-bottom: 3px;
        z-index: 1010;
        
        /*
         * [اصلاح] برای لغو کردن کلاس d-lg-block از بوت‌استرپ، !important اضافه شد.
         * این کار تضمین می‌کند که این عنصر یک flex container باقی بماند.
        */
        display: flex !important;
        
        /* * [تغییر اصلی] برای وسط‌چین کردن محتوا فقط در حالت دسکتاپ
         * مقدار justify-content از flex-start به center تغییر کرد.
         * برای بازگرداندن به حالت قبل، این خط را به justify-content: flex-start; تغییر دهید.
         */
        justify-content: center;
        padding: 1rem 0 0.5rem;
        margin-top: 0;
        background-color: var(--color-white-soft);
        transition: top 0.3s ease-in-out;
    }
}
