/* ============================================================
   style.css — Design tokens + base layout + components
   Theme: "Ceylon Deed" — pine teal, burnt copper & saffron
   on warm survey-paper white, with a mono ledger typeface
   for every price, spec and measurement on the site.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Petrona:ital,wght@0,500;0,600;0,700;1,500;1,600&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600;700&display=swap');

:root {
  /* ---- Color: paper & surfaces ---- */
  --color-bg: #fbfaf6;
  --color-bg-alt: #f2efe4;
  --color-surface: #ffffff;
  --color-surface-sunken: #f1efe4;
  --color-border: #e4dfcf;
  --color-border-strong: #d2c9ae;

  /* ---- Color: ink ---- */
  --color-ink: #16241f;
  --color-ink-soft: #4c5c54;
  --color-ink-faint: #8b9690;

  /* ---- Color: brand — deep pine teal ---- */
  --color-primary: #123832;
  --color-primary-dark: #0a211d;
  --color-primary-light: #e6ede9;

  /* ---- Color: accent — burnt copper (stamps / metal) ---- */
  --color-gold: #a85c2a;
  --color-gold-dark: #7e4319;
  --color-gold-light: #f5e7d6;

  /* ---- Color: signal — saffron (CTA / highlight) ---- */
  --color-saffron: #e2a63b;
  --color-saffron-dark: #b8811f;
  --color-saffron-light: #fbf0da;

  --color-success: #1f8a5f;
  --color-success-light: #e5f3ec;
  --color-danger: #b23b2e;
  --color-danger-light: #f8e8e5;

  /* ---- Type ---- */
  --font-display: 'Petrona', Georgia, serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  /* ---- Radius ---- */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  /* ---- Shadow ---- */
  --shadow-sm: 0 1px 2px rgba(15, 25, 21, 0.07);
  --shadow-md: 0 14px 34px rgba(15, 25, 21, 0.10);
  --shadow-lg: 0 30px 64px rgba(10, 33, 29, 0.20);
  --shadow-nav: 0 8px 24px rgba(15, 25, 21, 0.06);

  /* ---- Layout ---- */
  --nav-height: 76px;
  --bottom-nav-height: 66px;
  --container-max: 1220px;

  /* ---- Spacing scale ---- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 40px;
  --sp-9: 56px;

  /* ---- Z-index ---- */
  --z-nav: 100;
  --z-bottomnav: 100;
  --z-sheet: 200;
  --z-toast: 300;
}

/* ============================================================
   Reset & base
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

@media (max-width: 899px) {
  body { padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px)); }
}

body.no-scroll { overflow: hidden; }

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

button { cursor: pointer; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; margin: 0; color: var(--color-primary); }

p { margin: 0; }

ul { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--color-saffron-light); color: var(--color-primary-dark); }

:focus-visible {
  outline: 2.5px solid var(--color-gold);
  outline-offset: 2px;
  border-radius: 4px;
}

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--sp-4);
}

@media (min-width: 768px) {
  .container { padding: 0 var(--sp-7); }
}

.page-main { min-height: calc(100vh - var(--nav-height)); padding-top: var(--sp-5); padding-bottom: var(--sp-9); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ============================================================
   Survey-paper texture backdrop (subtle, whole-app)
   ============================================================ */

.paper-texture {
  background-image:
    radial-gradient(circle at 1px 1px, rgba(18,56,50,0.05) 1px, transparent 0);
  background-size: 22px 22px;
}

/* ============================================================
   Top navbar
   ============================================================ */

.topnav {
  position: sticky; top: 0; z-index: var(--z-nav);
  height: var(--nav-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-nav);
}

.topnav__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  height: 100%;
  padding: 0 var(--sp-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

@media (min-width: 768px) { .topnav__inner { padding: 0 var(--sp-7); } }

.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--color-primary);
  letter-spacing: 0.01em;
}

.brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: var(--color-saffron-light);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  position: relative;
  flex-shrink: 0;
}

.brand__mark::after {
  content: "";
  position: absolute; inset: 4px;
  border: 1px dashed rgba(226,166,59,0.55);
  border-radius: 5px;
}

.brand__accent { color: var(--color-gold); }

.topnav__links {
  display: none;
  align-items: center;
  gap: var(--sp-2);
}

@media (min-width: 900px) {
  .topnav__links { display: flex; }
}

.topnav__link {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.94rem;
  color: var(--color-ink-soft);
  transition: background 0.15s ease, color 0.15s ease;
}

.topnav__link i { font-size: 0.9rem; width: 16px; text-align: center; }

.topnav__link:hover { background: var(--color-primary-light); color: var(--color-primary); }

.topnav__link.is-active { background: var(--color-primary); color: #fff; }

.topnav__link.is-post {
  background: var(--color-saffron);
  color: var(--color-primary-dark);
}

.topnav__link.is-post:hover { background: var(--color-saffron-dark); color: #fff; }

.topnav__right {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

/* Language switcher */

.lang-switch { position: relative; }

.lang-switch__btn {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: var(--color-primary);
}

.lang-switch__btn i.fa-chevron-down { font-size: 0.6rem; color: var(--color-ink-faint); transition: transform 0.15s ease; }

.lang-switch.is-open .lang-switch__btn i.fa-chevron-down { transform: rotate(180deg); }

.lang-switch__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 168px;
  padding: var(--sp-2);
  display: none;
  z-index: var(--z-sheet);
}

.lang-switch.is-open .lang-switch__menu { display: block; }

.lang-switch__opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  text-align: left;
  font-weight: 500;
  font-size: 0.92rem;
}

.lang-switch__opt:hover { background: var(--color-bg-alt); }

.lang-switch__opt.is-current { color: var(--color-primary); font-weight: 700; }

.lang-switch__opt.is-current i { color: var(--color-gold); }

/* ============================================================
   Bottom nav (mobile app bar)
   ============================================================ */

.bottomnav {
  position: fixed;
  left: var(--sp-3); right: var(--sp-3);
  bottom: var(--sp-3);
  z-index: var(--z-bottomnav);
  height: var(--bottom-nav-height);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px rgba(15, 25, 21, 0.12), 0 0 0 1px rgba(255,255,255,0.5);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
}

@media (min-width: 900px) { .bottomnav { display: none; } }

.bottomnav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 100%;
  border: none;
  background: none;
  color: var(--color-ink-faint);
  font-size: 0.66rem;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bottomnav__item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

.bottomnav__item i { font-size: 1.15rem; }

.bottomnav__item.is-active { color: var(--color-primary); }

.bottomnav__item--sell {
  position: relative;
}

.bottomnav__item--sell .bottomnav__post-fab {
  position: absolute;
  top: -22px;
  width: 50px; height: 50px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--color-saffron), var(--color-saffron-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary-dark);
  font-size: 1.25rem;
  box-shadow: 0 10px 22px rgba(184,129,31,0.45), 0 0 0 6px var(--color-surface);
}

.bottomnav__item--sell span { margin-top: 30px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  border: none;
  border-radius: var(--radius-pill);
  padding: 13px 24px;
  font-weight: 700;
  font-size: 0.94rem;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-block { width: 100%; }

.btn-primary { background: var(--color-primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--color-primary-dark); }

.btn-saffron { background: var(--color-saffron); color: var(--color-primary-dark); box-shadow: var(--shadow-sm); }
.btn-saffron:hover { background: var(--color-saffron-dark); color: #fff; }

.btn-outline { background: transparent; color: var(--color-primary); border: 1.5px solid var(--color-border-strong); }
.btn-outline:hover { border-color: var(--color-primary); background: var(--color-primary-light); }

.btn-ghost { background: transparent; color: var(--color-ink-soft); }
.btn-ghost:hover { background: var(--color-bg-alt); }

.btn-danger { background: var(--color-danger-light); color: var(--color-danger); }
.btn-danger:hover { background: var(--color-danger); color: #fff; }

.btn-sm { padding: 9px 16px; font-size: 0.82rem; }

.btn-icon {
  width: 44px; height: 44px; padding: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--color-surface); border: 1px solid var(--color-border-strong); color: var(--color-ink-soft);
}
.btn-icon:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* ============================================================
   Section headers
   ============================================================ */

.section { margin-top: var(--sp-8); }

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
  gap: var(--sp-3);
}

.section__head-copy { min-width: 0; }

.section__eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: 4px;
}

.section__title { font-size: 1.4rem; overflow-wrap: break-word; min-width: 0; }

.section__see-all {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* ============================================================
   Category chips
   ============================================================ */

.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
}

@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(4, 1fr); } }

.cat-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: var(--sp-4) var(--sp-2);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-align: center;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  min-width: 0;
}

.cat-chip:hover { border-color: var(--color-gold); box-shadow: var(--shadow-sm); transform: translateY(-2px); }

.cat-chip__icon {
  width: 46px; height: 46px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 1.15rem;
  border: 1.5px dashed var(--color-border-strong);
}

.cat-chip__label { font-size: 0.78rem; font-weight: 700; color: var(--color-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* colour variants per category, echoed on cards */
.cat-chip[data-cat="land"] .cat-chip__icon { background: var(--color-success-light); color: var(--color-success); }
.cat-chip[data-cat="real_estate"] .cat-chip__icon { background: var(--color-primary-light); color: var(--color-primary); }
.cat-chip[data-cat="vehicles"] .cat-chip__icon { background: var(--color-gold-light); color: var(--color-gold-dark); }
.cat-chip[data-cat="pets"] .cat-chip__icon { background: var(--color-saffron-light); color: var(--color-saffron-dark); }

/* ============================================================
   Horizontal scroll container
   ============================================================ */

.scroll-x {
  display: flex;
  gap: var(--sp-3);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: var(--sp-1) 0;
  scrollbar-width: none;
}

.scroll-x::-webkit-scrollbar { display: none; }

.scroll-x .ad-card {
  flex: 0 0 260px;
  scroll-snap-align: start;
}

/* ============================================================
   Ad grid + Deed ticket-stub card
   ============================================================ */

.ad-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-4);
}

@media (min-width: 640px) { .ad-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .ad-grid { grid-template-columns: repeat(4, 1fr); gap: var(--sp-5); } }

.ad-card {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.ad-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--color-border-strong); }

/* corner tick marks, surveyor-style */
.ad-card::before, .ad-card::after,
.ad-card__media::before, .ad-card__media::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border-color: var(--color-gold);
  opacity: 0;
  transition: opacity 0.18s ease;
  z-index: 3;
  pointer-events: none;
}
.ad-card:hover::before, .ad-card:hover::after,
.ad-card:hover .ad-card__media::before, .ad-card:hover .ad-card__media::after { opacity: 0.85; }

.ad-card::before { top: 6px; left: 6px; border-top: 2px solid; border-left: 2px solid; }
.ad-card::after { top: 6px; right: 6px; border-top: 2px solid; border-right: 2px solid; }
.ad-card__media::before { bottom: 6px; left: 6px; border-bottom: 2px solid var(--color-gold); border-left: 2px solid var(--color-gold); }
.ad-card__media::after { bottom: 6px; right: 6px; border-bottom: 2px solid var(--color-gold); border-right: 2px solid var(--color-gold); }

.ad-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--color-surface-sunken);
  overflow: hidden;
}

.ad-card__media img { width: 100%; height: 100%; object-fit: cover; }

.ad-card__fallback {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px;
  background: var(--color-surface-sunken);
  color: var(--color-ink-faint);
}

.ad-card__fallback i { font-size: 1.6rem; }

.ad-card__fallback span { font-size: 0.62rem; font-family: var(--font-mono); letter-spacing: 0.05em; }

.ad-card__badge-cat {
  position: absolute;
  top: 10px; left: 10px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  border: 1.5px solid var(--color-gold);
  color: var(--color-gold-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem;
  z-index: 2;
}

.ad-card__featured-flag {
  position: absolute;
  top: 8px; right: -28px;
  background: var(--color-saffron);
  color: var(--color-primary-dark);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 30px;
  transform: rotate(38deg);
  z-index: 2;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.ad-card__like {
  position: absolute;
  bottom: 10px; right: 10px;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  border: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-ink-soft);
  font-size: 0.95rem;
  z-index: 2;
  box-shadow: var(--shadow-sm);
  transition: color 0.15s ease, transform 0.15s ease;
}

.ad-card__like i { pointer-events: none; }

.ad-card__like.is-liked { color: var(--color-danger); }
.ad-card__like.is-liked i { font-weight: 900; }
.ad-card__like:active { transform: scale(1.15); }

.ad-card__perforation {
  position: relative;
  height: 1px;
  border-top: 1.5px dashed var(--color-border-strong);
  margin: 0 var(--sp-3);
}

.ad-card__perforation::before, .ad-card__perforation::after {
  content: "";
  position: absolute;
  top: -6px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
}
.ad-card__perforation::before { left: -18px; }
.ad-card__perforation::after { right: -18px; }

.ad-card__body { padding: var(--sp-3) var(--sp-3) var(--sp-4); display: flex; flex-direction: column; gap: 6px; flex: 1; }

.ad-card__title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--color-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.4em;
}

.ad-card__price {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-primary);
}

.ad-card__price small { font-family: var(--font-mono); font-weight: 600; font-size: 0.68rem; color: var(--color-ink-faint); margin-left: 4px; }

.ad-card__loc {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.72rem; color: var(--color-ink-soft);
  margin-top: auto;
}

.ad-card__loc i { color: var(--color-gold); font-size: 0.7rem; }

/* Skeleton loading state */
.ad-card.is-skeleton .ad-card__media,
.skeleton-block {
  background: linear-gradient(100deg, var(--color-surface-sunken) 30%, #fff 50%, var(--color-surface-sunken) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ============================================================
   Search page
   ============================================================ */

.search-bar {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  margin-bottom: var(--sp-4);
}

.search-bar__field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--color-surface);
  border: 1.5px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  padding: 12px var(--sp-4);
}

.search-bar__field i { color: var(--color-ink-faint); }

.search-bar__field input {
  border: none; outline: none; background: none; flex: 1; font-size: 0.92rem; color: var(--color-ink);
}

.search-bar__field input::placeholder { color: var(--color-ink-faint); }

.search-bar__filter-btn {
  position: relative;
  width: 46px; height: 46px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  border: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}

.search-bar__filter-btn .dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-saffron);
  border: 1.5px solid var(--color-primary);
  display: none;
}
.search-bar__filter-btn.has-filters .dot { display: block; }

.result-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin: var(--sp-4) 0;
  gap: var(--sp-3);
}

.result-bar .select-native { max-width: 50%; }

.result-bar__count { font-size: 0.84rem; color: var(--color-ink-soft); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-bar__count strong { color: var(--color-primary); font-family: var(--font-mono); }

.chip-row { display: flex; gap: var(--sp-2); overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }

.filter-chip {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--color-border-strong);
  background: var(--color-surface);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-ink-soft);
  white-space: nowrap;
}

.filter-chip.is-active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

.select-native {
  border: 1.5px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--color-surface);
  color: var(--color-ink-soft);
}

/* Filter sheet (bottom sheet on mobile, modal on desktop) */

.sheet-overlay {
  position: fixed; inset: 0;
  background: rgba(10,33,29,0.45);
  z-index: var(--z-sheet);
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.sheet-overlay.is-open { display: flex; }

@media (min-width: 640px) { .sheet-overlay { align-items: center; } }

.sheet {
  background: var(--color-surface);
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: var(--sp-5) var(--sp-5) calc(var(--sp-6) + env(safe-area-inset-bottom, 0px));
  animation: sheet-up 0.22s ease;
}

@media (min-width: 640px) { .sheet { border-radius: var(--radius-lg); } }

@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.sheet__handle { width: 40px; height: 4px; border-radius: var(--radius-pill); background: var(--color-border-strong); margin: 0 auto var(--sp-4); }

@media (min-width: 640px) { .sheet__handle { display: none; } }

.sheet__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-5); }

.sheet__title { font-size: 1.15rem; }

.form-group { margin-bottom: var(--sp-5); }

.form-group:last-child { margin-bottom: 0; }

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-ink-soft);
  margin-bottom: 8px;
}

.seg-group { display: flex; flex-wrap: wrap; gap: 8px; }

.seg-btn {
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--color-border-strong);
  background: var(--color-surface);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-ink-soft);
}

.seg-btn.is-active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

.range-row { display: flex; align-items: center; gap: var(--sp-3); }

.sheet__actions { display: flex; gap: var(--sp-3); margin-top: var(--sp-6); }
.sheet__actions .btn { flex: 1; }

/* Empty state */

.empty-state {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: var(--sp-9) var(--sp-5);
  gap: var(--sp-2);
}

.empty-state__icon {
  width: 78px; height: 78px; border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.9rem;
  margin-bottom: var(--sp-3);
  border: 2px dashed var(--color-border-strong);
}

.empty-state__title { font-size: 1.1rem; }

.empty-state__desc { color: var(--color-ink-soft); font-size: 0.88rem; max-width: 320px; }

.empty-state .btn { margin-top: var(--sp-4); }

/* ============================================================
   Details page
   ============================================================ */

.details-slider { position: relative; border-radius: var(--radius-lg); overflow: hidden; background: var(--color-surface-sunken); }

.details-slider__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.details-slider__track::-webkit-scrollbar { display: none; }

.details-slider__slide { flex: 0 0 100%; scroll-snap-align: start; aspect-ratio: 4/3; position: relative; }

.details-slider__slide img { width: 100%; height: 100%; object-fit: cover; }

.details-slider__fallback {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: var(--color-ink-faint);
  background: var(--color-surface-sunken);
}
.details-slider__fallback i { font-size: 2.4rem; }
.details-slider__fallback span { font-family: var(--font-mono); font-size: 0.7rem; }

.details-slider__dots {
  position: absolute; bottom: var(--sp-3); left: 0; right: 0;
  display: flex; justify-content: center; gap: 6px;
}
.details-slider__dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.6); border: 1px solid rgba(10,33,29,0.3); }
.details-slider__dots span.is-active { background: var(--color-saffron); }

.details-slider__back, .details-slider__like {
  position: absolute; top: var(--sp-3);
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.92);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-ink); border: none; box-shadow: var(--shadow-sm);
  z-index: 2;
}
.details-slider__back { left: var(--sp-3); }
.details-slider__like { right: var(--sp-3); }
.details-slider__like.is-liked { color: var(--color-danger); }

.details-head { margin-top: var(--sp-5); }

.details-badges { display: flex; gap: 8px; align-items: center; margin-bottom: var(--sp-3); flex-wrap: wrap; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 5px 11px; border-radius: var(--radius-pill);
}

.badge-cat { background: var(--color-primary-light); color: var(--color-primary); }
.badge-featured { background: var(--color-saffron-light); color: var(--color-saffron-dark); border: 1px dashed var(--color-saffron-dark); }
.badge-negotiable { background: var(--color-success-light); color: var(--color-success); }

.details-title { font-size: 1.35rem; line-height: 1.3; margin-bottom: var(--sp-2); }

.details-loc { display: flex; align-items: center; gap: 6px; color: var(--color-ink-soft); font-size: 0.88rem; }
.details-loc i { color: var(--color-gold); }

.details-price-strip {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  margin: var(--sp-5) 0;
  padding: var(--sp-4) var(--sp-5);
  background: var(--color-primary);
  border-radius: var(--radius-md);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.details-price-strip::before {
  content: "";
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(-45deg, rgba(255,255,255,0.035) 0 10px, transparent 10px 20px);
}
.details-price-strip__value { font-family: var(--font-mono); font-weight: 700; font-size: 1.6rem; position: relative; }
.details-price-strip__value small { font-size: 0.9rem; font-weight: 600; opacity: 0.75; margin-right: 4px; }
.details-price-strip__meta { text-align: right; font-size: 0.72rem; color: rgba(255,255,255,0.7); position: relative; font-family: var(--font-mono); }

.details-actions { display: flex; gap: var(--sp-3); margin-bottom: var(--sp-7); }
.details-actions .btn { flex: 1; }

.details-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--sp-5);
  margin-bottom: var(--sp-5);
}

.details-panel__title {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--color-gold-dark); margin-bottom: var(--sp-4);
  display: flex; align-items: center; gap: 8px;
}
.details-panel__title::after { content: ""; flex: 1; border-top: 1px dashed var(--color-border-strong); }

.details-desc { font-size: 0.92rem; line-height: 1.7; color: var(--color-ink-soft); white-space: pre-line; }

.spec-ledger { display: flex; flex-direction: column; }

.spec-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px dashed var(--color-border);
  font-size: 0.86rem;
}
.spec-row:last-child { border-bottom: none; }
.spec-row__label { color: var(--color-ink-soft); }
.spec-row__value { font-family: var(--font-mono); font-weight: 700; color: var(--color-ink); text-align: right; }

.seller-card { display: flex; align-items: center; gap: var(--sp-4); }

.seller-card__avatar {
  width: 54px; height: 54px; border-radius: 50%; flex-shrink: 0;
  background: var(--color-gold-light); color: var(--color-gold-dark);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.3rem;
  border: 2px dashed var(--color-gold);
}

.seller-card__info { flex: 1; min-width: 0; }
.seller-card__name { font-weight: 700; font-size: 0.98rem; margin-bottom: 3px; }
.seller-card__since { font-size: 0.76rem; color: var(--color-ink-faint); font-family: var(--font-mono); }

.report-link {
  display: flex; align-items: center; gap: 6px; justify-content: center;
  font-size: 0.8rem; color: var(--color-ink-faint); font-weight: 600;
  padding: var(--sp-3) 0;
}

/* ============================================================
   Create-ad form
   ============================================================ */

.form-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
}

@media (min-width: 768px) { .form-card { padding: var(--sp-7); } }

.text-input, .textarea-input, .select-input {
  width: 100%;
  border: 1.5px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  font-size: 0.94rem;
  background: var(--color-surface);
  transition: border-color 0.15s ease;
}
.text-input:focus, .textarea-input:focus, .select-input:focus { border-color: var(--color-gold); outline: none; }

.textarea-input { resize: vertical; min-height: 110px; }

.price-input-wrap { position: relative; }
.price-input-wrap .prefix {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); font-weight: 700; color: var(--color-ink-faint);
}
.price-input-wrap input { padding-left: 42px; font-family: var(--font-mono); font-weight: 700; }

.check-row { display: flex; align-items: center; gap: 10px; }
.check-row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--color-primary); }
.check-row label { font-size: 0.88rem; font-weight: 600; color: var(--color-ink-soft); }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }

.image-upload-row { display: flex; gap: var(--sp-3); }

.image-slot {
  position: relative;
  flex: 1;
  aspect-ratio: 1;
  border: 1.5px dashed var(--color-border-strong);
  border-radius: var(--radius-md);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: var(--color-ink-faint);
  overflow: hidden;
  background: var(--color-bg-alt);
}

.image-slot i { font-size: 1.3rem; }
.image-slot span { font-size: 0.62rem; font-weight: 700; }
.image-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.image-slot input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.image-slot__remove {
  position: absolute; top: 4px; right: 4px; z-index: 2;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(10,33,29,0.75); color: #fff; border: none;
  display: none; align-items: center; justify-content: center; font-size: 0.68rem;
}
.image-slot.has-image .image-slot__remove { display: flex; }

.specs-fieldset { border: 1px dashed var(--color-border-strong); border-radius: var(--radius-md); padding: var(--sp-4); margin-bottom: var(--sp-5); }
.specs-fieldset legend { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-gold-dark); padding: 0 6px; }

/* ============================================================
   Login page
   ============================================================ */

.auth-wrap {
  max-width: 420px;
  margin: 0 auto;
  padding-top: var(--sp-6);
}

.auth-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-7) var(--sp-6);
  box-shadow: var(--shadow-md);
  position: relative;
}

.auth-card::before {
  content: "";
  position: absolute; top: 14px; left: 14px; right: 14px; bottom: 14px;
  border: 1.5px dashed var(--color-border);
  border-radius: calc(var(--radius-lg) - 6px);
  pointer-events: none;
}

.auth-seal {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-saffron);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  margin: 0 auto var(--sp-4);
  border: 3px double var(--color-saffron);
}

.auth-title { text-align: center; font-size: 1.35rem; margin-bottom: 4px; }
.auth-subtitle { text-align: center; color: var(--color-ink-soft); font-size: 0.88rem; margin-bottom: var(--sp-6); }

.auth-tabs { display: flex; background: var(--color-bg-alt); border-radius: var(--radius-pill); padding: 4px; margin-bottom: var(--sp-6); }
.auth-tab { flex: 1; text-align: center; padding: 10px; border-radius: var(--radius-pill); border: none; background: none; font-weight: 700; font-size: 0.86rem; color: var(--color-ink-soft); }
.auth-tab.is-active { background: var(--color-surface); color: var(--color-primary); box-shadow: var(--shadow-sm); }

.auth-hint {
  display: flex; gap: 8px; align-items: flex-start;
  background: var(--color-saffron-light);
  border: 1px dashed var(--color-saffron-dark);
  border-radius: var(--radius-sm);
  padding: var(--sp-3);
  font-size: 0.76rem;
  color: var(--color-gold-dark);
  margin-top: var(--sp-5);
}

/* ============================================================
   Profile page
   ============================================================ */

.profile-header {
  display: flex; align-items: center; gap: var(--sp-4);
  background: var(--color-primary);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.profile-header::after {
  content: "";
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.03) 0 12px, transparent 12px 24px);
}

.profile-avatar {
  width: 68px; height: 68px; border-radius: 50%; flex-shrink: 0;
  background: var(--color-saffron);
  color: var(--color-primary-dark);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.6rem;
  border: 3px solid rgba(255,255,255,0.35);
  position: relative;
  z-index: 1;
}

.profile-info { position: relative; z-index: 1; min-width: 0; flex: 1; }
.profile-name { color: #fff; font-size: 1.15rem; margin-bottom: 2px; }
.profile-phone { font-family: var(--font-mono); font-size: 0.78rem; color: rgba(255,255,255,0.75); }
.profile-since { font-size: 0.72rem; color: rgba(255,255,255,0.6); margin-top: 4px; font-family: var(--font-mono); }

.profile-stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); margin: var(--sp-5) 0; }

.stat-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--sp-4); text-align: center; }
.stat-card__value { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 700; color: var(--color-primary); }
.stat-card__label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-ink-soft); margin-top: 4px; }

.tabs { display: flex; border-bottom: 1.5px solid var(--color-border); margin-bottom: var(--sp-5); }
.tab-btn { padding: 12px var(--sp-4); border: none; background: none; font-weight: 700; font-size: 0.88rem; color: var(--color-ink-faint); border-bottom: 2.5px solid transparent; margin-bottom: -1.5px; }
.tab-btn.is-active { color: var(--color-primary); border-color: var(--color-gold); }

.myad-row {
  display: flex; gap: var(--sp-3);
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: var(--sp-3); margin-bottom: var(--sp-3);
  align-items: center;
}
.myad-row__img { width: 68px; height: 68px; border-radius: var(--radius-sm); overflow: hidden; flex-shrink: 0; background: var(--color-surface-sunken); display: flex; align-items: center; justify-content: center; color: var(--color-ink-faint); position: relative; }
.myad-row__img img { width: 100%; height: 100%; object-fit: cover; }
.myad-row__body { flex: 1; min-width: 0; }
.myad-row__title { font-weight: 600; font-size: 0.86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }
.myad-row__price { font-family: var(--font-mono); font-weight: 700; color: var(--color-primary); font-size: 0.88rem; }
.myad-row__actions { display: flex; gap: 6px; flex-shrink: 0; }

.account-list { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; }
.account-row { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-4); border-bottom: 1px solid var(--color-border); font-size: 0.88rem; }
.account-row:last-child { border-bottom: none; }
.account-row__label { color: var(--color-ink-soft); font-weight: 600; }
.account-row__value { font-family: var(--font-mono); font-weight: 600; }

/* ============================================================
   Toasts
   ============================================================ */

.toast-stack {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--bottom-nav-height) + 18px + env(safe-area-inset-bottom, 0px));
  z-index: var(--z-toast);
  display: flex; flex-direction: column; gap: 8px;
  width: min(92vw, 380px);
}

@media (min-width: 900px) { .toast-stack { bottom: 24px; } }

.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--color-primary-dark);
  color: #fff;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.22s ease;
}

.toast i { color: var(--color-saffron); }
.toast.is-error { background: var(--color-danger); }
.toast.is-error i { color: #fff; }

@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   Login-required / gate panel (used on create-ad, saved, profile)
   ============================================================ */

.gate-panel {
  max-width: 420px; margin: var(--sp-8) auto 0;
  text-align: center;
  background: var(--color-surface);
  border: 1.5px dashed var(--color-border-strong);
  border-radius: var(--radius-lg);
  padding: var(--sp-8) var(--sp-6);
}

.gate-panel__icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--color-primary-light); color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; margin: 0 auto var(--sp-4);
}

.gate-panel__title { font-size: 1.15rem; margin-bottom: 6px; }
.gate-panel__desc { color: var(--color-ink-soft); font-size: 0.88rem; margin-bottom: var(--sp-5); }

/* ============================================================
   Misc utility
   ============================================================ */

.flex-between { display: flex; align-items: center; justify-content: space-between; }
.mt-0 { margin-top: 0 !important; }
.text-center { text-align: center; }
.hide-mobile { display: none; }
@media (min-width: 900px) { .hide-mobile { display: initial; } .hide-desktop { display: none; } }

/* ============================================================
   extra.css merge — page-level additions
   ============================================================ */

button { margin: 0; }

.page-header { margin-bottom: var(--sp-6); }
.page-header__title { font-size: 1.55rem; overflow-wrap: break-word; word-wrap: break-word; }
.page-header__desc { color: var(--color-ink-soft); font-size: 0.9rem; margin-top: 4px; max-width: 60ch; }

.lang-switch__opt-label { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.lang-switch__opt-native { font-size: 0.92rem; }
.lang-switch__opt-code {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: var(--color-ink-faint);
}
.lang-switch__opt.is-current .lang-switch__opt-code { color: var(--color-gold); }

.site-footer {
  margin-top: var(--sp-9);
  background: var(--color-primary-dark);
  color: rgba(255, 255, 255, 0.82);
  padding: var(--sp-8) 0;
  position: relative;
  overflow: hidden;
}

@media (max-width: 899px) { .site-footer { display: none; } }
.site-footer::before {
  content: "";
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(-45deg, rgba(255,255,255,0.025) 0 12px, transparent 12px 24px);
  pointer-events: none;
}
.site-footer__inner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-7);
  justify-content: space-between;
}
.site-footer__brand { max-width: 320px; }
.site-footer__brand .brand { color: #fff; margin-bottom: var(--sp-3); }
.site-footer__brand .brand__mark { background: var(--color-saffron); color: var(--color-primary-dark); }
.site-footer__brand p { font-size: 0.84rem; line-height: 1.65; color: rgba(255, 255, 255, 0.58); }
.site-footer__col { min-width: 140px; }
.site-footer__col-title {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-saffron);
  margin-bottom: var(--sp-3);
}
.site-footer__links { display: flex; flex-direction: column; gap: 11px; }
.site-footer__links a { font-size: 0.87rem; color: rgba(255, 255, 255, 0.72); transition: color 0.15s ease; }
.site-footer__links a:hover { color: #fff; }
.site-footer__links a i { width: 16px; margin-right: 6px; color: var(--color-saffron); font-size: 0.78rem; }
.site-footer__bottom {
  position: relative;
  margin-top: var(--sp-7);
  padding-top: var(--sp-5);
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.45);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-2);
  font-family: var(--font-mono);
}
.stack-gap-sm { display: flex; flex-direction: column; gap: var(--sp-3); }
.text-danger { color: var(--color-danger); }

/* Form hints */
.form-hint { font-size: 0.78rem; color: var(--color-ink-faint); margin-top: 4px; }