/* Kule Emlak — real-estate listings demo */

:root {
  --navy: #14213d;
  --ink: #1b2333;
  --muted: #69707f;
  --line: #e4e6ec;
  --bg: #f5f6f9;
  --card: #fff;
  --orange: #e4572e;
  --orange-soft: #fdebe5;
  --teal: #13867a;
  --teal-soft: #e0f3f0;
  --radius: 18px;
  --top: 64px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: "Sora", system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink);
  background: var(--bg); line-height: 1.5; overflow-x: hidden;
}
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.wrap { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

/* ---- Demo strip & top bar ----------------------------------------------------- */
.demo-strip {
  display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: space-between; align-items: center;
  padding: 8px 16px; font-size: 0.78rem; background: #0b1324; color: #c9d0de;
}
.demo-strip strong { color: #ffb59e; }
.demo-strip a { color: #fff; font-weight: 600; text-decoration: none; }
.demo-strip a:hover { text-decoration: underline; }
.topbar {
  position: sticky; top: 0; z-index: 1000; height: var(--top);
  display: flex; align-items: center; gap: 20px; padding: 0 20px;
  background: var(--navy); color: #fff;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 1.15rem; font-weight: 500; }
.logo b { font-weight: 800; color: #ffb59e; }
.logo svg { width: 30px; height: 30px; fill: none; stroke: var(--orange); stroke-width: 2.4; stroke-linejoin: round; }
.topbar nav { margin-left: auto; display: flex; gap: 4px; }
.topbar nav a {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  text-decoration: none; font-weight: 600; font-size: 0.92rem; color: #c9d0de;
}
.topbar nav a:hover { color: #fff; }
.topbar nav a[aria-current="page"] { background: rgb(255 255 255 / 0.12); color: #fff; }
.fav-count {
  display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--orange); color: #fff; font-size: 0.75rem; font-weight: 700;
}
.fav-count[hidden] { display: none; }

/* ---- Buttons ----------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px;
  border: 1px solid transparent; border-radius: 12px; background: var(--orange); color: #fff; font-weight: 700; text-decoration: none;
  transition: filter 0.15s, transform 0.15s;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: scale(0.98); }
.btn.ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn.block { width: 100%; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.fav-btn.on svg { fill: var(--orange); stroke: var(--orange); }

/* ---- Filters -------------------------------------------------------------------------- */
.filters {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 14px 20px;
  background: var(--card); border-bottom: 1px solid var(--line);
}
.fav-head { display: grid; gap: 2px; padding: 20px; }
.fav-head h1 { font-size: 1.5rem; }
.seg { display: flex; padding: 4px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; padding: 8px 16px; border-radius: 9px; font-weight: 700; font-size: 0.9rem; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.search {
  display: flex; align-items: center; gap: 8px; flex: 1 1 220px; min-width: 0; height: 44px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card);
}
.search svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.search input { border: 0; outline: 0; flex: 1; min-width: 0; background: transparent; }
.filters select, .range input, .sort select {
  height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font-size: 0.9rem;
}
.range { display: flex; align-items: center; gap: 4px; }
.range input { width: 112px; }
.range span { color: var(--muted); }
.clear { border: 0; background: none; color: var(--orange); font-weight: 700; padding: 8px; }
.results-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px 4px; }
.sort { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; color: var(--muted); }
.sort select { height: 38px; color: var(--ink); }

/* ---- List + map split ------------------------------------------------------------------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; padding: 12px 20px 40px; align-content: start; }
.map-wrap { position: sticky; top: var(--top); height: calc(100vh - var(--top)); padding: 12px 20px 20px 0; }
.map { width: 100%; height: 100%; border-radius: var(--radius); overflow: hidden; background: #dfe6e9; z-index: 0; }
.map-missing { display: grid; place-items: center; height: 100%; color: var(--muted); }
.map-toggle { display: none; }

.card {
  position: relative; display: grid; grid-template-rows: auto 1fr; background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--line); overflow: hidden; transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
  animation: rise 0.35s ease-out both;
}
.card:hover, .card.active { box-shadow: 0 14px 34px rgb(20 33 61 / 0.12); border-color: #cfd4de; }
.card.active { border-color: var(--orange); }
.card-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.card-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.art { display: block; width: 100%; height: 100%; transition: transform 0.5s; }
.card:hover .card-media .art { transform: scale(1.04); }
.badge {
  position: absolute; left: 10px; top: 10px; padding: 4px 10px; border-radius: 999px; font-size: 0.74rem; font-weight: 700;
  background: var(--card); color: var(--orange);
}
.badge.kiralik { color: var(--teal); }
.fav {
  position: absolute; z-index: 2; right: 10px; top: 10px; width: 38px; height: 38px; border-radius: 50%; border: 0;
  display: grid; place-items: center; background: rgb(255 255 255 / 0.92); box-shadow: 0 2px 8px rgb(0 0 0 / 0.12);
  transition: transform 0.15s;
}
.fav:active { transform: scale(0.88); }
.fav svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 2; }
.fav.on svg { fill: var(--orange); stroke: var(--orange); animation: pop 0.3s; }
.card-body { padding: 14px 16px 16px; display: grid; gap: 4px; align-content: start; }
.price { font-size: 1.2rem; font-weight: 800; color: var(--navy); letter-spacing: -0.01em; }
.price.big { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.card h3 { font-size: 0.98rem; font-weight: 600; line-height: 1.35; }
.where { color: var(--muted); font-size: 0.88rem; }
.facts { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; padding: 0; }
.facts li { padding: 3px 9px; border-radius: 8px; background: var(--bg); font-size: 0.8rem; font-weight: 600; }
.age { font-size: 0.78rem; color: var(--muted); margin-top: 4px !important; }
.empty { grid-column: 1 / -1; display: grid; justify-items: center; gap: 8px; text-align: center; padding: 60px 20px; }
.empty strong { font-size: 1.15rem; }
.empty p { color: var(--muted); }

/* Map pins */
.pin-wrap { background: none; border: 0; }
.pin {
  display: inline-block; transform: translate(-50%, -100%); white-space: nowrap; padding: 5px 9px; border-radius: 999px;
  background: var(--card); color: var(--navy); font: 700 0.78rem/1 "Sora", sans-serif; border: 2px solid var(--orange);
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.18); position: relative; transition: transform 0.15s, background 0.15s;
}
.pin.kiralik { border-color: var(--teal); }
.pin::after {
  content: ""; position: absolute; left: 50%; bottom: -7px; width: 10px; height: 10px; transform: translateX(-50%) rotate(45deg);
  background: inherit; border-right: 2px solid var(--orange); border-bottom: 2px solid var(--orange); z-index: -1;
}
.pin.kiralik::after { border-color: var(--teal); }
.pin.active { background: var(--navy); color: #fff; transform: translate(-50%, -100%) scale(1.12); }
.pin.active::after { background: var(--navy); }
.leaflet-container { font-family: "Sora", sans-serif; }
.map-preview { display: none; }

/* ---- Detail ----------------------------------------------------------------------------- */
.detail { padding: 20px 0 60px; }
.back { display: inline-block; margin-bottom: 14px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.92rem; }
.back:hover { color: var(--ink); }
.detail-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.crumbs { color: var(--orange); font-size: 0.82rem; font-weight: 700; letter-spacing: 0.02em; }
.detail-head h1 { font-size: clamp(1.5rem, 3.2vw, 2.2rem); line-height: 1.2; margin: 6px 0; letter-spacing: -0.02em; max-width: 28ch; }
.head-side { display: grid; justify-items: end; gap: 4px; text-align: right; }
.head-actions { display: flex; gap: 8px; margin-top: 8px; }

.gallery { display: grid; grid-template-columns: 1fr 220px; gap: 10px; margin-bottom: 26px; }
.stage { border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 8.5; background: #eee; }
.thumbs { display: grid; grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 10px; }
.thumbs .art { height: 100%; }
.thumbs button {
  position: relative; padding: 0; border: 3px solid transparent; border-radius: 14px; overflow: hidden; background: none;
}
.thumbs button[aria-selected="true"] { border-color: var(--orange); }
.thumbs button span {
  position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 999px; background: rgb(255 255 255 / 0.92);
  font-size: 0.74rem; font-weight: 700;
}
.plan text { font-family: "Sora", sans-serif; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.detail-main h2 { font-size: 1.2rem; margin: 30px 0 12px; }
.specs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 0; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.specs div { background: var(--card); padding: 14px 16px; }
.specs dt { font-size: 0.78rem; color: var(--muted); }
.specs dd { margin: 2px 0 0; font-weight: 700; }
.desc { font-size: 1.02rem; max-width: 64ch; }
.features { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.features li { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-weight: 600; font-size: 0.92rem; }
.features svg { width: 18px; height: 18px; fill: none; stroke: var(--teal); stroke-width: 2.4; flex: none; }
.detail-map { height: 300px; margin-top: 10px; }

.calc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.calc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.calc-grid label { display: grid; gap: 8px; font-size: 0.86rem; color: var(--muted); font-weight: 600; }
.calc-grid output { color: var(--ink); font-weight: 700; font-size: 0.95rem; }
.calc-grid input { width: 100%; accent-color: var(--orange); }
.calc-out { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.calc-out div { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--bg); }
.calc-out span { font-size: 0.8rem; color: var(--muted); }
.calc-out strong { font-size: 1.05rem; }
.calc-out .big { background: var(--navy); color: #fff; }
.calc-out .big span { color: #c9d0de; }
.calc-out .big strong { font-size: 1.3rem; }
.fine { font-size: 0.78rem; color: var(--muted); margin-top: 10px !important; }

.agent-card {
  position: sticky; top: calc(var(--top) + 16px); display: grid; gap: 14px; padding: 20px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgb(20 33 61 / 0.06);
}
.agent { display: flex; gap: 12px; align-items: center; }
.agent .avatar {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--orange), #f2a65a); color: #fff; font-weight: 800;
}
.agent div { display: grid; }
.agent span:not(.avatar) { color: var(--muted); font-size: 0.85rem; }
.contact { display: grid; gap: 10px; }
.contact label { display: grid; gap: 4px; font-size: 0.84rem; font-weight: 600; color: var(--muted); }
.contact input, .contact textarea {
  width: 100%; padding: 10px 12px; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); resize: vertical;
}
.sent { padding: 14px; border-radius: 12px; background: var(--teal-soft); color: #0b5b52; font-size: 0.92rem; }
.similar-title { font-size: 1.3rem; margin: 44px 0 14px; }
.cards.similar { padding: 0; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* ---- Toast & motion ------------------------------------------------------------------------ */
.toast {
  position: fixed; z-index: 2000; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: calc(100% - 32px);
  padding: 12px 18px; border-radius: 12px; background: var(--navy); color: #fff; font-weight: 600; font-size: 0.92rem;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.25); animation: up 0.25s ease-out;
}
.toast[hidden] { display: none; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes up { from { opacity: 0; transform: translate(-50%, 10px); } }
@keyframes pop { 50% { transform: scale(1.3); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---- Responsive ---------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .split { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }
  .cards { grid-template-columns: 1fr; }
  .cards.similar { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .detail-grid { grid-template-columns: 1fr; }
  .agent-card { position: static; }
}
@media (max-width: 800px) {
  .topbar { padding: 0 14px; }
  .topbar nav a { padding: 8px 10px; }
  .filters { padding: 12px 14px; }
  .seg { width: 100%; }
  .seg button { flex: 1; }
  .search { flex-basis: 100%; }
  .filters { gap: 6px; }
  .filters select { flex: 1 1 calc(33% - 4px); min-width: 0; padding: 0 8px; font-size: 0.84rem; }
  .range { flex: 1 1 60%; min-width: 0; }
  .clear { flex: none; }
  .seg button { padding: 7px 12px; }
  body.map-open { overflow: hidden; }
  .range input { flex: 1; width: 0; min-width: 0; }
  .results-head { padding: 12px 14px 0; }
  .split { grid-template-columns: 1fr; }
  .cards { padding: 12px 14px 90px; }
  .map-wrap { display: none; position: fixed; inset: var(--top) 0 0 0; height: auto; padding: 0; z-index: 900; }
  .map { border-radius: 0; }
  .show-map .map-wrap { display: block; }
  .map-toggle {
    display: inline-flex; align-items: center; gap: 8px; position: fixed; z-index: 950; left: 50%; bottom: 22px; transform: translateX(-50%);
    padding: 12px 22px; border: 0; border-radius: 999px; background: var(--navy); color: #fff; font-weight: 700;
    box-shadow: 0 10px 24px rgb(0 0 0 / 0.3);
  }
  .map-preview {
    display: flex; position: absolute; z-index: 1000; left: 12px; right: 12px; bottom: 80px; gap: 12px; align-items: center;
    padding: 8px; border-radius: 16px; background: var(--card); text-decoration: none; box-shadow: 0 10px 30px rgb(0 0 0 / 0.2);
    animation: rise 0.25s ease-out;
  }
  .map-preview .art { width: 96px; height: 72px; border-radius: 10px; flex: none; }
  .map-preview span { display: grid; gap: 2px; font-size: 0.86rem; min-width: 0; }
  .map-preview b { font-size: 1rem; color: var(--navy); }
  .map-preview small { color: var(--muted); }
  .gallery { grid-template-columns: 1fr; }
  .stage { aspect-ratio: 16 / 10; }
  .thumbs { grid-template-columns: repeat(3, 1fr); grid-template-rows: none; }
  .thumbs button { aspect-ratio: 16 / 11; }
  .head-side { justify-items: start; text-align: left; }
  .specs { grid-template-columns: repeat(2, 1fr); }
  .calc-grid, .calc-out { grid-template-columns: 1fr; }
}
