/* =====================================================================
   İlan listesi ve detay sayfası
   ===================================================================== */

/* ---------- Liste düzeni ---------- */
.listings-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 32px; align-items: start; }
.listings-layout__filter { position: sticky; top: 92px; max-height: calc(100vh - 110px); overflow-y: auto; }

.filter { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.filter__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.filter__title { font-size: 16px; margin: 0; }
.filter__close { display: none; }
.filter__field { margin-bottom: 16px; }
.filter__field > label, .filter__label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; letter-spacing: .01em; }
.range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.filter__more { margin: 4px 0 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.filter__more summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--brand); }
.filter__group { border: 0; padding: 0; margin: 12px 0 0; }
.filter__group legend { font-size: 12.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.filter__actions { display: grid; gap: 10px; justify-items: center; }

.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar__filter { display: none; }
.toolbar__sort { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin-right: auto; }
.toolbar__sort select { padding: 7px 10px; border: 1px solid #d3d9de; border-radius: 6px; font: inherit; font-size: 14px; background: #fff; color: var(--ink); }
.view-switch { display: flex; border: 1px solid #d3d9de; border-radius: 6px; overflow: hidden; }
.view-switch button { border: 0; background: #fff; padding: 7px 12px; font: inherit; font-size: 14px; color: var(--ink-soft); cursor: pointer; border-left: 1px solid #d3d9de; }
.view-switch button:first-child { border-left: 0; }
.view-switch button.is-active { background: var(--bg-soft); color: var(--brand); font-weight: 600; }

.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.results--row { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.results--list { grid-template-columns: 1fr; }
.results--list .card-listing { flex-direction: row; flex-wrap: wrap; }
.results--list .card-listing__media { width: 300px; aspect-ratio: auto; min-height: 210px; }
.results--list .card-listing__body { flex: 1; padding: 20px; min-width: 240px; }
.results--list .card-listing__actions { width: 100%; }

.results-map { height: 560px; border-radius: var(--radius); border: 1px solid var(--line); margin-bottom: 22px; position: relative; z-index: 0; }
.map-empty { position: absolute; inset: auto 0 16px 0; margin: auto; width: max-content; background: #fff; padding: 8px 14px; border-radius: 6px; z-index: 500; }
.map-card { display: grid; gap: 3px; text-decoration: none; color: var(--ink); }
.map-card img { width: 100%; height: auto; border-radius: 4px; margin-bottom: 4px; }
.map-card strong { color: var(--brand); font-size: 15px; }
.map-card small { color: var(--muted); }

.empty-state { text-align: center; padding: 64px 20px; background: var(--bg-soft); border-radius: var(--radius); }

@media (max-width: 960px) {
  .listings-layout { grid-template-columns: 1fr; }
  .listings-layout__filter {
    position: fixed; inset: 0; z-index: 70; max-height: none; background: rgba(20, 30, 40, .4);
    display: none; padding: 0; overflow: hidden;
  }
  body.filter-open { overflow: hidden; }
  body.filter-open .listings-layout__filter { display: block; }
  .filter { position: absolute; right: 0; top: 0; bottom: 0; width: min(380px, 92vw); border-radius: 0; overflow-y: auto; }
  .filter__close { display: inline; }
  .toolbar__filter { display: inline-flex; }
  .results--list .card-listing__media { width: 100%; }
}

/* ---------- Detay ---------- */
.lst-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; padding: 8px 0 20px; flex-wrap: wrap; }
.lst-head__main { flex: 1; min-width: 280px; }
.lst-head__tags { display: flex; gap: 6px; margin-bottom: 10px; }
.lst-head__tags .tag { background: var(--bg-soft); }
.lst-head__title { font-size: clamp(24px, 3vw, 34px); margin: 0 0 6px; }
.lst-head__loc { margin: 0; color: var(--ink-soft); }
.lst-head__side { text-align: right; }
.lst-head__price { font-size: clamp(24px, 3vw, 32px); font-weight: 600; color: var(--brand); margin: 0 0 10px; letter-spacing: -.01em; }
.lst-head__price.is-muted { font-size: 18px; color: var(--ink-soft); font-weight: 500; }
.lst-head__actions { display: flex; gap: 8px; justify-content: flex-end; }

.lst-gallery { position: relative; display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 8px; height: clamp(320px, 48vw, 540px); border-radius: var(--radius); overflow: hidden; }
.lst-gallery.is-single { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.lst-gallery__item { display: block; overflow: hidden; background: #eceae5; }
.lst-gallery__item:first-child { grid-row: 1 / 3; }
.lst-gallery__item img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease-out; }
.lst-gallery__item:hover img { transform: scale(1.02); }
.lst-gallery__all { position: absolute; right: 14px; bottom: 14px; background: #fff; border: 0; border-radius: 6px; padding: 9px 14px; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.12); }

.lst-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; margin-top: 32px; align-items: start; }
.lst-layout__side { position: sticky; top: 92px; }
.lst-section { padding: 0 0 32px; margin-bottom: 32px; border-bottom: 1px solid var(--line); }
.lst-section:last-child { border-bottom: 0; }
.lst-section h2 { font-size: 21px; margin-bottom: 16px; }

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; margin: 0; }
.facts__row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f0f1f3; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; text-align: right; }

.feature-group { font-size: 14px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 18px 0 8px; }
.feature-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 20px; }
.feature-list li { position: relative; padding-left: 22px; color: var(--ink-soft); }
.feature-list li::before { content: ""; position: absolute; left: 2px; top: 7px; width: 10px; height: 6px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }

.embed { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #111; }
.embed iframe, .embed video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.doc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.doc-list a { display: grid; grid-template-columns: 72px 1fr auto; align-items: center; gap: 14px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.doc-list a:hover { border-color: #cfd5da; }
.doc-list img { width: 72px; height: 54px; object-fit: cover; border-radius: 4px; }
.doc-list__ext { width: 72px; height: 54px; display: flex; align-items: center; justify-content: center; background: var(--bg-soft); border-radius: 4px; font-weight: 600; font-size: 13px; color: var(--muted); }

.detail-map { height: 360px; border-radius: var(--radius); border: 1px solid var(--line); z-index: 0; }

.contact-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: #fff; }
.contact-card__price { font-size: 24px; font-weight: 600; color: var(--brand); margin: 0 0 18px; }
.contact-card__buttons { display: grid; gap: 10px; margin: 18px 0; }
.agent { display: flex; gap: 14px; align-items: center; }
.agent__photo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.agent__photo--empty { display: flex; align-items: center; justify-content: center; background: var(--bg-soft); color: var(--brand); font-weight: 600; font-size: 22px; }
.agent__label { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.agent__name { margin: 2px 0 0; font-weight: 600; font-size: 17px; }
.agent__title { margin: 0; color: var(--ink-soft); font-size: 14px; }
.share { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.share__label { color: var(--muted); }
.share a { text-decoration: none; }

.similar { margin-top: 56px; }
.similar h2 { font-size: 22px; margin-bottom: 18px; }

.mobile-contact { display: none; }

@media (max-width: 960px) {
  .lst-layout { grid-template-columns: minmax(0, 1fr); }
  .lst-layout__side { position: static; }
  .lst-head__side { text-align: left; }
  .lst-head__actions { justify-content: flex-start; }
  .lst-gallery { grid-template-columns: 1fr; grid-template-rows: 1fr; height: 62vw; }
  .lst-gallery__item:not(:first-child) { display: none; }
  .facts { grid-template-columns: 1fr; }
  .mobile-contact { display: grid; grid-auto-flow: column; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); }
  .page-listing .site-footer { padding-bottom: 64px; }
  .page-listing .compare-bar { bottom: 80px; }
}

/* ---------- Lightbox ---------- */
body.lightbox-open { overflow: hidden; }
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(12, 16, 20, .94); display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox__img { max-width: 92vw; max-height: 86vh; object-fit: contain; }
.lightbox__close, .lightbox__nav { position: absolute; background: rgba(255,255,255,.1); color: #fff; border: 0; cursor: pointer; border-radius: 50%; width: 46px; height: 46px; font-size: 28px; line-height: 1; }
.lightbox__close:hover, .lightbox__nav:hover { background: rgba(255,255,255,.22); }
.lightbox__close { top: 16px; right: 16px; }
.lightbox__nav--prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox__nav--next { right: 16px; top: 50%; transform: translateY(-50%); }
.lightbox__count { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); color: #cfd6dc; font-size: 14px; }

/* ---------- Karşılaştırma ---------- */
.compare-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.compare { width: 100%; border-collapse: collapse; min-width: 640px; }
.compare th, .compare td { padding: 12px 14px; border-bottom: 1px solid #f0f1f3; text-align: left; vertical-align: top; font-size: 15px; }
.compare thead th { vertical-align: bottom; width: 28%; }
.compare thead th:first-child { width: 16%; }
.compare thead img { width: 100%; height: auto; border-radius: 6px; margin-bottom: 8px; aspect-ratio: 4 / 3; object-fit: cover; }
.compare thead a { display: block; color: var(--ink); font-weight: 600; text-decoration: none; margin-bottom: 6px; }
.compare tbody th { color: var(--muted); font-weight: 500; background: #fafaf8; }
.compare__features { font-size: 14px; color: var(--ink-soft); }
.saved-actions { margin-top: 20px; text-align: right; }
.contact-card--form { margin-top: 16px; }
.units-table { min-width: 520px; }
.units-table thead th { width: auto; vertical-align: middle; }

/* ---------- Tema katmanı: ilan / proje detay ---------- */
.lst-head__price { font: 600 clamp(32px, 3.6vw, 44px)/1.1 var(--font-serif); color: var(--navy); letter-spacing: 0; }
.lst-head__title, .lst-head h1 { font-size: clamp(30px, 3.6vw, 44px); }
.lst-section h2 { position: relative; font-size: 30px; margin-bottom: 20px; padding-bottom: 10px; }
.lst-section h2::after { content: ""; position: absolute; left: 0; bottom: 0; width: 44px; height: 2px; background: linear-gradient(90deg, var(--gold), transparent); }
.lst-gallery { gap: 10px; border-radius: var(--radius-lg); }
.lst-gallery__item img { transition: transform 1.2s var(--ease); }
.lst-gallery__item:hover img { transform: scale(1.06); }
/* 4 fotoğrafta boş hücre kalmasın: sonuncusu iki sütuna yayılır */
.lst-gallery:has(> .lst-gallery__item:nth-of-type(4)):not(:has(> .lst-gallery__item:nth-of-type(5))) > .lst-gallery__item:nth-of-type(4) { grid-column: span 2; }
.lst-gallery__all { border-radius: 30px; padding: 10px 18px; font-weight: 600; transition: background .25s, color .25s; }
.lst-gallery__all:hover { background: var(--gold); color: var(--navy); }
.contact-card { border-radius: var(--radius-lg); border-top: 3px solid var(--gold); box-shadow: var(--shadow-sm); }
.facts__row dt { color: var(--muted); }
.facts__row dd { font-weight: 600; }
.feature-list li::before { border-color: var(--gold) !important; }
.filter { border-radius: var(--radius-lg); }
.filter__title, .filter h2 { font-family: var(--font-serif); font-size: 22px; }

/* Grid öğeleri geniş tablo/harita yüzünden taşmasın */
.lst-layout > * { min-width: 0; }
