/* ===================================================================
   استایل ثابت صفحه نتایج جستجوی کل سایت (محصول/مقاله/دسته/دوره)
=================================================================== */

.search-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 16px;
    direction: rtl;
    color: #1f2937;
}

.search-form-box {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.search-form-box input[type="text"] {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 15px;
}

.search-form-box button {
    border: none;
    border-radius: 12px;
    padding: 12px 26px;
    background: #1f2937;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

.search-term-label {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 32px;
}

.search-empty {
    color: #6b7280;
    text-align: center;
    padding: 60px 0;
}

.search-section {
    margin-bottom: 48px;
}

.search-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 10px;
}

.search-section-title {
    font-size: 18px;
    font-weight: 700;
}

.search-section-count {
    font-size: 13px;
    color: #6b7280;
}

.search-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

@media (max-width: 900px) {
    .search-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
    .search-grid { grid-template-columns: 1fr; }
}

/* لیست تخت برای دسته‌بندی‌ها (بدون تصویر) */
.search-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.search-tag-list a {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    color: #1f2937;
    text-decoration: none;
    font-size: 14px;
}

.search-tag-list a:hover {
    border-color: #b45309;
    color: #b45309;
}

/* کارت نتیجه (محصول / مقاله / دوره) */
.search-card {
    display: block;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    background: #fff;
    transition: box-shadow .15s ease;
}

.search-card:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
}

.search-card-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
    background: #f9fafb;
}

.search-card-placeholder {
    width: 100%;
    height: 150px;
    background: #f9fafb;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.search-card-body {
    padding: 12px;
}

.search-card-badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 999px;
    background: #f9fafb;
    color: #6b7280;
    margin-bottom: 6px;
}

.search-card-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.search-card:hover .search-card-title {
    color: #b45309;
}

.search-card-extra {
    font-size: 13px;
    color: #6b7280;
}

.search-pagination {
    margin-top: 20px;
}
/* ===================================================================
   Autocomplete سرچ هدر - دراپ‌داون زیر اینپوت
=================================================================== */

.rs-header-search {
    position: relative;
}

.gm-search-autocomplete {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
    max-height: 420px;
    overflow-y: auto;
    z-index: 999;
    display: none;
    direction: rtl;
}

.gm-search-autocomplete.is-open {
    display: block;
}

.gm-search-ac-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    text-decoration: none;
    color: #1f2937;
    border-bottom: 1px solid #f3f4f6;
}

.gm-search-ac-item:last-child {
    border-bottom: none;
}

.gm-search-ac-item:hover {
    background: #f9fafb;
}

.gm-search-ac-thumb {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 8px;
    object-fit: cover;
    background: #f3f4f6;
}

.gm-search-ac-thumb-placeholder {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 8px;
    background: #f3f4f6;
}

.gm-search-ac-body {
    flex: 1;
    min-width: 0;
}

.gm-search-ac-title {
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gm-search-ac-badge {
    font-size: 11px;
    color: #6b7280;
}

.gm-search-ac-extra {
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
}

.gm-search-ac-empty,
.gm-search-ac-loading {
    padding: 16px;
    text-align: center;
    font-size: 13px;
    color: #6b7280;
}

.gm-search-ac-seeall {
    display: block;
    text-align: center;
    padding: 10px;
    font-size: 13px;
    color: #b45309;
    text-decoration: none;
    border-top: 1px solid #f3f4f6;
}