/* Reswons Emlak — vitrin keşif haritası (/harita). site.css değişkenlerini kullanır. */

/* Yan panelin genişliği. Viewport'a bağlı olması ÖNEMLİ: tarayıcı uzaklaştırıldığında
   (Ctrl -) viewport CSS piksel olarak büyür; sabit 380px'lik bir panel ekranın gitgide
   daha küçük bir oranına düşer ve gözle görülür şekilde küçülürdü. clamp ile panel her
   zaman ekranın ~%24'ü kalır; yalnız haritanın içeriği yakınlaşıp uzaklaşır.
   Panel kenarına yapışan düğmeler de bu değişkeni kullanır, böylece kopmazlar. */
:root { --h-panel-genislik: clamp(340px, 24vw, 760px); }

html.harita-modu, html.harita-modu body { height: 100%; margin: 0; overflow: hidden; }
body.harita-govde {
  font-family: 'Onest', system-ui, sans-serif;
  background: var(--forest-deep);
  color: var(--ivory);
}

#vitrinHarita { position: fixed; inset: 0; z-index: 1; opacity: 0; transition: opacity .6s cubic-bezier(.76,0,.24,1); }
#vitrinHarita.harita-acildi { opacity: 1; }   /* FAZ 10.5: harita load'da yumuşak belirir */
/* Pin/cluster merkezden dışa stagger düşüş — inner öğede (MapLibre konum transform'una dokunmaz) */
.pin-cluster-wrap { display: block; }
@keyframes pinDus { 0% { opacity: 0; transform: translateY(-14px) scale(0); } 62% { opacity: 1; transform: translateY(2px) scale(1.12); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
.pin-dus { animation: pinDus .5s cubic-bezier(.76,0,.24,1) both; }

/* ---------- ÜST ŞERİT ---------- */
.h-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; gap: clamp(12px, 2.5vw, 32px);
  padding: 14px clamp(16px, 3vw, 40px);
  background: linear-gradient(to bottom, rgba(15, 36, 29, .82), rgba(15, 36, 29, 0));
  pointer-events: none;
}
.h-header > * { pointer-events: auto; }
.h-header .logo {
  font-family: 'Newsreader', serif; font-size: clamp(19px, 2.4vw, 26px); font-weight: 400;
  color: var(--ivory); text-decoration: none; white-space: nowrap;
}
.h-header .logo em { color: var(--brass); font-style: normal; }

.h-filtre { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.h-filtre select, .h-filtre input {
  font-family: inherit; font-size: 13px; color: var(--ivory);
  background: rgba(20, 40, 33, .72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(239, 233, 221, .22); border-radius: 999px;
  padding: 8px 14px; -webkit-appearance: none; appearance: none; cursor: pointer;
}
.h-filtre input { width: 92px; cursor: text; }
.h-filtre select:focus, .h-filtre input:focus {
  outline: none; border-color: var(--brass); background: rgba(20, 40, 33, .92);
}
.h-filtre select option { color: #1a1a1a; }
.h-sayac { font-size: 12px; letter-spacing: .06em; color: var(--brass-soft); white-space: nowrap; }

.h-linkler { margin-left: auto; display: flex; gap: 16px; }
.h-linkler a {
  font-size: 13px; letter-spacing: .04em; color: var(--ivory); text-decoration: none;
  border-bottom: 1px solid transparent; padding-bottom: 2px; white-space: nowrap;
}
.h-linkler a:hover { border-color: var(--brass); }

/* ---------- MARKER: FİYAT PİNİ ---------- */
.pin { position: relative; display: flex; align-items: center; justify-content: center; }
.pin-fiyat {
  font-family: 'Newsreader', serif; font-size: 13px; font-weight: 500; letter-spacing: .01em;
  padding: 5px 11px; border-radius: 999px; border: 0; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35); white-space: nowrap;
  transition: transform .18s ease, box-shadow .18s ease; transform-origin: center bottom;
}
.pin-fiyat.satilik { background: var(--brass); color: #1a140a; }
.pin-fiyat.kiralik { background: var(--ivory); color: var(--forest-deep); }
.pin-fiyat::after {
  content: ''; position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: inherit; /* okun rengi pil ile eşleşir */
}
.pin-fiyat.satilik::after { border-top-color: var(--brass); }
.pin-fiyat.kiralik::after { border-top-color: var(--ivory); }
.pin-fiyat:hover, .pin-fiyat:focus-visible { transform: scale(1.09); box-shadow: 0 6px 20px rgba(0, 0, 0, .45); outline: none; z-index: 5; }

/* Gizli konum: fiyat pininin arkasında yarı saydam daire (piksel çapı JS'te zoom'a göre) */
.pin-gizli .pin-daire {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  border-radius: 50%; background: rgba(168, 124, 63, .16);
  border: 1px solid rgba(168, 124, 63, .4); pointer-events: none;
}

/* ---------- MARKER: CLUSTER ---------- */
.pin-cluster {
  font-family: 'Onest', sans-serif; font-size: 14px; font-weight: 700;
  min-width: 40px; height: 40px; padding: 0 8px; border-radius: 999px; cursor: pointer;
  background: var(--forest); color: var(--ivory); border: 2px solid var(--brass);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .4);
  transition: transform .18s ease;
}
.pin-cluster:hover { transform: scale(1.08); }

/* ---------- 2B/3B DÜĞMESİ ---------- */
.h-boyut-btn {
  position: fixed; left: clamp(16px, 3vw, 40px); bottom: 28px; z-index: 20;
  width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  font-family: 'Onest', sans-serif; font-size: 13px; font-weight: 700; letter-spacing: .04em;
  background: rgba(20, 40, 33, .82); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--ivory); border: 1px solid rgba(239, 233, 221, .28);
  transition: background .2s, border-color .2s;
}
.h-boyut-btn:hover { background: var(--brass); border-color: var(--brass); color: #1a140a; }

/* ---------- SOL PANEL ---------- */
.h-panel {
  position: fixed; top: 64px; left: 0; bottom: 0; z-index: 30; /* header'ın altından başlar (logo/filtre görünür kalır) */
  width: var(--h-panel-genislik); background: var(--forest-deep); color: var(--ivory);
  box-shadow: 8px 0 40px rgba(0, 0, 0, .5);
  transform: translateX(-100%); transition: transform .38s cubic-bezier(.4, 0, .2, 1);
  display: flex; flex-direction: column; overflow-y: auto;
}
.h-panel.acik { transform: translateX(0); }
.h-panel-kapat {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  background: rgba(0, 0, 0, .35); color: var(--ivory); border: 0; font-size: 16px;
}
.h-panel-kapat:hover { background: var(--brass); color: #1a140a; }

.h-panel-gorsel {
  position: relative; display: block; min-height: 180px; aspect-ratio: 16 / 10; overflow: hidden;
  background: linear-gradient(160deg, var(--forest) 0%, var(--forest-deep) 75%); text-decoration: none;
}
.h-panel-gorsel { cursor: pointer; }
.h-panel-gorsel img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .28s cubic-bezier(.76,0,.24,1); }
/* FAZ 10.5b galeri: foto geçişi (devralma-crossfade) + oklar + sayaç */
#hpImg.gal-gecis { opacity: 0; }
.h-galeri-ok {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(15, 36, 29, .58); color: #fff; font-size: 22px; line-height: 1;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; transition: background .3s, transform .18s;
}
.h-galeri-ok:hover { background: rgba(15, 36, 29, .85); }
.h-galeri-ok:active { transform: translateY(-50%) scale(.92); }
.h-galeri-ok.onceki { left: 10px; }
.h-galeri-ok.sonraki { right: 10px; }
.h-galeri-sayac {
  position: absolute; bottom: 10px; right: 12px; z-index: 3;
  font-family: 'Newsreader', serif; font-size: 13px; color: #fff; background: rgba(15, 36, 29, .58);
  padding: 3px 10px; border-radius: 999px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font-variant-numeric: tabular-nums;
}
.h-panel-svg { position: absolute; inset: 0; color: rgba(239, 233, 221, .14); }
.h-panel-svg svg { width: 100%; height: 100%; }
.h-panel-etiket {
  position: absolute; left: 14px; top: 14px; z-index: 1;
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  background: rgba(0, 0, 0, .45); color: var(--ivory); padding: 5px 11px; border-radius: 999px;
}
.h-panel-gizli {
  position: absolute; right: 14px; bottom: 14px; z-index: 1;
  font-size: 11px; letter-spacing: .04em;
  background: rgba(168, 124, 63, .9); color: #1a140a; padding: 4px 10px; border-radius: 999px;
}

.h-panel-govde { padding: 22px 24px 28px; display: flex; flex-direction: column; gap: 10px; }
.h-panel-govde .kicker {
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--brass);
}
.h-panel-govde h2 { font-family: 'Newsreader', serif; font-weight: 400; font-size: 25px; line-height: 1.15; margin: 0; }
.h-panel-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 14px; color: rgba(239, 233, 221, .75); }
.h-panel-meta span { position: relative; }
.h-panel-meta span + span::before { content: '·'; position: absolute; left: -10px; opacity: .5; }
.h-panel-fiyat { font-family: 'Newsreader', serif; font-size: 27px; color: var(--ivory); margin-top: 2px; }
/* .cta temel kurali opacity:0 + translateY ile BASLAR; onu acan tek kural
   ".slide.active .cta" — yani ana sayfadaki slayt destesine ait. Harita paneli
   slayt degil, bu yuzden "Ilan detayi" dugmesi GORUNMUYORDU (DOM'da vardi,
   ekranda yoktu). Ayni duzeltme projede .bos-portfoy .cta icin de yapilmis. */
.h-panel .cta { margin-top: 8px; align-self: flex-start; opacity: 1; transform: none; }

/* Panel açıkken düğme onu kapatmasın (masaüstünde 2B/3B'yi panelin sağına it) */
body.panel-acik .h-boyut-btn { left: calc(var(--h-panel-genislik) + 20px); }

/* ---------- YÜKLENİYOR GÖSTERGESİ ----------
   Harita hazır olana kadar #vitrinHarita opacity:0 duruyor; bu katman olmadan
   kullanıcı boş koyu ekrana bakıp "harita açılmadı" sanıyordu. Karo sunucusu
   yavaşladığında bekleme SÜRESİ değişmiyor, ama artık beklendiği belli oluyor. */
.h-yukleniyor {
  position: fixed; inset: 0; z-index: 30;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: var(--forest-deep); color: var(--ivory);
  font-size: 14px; letter-spacing: .06em;
  transition: opacity .45s ease;
}
.h-yukleniyor-halka {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid rgba(239, 233, 221, .22);
  border-top-color: var(--brass);
  animation: haritaDon .9s linear infinite;
}
@keyframes haritaDon { to { transform: rotate(360deg); } }
.h-yukleniyor.gizle { opacity: 0; pointer-events: none; }
.h-yukleniyor[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  .h-yukleniyor-halka { animation: none; border-top-color: var(--brass); }
  .h-yukleniyor { transition: none; }
}

/* ---------- FALLBACK ---------- */
.h-fallback {
  position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px; text-align: center; padding: 24px;
  background: var(--forest-deep); color: var(--ivory);
}
.h-fallback p { font-family: 'Newsreader', serif; font-size: 20px; }
.h-fallback-aksiyon { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
/* Tekrar dene: birincil aksiyon (marka aksan rengi), buton reset */
.btn-tekrar { border: 0; cursor: pointer; background: var(--brass); }
.btn-tekrar:hover { background: var(--brass); filter: brightness(1.08); }
/* KRİTİK: .h-fallback{display:flex} + .btn-buyuk{display:inline-block}, UA [hidden]{display:none}'ı
   eziyordu → fallback KATMANI (ve retry butonu) hidden attribute'una rağmen HEP görünüyor,
   çalışan haritayı z-index:40 ile kaplıyordu (motor çalışır ama ekranda fallback). Nitelik
   seçicisiyle özgüllüğü aşıp hidden'ı geri kazandır. */
.h-fallback[hidden], .btn-tekrar[hidden], .h-fallback [hidden] { display: none !important; }

/* ---------- MOBİL ---------- */
@media (max-width: 720px) {
  .h-header { flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
  .h-filtre { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .h-filtre select, .h-filtre input { flex: 0 0 auto; }
  .h-linkler { margin-left: 0; }

  /* Panel: alttan açılan sayfa (bottom sheet) */
  .h-panel {
    top: auto; right: 0; width: 100%; max-height: 78vh;
    transform: translateY(100%); border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, .5);
  }
  .h-panel.acik { transform: translateY(0); }
  body.panel-acik .h-boyut-btn { left: clamp(16px, 3vw, 40px); bottom: calc(78vh + 12px); }
}

/* ---------- HAREKET AZALTMA ---------- */
@media (prefers-reduced-motion: reduce) {
  .h-panel { transition: none; }
  .pin-fiyat, .pin-cluster, .h-boyut-btn { transition: none; }
}

/* ---------- Panel: dis harita baglantilari (Google Maps / yol tarifi) ---------- */
/* Koyu panelde ikincil eylem: cerceveli, sessiz — birincil "Ilan detayi" CTA'sinin
   onune gecmesin. Telefonda api=1 baglantisi Google Maps uygulamasini acar. */
.h-panel-dis { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.h-dis-baglanti {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 13px; border-radius: 999px;
    border: 1px solid rgba(239, 233, 221, .28);
    color: rgba(239, 233, 221, .82);
    font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
    text-decoration: none; white-space: nowrap;
    transition: border-color .25s ease, color .25s ease, background-color .25s ease;
}
.h-dis-baglanti:hover {
    border-color: var(--brass); color: var(--ivory); background: rgba(168, 124, 63, .16);
}
.h-dis-baglanti svg { flex: 0 0 auto; }
@media (prefers-reduced-motion: reduce) { .h-dis-baglanti { transition: none; } }

/* ---------- TEMA DÜĞMESİ (koyu keşif ↔ açık sokak) ---------- */
/* 2B/3B düğmesinin hemen üstünde, aynı dil. Metinli çünkü ikon tek başına
   "tema değiştir"i anlatmıyor — 20-70 yaş kullanıcı ne olacağını okuyabilmeli. */
.h-tema-btn {
  position: fixed; left: clamp(16px, 3vw, 40px); bottom: 84px; z-index: 20;
  display: inline-flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  font-family: 'Onest', sans-serif; font-size: 12px; font-weight: 600; letter-spacing: .08em;
  background: rgba(20, 40, 33, .82); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--ivory); border: 1px solid rgba(239, 233, 221, .28);
  transition: background .2s, border-color .2s, color .2s;
}
.h-tema-btn:hover { background: var(--brass); border-color: var(--brass); color: #1a140a; }
.h-tema-btn svg { flex: 0 0 auto; }

/* Açık temada düğmelerin kendisi koyu zeminde kalmasın — harita artık aydınlık */
body.harita-acik-tema .h-tema-btn,
body.harita-acik-tema .h-boyut-btn {
  background: rgba(255, 255, 255, .9); color: var(--forest);
  border-color: rgba(23, 51, 42, .22);
}

/* İlan sayacı kendi zemini olmayan düz metindi: koyu haritada brass okunuyordu
   (kontrast 4.78) ama açık haritada 1.07'ye düşüp GÖRÜNMEZ oluyordu. Açık temada
   filtre hapları gibi kendi zeminini alır — harita altında ne olursa olsun okunur. */
body.harita-acik-tema .h-sayac {
  color: var(--forest); font-weight: 600;
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(23, 51, 42, .16);
  border-radius: 999px; padding: 6px 12px;
}
body.harita-acik-tema .h-tema-btn:hover,
body.harita-acik-tema .h-boyut-btn:hover { background: var(--brass); color: #1a140a; border-color: var(--brass); }

/* Panel açıkken 2B/3B düğmesiyle birlikte kaysın (mevcut kuralla aynı mantık) */
body.panel-acik .h-tema-btn { left: calc(var(--h-panel-genislik) + 20px); }

@media (max-width: 720px) {
  /* Dar ekranda metin yer kaplıyor; ikon + kısa etiket yeter */
  .h-tema-btn { bottom: 80px; padding: 0 13px; font-size: 11px; letter-spacing: .05em; }
  body.panel-acik .h-tema-btn { left: clamp(16px, 3vw, 40px); bottom: calc(78vh + 66px); }
}
@media (prefers-reduced-motion: reduce) { .h-tema-btn { transition: none; } }

/* Sokak Görünümü, dış bağlantılar içinde ÖNE ÇIKAR: emlak sitelerinde alıcının
   en çok kullandığı eylem (sokağı ve bina cephesini görmek). Brass dolgu ile
   Google Maps / Yol tarifi'nden ayrılır ama panelin birincil CTA'sını gölgelemez. */
.h-dis-baglanti.h-dis-one {
  background: rgba(168, 124, 63, .18);
  border-color: rgba(195, 154, 94, .55);
  color: var(--brass-soft);
}
.h-dis-baglanti.h-dis-one:hover { background: var(--brass); border-color: var(--brass); color: #1a140a; }
body.harita-acik-tema .h-dis-baglanti.h-dis-one { color: var(--brass); }
