/* Taqalgani — bitta uslub fayli.
   Ranglar: havorang #a5e0f5 va navy #0d2b3e (brend juftligi).
   Tizim shriftlari: tez yuklanadi, har qurilmada tabiiy ko'rinadi. */

:root {
  --bg: #f2f7fa;
  --surface: #ffffff;
  --ink: #0d2b3e;
  --ink-soft: #3c5567;
  --muted: #6d8496;
  --line: #dbe7ee;
  --navy: #0d2b3e;
  --sky: #a5e0f5;
  --sky-soft: #e6f5fc;
  --accent: #0d6b8f;         /* havoni matnda o'qish uchun to'qlashtirilgani */
  --sold: #8a99a4;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(13, 43, 62, .06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1620;
    --surface: #10222f;
    --ink: #e8f3f9;
    --ink-soft: #bdd2de;
    --muted: #8ba4b3;
    --line: #1d3646;
    --navy: #a5e0f5;
    --sky-soft: #122d3d;
    --accent: #7fcfe9;
    --sold: #7b8c99;
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

h1, h2, h3 { line-height: 1.25; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; font-weight: 650; }
h2 { font-size: 1.15rem; font-weight: 620; }
h3 { font-size: .95rem; font-weight: 600; }
p { margin: 0 0 1em; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
.is-hidden { display: none !important; }

/* --- Sarlavha --- */
.site-head { background: var(--surface); border-bottom: 1px solid var(--line); }
.head-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; min-height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; flex: none; border-radius: 9px;
  background: var(--navy); color: var(--sky);
  display: grid; place-items: center;
  font-weight: 700; font-size: 1.15rem; line-height: 1;
}
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: 1.05rem; font-weight: 650; letter-spacing: -.02em; }
.brand-tag { font-size: .76rem; color: var(--muted); }

.head-actions { display: flex; align-items: center; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; border-radius: 9px; padding: 10px 16px;
  font-size: .9rem; font-weight: 560; border: 1px solid transparent;
  cursor: pointer; font-family: inherit;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--navy); color: var(--surface); }
.btn--primary:hover { opacity: .9; }
.btn--icon {
  background: var(--sky-soft); color: var(--accent);
  padding: 9px; width: 42px; height: 42px;
}
.btn--icon:hover { background: var(--sky); color: var(--navy); }
.btn--ghost {
  background: transparent; border-color: var(--line); color: var(--ink-soft);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

/* --- Reklama banneri (1200x120) --- */
.banner {
  display: flex; flex-direction: column; justify-content: center;
  min-height: 120px; margin: 16px 0 4px; padding: 16px 24px;
  background: linear-gradient(100deg, var(--navy), #14425e);
  border-radius: var(--radius); color: #fff; overflow: hidden;
}
.banner:hover { text-decoration: none; opacity: .96; }
.banner img { width: 100%; height: auto; border-radius: 4px; }
.banner-title { font-size: 1.15rem; font-weight: 650; }
.banner-text { font-size: .9rem; color: var(--sky); }

main { padding: 22px 16px 48px; }
.page-head { font-size: 1.7rem; margin-bottom: 16px; }

/* --- Filtr --- */
.filters {
  display: grid; gap: 12px; align-items: end;
  grid-template-columns: 2fr 1fr 1fr 1.3fr 1fr auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 28px;
  box-shadow: var(--shadow);
}
.f-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.f-field label { font-size: .78rem; color: var(--muted); font-weight: 560; }
.f-pair { display: flex; gap: 6px; }
.f-pair input { min-width: 0; }
.filters input, .filters select {
  width: 100%; padding: 10px 11px; font: inherit; font-size: .92rem;
  color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 9px;
}
.filters input:focus, .filters select:focus {
  outline: 2px solid var(--sky); outline-offset: -1px; border-color: var(--accent);
}
#f-reset { height: 42px; }

/* --- Bloklar --- */
.block { margin-bottom: 40px; }
.block-head {
  display: flex; align-items: baseline; gap: 10px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 18px;
}
.count { font-size: .85rem; font-weight: 400; color: var(--muted); }

/* --- Kartochka to'rlari: TOP 4 ta, oddiy 5 ta --- */
.grid { display: grid; gap: 16px; }
.grid--top { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--plain { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.cards { display: grid; gap: 16px; grid-template-columns: repeat(5, minmax(0, 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; color: var(--ink);
  box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.card:hover { border-color: var(--sky); box-shadow: 0 4px 14px rgba(13, 43, 62, .09); }
.card-link { color: inherit; display: flex; flex-direction: column; flex: 1; }
.card-link:hover { text-decoration: none; }
.card-shot { position: relative; display: block; }
.card-shot img { width: 100%; aspect-ratio: 1; object-fit: cover; background: #fff; }
.card-shot--empty { display: block; aspect-ratio: 1; background: var(--sky-soft); }
.card.is-sold .card-shot img { opacity: .55; filter: grayscale(1); }
.card-body { display: flex; flex-direction: column; gap: 3px; padding: 11px 13px; }
.card-title { font-weight: 570; font-size: .95rem; }
.card-meta { font-size: .8rem; color: var(--muted); }
.card-price { font-size: 1.12rem; font-weight: 680; letter-spacing: -.01em; margin-top: 2px; }

.card--top { border-color: var(--sky); }
.card--top .card-title { font-size: 1.02rem; }
.card--top .card-price { font-size: 1.28rem; }

/* --- Yorliqlar --- */
.badge {
  position: absolute; top: 9px; font-size: .72rem; font-weight: 620;
  padding: 4px 9px; border-radius: 999px; line-height: 1.4;
}
.badge--top { left: 9px; background: var(--navy); color: var(--sky); }
.badge--deal { right: 9px; background: var(--sky); color: var(--navy); }
.badge--sold { right: 9px; background: #e7ecef; color: #55636c; }

/* --- Telefon tugmasi (JavaScriptsiz ham ochiladi) --- */
.phone {
  display: block; margin: 0 13px 13px; border-radius: 9px;
  background: var(--sky-soft); color: var(--accent);
  font-size: .86rem; font-weight: 570; text-align: center;
}
.phone > summary {
  list-style: none; cursor: pointer; padding: 9px 10px; border-radius: 9px;
}
.phone > summary::-webkit-details-marker { display: none; }
.phone:hover { background: var(--sky); color: var(--navy); }
.phone--link { padding: 9px 10px; }
.phone--link:hover { text-decoration: none; }
.phone[open] { background: var(--navy); }
.phone[open] > summary { display: none; }
.phone-num {
  display: block; padding: 9px 10px; color: var(--sky);
  font-size: 1rem; font-weight: 650; letter-spacing: .02em;
}
.phone-num:hover { text-decoration: none; }

/* --- E'lon sahifasi --- */
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 16px; }
.crumbs a { color: var(--muted); }
.crumbs span { margin: 0 6px; }
.crumbs span:last-child { margin: 0; }

.deal { max-width: 680px; }
.deal h1 { font-size: 1.5rem; }
.deal-sub { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.deal-date { font-size: .85rem; color: var(--muted); }
.deal-photo {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; margin-bottom: 28px;
}
.deal-photo.is-sold { opacity: .6; filter: grayscale(1); }

.tag { display: inline-block; font-size: .78rem; font-weight: 570;
       padding: 3px 10px; border-radius: 999px; }
.tag-deal { background: var(--sky); color: var(--navy); }
.tag-sold { background: var(--line); color: var(--sold); }
.tag-top { background: var(--navy); color: var(--sky); }

/* --- Narx tahlili: sahifaning yuragi --- */
.analysis {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; margin-bottom: 28px;
}
.figures { margin: 0 0 14px; }
.figures > div {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line);
}
.figures > div:last-child { border-bottom: 0; padding-bottom: 0; }
.figures dt { color: var(--muted); font-size: .92rem; }
.figures dd { margin: 0; font-weight: 560; font-size: 1.05rem; }
.figures .is-key dt { color: var(--ink); font-weight: 560; }
.figures .is-key dd { color: var(--accent); font-weight: 680; font-size: 1.2rem; }
.analysis-note { font-size: .87rem; color: var(--muted); margin: 0; }

.specs { margin: 0 0 28px; }
.specs > div {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 9px 0; border-bottom: 1px solid var(--line);
}
.specs dt { color: var(--muted); font-size: .92rem; }
.specs dd { margin: 0; text-align: right; }

/* --- Chaqiriq bloki --- */
.cta-box {
  background: var(--sky-soft); border-radius: var(--radius);
  padding: 20px; margin-bottom: 24px;
}
.cta-box.is-sold { background: var(--surface); border: 1px solid var(--line); }
.cta-title { font-weight: 620; margin-bottom: 4px; }
.cta-text { font-size: .9rem; color: var(--ink-soft); margin-bottom: 14px; }
.cta {
  display: inline-block; background: var(--navy); color: var(--surface);
  padding: 11px 20px; border-radius: 9px; font-weight: 570;
}
.cta:hover { text-decoration: none; opacity: .92; }
.cta-phone {
  display: inline-block; font-size: 1.45rem; font-weight: 700;
  letter-spacing: .02em; color: var(--ink);
}
.cta-phone:hover { text-decoration: none; }

.source { font-size: .85rem; color: var(--muted); }

.similar { margin-top: 44px; }
.similar h2 { padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }

.how { margin-top: 40px; max-width: 72ch; }
.steps { margin: 0; padding-left: 20px; color: var(--ink-soft); }
.steps li { margin-bottom: 12px; }
.steps b { color: var(--ink); }
.empty { color: var(--muted); }

/* --- Pastki qism --- */
.site-foot {
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 36px 0 40px; margin-top: 56px; font-size: .9rem;
}
.foot-cols {
  display: grid; gap: 28px; margin-bottom: 28px;
  grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr));
}
.foot-cols p { color: var(--muted); margin: 0; }
.foot-links { list-style: none; margin: 0; padding: 0; }
.foot-links li { margin-bottom: 5px; }
.foot-links a { color: var(--ink-soft); }
.foot-links--inline { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.foot-note {
  color: var(--muted); font-size: .84rem; max-width: 70ch;
  padding-top: 20px; border-top: 1px solid var(--line);
}
.foot-meta { color: var(--muted); font-size: .8rem; margin: 0; }

/* --- Mobil --- */
@media (max-width: 1080px) {
  .grid--plain, .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid--top { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #f-reset { grid-column: 3; }
}

@media (max-width: 720px) {
  .page-head { font-size: 1.35rem; }
  .deal h1 { font-size: 1.3rem; }
  .grid--plain, .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid--top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .filters { grid-template-columns: 1fr 1fr; padding: 12px; gap: 10px; }
  .f-field--wide, #f-reset { grid-column: 1 / -1; }
  .brand-tag { display: none; }
  .btn { padding: 9px 13px; font-size: .85rem; }
  .banner { min-height: 92px; padding: 14px 16px; }
  .banner-title { font-size: 1rem; }
  .card-title { font-size: .9rem; }
  .card-price { font-size: 1.02rem; }
  .card--top .card-price { font-size: 1.1rem; }
  .foot-cols { grid-template-columns: 1fr 1fr; }
  .foot-cols > :first-child { grid-column: 1 / -1; }
}
