/* ==========================================================================
   Search Styles (search.css) - نالش
   يحتوي على: سجل البحث، الكبسولات (Chips/Pills)، نتائج البحث، والمتاجر المقترحة
   ========================================================================== */

/* ----------------------------------
   1. حاويات وعناوين البحث
------------------------------------- */
.search-history-container {
    padding: 15px 0;
    margin-bottom: 10px;
}

.recent-searches-wrapper {
    margin-bottom: 25px;
    animation: fadeIn 0.4s ease-out;
}

.search-label {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-section-header {
    font-size: 1.2rem;
    font-weight: 900;
    margin: 20px 0 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header-inline h4 {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.search-section-label {
    font-size: 1.1rem;
    font-weight: 900;
    margin: 25px 0 15px;
    color: var(--primary);
    display: block;
    border-right: 4px solid var(--primary);
    padding-right: 10px;
}

/* ----------------------------------
   2. أزرار الإجراءات (حذف السجل وغيرها)
------------------------------------- */
.clear-history-btn {
    color: var(--danger);
    font-size: 0.8rem;
    cursor: pointer;
    background: rgba(244, 63, 94, 0.1);
    padding: 4px 10px;
    border-radius: 8px;
}

.btn-text-only {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 8px;
    transition: 0.2s;
}

.btn-text-only:hover {
    background: rgba(244, 63, 94, 0.1);
}

/* ----------------------------------
   3. الكبسولات وكلمات البحث (Chips / Pills)
------------------------------------- */
.search-pills-wrapper,
.chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.search-pill,
.search-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.search-pill i,
.search-chip i {
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.8;
}

.search-pill:hover,
.search-chip:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(79, 70, 229, 0.2);
}

.search-pill:hover i,
.search-chip:hover i {
    color: rgba(255, 255, 255, 0.8);
}

.search-pill:active,
.search-chip:active {
    transform: scale(0.95);
}

.category-chip {
    background: rgba(79, 70, 229, 0.05);
    border: 1px dashed var(--primary);
    color: var(--primary);
}

/* ----------------------------------
   4. شبكة نتائج البحث وكروت المتاجر المقترحة
------------------------------------- */
.smart-results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 10px;
}

@media (min-width: 768px) {
    .smart-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 20px;
    }
}

.store-match-card,
.merchant-result-card,
.merchant-match-card {
    background: var(--primary-gradient);
    color: white;
    padding: 15px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.2);
}

.store-match-card:active,
.merchant-result-card:active,
.merchant-match-card:active {
    transform: scale(0.96);
}

.store-match-card .store-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 900;
}

.store-match-card .store-info h4 {
    margin: 0;
    font-size: 1.1rem;
}

.store-match-card .store-info p {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.9;
}