/**
 * Search Results (Ilan Arama) Component CSS.
 * 4 preset icin ortak + preset-bazli stiller.
 * K2 cascade uyumlu — var() ile.
 *
 * @package Necox
 * @since   2.68.3
 */

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ORTAK STILLER
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* ── Sonuc Basligi ── */
.necox-search__result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.necox-search__result-count {
    font-size: var(--necox-sr-result-size, 14px);
    font-weight: 500;
    color: var(--necox-sr-result-color, var(--necox-heading));
}

/* ── Gorunum Toggle ── */
.necox-search__view-toggle {
    display: flex;
    gap: 4px;
}

.necox-search__view-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--necox-border, var(--necox-border));
    border-radius: 6px;
    background: none;
    color: var(--necox-muted, var(--necox-muted));
    cursor: pointer;
    transition: all 0.15s;
}

.necox-search__view-btn.is-active,
.necox-search__view-btn:hover {
    background: var(--necox-primary, var(--necox-primary));
    color: #ffffff;
    border-color: var(--necox-primary, var(--necox-primary));
}

/* ── Kartlar Grid ── */
.necox-search__cards {
    display: grid;
    gap: var(--necox-sr-gap, 16px);
}

/* ── Chip Filtreler ── */
.necox-search__chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.necox-search__chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    background: var(--necox-sr-chip-bg, var(--necox-primary-light, #e6f7f5));
    color: var(--necox-sr-chip-color, var(--necox-primary, #00a591));
    border-radius: 20px;
}

.necox-search__chip-remove {
    border: none;
    background: none;
    color: inherit;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.7;
}

.necox-search__chip-remove:hover { opacity: 1; }

.necox-search__chips-clear {
    font-size: 12px;
    color: var(--necox-muted, var(--necox-muted));
    text-decoration: none;
    margin-left: 4px;
}

.necox-search__chips-clear:hover { color: #ef4444; text-decoration: none; }

.necox-search__chips-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

/* ── Kategori Tab'lari ── */
.necox-search__cat-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--necox-border, var(--necox-border));
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.necox-search__cat-tab {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--necox-muted, var(--necox-muted));
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}

.necox-search__cat-tab:hover { color: var(--necox-heading, #1a1a2e); text-decoration: none; }

.necox-search__cat-tab.is-active {
    color: var(--necox-primary, var(--necox-primary));
    border-bottom-color: var(--necox-primary, var(--necox-primary));
}

/* ── Yatay Filtre Bar ── */
.necox-search__hbar {
    margin-bottom: 16px;
}

.necox-search__hbar-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.necox-search__hbar-field {
    flex: 1;
    min-width: 140px;
}

.necox-search__hbar-field--price {
    display: flex;
    gap: 4px;
    align-items: center;
}

.necox-search__hbar-select,
.necox-search__hbar-input {
    width: 100%;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--necox-sr-filter-border, var(--necox-border, #e5e7eb));
    border-radius: var(--necox-sr-filter-radius, 6px);
    background: var(--necox-sr-filter-bg, var(--necox-white));
    color: var(--necox-sr-filter-color, var(--necox-text, #374151));
    font-size: 13px;
}

.necox-search__hbar-sep {
    color: var(--necox-muted, var(--necox-muted));
    font-size: 12px;
    flex-shrink: 0;
}

.necox-search__hbar-submit {
    flex-shrink: 0;
    height: 38px;
}

/* ── Topbar (Preset 4) ── */
.necox-search__topbar {
    margin-bottom: 16px;
}

.necox-search__topbar-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.necox-search__topbar-input-wrap {
    flex: 1;
    position: relative;
}

.necox-search__topbar-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--necox-muted, var(--necox-muted));
}

.necox-search__topbar-input {
    width: 100%;
    height: 42px;
    padding: 0 12px 0 38px;
    border: 1px solid var(--necox-sr-filter-border, var(--necox-border, #e5e7eb));
    border-radius: var(--necox-sr-filter-radius, var(--necox-radius));
    background: var(--necox-sr-filter-bg, var(--necox-white));
    color: var(--necox-sr-filter-color, var(--necox-text, #374151));
    font-size: 14px;
}

/* ── Liste Ogeleri (Preset 2, 3) ── */
.necox-search__list-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--necox-border, var(--necox-border));
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    margin-bottom: 8px;
    background: var(--necox-white);
}

.necox-search__list-item:hover,
.necox-search__list-item.is-active {
    border-color: var(--necox-primary, var(--necox-primary));
    box-shadow: 0 0 0 1px var(--necox-primary, var(--necox-primary));
}

.necox-search__list-thumb {
    width: 64px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.necox-search__list-info { flex: 1; min-width: 0; }

.necox-search__list-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--necox-heading, #1a1a2e);
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.necox-search__list-meta {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    font-size: 12px;
}

.necox-search__list-price {
    font-weight: 600;
    color: var(--necox-primary, var(--necox-primary));
}

.necox-search__list-loc {
    color: var(--necox-muted, var(--necox-muted));
}

/* ── Onizleme Paneli (Preset 2) ── */
.necox-search__preview {
    border: 1px solid var(--necox-border, var(--necox-border));
    border-radius: 10px;
    background: var(--necox-white);
    overflow: hidden;
}

.necox-search__preview-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: var(--necox-muted, var(--necox-muted));
    gap: 8px;
    text-align: center;
    padding: 20px;
    font-size: 13px;
}

.necox-search__preview-img {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
}

.necox-search__preview-content { padding: 16px; }

.necox-search__preview-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--necox-heading, #1a1a2e);
    margin: 0 0 8px;
}

.necox-search__preview-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--necox-primary, var(--necox-primary));
    margin-bottom: 8px;
}

.necox-search__preview-excerpt {
    font-size: 13px;
    color: var(--necox-text, var(--necox-text));
    line-height: 1.5;
    margin-bottom: 12px;
}

.necox-search__preview-loc {
    font-size: 12px;
    color: var(--necox-muted, var(--necox-muted));
    margin-bottom: 12px;
}

/* ── Harita Paneli (Preset 3) ── */
.necox-search__map {
    width: 100%;
    height: 100%;
    min-height: 500px;
    border-radius: 10px;
    overflow: hidden;
}

/* ── Sayfalama ── */
.necox-search__pagination {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.necox-search__load-more {
    min-width: 200px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   PRESET 1 — Klasik 2 Kolon
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.necox-search--preset-1 {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    padding: 24px 0;
    align-items: start;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   PRESET 2 — 3 Kolon Panel
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.necox-search--preset-2 {
    display: grid;
    grid-template-columns: 200px 1fr 300px;
    gap: 20px;
    padding: 24px 0;
    align-items: start;
}

.necox-search__sidebar--compact .necox-filter-sidebar {
    font-size: 12px;
}

.necox-search--preset-2 .necox-search__preview {
    position: sticky;
    top: 80px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   PRESET 3 — Harita + Liste Split
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.necox-search--preset-3 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding-bottom: 24px;
    align-items: start;
}

.necox-search__main--scroll {
    max-height: 600px;
    overflow-y: auto;
}

.necox-search__map-panel {
    position: sticky;
    top: 80px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   PRESET 4 — Ust Filtre + Tam Grid
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.necox-search--preset-4 {
    padding: 24px 0;
}

.necox-search__full-grid .necox-search__cards {
    grid-template-columns: repeat(4, 1fr);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   RESPONSIVE
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

@media (max-width: 1024px) {
    .necox-search--preset-1 {
        grid-template-columns: 220px 1fr;
    }
    .necox-search--preset-2 {
        grid-template-columns: 1fr 280px;
    }
    .necox-search--preset-2 .necox-search__sidebar {
        display: none;
    }
    .necox-search--preset-3 {
        grid-template-columns: 1fr;
    }
    .necox-search__map-panel {
        position: static;
        height: 350px;
    }
    .necox-search__map { min-height: 350px; }
    .necox-search__main--scroll { max-height: none; }
    .necox-search__full-grid .necox-search__cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .necox-search--preset-1 {
        grid-template-columns: 1fr;
    }
    .necox-search--preset-1 .necox-search__sidebar {
        display: none;
    }
    .necox-search--preset-2 {
        grid-template-columns: 1fr;
    }
    .necox-search--preset-2 .necox-search__preview {
        display: none;
    }
    .necox-search__hbar-form {
        flex-direction: column;
    }
    .necox-search__hbar-field { min-width: 100%; }
    .necox-search__full-grid .necox-search__cards {
        grid-template-columns: 1fr;
    }
    .necox-search__cards {
        grid-template-columns: 1fr !important;
    }
    .necox-search__map-panel { height: 280px; }
    .necox-search__map { min-height: 280px; }

    /* Mobil: filtre drawer tetikleyici */
    .necox-search__mobile-filter-btn {
        position: fixed;
        bottom: 16px;
        right: 16px;
        z-index: 998;
        width: 48px;
        height: 48px;
        border-radius: 50%;
        background: var(--necox-primary, var(--necox-primary));
        color: #ffffff;
        border: none;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }
}
