/* ============================================================
   Oikosa — Kiralık Arama Sonuçları sayfası
   (header / card / btn / field stilleri style.css'ten gelir)
   ============================================================ */

.search-page { padding-top: 30px; padding-bottom: 72px; }

/* --- Sonuç başlığı + sıralama --- */
.results-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.crumbs {
  font-size: 13px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 7px;
}
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--teal-2); }
.crumbs i { font-size: 13px; }
.crumbs .here { color: var(--ink-2); }
.results-head h1 {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -.01em;
  margin-top: 8px;
  line-height: 1.1;
}
.result-count { color: var(--ink-2); font-size: 14.5px; margin-top: 6px; }
.result-count strong { color: var(--teal-2); font-weight: 600; }
.sort-field { min-width: 210px; }

/* --- Sayfa düzeni: sidebar + grid --- */
.search-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 34px;
  align-items: start;
}

/* --- Filtre paneli --- */
.filters {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 4px 22px 20px;
  position: sticky;
  top: 90px;
  box-shadow: var(--shadow-sm);
}
.filters-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.filters-head .title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.filters-head .clear {
  font-size: 13px;
  font-weight: 600;
  color: var(--teal-2);
  background: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.filters-head .clear:hover { color: var(--teal); }

.fgroup { padding: 16px 0; border-top: 1px solid var(--line); }
.fgroup:first-of-type { border-top: none; }
.fgroup > .flabel {
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.fgroup > .flabel i { color: var(--ink-3); font-size: 16px; }

/* iki sütunlu min-max alanları — taşma yok */
.range-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}
.filters .field input,
.filters .field select {
  width: 100%;
  box-sizing: border-box;
}
.loc-field { position: relative; }
.loc-field .pin {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  font-size: 16px;
  pointer-events: none;
}
.loc-field input { padding-left: 34px; }

/* --- Chip (tab) butonları --- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: all .15s ease;
  -webkit-appearance: none;
  appearance: none;
  font-family: inherit;
  line-height: 1.4;
}
.chip:hover { border-color: var(--mint-2); color: var(--teal); }
.chip.active {
  background: var(--mint);
  border-color: var(--mint-2);
  color: var(--teal);
  font-weight: 600;
}

/* --- Evet/Hayır segment (Site içinde) --- */
.seg-yn {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 3px;
  gap: 2px;
}
.seg-yn button {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  padding: 6px 16px;
  border-radius: var(--r-pill);
  transition: all .15s ease;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}
.seg-yn button.active {
  /* zemin + gölge artık kayan pill'de (bkz. style.css .seg-yn::before) */
  color: #fff;
  font-weight: 600;
}

/* --- Aktif filtre rozetleri --- */
.active-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-bottom: 22px;
}
.active-chips .lbl { font-size: 13px; color: var(--ink-3); }
.active-chips .pill-x {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--teal);
  background: var(--mint);
  border: 1px solid var(--mint-2);
  border-radius: var(--r-pill);
  cursor: pointer;
}
.active-chips .pill-x:hover { background: var(--mint-2); }
.active-chips .pill-x i { font-size: 14px; }
.active-chips .clear-all {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
  background: none;
  cursor: pointer;
  margin-left: 2px;
}
.active-chips .clear-all:hover { color: var(--ink-2); }

/* --- Sonuç grid'i --- */
.results-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.results-grid .card .body .price small {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-3);
}

/* boş durum */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-2);
}
.no-results i { font-size: 40px; color: var(--ink-4); }
.no-results h3 { font-family: var(--serif); font-size: 20px; margin: 14px 0 6px; color: var(--ink); }

/* --- Sayfalama --- */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 40px;
}
.pager button {
  width: 42px;
  height: 42px;
  padding: 0;
  justify-content: center;
}
.pager .dots { color: var(--ink-3); padding: 0 6px; }

/* --- Mobil filtre aç/kapa --- */
.filters-toggle {
  display: none;
  width: 100%;
  margin-bottom: 18px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1040px) {
  .results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 880px) {
  .search-layout { grid-template-columns: 1fr; }
  .filters {
    position: static;
    display: none;
  }
  .filters.open { display: block; }
  .filters-toggle { display: inline-flex; }
}
@media (max-width: 560px) {
  .results-grid { grid-template-columns: 1fr; }
  .results-head h1 { font-size: 26px; }
}

/* ============================================================
   Gece modu — sabit beyaz zeminli parçaları yüzeye çek
   ============================================================ */
[data-theme="dark"] .chip { background: var(--surface); border-color: var(--line-2); color: var(--ink-2); }
[data-theme="dark"] .chip.active { background: var(--surface-3); border-color: var(--mint-2); color: var(--teal-2); }
[data-theme="dark"] .seg-yn { background: var(--surface-2); }
[data-theme="dark"] .seg-yn button.active { color: #07120f; }
[data-theme="dark"] .active-chips .pill-x { color: var(--teal-2); }

/* ===== Liste / Harita görünüm seçici ===== */
.view-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.view-bar .filters-toggle { margin: 0; }
.view-toggle {
  display: inline-flex;
  gap: 2px;
  margin-left: auto;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.view-toggle button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border: none;
  background: none;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.view-toggle button.active { color: #fff; } /* zemin kayan pill'de (style.css .view-toggle::before) */
.view-toggle button:not(.active):hover { color: var(--ink); }

/* ===================== ARAMA HARİTASI (Leaflet) ===================== */
.map-panel {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
}
.map-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.map-bar .map-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  color: var(--ink);
}
.map-bar .map-title i { color: var(--teal); }
.map-bar #map-hint { color: var(--ink-3); font-size: 13px; margin-left: auto; }
.map-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface);
  color: var(--teal);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.map-back:hover { background: var(--mint); }
.map-back[hidden] { display: none; }
#search-map {
  height: 68vh;
  min-height: 440px;
  max-height: 760px;
  width: 100%;
  z-index: 0;
  background: var(--surface-2);
}

/* İlçe balonu */
.oik-cluster { background: none; border: none; }
.oik-bubble {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  min-width: 52px;
  padding: 7px 10px;
  background: var(--teal);
  color: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(15, 79, 74, .35);
  border: 2px solid #fff;
  cursor: pointer;
  transition: transform .12s ease;
}
.oik-bubble:hover { transform: translate(-50%, -50%) scale(1.07); }
.oik-bubble b { font-size: 15px; line-height: 1; }
.oik-bubble small { font-size: 11px; opacity: .92; margin-top: 2px; white-space: nowrap; }

/* İlan fiyat pini — etiket + konum oku */
.oik-pin {
  position: relative;
  display: inline-block;
  transform: translate(-50%, -100%);
  padding: 5px 11px;
  background: var(--teal);
  color: #fff;
  border: 2px solid #fff;
  border-radius: 13px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -.1px;
  white-space: nowrap;
  box-shadow: 0 5px 16px rgba(15, 79, 74, .4);
  cursor: pointer;
  transition: transform .12s ease, background .12s ease;
}
.oik-pin::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 10px;
  height: 10px;
  background: var(--teal);
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: translateX(-50%) rotate(45deg);
}
.oik-pin:hover {
  transform: translate(-50%, -100%) scale(1.07);
  background: var(--teal-2);
  z-index: 500;
}
.oik-pin:hover::after { background: var(--teal-2); }

/* Popup */
.oik-popup .leaflet-popup-content-wrapper { border-radius: 14px; padding: 0; overflow: hidden; }
.oik-popup .leaflet-popup-content { margin: 0; width: 230px !important; }
.oik-pop-photo {
  height: 96px;
  background-size: cover;
  background-position: center;
}
.oik-pop-body { padding: 10px 12px 12px; }
.oik-pop-price { font-weight: 700; color: var(--teal); font-size: 16px; }
.oik-pop-price small { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.oik-pop-title { font-size: 13px; color: var(--ink); margin: 3px 0 6px; line-height: 1.3; }
.oik-pop-meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--ink-3); font-size: 11.5px; }
.oik-pop-meta i { font-size: 13px; }
.oik-pop-link {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 9px; color: var(--teal); font-weight: 600; font-size: 13px; text-decoration: none;
}
.oik-pop-link:hover { text-decoration: underline; }

[data-theme="dark"] .oik-pin { background: var(--teal-2); color: #07120f; border-color: var(--surface); }
[data-theme="dark"] .oik-pin::after { background: var(--teal-2); border-color: var(--surface); }
[data-theme="dark"] .oik-pin:hover, [data-theme="dark"] .oik-pin:hover::after { background: var(--teal); }
[data-theme="dark"] .oik-popup .leaflet-popup-content-wrapper,
[data-theme="dark"] .oik-popup .leaflet-popup-tip { background: var(--surface); color: var(--ink); }

@media (max-width: 560px) {
  #search-map { height: 60vh; min-height: 340px; }
  .map-bar #map-hint { display: none; }
}
