/* ── CSS Variables ─────────────────────────────────────────────── */
:root {
  --primary:       #1C1B3A;
  --accent:        #F0A500;
  --accent-light:  #FFF3CC;
  --text:          #1a1a2e;
  --text-muted:    #6b7280;
  --border:        #e5e7eb;
  --bg:            #f8f9fb;
  --card-bg:       #ffffff;
  --radius:        12px;
  --radius-sm:     8px;
  --shadow:        0 1px 6px rgba(0,0,0,0.08);
  --shadow-md:     0 4px 16px rgba(0,0,0,0.12);
  --header-h:      160px;
  --bottom-nav-h:  64px;
  --font:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: var(--font); cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: var(--font); font-size: 1rem; }
ul { list-style: none; }

/* ── Header ────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 6px;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 0;
  font-weight: 900;
  font-size: 1.45rem;
  letter-spacing: -0.5px;
}
.logo-icon {
  background: var(--accent);
  color: var(--primary);
  font-weight: 900;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 1rem;
  margin-right: 6px;
}
.logo-adz  { color: #fff; }
.logo-city { color: var(--accent); }

.header-right {
  display: flex;
  align-items: center;
  gap: 4px;
}
.header-icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 8px;
  color: rgba(255,255,255,0.85);
  font-size: 0.65rem;
  border-radius: 6px;
  transition: background 0.15s;
}
.header-icon-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.header-icon-btn svg   { stroke: currentColor; }
.icon-label { font-size: 0.62rem; }

.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 6px;
  border-radius: 6px;
}
.hamburger-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: rgba(255,255,255,0.85);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.hamburger-btn.open span:nth-child(1) { transform: rotate(45deg) translate(4px,4px); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; }
.hamburger-btn.open span:nth-child(3) { transform: rotate(-45deg) translate(4px,-4px); }

/* Location */
.location-bar {
  padding: 4px 16px 0;
}
.location-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  color: rgba(255,255,255,0.85);
  font-size: 0.85rem;
  font-weight: 500;
}
.location-btn svg { stroke: var(--accent); }

/* Search */
.header-search {
  padding: 8px 16px;
}
.search-form-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}
.search-input-wrap {
  flex: 1;
  position: relative;
}
.search-icon-inner {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  stroke: var(--text-muted);
  pointer-events: none;
}
.search-input-wrap input {
  width: 100%;
  padding: 10px 12px 10px 38px;
  border-radius: 10px;
  border: none;
  background: #fff;
  font-size: 0.9rem;
  color: var(--text);
  outline: none;
}
.post-ad-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--accent);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 10px 14px;
  border-radius: 10px;
  white-space: nowrap;
}

/* Search suggestions */
.search-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 300;
  max-height: 240px;
  overflow-y: auto;
}
.search-suggestions a {
  display: block;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text);
}
.search-suggestions a:hover { background: var(--bg); }

/* Category chips */
.header-cats {
  padding: 6px 0 10px;
}
.cats-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px;
  scrollbar-width: none;
}
.cats-scroll::-webkit-scrollbar { display: none; }
.cat-chip {
  flex-shrink: 0;
  padding: 6px 14px;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.9);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s;
}
.cat-chip:hover,
.cat-chip.active { background: var(--accent); color: var(--primary); }
.cat-more { background: transparent; border: 1px solid rgba(255,255,255,0.3); }

/* ── Slide Nav ──────────────────────────────────────────────────── */
.slide-nav {
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100%;
  background: #fff;
  z-index: 500;
  transition: right 0.28s cubic-bezier(0.4,0,0.2,1);
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
  overflow-y: auto;
}
.slide-nav.open { right: 0; }
.slide-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 499;
  display: none;
  backdrop-filter: blur(2px);
}
.slide-nav-overlay.visible { display: block; }

.slide-nav-inner { padding: 16px; }
.slide-nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.nav-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.nav-user-name { font-weight: 700; font-size: 0.95rem; }
.nav-profile-link { color: var(--accent); font-size: 0.8rem; }
.nav-auth-links { display: flex; gap: 8px; }

.slide-nav-links li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  transition: background 0.15s;
}
.slide-nav-links li a:hover { background: var(--bg); }

/* ── Bottom Nav ─────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-h);
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
}
.bnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: color 0.15s;
  padding: 6px 0;
}
.bnav-item.active,
.bnav-item:hover { color: var(--primary); }
.bnav-item svg { stroke: currentColor; }
.bnav-post { position: relative; }
.bnav-post-btn {
  width: 52px;
  height: 52px;
  background: var(--primary);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  margin-top: -20px;
  box-shadow: 0 4px 12px rgba(28,27,58,0.4);
}
.bnav-post-btn svg { fill: #fff; }
.bnav-icon-wrap { position: relative; display: inline-block; }
.bnav-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  background: #ef4444;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  padding: 0 3px;
}

/* ── Main content ───────────────────────────────────────────────── */
.site-main {
  min-height: 60vh;
  padding-bottom: 24px;
}
.page-content-wrap,
.home-wrap {
  max-width: 700px;
  margin: 0 auto;
}

/* ── Sections ───────────────────────────────────────────────────── */
.section-top-listings,
.section-category-ads {
  padding: 20px 16px 0;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-header h2 { font-size: 1.1rem; font-weight: 700; }
.see-all { font-size: 0.85rem; color: var(--accent); font-weight: 600; }

/* ── Ad Cards (Masonry/2-col) ───────────────────────────────────── */
.ads-masonry {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ad-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px 12px;
  box-shadow: var(--shadow);
  position: relative;
  transition: box-shadow 0.15s, transform 0.15s;
  border: 1px solid var(--border);
}
.ad-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.ad-card-wide {
  grid-column: 1 / -1;
}
.ad-card-body { display: flex; flex-direction: column; gap: 6px; }
.ad-title a {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ad-location {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 3px;
}
.ad-price {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
}
.ad-time { font-size: 0.72rem; color: var(--text-muted); }

/* Badge */
.ad-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-featured { background: var(--accent-light); color: #92600a; }
.badge-premium  { background: #e8f5e9; color: #1b5e20; }
.badge-urgent   { background: #fce4ec; color: #880e4f; }

/* Bookmark btn */
.bookmark-btn,
.bookmark-btn-lg {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  opacity: 0.4;
  transition: opacity 0.15s, transform 0.15s;
}
.bookmark-btn { position: absolute; top: 10px; right: 10px; }
.bookmark-btn.bookmarked,
.bookmark-btn-lg.bookmarked { opacity: 1; }
.bookmark-btn:hover,
.bookmark-btn-lg:hover { opacity: 0.8; transform: scale(1.15); }

/* ── Listings (text mode / thumb mode) ──────────────────────────── */
.ads-list { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; }
.ads-list .ad-card { display: flex; flex-direction: row; gap: 12px; align-items: flex-start; }
.ads-list .ad-card-body { flex: 1; }
.ads-list .ad-thumb-container { display: none; }
.ads-list.show-thumbs .ad-thumb-container { display: block; }
.ad-thumb-img { width: 80px; height: 70px; object-fit: cover; border-radius: var(--radius-sm); flex-shrink: 0; }

/* ── Horizontal scroll row ──────────────────────────────────────── */
.ads-row-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.ads-row-scroll::-webkit-scrollbar { display: none; }
.ad-scroll-card {
  flex-shrink: 0;
  width: 160px;
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.ad-scroll-card img { width: 100%; height: 100px; object-fit: cover; }
.scroll-card-body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 4px; }
.scroll-card-body h4 { font-size: 0.82rem; font-weight: 600; line-height: 1.3; }
.ad-location-sm { font-size: 0.72rem; color: var(--text-muted); }
.ad-price-sm { font-size: 0.82rem; font-weight: 700; color: var(--primary); }

/* ── Price formatting ───────────────────────────────────────────── */
.price-tag { font-size: 0.72rem; font-weight: 400; margin-left: 3px; }
.price-tag.negotiable { color: #d97706; }
.price-tag.per-period { color: var(--text-muted); }
.price-tag.contact { font-size: 0.95rem; font-weight: 700; color: #16a34a; }

/* ── Filters ────────────────────────────────────────────────────── */
.listings-header { padding: 12px 16px 0; background: #fff; border-bottom: 1px solid var(--border); }
.filter-top-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.inline-filters { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.filter-group { display: flex; align-items: center; gap: 6px; }
.filter-select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  background: #fff;
  color: var(--text);
  outline: none;
  cursor: pointer;
}
.price-range { gap: 4px; align-items: center; }
.price-range input { width: 90px; padding: 8px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.82rem; }
.filter-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.thumb-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  background: #fff;
  white-space: nowrap;
}
.thumb-toggle:hover { background: var(--bg); }
.filter-drawer-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  position: relative;
}
.filter-active-dot {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  position: absolute;
  top: 6px; right: 6px;
}
.listings-search { margin-bottom: 10px; }
.search-inner {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.search-inner .search-input { flex: 1; border: none; padding: 10px 14px; background: transparent; outline: none; font-size: 0.9rem; }
.search-inner .search-btn { padding: 0 14px; background: none; border: none; font-size: 1.1rem; cursor: pointer; }
.result-count { font-size: 0.82rem; color: var(--text-muted); padding-bottom: 10px; }

/* Drawer */
.filter-drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 300; }
.filter-drawer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-radius: 20px 20px 0 0;
  z-index: 301;
  max-height: 85vh;
  overflow-y: auto;
}
.drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.drawer-header h3 { font-size: 1.05rem; font-weight: 700; }
.drawer-header button { font-size: 1.5rem; line-height: 1; color: var(--text-muted); }
.drawer-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
body.drawer-open { overflow: hidden; }

/* ── Single Ad ──────────────────────────────────────────────────── */
.ad-single-wrap { max-width: 900px; margin: 0 auto; padding: 16px; }
.breadcrumb { font-size: 0.78rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.breadcrumb a { color: var(--accent); }
.bc-current { color: var(--text-muted); }

.ad-single-layout { display: flex; flex-direction: column; gap: 20px; }

/* Gallery */
.ad-gallery { border-radius: var(--radius); overflow: hidden; }
.gallery-main {
  position: relative;
  background: #f3f4f6;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4/3;
}
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.3rem;
  display: grid;
  place-items: center;
}
.gallery-nav.prev { left: 10px; }
.gallery-nav.next { right: 10px; }
.gallery-counter {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.78rem;
  padding: 4px 8px;
  border-radius: 12px;
}
.gallery-thumbs { display: flex; gap: 6px; padding: 8px 0; }
.gallery-thumb { width: 60px; height: 50px; object-fit: cover; border-radius: 6px; cursor: pointer; opacity: 0.6; border: 2px solid transparent; transition: opacity 0.15s, border-color 0.15s; }
.gallery-thumb.active { opacity: 1; border-color: var(--accent); }

.ad-single-header { background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.ad-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.ad-single-title { font-size: 1.2rem; font-weight: 700; line-height: 1.3; }
.ad-single-price { font-size: 1.5rem; font-weight: 800; color: var(--primary); margin: 8px 0; }
.ad-meta-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.meta-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--bg); padding: 4px 10px; border-radius: 20px; font-size: 0.78rem; color: var(--text-muted); }

.ad-single-desc { background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.ad-single-desc h3 { font-size: 1rem; font-weight: 700; margin-bottom: 10px; }
.ad-single-desc p, .ad-single-desc li { margin-bottom: 8px; color: var(--text); font-size: 0.93rem; }
.ad-single-desc ul { list-style: disc; padding-left: 20px; }

.ad-single-location-box { background: #fff; border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.ad-single-location-box h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 6px; }

.safety-tips { background: #fff9e6; border-radius: var(--radius); padding: 14px; border: 1px solid #fde68a; }
.safety-tips h4 { font-size: 0.88rem; font-weight: 700; margin-bottom: 8px; color: #92600a; }
.safety-tips li { font-size: 0.82rem; color: #78350f; padding: 3px 0 3px 12px; position: relative; }
.safety-tips li::before { content: '✓'; position: absolute; left: 0; color: #d97706; }

/* Seller card */
.seller-card { background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.seller-info { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.seller-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.seller-name { font-weight: 700; font-size: 0.95rem; }
.seller-profile-link { font-size: 0.8rem; color: var(--accent); }

.btn-call { display: block; background: #16a34a; color: #fff; padding: 12px; border-radius: var(--radius-sm); font-size: 0.93rem; font-weight: 700; text-align: center; margin-bottom: 8px; }
.btn-call:hover { background: #15803d; }
.btn-message { display: block; border: 2px solid var(--primary); color: var(--primary); padding: 12px; border-radius: var(--radius-sm); font-size: 0.93rem; font-weight: 700; text-align: center; width: 100%; background: #fff; cursor: pointer; }
.btn-message:hover { background: var(--primary); color: #fff; }
.own-ad-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.btn-danger { background: #fee2e2; color: #dc2626; font-size: 0.9rem; font-weight: 600; padding: 10px; border-radius: var(--radius-sm); width: 100%; }
.btn-danger:hover { background: #dc2626; color: #fff; }

/* Share */
.share-card { background: #fff; border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.share-card h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 10px; }
.share-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.share-btn { padding: 8px 14px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.share-btn.whatsapp { background: #dcfce7; color: #16a34a; }
.share-btn.facebook { background: #dbeafe; color: #1d4ed8; }
.share-btn.copy-link { background: var(--bg); color: var(--text); border: 1px solid var(--border); }

/* Related */
.related-ads { padding: 20px 16px; }

/* ── Auth ───────────────────────────────────────────────────────── */
.adzcity-auth-wrap { min-height: 80vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; background: #fff; border-radius: 20px; padding: 32px 28px; box-shadow: var(--shadow-md); border: 1px solid var(--border); }
.auth-logo { font-size: 1.6rem; font-weight: 900; margin-bottom: 16px; display: flex; align-items: center; gap: 2px; }
.auth-logo .logo-icon { width: 36px; height: 36px; }
.auth-logo .logo-adz  { color: var(--primary); }
.auth-logo .logo-city { color: var(--accent); }
.auth-card h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 4px; }
.auth-sub { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 24px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 0.88rem; color: var(--text-muted); }
.auth-footer a { color: var(--accent); font-weight: 600; }

/* ── Forms ──────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group label { font-size: 0.88rem; font-weight: 600; color: var(--text); }
.form-group input:not([type=checkbox]):not([type=file]),
.form-group select,
.form-group textarea {
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.93rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #fff;
  width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(28,27,58,0.08); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-row-between { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; cursor: pointer; }
.forgot-link { font-size: 0.84rem; color: var(--accent); }
.req { color: #ef4444; }
.char-count { font-size: 0.75rem; color: var(--text-muted); align-self: flex-end; }

.input-eye { position: relative; }
.input-eye input { padding-right: 44px !important; }
.toggle-pw {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
}

/* Password strength */
.pw-strength {
  font-size: 0.75rem;
  font-weight: 600;
  height: 18px;
  padding-top: 2px;
}
.pw-weak   { color: #dc2626; }
.pw-fair   { color: #d97706; }
.pw-good   { color: #2563eb; }
.pw-strong { color: #16a34a; }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.93rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: background 0.15s, transform 0.1s;
  text-decoration: none;
}
.btn-primary:hover { background: #2d2c52; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.6; cursor: default; transform: none; }
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--bg);
  color: var(--text);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.93rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  transition: background 0.15s;
}
.btn-secondary:hover { background: #e9eaf2; }
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  color: var(--primary);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--primary);
  transition: all 0.15s;
}
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-full { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 0.82rem; }

/* ── Messages ────────────────────────────────────────────────────── */
.adzcity-msg { padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: 0.88rem; }
.msg-success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.msg-error   { background: #fee2e2; color: #dc2626; border: 1px solid #fca5a5; }

/* ── Empty state ─────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.empty-state .empty-icon { font-size: 3rem; }
.empty-state h3 { font-size: 1.1rem; font-weight: 700; }
.empty-state p  { color: var(--text-muted); font-size: 0.9rem; }

/* ── Pagination ──────────────────────────────────────────────────── */
.adzcity-pagination { padding: 16px; }
.adzcity-pagination .page-numbers { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; list-style: none; }
.adzcity-pagination .page-numbers li a,
.adzcity-pagination .page-numbers li span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 0.88rem;
  font-weight: 600;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
}
.adzcity-pagination .page-numbers li .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Profiles ────────────────────────────────────────────────────── */
.adzcity-profile-wrap { max-width: 720px; margin: 0 auto; padding: 16px; }
.profile-header { display: flex; gap: 16px; align-items: flex-start; background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); border: 1px solid var(--border); margin-bottom: 16px; }
.profile-avatar-wrap { position: relative; flex-shrink: 0; }
.profile-avatar { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 3px solid var(--border); }
.avatar-change-btn { position: absolute; bottom: 0; right: 0; font-size: 0.9rem; cursor: pointer; background: #fff; border-radius: 50%; width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--border); }
.profile-info { flex: 1; }
.profile-info h1 { font-size: 1.2rem; font-weight: 800; }
.profile-city, .profile-joined { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }
.profile-phone a { color: var(--accent); font-weight: 600; }
.profile-actions { display: flex; flex-direction: column; gap: 8px; }
.profile-bio { background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); border: 1px solid var(--border); margin-bottom: 16px; font-size: 0.9rem; color: var(--text-muted); }
.profile-stats { display: flex; gap: 1px; background: var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
.stat { flex: 1; background: #fff; padding: 14px; text-align: center; }
.stat-n { display: block; font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.stat-l { font-size: 0.78rem; color: var(--text-muted); }
.profile-ads-section h2 { font-size: 1.05rem; font-weight: 700; margin-bottom: 14px; }

/* ── Ads Grid ────────────────────────────────────────────────────── */
.ads-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.ad-grid-card { background: var(--card-bg); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--border); }
.grid-thumb { width: 100%; height: 110px; object-fit: cover; }
.grid-card-body { padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.grid-card-body h3 { font-size: 0.85rem; font-weight: 600; line-height: 1.3; }

/* ── Messages page ───────────────────────────────────────────────── */
.adzcity-messages-wrap { padding: 0; }
.messages-layout { display: flex; height: calc(100vh - var(--header-h) - var(--bottom-nav-h)); }
.thread-list { width: 100%; border-right: 1px solid var(--border); overflow-y: auto; background: #fff; display: flex; flex-direction: column; }
.thread-list-header { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.thread-list-header h2 { font-size: 1.05rem; font-weight: 700; }
.thread-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  position: relative;
  transition: background 0.1s;
}
.thread-item:hover,
.thread-item.active { background: #f3f4ff; }
.thread-avatar { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; object-fit: cover; }
.thread-body { flex: 1; overflow: hidden; }
.thread-top { display: flex; justify-content: space-between; align-items: center; }
.thread-name { font-weight: 700; font-size: 0.9rem; }
.thread-time { font-size: 0.72rem; color: var(--text-muted); }
.thread-ad { font-size: 0.75rem; color: var(--accent); margin: 1px 0; }
.thread-preview { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unread-badge {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: grid;
  place-items: center;
}

.chat-panel { flex: 1; display: flex; flex-direction: column; background: var(--bg); }
.chat-header { padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.back-btn { font-size: 1.3rem; color: var(--text); }
.chat-avatar { width: 38px; height: 38px; border-radius: 50%; }
.chat-user-info { display: flex; align-items: center; gap: 10px; }
.chat-user-name { font-weight: 700; font-size: 0.93rem; }
.chat-ad-title { font-size: 0.75rem; color: var(--accent); }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { display: flex; align-items: flex-end; gap: 8px; }
.chat-msg.mine { flex-direction: row-reverse; }
.msg-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.msg-bubble { max-width: 70%; }
.msg-text { padding: 10px 14px; border-radius: 18px; font-size: 0.9rem; line-height: 1.4; word-break: break-word; }
.chat-msg.mine .msg-text  { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.theirs .msg-text{ background: #fff; border: 1px solid var(--border); color: var(--text); border-bottom-left-radius: 4px; }
.msg-time { font-size: 0.68rem; color: var(--text-muted); margin-top: 3px; }
.chat-msg.mine .msg-time { text-align: right; }
.chat-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid var(--border);
}
.chat-input-bar textarea {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 10px 14px;
  font-size: 0.9rem;
  resize: none;
  outline: none;
  max-height: 120px;
  overflow-y: auto;
}
.chat-input-bar textarea:focus { border-color: var(--primary); }
.send-btn {
  width: 42px;
  height: 42px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.send-btn:disabled { opacity: 0.4; }

/* ── My Ads ──────────────────────────────────────────────────────── */
.adzcity-myads-wrap { padding: 16px; max-width: 700px; margin: 0 auto; }
.page-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.status-tabs { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 16px; }
.status-tab { padding: 8px 16px; border-radius: 20px; font-size: 0.82rem; font-weight: 600; color: var(--text-muted); background: #fff; border: 1px solid var(--border); white-space: nowrap; }
.status-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.my-ads-list { display: flex; flex-direction: column; gap: 10px; }
.my-ad-card { display: flex; align-items: flex-start; gap: 12px; background: #fff; border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.my-ad-thumb img { width: 70px; height: 60px; object-fit: cover; border-radius: var(--radius-sm); }
.my-ad-info { flex: 1; }
.my-ad-info h3 { font-size: 0.9rem; font-weight: 700; line-height: 1.35; }
.my-ad-info h3 a { color: var(--text); }
.my-ad-meta { font-size: 0.78rem; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 4px; }
.dot { color: var(--border); }
.status-tag { display: inline-block; font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.status-tag.expired { background: #fee2e2; color: #dc2626; }
.my-ad-actions { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.action-btn { font-size: 1rem; padding: 6px; border-radius: 6px; }
.action-btn:hover { background: var(--bg); }

/* ── Post Ad ─────────────────────────────────────────────────────── */
.adzcity-post-ad-wrap { max-width: 640px; margin: 0 auto; padding: 16px; }
.page-header h1 { font-size: 1.3rem; font-weight: 800; margin-bottom: 20px; }
.form-section { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); border: 1px solid var(--border); margin-bottom: 14px; }
.form-section h3 { font-size: 1rem; font-weight: 700; margin-bottom: 16px; }
.optional { font-size: 0.8rem; color: var(--text-muted); font-weight: 400; }

.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cat-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; transition: all 0.15s; text-align: center; }
.cat-item:hover, .cat-item.active { border-color: var(--primary); background: #f3f4ff; }
.cat-item.active { border-color: var(--primary); background: var(--primary); color: #fff; }
.cat-icon { font-size: 1.4rem; }
.cat-name { font-size: 0.72rem; font-weight: 600; }

.price-row { display: flex; gap: 10px; }
.flex-1 { flex: 1; }
.price-input-wrap { position: relative; }
.currency-prefix { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-weight: 700; color: var(--text-muted); }
.price-input-wrap input { padding-left: 28px !important; }

.image-upload-area { border: 2px dashed var(--border); border-radius: var(--radius); padding: 12px; }
.image-previews { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.img-thumb { position: relative; width: 70px; height: 70px; border-radius: var(--radius-sm); overflow: hidden; }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.remove-img { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; background: rgba(0,0,0,0.6); color: #fff; border-radius: 50%; font-size: 0.8rem; display: grid; place-items: center; }
.upload-btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 10px; background: var(--bg); border-radius: var(--radius-sm); cursor: pointer; font-size: 0.88rem; font-weight: 600; color: var(--text); }
.upload-btn.hidden { display: none; }

.form-actions { display: flex; gap: 10px; padding: 4px 0 20px; }
.form-actions .btn-primary, .form-actions .btn-secondary { flex: 1; }

/* ── Post Ad preview ─────────────────────────────────────────────── */
.adzcity-preview-wrap { max-width: 800px; margin: 0 auto; padding: 16px; }
.preview-banner { background: #fef9c3; border: 1px solid #fde047; border-radius: var(--radius-sm); padding: 10px 14px; font-size: 0.85rem; color: #854d0e; font-weight: 600; margin-bottom: 16px; }
.preview-actions { display: flex; gap: 10px; margin-top: 20px; padding-bottom: 20px; }
.preview-actions .btn-primary, .preview-actions .btn-secondary { flex: 1; }

/* ── Bookmarks ───────────────────────────────────────────────────── */
.adzcity-bookmarks-wrap { max-width: 700px; margin: 0 auto; padding: 16px; }

/* ── Listings wrap ───────────────────────────────────────────────── */
.adzcity-listings-wrap { max-width: 800px; margin: 0 auto; }
.adzcity-listings-wrap .ad-card { cursor: pointer; }

/* ── Modal ───────────────────────────────────────────────────────── */
.adzcity-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 600;
  display: flex;
  align-items: flex-end;
}
.modal-inner {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 24px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-header h3 { font-size: 1.05rem; font-weight: 700; }
.modal-close { font-size: 1.5rem; color: var(--text-muted); }
#msg-modal-text { width: 100%; border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 12px; font-size: 0.9rem; resize: vertical; outline: none; margin-bottom: 12px; }
#msg-modal-text:focus { border-color: var(--primary); }

/* ── Stars ───────────────────────────────────────────────────────── */
.adzcity-stars { color: var(--accent); font-size: 1rem; letter-spacing: 2px; }
.rating-count { font-size: 0.78rem; color: var(--text-muted); }

/* ── Error page ──────────────────────────────────────────────────── */
.error-page-wrap { min-height: 60vh; display: flex; align-items: center; justify-content: center; }
.error-page-inner { text-align: center; padding: 40px 24px; }
.error-icon { font-size: 3rem; margin-bottom: 8px; }
.error-page-inner h1 { font-size: 5rem; font-weight: 900; color: var(--primary); }
.error-page-inner h2 { font-size: 1.2rem; margin-bottom: 8px; }
.error-page-inner p  { color: var(--text-muted); margin-bottom: 20px; }

/* ── Footer ──────────────────────────────────────────────────────── */
.site-footer { background: var(--primary); color: rgba(255,255,255,0.85); padding-top: 32px; margin-top: 40px; }
.footer-inner { max-width: 900px; margin: 0 auto; padding: 0 16px 24px; display: flex; flex-direction: column; gap: 24px; }
.footer-brand .logo-adz  { color: #fff; font-size: 1.3rem; font-weight: 900; }
.footer-brand .logo-city { color: var(--accent); font-size: 1.3rem; font-weight: 900; }
.footer-brand p { font-size: 0.82rem; margin-top: 8px; color: rgba(255,255,255,0.6); }
.footer-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.footer-col h4 { font-size: 0.82rem; font-weight: 700; color: #fff; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.footer-col li { margin-bottom: 6px; }
.footer-col a { font-size: 0.82rem; color: rgba(255,255,255,0.65); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding: 14px 16px; text-align: center; font-size: 0.78rem; color: rgba(255,255,255,0.5); }

/* ── Loading spinner ─────────────────────────────────────────────── */
.loading-spinner { text-align: center; padding: 24px; color: var(--text-muted); font-size: 0.88rem; }
.empty-state-sm { text-align: center; padding: 30px; color: var(--text-muted); font-size: 0.88rem; }

/* ── Nav unread badge ────────────────────────────────────────────── */
.nav-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  padding: 0 3px;
  margin-right: 4px;
}

/* ── Tablet / Desktop ────────────────────────────────────────────── */
@media (min-width: 640px) {
  .bottom-nav { display: none; }
  body { padding-bottom: 0; }
  .site-header { --header-h: 140px; }
  .header-search .search-form-wrap { max-width: 700px; }
  .ad-single-layout { flex-direction: row; gap: 24px; }
  .ad-single-main { flex: 1; min-width: 0; }
  .ad-single-sidebar { width: 300px; flex-shrink: 0; display: flex; flex-direction: column; gap: 14px; }
  .messages-layout { height: calc(100vh - 140px); }
  .thread-list { width: 320px; min-width: 320px; }
  .ads-masonry { grid-template-columns: repeat(3, 1fr); }
  .ads-grid { grid-template-columns: repeat(3, 1fr); }
  .ads-list { grid-template-columns: 1fr; }
  .modal-inner { margin: auto; border-radius: 20px; }
  .adzcity-modal { align-items: center; }
  .filter-style-sidebar { display: grid; grid-template-columns: 260px 1fr; gap: 16px; padding: 16px; }
  .category-grid { grid-template-columns: repeat(4, 1fr); }
  .auth-card { padding: 40px 36px; }
  .footer-inner { flex-direction: row; }
}
@media (min-width: 900px) {
  .ads-masonry { grid-template-columns: repeat(4, 1fr); }
  .ads-grid    { grid-template-columns: repeat(4, 1fr); }
  .ad-scroll-card { width: 200px; }
  .ad-scroll-card img { height: 130px; }
}
