:root {
  --blue: #1a56db;
  --blue-d: #1446b5;
  --blue-l: #e8effd;
  --saf: #f59e0b;
  --saf-l: #fff4dc;
  --green: #16a34a;
  --wa: #25d366;
  --red: #e11d48;
  --ink: #111827;
  --ink2: #4b5563;
  --ink3: #9ca3af;
  --line: #e5e7eb;
  --bg: #f4f5f7;
  --r: 14px;
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  overflow-x: clip;
}
body {
  font-family: 'Vazirmatn', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
  padding-bottom: 76px;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 14px;
}
.row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sp {
  flex: 1;
}
.muted {
  color: var(--ink2);
}
.faint {
  color: var(--ink3);
}
.hide {
  display: none !important;
}

/* header */
header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}
.hb {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 62px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  font-size: 22px;
  color: var(--blue);
}
.logo svg {
  width: 34px;
  height: 34px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}
.pill:hover {
  border-color: var(--blue);
}
.pill select {
  border: 0;
  background: none;
  outline: none;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.postbtn {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.postbtn:hover {
  background: var(--blue-d);
}
.dnav {
  display: flex;
  gap: 6px;
}

/* search + chips */
.hero {
  background: linear-gradient(135deg, #1a56db, #1e3a8a);
  color: #fff;
  padding: 22px 0 26px;
}
.hero h1 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.5;
}
.hero p {
  margin: 0 0 14px;
  opacity: 0.85;
  font-size: 14px;
}
.sbox {
  display: flex;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}
.sbox input {
  flex: 1;
  border: 0;
  outline: 0;
  height: 52px;
  padding: 0 16px;
  font-size: 16px;
  color: var(--ink);
  min-width: 0;
}
.sbox button {
  border: 0;
  background: var(--saf);
  color: #111;
  font-weight: 800;
  padding: 0 20px;
  font-size: 15px;
}
.cats {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 14px 2px 6px;
  scrollbar-width: none;
}
.cats::-webkit-scrollbar {
  display: none;
}
.cat {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 78px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
  background: none;
  border: 0;
  padding: 0;
}
.cat .ci {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 28px;
  border: 2px solid transparent;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.cat.on .ci {
  border-color: var(--blue);
  background: var(--blue-l);
}
.cat.on {
  color: var(--blue);
}
.chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 0;
  scrollbar-width: none;
  align-items: center;
}
.chips::-webkit-scrollbar {
  display: none;
}
.chip {
  flex: none;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.chip.on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.chips select {
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 10px;
  font-size: 13.5px;
  font-weight: 600;
}

/* feed */
.fh {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
}
.fh h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
  gap: 12px;
}
.ad {
  background: #fff;
  border-radius: var(--r);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: 0.15s;
  position: relative;
}
.ad:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}
.ph {
  position: relative;
  aspect-ratio: 4/3;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 35% 30%, hsl(var(--h) 85% 96%), hsl(var(--h) 60% 86%));
}
.ph span {
  font-size: 64px;
  line-height: 1;
  filter: drop-shadow(0 6px 10px hsl(var(--h) 40% 30% / 0.25));
}
.ph img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ph .tg {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  z-index: 2;
}
.tag {
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  white-space: nowrap;
}
.tag.f {
  background: #1e3a8a;
  color: #fff;
}
.tag.s {
  background: #0f766e;
  color: #fff;
}
.tag.p {
  background: #fff;
  color: var(--ink);
}
.tag.w {
  background: var(--saf);
  color: #111;
}
.tag.sold {
  background: var(--red);
  color: #fff;
}
.tag.demo {
  background: rgba(17, 24, 39, 0.65);
  color: #fff;
}
.ad .bd {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.ad .tt {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 45px;
}
.ad .pr {
  font-weight: 900;
  font-size: 16px;
  margin-top: auto;
}
.ad .pr small {
  font-weight: 500;
  font-size: 12px;
  color: var(--ink2);
}
.ad .mt {
  font-size: 12px;
  color: var(--ink3);
}
.heart {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.95);
  font-size: 17px;
  display: grid;
  place-items: center;
  color: var(--ink2);
}
.heart.on {
  color: var(--red);
}
.empty {
  text-align: center;
  padding: 50px 16px;
  color: var(--ink2);
  background: #fff;
  border-radius: var(--r);
}
.empty .e {
  font-size: 52px;
}

/* buttons/forms */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
}
.btn.p {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.btn.call {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.btn.wa {
  background: var(--wa);
  border-color: var(--wa);
  color: #fff;
}
.btn.sm {
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 10px;
}
.btn.d {
  color: var(--red);
}
.btn.blk {
  width: 100%;
}
.btn[disabled] {
  opacity: 0.5;
  pointer-events: none;
}
.card {
  background: #fff;
  border-radius: var(--r);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.pad {
  padding: 18px;
}
.fld {
  margin-bottom: 16px;
}
.fld > label {
  display: block;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
}
.fld input[type='text'],
.fld input[type='tel'],
.fld input[type='email'],
.fld input[type='password'],
.fld input:not([type]),
.fld select,
.fld textarea {
  width: 100%;
  height: 50px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  background: #fff;
  outline: none;
  font-size: 16px;
}
.fld textarea {
  height: auto;
  min-height: 110px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.8;
}
.fld input:focus,
.fld select:focus,
.fld textarea:focus {
  border-color: var(--blue);
}
.fld .h {
  font-size: 12.5px;
  color: var(--ink3);
  margin-top: 4px;
}
.bad {
  border-color: var(--red) !important;
}
.seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.seg label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 10px 6px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13.5px;
  text-align: center;
  min-height: 64px;
}
.seg label .i {
  font-size: 22px;
}
.seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.seg label:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue-l);
  color: var(--blue);
}
.chk {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin-top: 8px;
  cursor: pointer;
}
.chk input {
  width: 18px;
  height: 18px;
  accent-color: var(--wa);
}
.phs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.phs .th {
  width: 96px;
  height: 96px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: #eee;
}
.phs .th img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.phs .th button {
  position: absolute;
  top: 4px;
  inset-inline-end: 4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 14px;
  line-height: 1;
}
.phs .addp {
  width: 96px;
  height: 96px;
  border-radius: 12px;
  border: 2px dashed #c7cdd6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink2);
  cursor: pointer;
  background: #fafbfc;
}
.phs .addp b {
  font-size: 28px;
  line-height: 1;
  color: var(--blue);
}

/* ad page */
.adp {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 16px;
  align-items: start;
  margin-top: 14px;
}
.gal .main {
  aspect-ratio: 4/3;
  border-radius: var(--r);
  overflow: hidden;
}
.gal .main span {
  font-size: 140px;
}
.gal .ths {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.gal .ths button {
  width: 70px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  background: #eee;
}
.gal .ths button.on {
  border-color: var(--blue);
}
.gal .ths img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.info h1 {
  font-size: 21px;
  margin: 0 0 4px;
  line-height: 1.6;
}
.info .price {
  font-size: 26px;
  font-weight: 900;
  margin: 8px 0;
}
.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 18px;
  font-size: 14px;
  margin: 12px 0;
}
.kv dt {
  color: var(--ink3);
}
.kv dd {
  margin: 0;
  font-weight: 600;
}
.seller {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 14px 0;
}
.av {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  font-size: 20px;
  flex: none;
  background: linear-gradient(135deg, hsl(var(--h) 65% 50%), hsl(calc(var(--h) + 40) 65% 40%));
}
.cta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.num {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 15px;
}
.num b {
  font-size: 18px;
  letter-spacing: 0.5px;
}
.safe {
  background: var(--saf-l);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  margin-top: 14px;
  color: #7a4b00;
}
.bc {
  font-size: 13px;
  color: var(--ink3);
  margin-top: 12px;
}

/* my ads */
.mine {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.mine:last-child {
  border: 0;
}
.mine .ph {
  width: 96px;
  flex: none;
  border-radius: 10px;
}
.mine .ph span {
  font-size: 36px;
}
.tabs {
  display: flex;
  gap: 6px;
  margin: 14px 0;
}
.tabs a {
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  font-size: 14px;
}
.tabs a.on {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

/* bottom nav */
.bnav {
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  background: #fff;
  border-top: 1px solid var(--line);
  display: none;
  z-index: 50;
  height: 66px;
  padding-bottom: env(safe-area-inset-bottom);
}
.bnav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink2);
  gap: 1px;
}
.bnav a .i {
  font-size: 21px;
}
.bnav a.on {
  color: var(--blue);
}
.bnav a.plus .i {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 28px;
  margin-top: -22px;
  box-shadow: 0 6px 16px rgba(26, 86, 219, 0.4);
}
footer {
  padding: 26px 0 30px;
  color: var(--ink2);
  font-size: 13px;
}
.g2f {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 10px;
}
.drow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 6px;
  font-size: 13.5px;
  font-weight: 600;
}
.drow select {
  flex: 1;
  max-width: 340px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 10px;
  font-size: 14px;
}
.note {
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 10px;
}
.terms h3 {
  margin: 18px 0 4px;
  font-size: 16px;
}
.terms p {
  margin: 0 0 6px;
  color: var(--ink2);
  line-height: 2;
}

/* overlays */
.mbg {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.5);
  z-index: 90;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.mdl {
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 18px;
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  overflow: auto;
  animation: up 0.2s;
}
@media (min-width: 700px) {
  .mbg {
    align-items: center;
  }
  .mdl {
    border-radius: 20px;
  }
}
@keyframes up {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
}
.mdl h3 {
  margin: 0 0 12px;
}
.clist button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 12px 10px;
  border: 0;
  background: none;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  text-align: start;
}
.clist button.on {
  color: var(--blue);
  font-weight: 800;
}
#toasts {
  position: fixed;
  bottom: 86px;
  inset-inline: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 100;
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 600;
  animation: up 0.2s;
}
.toast.err {
  background: var(--red);
}

@media (max-width: 760px) {
  .dnav {
    display: none;
  }
  .bnav {
    display: flex;
  }
  .adp {
    grid-template-columns: 1fr;
  }
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .ph span {
    font-size: 48px;
  }
  .ad .bd {
    padding: 8px 10px 10px;
  }
  .ad .tt {
    font-size: 13.5px;
  }
  .hero h1 {
    font-size: 19px;
  }
  .logo {
    font-size: 20px;
  }
  .hb {
    gap: 6px;
  }
  .pill {
    padding: 0 9px;
    height: 38px;
    font-size: 13px;
  }
  .logo {
    font-size: 19px;
    gap: 6px;
  }
  .logo svg {
    width: 30px;
    height: 30px;
  }
  .cityp {
    min-width: 0;
    flex-shrink: 1;
  }
  .cityp .tx {
    display: inline-block;
    max-width: 84px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
  }
  .lpill .gl {
    display: none;
  }
}
@media (min-width: 761px) {
  body {
    padding-bottom: 0;
  }
}

/* accounts */
.authlinks {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  font-size: 13.5px;
}
.authlinks a {
  color: var(--blue);
  font-weight: 700;
}
@media (max-width: 760px) {
  .acc .tx {
    display: none;
  }
}
