/* sari3 — full search page (iqcars /search style) */

.search-page {
    padding: 1rem 0 5rem;
    min-height: 70vh;
}

.search-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.search-sidebar {
    position: sticky;
    top: calc(var(--header-h, 70px) + 12px);
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 0;
    max-height: calc(100vh - var(--header-h, 70px) - 24px);
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.search-sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 1rem 0.5rem;
}

.search-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
}

.search-sidebar-head h2 {
    font-size: 1.05rem;
    font-weight: 800;
}

.search-sidebar-close {
    display: none;
    border: none;
    background: #f4f4f4;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 1.25rem;
    cursor: pointer;
    line-height: 1;
}

.filter-section-title {
    font-size: 0.82rem;
    font-weight: 800;
    margin: 0.75rem 0 0.5rem;
    color: #1a1a1a;
}

.filter-brands-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
}

.filter-brand-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.45rem 0.25rem;
    border: 1px solid #eee;
    border-radius: 8px;
    background: #fafafa;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.62rem;
    font-weight: 600;
    color: #333;
}

.filter-brand-btn img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.filter-brand-btn.active {
    border-color: var(--primary);
    background: #fff5f5;
    color: var(--primary);
}

.search-filter-fields {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.75rem;
}

.search-filter-free {
    padding-bottom: 0.5rem;
}

.field-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.field-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: #8a8a8a;
    margin-bottom: 0.25rem;
}

.field-input {
    width: 100%;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 0.55rem 0.65rem;
    font-family: inherit;
    font-size: 0.88rem;
    background: #fafafa;
}

.field-fake {
    color: #bbb;
    pointer-events: none;
    user-select: none;
}

.field-chips-fake {
    display: flex;
    gap: 0.35rem;
}

.field-chips-fake span {
    flex: 1;
    height: 34px;
    border-radius: 8px;
    border: 1px solid #eee;
    background: #fafafa;
}

/* Compact app promo — no tall fake locked filters */
.filter-app-promo {
    margin: 0.85rem 0 0.35rem;
    padding: 0.85rem 0.9rem;
    border: 1px solid #eee;
    border-radius: 12px;
    background: #fafafa;
    text-align: center;
}

.filter-app-promo p {
    font-size: 0.82rem;
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1.4;
    margin: 0 0 0.65rem;
}

.filter-app-promo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
}

.filter-app-promo-actions .btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.78rem;
    min-height: 34px;
}

/* Legacy locked styles kept unused */
.filter-locked {
    display: none;
}

.filter-locked-ghost {
    display: none;
}

.filter-locked-card {
    display: none;
}

.store-btn {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.55rem 0.7rem;
    border-radius: 8px;
    text-decoration: none;
    color: #fff;
    margin-bottom: 0.4rem;
    transition: opacity 0.15s;
}

.store-btn:last-child { margin-bottom: 0; }
.store-btn:hover { opacity: 0.92; color: #fff; }

.store-btn--apple { background: #000; }
.store-btn--google { background: #1A2130; }

.store-btn-icon {
    font-size: 1.25rem;
    line-height: 1;
    width: 1.35rem;
    text-align: center;
}

.store-btn small {
    display: block;
    font-size: 0.58rem;
    font-weight: 500;
    opacity: 0.85;
    line-height: 1.1;
}

.store-btn strong {
    display: block;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.15;
}

.search-sidebar-actions {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 0.5rem;
    padding: 0.85rem 1rem 1rem;
    border-top: 1px solid #eee;
    background: #fff;
    flex-shrink: 0;
}

.btn-dark {
    background: #1A2130;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 0.7rem 0.5rem;
    cursor: pointer;
    line-height: 1.25;
}

.btn-dark:hover {
    background: #000;
    color: #fff;
}

.filter-locked--modal {
    margin-top: 1rem;
    min-height: 180px;
}

.filter-locked--modal .filter-locked-card {
    max-width: 240px;
}

.search-main {
    min-width: 0;
}

.search-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.search-head h1 {
    font-size: clamp(1.2rem, 2.5vw, 1.55rem);
    font-weight: 800;
    color: #1a1a1a;
    margin: 0 0 0.25rem;
}

.search-count {
    font-size: 0.9rem;
    color: #8a8a8a;
    font-weight: 600;
    margin: 0;
}

.search-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.search-filter-toggle {
    display: none;
}

.search-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
    gap: 0.85rem !important;
}

.search-sidebar-backdrop {
    display: none;
}

/* Home show-more CTA */
.show-more-wrap {
    display: flex;
    justify-content: center;
    margin: 1.25rem 0 2rem;
}

.show-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.85rem 1.75rem;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}

.show-more-btn:hover {
    background: #000;
    color: #fff;
    transform: translateY(-1px);
}

.show-more-btn[hidden] {
    display: none !important;
}

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

    .search-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(340px, 92vw);
        max-height: none;
        height: 100%;
        z-index: 1200;
        border-radius: 0;
        transform: translateX(-105%);
        transition: transform 0.25s ease;
        box-shadow: 8px 0 30px rgba(0, 0, 0, 0.15);
    }

    html[dir="rtl"] .search-sidebar {
        inset: 0 0 0 auto;
        transform: translateX(105%);
        box-shadow: -8px 0 30px rgba(0, 0, 0, 0.15);
    }

    .search-sidebar.is-open {
        transform: translateX(0) !important;
    }

    .search-sidebar-close {
        display: grid;
        place-items: center;
    }

    .search-filter-toggle {
        display: inline-flex;
    }

    .search-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1190;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s;
    }

    .search-sidebar-backdrop.is-open {
        opacity: 1;
        pointer-events: auto;
    }
}
