/* ===================== هیرو ===================== */
.archive-hero {
    background: transparent;
    padding: 40px 24px 60px;
    margin-bottom: 24px;
}
.archive-hero-columns {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 40px;
}
.archive-hero-text {
    flex: 1.1;
    color: #fff;
}
.archive-hero-image {
    flex: 1.4;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}
.archive-hero-image img {
    max-width: 100%;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}
.archive-hero h1 {
    font-size: 34px;
    font-weight: 600;
    margin-bottom: 14px;
    color: #fff;
}
.archive-hero p {
    font-size: 15px;
    line-height: 1.9;
    color: rgba(255,255,255,0.75);
    margin-bottom: 32px;
    max-width: 520px;
    text-align: justify;
}
.archive-stats {
    display: flex;
    gap: 0;
    flex-wrap: wrap;
    background: #fff;
    border-radius: 14px;
    padding: 22px 10px;
}
.stat-item {
    text-align: center;
    padding: 0 18px;
    flex: 1;
    position: relative;
}
.stat-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 0;
    top: 10%;
    height: 80%;
    width: 1px;
    background: #E4E2DA;
}
.stat-number {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: #0C447C;
}
.stat-label {
    font-size: 12px;
    color: #5F5E5A;
}

@media (max-width: 900px) {
    .archive-hero-columns {
        flex-direction: column-reverse;
        text-align: center;
    }
    .archive-hero-text {
        text-align: center;
    }
    .archive-hero h1 {
        font-size: 16px !important;
    }
    .archive-hero p {
        margin-left: auto;
        margin-right: auto;
        text-align: center !important;
    }
    .archive-hero-image img {
        max-width: 90%;
        width: 90%;
    }
    .stat-item:not(:last-child)::after {
        display: none;
    }
    .archive-stats {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 4px !important;
        padding: 16px 4px !important;
    }
    .stat-item {
        padding: 0 2px !important;
        min-width: 0;
    }
    .stat-number {
        font-size: 16px !important;
    }
    .stat-label {
        font-size: 10px !important;
    }
    .companies-grid {
        padding-left: 5px !important;
        padding-right: 5px !important;
        box-sizing: border-box;
    }
    .card-body {
        margin-left: 5px !important;
        margin-right: 5px !important;
        box-sizing: border-box;
    }
    .archive-cta {
        margin-left: 5px !important;
        margin-right: 5px !important;
        max-width: none !important;
        box-sizing: border-box;
        justify-content: center;
        text-align: center;
    }
    .archive-cta .cta-btn {
        font-size: 12.5px !important;
        padding: 8px 16px !important;
    }
}

/* ===================== فیلترها ===================== */
.archive-filters {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}
.search-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.search-row input[type="text"] {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #D3D1C7;
    border-radius: 8px;
}
.filters-toggle, .search-btn {
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid #D3D1C7;
    background: #fff;
    cursor: pointer;
}
.filters-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.filters-row select {
    padding: 10px 36px 10px 14px;
    border: 1px solid #D3D1C7;
    border-radius: 8px;
    min-width: 180px;
    background: #fff url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235F5E5A' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat left 12px center;
    appearance: none;
    -webkit-appearance: none;
    font-size: 14px;
    color: #2C2C2A;
    cursor: pointer;
}
.filters-row select:focus {
    outline: none;
    border-color: #185FA5;
}
select[name="dbonyan"] {
    min-width: 230px;
}
.filters-row select option {
    font-size: 13px;
    padding-right: 20px;
    color: #5F5E5A;
}
.filters-row select option:first-child {
    font-size: 14px;
    font-weight: 600;
    padding-right: 8px;
    color: #2C2C2A;
}

/* گزینه‌ی پیش‌فرض/راهنمای هر دراپ‌داون فیلتر (ترتیب، تمام حوزه‌ها، وضعیت دانش‌بنیان)
   کم‌رنگ‌تر باشه تا مشخص باشه هنوز چیزی به‌صورت فعال انتخاب نشده */
.filters-row select option[value=""] {
    color: #A8ACB4 !important;
}
.filters-row select:has(option[value=""]:checked) {
    color: #A8ACB4;
}
.filters-toggle {
    display: none; /* فقط توی موبایل نمایش داده می‌شه */
}
.results-count {
    margin-top: 12px;
    font-size: 14px;
    color: #5F5E5A;
}

/* ===================== گرید کارت‌ها ===================== */
.companies-grid {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
@media (max-width: 1024px) {
    .companies-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .companies-grid { grid-template-columns: 1fr; }
}

.company-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #D3D1C7;
    box-shadow: 0 2px 8px rgba(20,30,60,0.06);
    transition: box-shadow .2s;
}
.company-card:hover {
    box-shadow: 0 6px 20px rgba(20,30,60,0.12);
}
.card-banner {
    position: relative;
    height: 140px;
    background: #185FA5;
}
.card-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.card-badge-icon {
    position: absolute;
    bottom: -24px;
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    overflow: hidden;
}
.card-badge-icon img {
    width: 88%;
    height: 88%;
    object-fit: contain;
}
.card-body {
    padding: 32px 16px 16px;
}
.card-body h3 {
    font-size: 16px;
    margin-bottom: 6px;
}
.card-body h3 a {
    color: #042C53;
    text-decoration: none;
}
.card-short-desc {
    font-size: 13px;
    color: #5F5E5A;
    margin-bottom: 14px;
}
.card-stats-row {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    font-size: 12px;
    color: #5F5E5A;
    flex-wrap: wrap;
}
.card-stat {
    text-align: center;
}
/* آیکون سبد خرید (dashicons-cart) با یه آیکون جعبه/محصول جایگزین شد — چون سایت ویترین فناوری‌ست، نه فروشگاهی */
.card-stat .dashicons-cart {
    font: 0/0 a;
    display: inline-block;
    width: 14px;
    height: 14px;
    vertical-align: middle;
    background: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235F5E5A' stroke-width='2' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M21 8 12 3 3 8l9 5 9-5Z'/%3E%3Cpath d='M3 8v8l9 5 9-5V8'/%3E%3Cpath d='M12 13v8'/%3E%3C/svg%3E") no-repeat center / contain;
}
.badge-daneshbonyan {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    background: #E6F1FB;
    color: #0C447C;
}
.badge-daneshbonyan.medal-gold {
    background: linear-gradient(135deg, #FFD700, #C99700) !important;
    color: #4A3300 !important;
    font-weight: 700 !important;
    border: none !important;
}
.badge-daneshbonyan.medal-silver {
    background: linear-gradient(135deg, #D8DCE0, #9AA2AA) !important;
    color: #2C3238 !important;
    font-weight: 700 !important;
    border: none !important;
}
.badge-daneshbonyan.medal-bronze {
    background: linear-gradient(135deg, #CD7F32, #8B4E1F) !important;
    color: #FFFFFF !important;
    font-weight: 700 !important;
    border: none !important;
}
.card-view-btn {
    display: block;
    text-align: center;
    padding: 8px;
    border: 1px solid #185FA5;
    color: #185FA5;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
}
.card-view-btn:hover {
    background: #185FA5;
    color: #fff;
}

/* ===================== صفحه‌بندی ===================== */
.archive-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 32px;
}
.archive-pagination .page-numbers {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid #D3D1C7;
    text-decoration: none;
    color: #2C2C2A;
}
.archive-pagination .page-numbers.current {
    background: #185FA5;
    color: #fff;
    border-color: #185FA5;
}

/* ===================== CTA ===================== */
.archive-cta {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    align-items: center;
    gap: 20px;
    background: #E6F1FB;
    padding: 32px;
    border-radius: 16px;
    margin-top: 32px;
    flex-wrap: wrap;
}
.cta-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #185FA5;
}
.cta-text { flex: 1; min-width: 200px; }
.cta-text h2 { font-size: 20px; margin-bottom: 6px; color: #042C53; }
.cta-text p { font-size: 14px; color: #5F5E5A; margin: 0; }
.cta-btn {
    background: #0F6E56;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
}

/* ===================== حالت موبایل برای فیلترها ===================== */
@media (max-width: 768px) {
    .search-row {
        flex-wrap: wrap;
    }
    .search-row input[type="text"] {
        order: 3;
        flex-basis: 100%;
    }
    .filters-toggle {
        display: none !important;
    }
    .filters-row {
        display: flex !important;
        flex-direction: column;
        margin-top: 12px;
    }
    .filters-row.open {
        display: flex !important;
    }
    .filters-row select {
        width: 100%;
        min-width: 0;
    }
}

/* ===================== بدون نتیجه ===================== */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 20px;
    background: #fff;
    border-radius: 12px;
    color: #5F5E5A;
    font-size: 15px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ===================== لینک پاک کردن فیلترها ===================== */
.clear-filters-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 13px;
    color: #185FA5;
    text-decoration: underline;
}
.clear-filters-link:hover {
    color: #042C53;
}

/* =====================================================================
   Override با اولویت بالا: چون style.css (تم) با specificity بالاتر
   یا بعد از این فایل لود می‌شه و بعضی از قوانین بالا رو بی‌اثر می‌کنه.
   این بخش رو همیشه انتهای فایل نگه دار تا آخرین قانونی باشه که اعمال می‌شه.
   ===================================================================== */
.company-card .card-stats-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.company-card .card-stats-row .badge-daneshbonyan {
    order: 2 !important;
    margin-inline-start: auto !important;
}

.company-card .card-stats-row .card-stat {
    order: 1 !important;
}

.company-card .card-stat .dashicons-cart {
    font: 0/0 a !important;
    display: inline-block !important;
    width: 14px !important;
    height: 14px !important;
    vertical-align: middle !important;
    background: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235F5E5A' stroke-width='2' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M21 8 12 3 3 8l9 5 9-5Z'/%3E%3Cpath d='M3 8v8l9 5 9-5V8'/%3E%3Cpath d='M12 13v8'/%3E%3C/svg%3E") no-repeat center / contain !important;
}

.company-card {
    box-shadow: 0 2px 8px rgba(20,30,60,0.06) !important;
}
.company-card:hover {
    box-shadow: 0 6px 20px rgba(20,30,60,0.12) !important;
}

.no-results {
    display: block !important;
    text-align: center !important;
    direction: rtl !important;
    padding: 48px 20px !important;
    background: #fff !important;
    border-radius: 12px !important;
    color: #5F5E5A !important;
    font-size: 15px !important;
    max-width: 1400px !important;
    margin: 0 auto !important;
    width: auto !important;
    float: none !important;
}

/* آیکون ذره‌بین جستجو: رنگ صریح در هر دو حالت، چون در حالت عادی محو (سفید روی سفید) بود */
.search-btn {
    background: #fff !important;
    border-color: #D3D1C7 !important;
    transition: background .15s, border-color .15s;
}
.search-btn .dashicons-search {
    color: #5F5E5A !important;
}
.search-btn:hover {
    background: #185FA5 !important;
    border-color: #185FA5 !important;
}
.search-btn:hover .dashicons-search {
    color: #fff !important;
}

.pa-sort-select {
    display: none !important;
}

/* ===================== جستجوی زنده‌ی شرکت‌ها ===================== */
.qstp-live-search-wrap {
    position: relative;
    display: block !important;
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important; /* جلوی جمع‌شدن غیرمنتظره‌ی flex item رو می‌گیره */
}
#qstp-company-search {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
    flex: none !important; /* چون دیگه بچه‌ی مستقیم فلکس نیست، این خنثی می‌کنیم */
}

.qstp-live-search-results {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: 0;
    z-index: 50;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(20,30,60,0.18), 0 2px 8px rgba(20,30,60,0.08);
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
}
.qstp-live-search-results.is-open {
    display: block;
    animation: qstpLiveSearchFadeIn .15s ease;
}
@keyframes qstpLiveSearchFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.qstp-live-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: background .12s ease;
}
.qstp-live-search-item + .qstp-live-search-item {
    margin-top: 2px;
}
.qstp-live-search-item:hover,
.qstp-live-search-item:focus,
.qstp-live-search-item.is-active {
    background: #EAF2FB;
}

.qstp-live-search-logo {
    width: 42px !important;
    height: 42px !important;
    max-width: 42px !important;
    border-radius: 10px !important;
    object-fit: contain !important;
    background: #F8F9FB;
    border: 1px solid #EEF0F3;
    flex-shrink: 0;
    padding: 4px;
    box-sizing: border-box;
}
.qstp-live-search-logo-empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.qstp-live-search-logo-empty::after {
    content: '🏢';
    font-size: 16px;
}

.qstp-live-search-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
    flex: 1;
}
.qstp-live-search-name {
    font-size: 14px;
    font-weight: 700;
    color: #042C53;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.qstp-live-search-name mark {
    background: #FFF1B8;
    color: #042C53;
    border-radius: 3px;
    padding: 0 1px;
}
.qstp-live-search-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #8A8D97;
}
.qstp-live-search-meta-domain {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.qstp-live-search-reason {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #185FA5;
    background: #EAF2FB;
    padding: 1px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.qstp-live-search-badge {
    flex-shrink: 0;
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}
.qstp-live-search-badge.is-dbonyan {
    background: #E8F8F1;
    color: #1FA983;
}
.qstp-live-search-badge.is-private {
    background: #F3F5F9;
    color: #5F5E5A;
}

.qstp-live-search-arrow {
    flex-shrink: 0;
    color: #C9CBD3;
    font-size: 18px;
}

.qstp-live-search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 28px 14px;
    text-align: center;
    font-size: 13px;
    color: #8A8D97;
}
.qstp-live-search-empty-icon {
    font-size: 22px;
}

.qstp-live-search-loading {
    padding: 18px;
    text-align: center;
    font-size: 12.5px;
    color: #8A8D97;
}