/* =============================================
   LABuySell.com — Classifieds Style (Light Theme)
   Inspired by losangeles-ads.com
   ============================================= */

:root {
  --blue: #483D8B;
  --blue-light: #6A5ACD;
  --link: #036;
  --link-hover: #06c;
  --bg: #FFFFFF;
  --bg-alt: #f2ffff;
  --bg-page: #f0f0f0;
  --border: #BEBEBE;
  --border-light: #DCDCDC;
  --text: #333;
  --text-muted: #666;
  --sun: #F5A623;
  --sunset: #E8432A;
  --green: #2ECC71;
  --cloud: #F2F2F7;
  --white: #FFFFFF;
  --danger: #E8432A;
  --success: #2ECC71;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.12);
  --font-body: Verdana, Tahoma, Arial, sans-serif;
  --header-h: 52px;
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 12px;
  background: var(--bg-page);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
  overflow-x: hidden;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
img { max-width: 100%; display: block; border: 0; }
button { cursor: pointer; font-family: var(--font-body); }
input, select, textarea { font-family: var(--font-body); font-size: 12px; }
main { display: block; width: 100%; max-width: 1000px; margin: 0 auto; background: var(--white); min-height: calc(100vh - 52px - 200px); }

/* ═══════════════════════════════════
   HEADER
   ═══════════════════════════════════ */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
}
.header-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.logo {
  display: flex;
  align-items: center;
  text-decoration: none !important;
  flex-shrink: 0;
}
.logo-img {
  height: 44px;
  width: auto;
  display: block;
}

.header-nav {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.hbtn {
  display: inline-block;
  padding: 6px 13px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none !important;
  transition: all 0.15s;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  position: relative;
}
.hbtn-safety { background: #e8f5e9; color: #2e7d32; }
.hbtn-safety:hover { background: #c8e6c9; color: #2e7d32; }
.hbtn-post { background: var(--sunset); color: #fff !important; }
.hbtn-post:hover { background: #d03a24; color: #fff !important; }
.hbtn-fav { background: #fff3e0; color: #e65100; }
.hbtn-fav:hover { background: #ffe0b2; color: #e65100; }
.hbtn-login { background: #e3f2fd; color: var(--link); }
.hbtn-login:hover { background: #bbdefb; color: var(--link); }

/* Badge */
.badge {
  background: var(--sunset);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 50px;
  min-width: 16px;
  text-align: center;
}
.badge.hidden { display: none; }

/* User dropdown */
.user-menu-wrap { position: relative; }
.user-menu-btn { font-family: var(--font-body); }
.user-dropdown {
  display: none;
  position: absolute;
  top: 36px;
  right: 0;
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  overflow: hidden;
  z-index: 200;
  border: 1px solid var(--border-light);
}
.user-dropdown.open { display: block; }
.user-dropdown a {
  display: block;
  padding: 9px 14px;
  color: var(--text);
  font-size: 12px;
  transition: background 0.12s;
  text-decoration: none;
}
.user-dropdown a:hover { background: var(--cloud); text-decoration: none; }
.dropdown-divider { height: 1px; background: var(--border-light); }

/* Desktop / Mobile toggles */
.desktop-only { display: flex; }
.mobile-only { display: none !important; }
.mobile-menu-btn {
  background: none;
  border: none;
  padding: 4px;
}

/* Mobile menu */
.mobile-menu {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--white);
  z-index: 500;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
}
.mobile-menu-header button { background:none; border:none; padding:4px; }
.mobile-nav { padding: 12px 16px; }
.mobile-nav a {
  display: block;
  padding: 12px 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  border-bottom: 1px solid var(--border-light);
}
.mobile-nav a:hover { text-decoration: none; color: var(--blue); }
.mobile-post { color: var(--sunset) !important; font-weight: 700 !important; }
.mobile-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
  font-weight: 700;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 4px;
}
.avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.mobile-lang {
  display: flex;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid var(--border-light);
  margin-top: 8px;
}
.mobile-lang a { border: none !important; color: var(--text-muted); font-size: 12px; padding: 4px 10px; border-radius: 50px; }
.mobile-lang a.active { background: var(--blue); color: #fff; }
.mobile-logout { color: var(--sunset) !important; }

/* ═══════════════════════════════════
   3-COLUMN MAIN LAYOUT
   ═══════════════════════════════════ */
.main-layout {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 200px 1fr 200px;
  min-height: 600px;
  background: var(--white);
  border-left: 1px solid #e0e0e0;
  border-right: 1px solid #e0e0e0;
  box-shadow: 0 0 10px rgba(0,0,0,.04);
}

/* ═══ LEFT SIDEBAR ═══ */
.sb-left {
  padding: 14px 10px;
  border-right: 1px solid var(--border-light);
}
.site-title {
  font-size: 16pt;
  font-weight: bold;
  color: var(--blue);
  text-align: center;
  margin-bottom: 14px;
  line-height: 1.25;
}
.sb-btn {
  display: block;
  text-align: center;
  padding: 8px 8px;
  margin-bottom: 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none !important;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  transition: opacity 0.15s;
}
.sb-btn:hover { opacity: 0.85; text-decoration: none; }
.sb-home { background: #e8eaf6; color: var(--blue); border: 1px solid #c5cae9; }
.sb-post { background: var(--sunset); color: #fff; }
.sb-event { background: var(--blue); color: #fff; }
.sb-help { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }

/* Search box */
.sbox {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 10px 8px;
}
.sbox input[type="text"] {
  width: 100%;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: 2px;
  font-size: 11px;
  margin-bottom: 6px;
  outline: none;
}
.sbox input[type="text"]:focus { border-color: var(--blue-light); }
.sbox select {
  width: 100%;
  padding: 6px 4px;
  border: 1px solid var(--border);
  border-radius: 2px;
  font-size: 11px;
  margin-bottom: 6px;
}
.sbtn {
  display: block;
  width: 100%;
  padding: 8px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
}
.sbtn:hover { background: var(--blue-light); }

.sb-label {
  text-align: center;
  font-size: 12px;
  font-weight: bold;
  color: var(--blue);
  margin: 10px 0 4px;
}
.sb-select {
  width: 100%;
  padding: 6px 4px;
  border: 1px solid var(--border);
  border-radius: 2px;
  font-size: 11px;
}
.sb-lang {
  text-align: center;
  margin-top: 12px;
  font-size: 11px;
}
.sb-lang a { color: var(--text-muted); margin: 0 3px; }
.sb-lang a.active { color: var(--blue); font-weight: 700; }
.sb-lang span { color: var(--border); }
.sb-map { text-decoration: none !important; }

/* ═══ MAIN CONTENT ═══ */
.content {
  padding: 10px 16px;
}
.content-heading {
  font-size: 11pt;
  font-weight: normal;
  color: var(--blue);
  text-align: center;
  padding: 4px 0 10px;
}

/* Category directory — 3 columns */
.cat-dir {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0 10px;
  padding: 6px 0 10px;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}
.ci {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 4px;
  border-radius: 2px;
  transition: background 0.12s;
  text-decoration: none !important;
  color: var(--blue);
  font-size: 12px;
}
.ci:hover { background: #f5f5f5; }
.ci-icon {
  font-size: 18px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ci-name { line-height: 1.3; }
.ci-count { font-size: 10px; color: var(--text-muted); font-weight: 400; }

/* Ads section */
.ads-sec { margin-top: 12px; }
.ads-head {
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-bottom: none;
  padding: 8px 12px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}
.ads-head strong { color: var(--blue); }

.ad-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.12s;
  text-decoration: none !important;
  color: inherit;
}
.ad-row:hover { background: #fafafa; }
.ad-thumb {
  width: 55px;
  height: 50px;
  border: 1px solid #e0e0e0;
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ad-thumb-emoji { font-size: 22px; }
.ad-info { flex: 1; min-width: 0; }
.ad-title {
  font-weight: 700;
  color: var(--link);
  font-size: 12px;
  line-height: 1.3;
}
.ad-loc { font-size: 11px; color: #888; margin-top: 1px; }
.ad-price {
  font-weight: 700;
  color: var(--sunset);
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
  text-align: right;
}
.ad-price.free { color: var(--green); }
.ad-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 2px;
  margin-left: 4px;
  vertical-align: middle;
}
.b-feat { background: #fff3e0; color: #e65100; }
.b-new { background: #e8f5e9; color: #2e7d32; }
.b-urgent { background: #fce4ec; color: #c62828; }

.see-all-link {
  color: var(--link);
  font-size: 12px;
  font-weight: 600;
}

/* ═══ RIGHT SIDEBAR ═══ */
.sb-right {
  padding: 12px 8px;
  border-left: 1px solid var(--border-light);
}
.tk-head {
  text-align: center;
  font-weight: bold;
  font-size: 12px;
  color: var(--blue);
  margin-bottom: 5px;
}
.tk-box {
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 14px;
}
.tk-item {
  padding: 6px 7px;
  font-size: 10px;
  font-weight: 700;
  color: var(--blue);
  border-bottom: 1px solid var(--border-light);
  line-height: 1.4;
  overflow: hidden;
}
.tk-item:last-child { border-bottom: none; }
.tk-item:nth-child(odd) { background: var(--bg-alt); }
.tk-item:nth-child(even) { background: var(--bg); }
.tk-item a { color: var(--blue); font-weight: 700; font-size: 10px; text-decoration: none; }
.tk-item a:hover { text-decoration: underline; }
.tk-featured { background: #fff8e1 !important; border-left: 3px solid var(--sun); }
.tk-featured a { color: #e65100 !important; }

.stats-box {
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 10px;
  margin-bottom: 14px;
}
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}
.stat-num { font-weight: 800; font-size: 14px; color: var(--sunset); }
.stat-label { font-size: 11px; color: var(--text-muted); }

/* ═══════════════════════════════════
   POST CTA
   ═══════════════════════════════════ */
.cta-wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 16px;
}
.post-cta {
  background: var(--blue);
  border-radius: var(--radius);
  padding: 30px 28px;
  margin: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.post-cta-text h2 {
  font-size: 16pt;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}
.post-cta-text p { color: rgba(255,255,255,.7); font-size: 12px; }
.cta-btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--sunset);
  color: #fff !important;
  font-weight: 700;
  font-size: 13px;
  border-radius: 4px;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background 0.15s;
}
.cta-btn:hover { background: #d03a24; }

/* ═══════════════════════════════════
   FOOTER
   ═══════════════════════════════════ */
.site-footer {
  max-width: 1000px;
  margin: 0 auto;
  border-top: 1px solid #b3b3b3;
  padding: 14px 16px;
  background: var(--white);
  font-size: 11px;
  text-align: center;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.footer-copy { color: var(--blue); font-weight: 600; }
.footer-links a { color: var(--link); margin: 0 5px; }
.footer-lang a { color: var(--text-muted); margin: 0 2px; }
.footer-lang a.active { color: var(--blue); font-weight: 700; }
.footer-lang span { color: var(--border); }

/* ═══════════════════════════════════
   SHARED COMPONENTS (used across pages)
   ═══════════════════════════════════ */

/* Buttons */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  line-height: 1.2;
}
.btn-primary { background: var(--sunset); color: #fff; }
.btn-primary:hover { background: #d03a24; color: #fff; text-decoration: none; }
.btn-outline { background: transparent; color: var(--blue); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--blue); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text-muted); border: none; }
.btn-ghost:hover { color: var(--text); text-decoration: none; }
.btn-big { padding: 14px 28px; font-size: 14px; border-radius: var(--radius); font-weight: 700; }
.btn-sm { padding: 6px 12px; font-size: 11px; }
.btn-block { width: 100%; justify-content: center; }
.mt-10 { margin-top: 10px; }

/* Auth page buttons */
.auth-page .btn-outline,
.form-page .btn-outline { color: var(--text); border-color: var(--border-light); }

/* Sections (for non-homepage pages) */
.section {
  padding: 30px 24px;
  background: var(--white);
}
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 8px;
}
.section-title {
  font-size: 14pt;
  font-weight: 800;
  color: var(--blue);
}
.result-count { font-weight: 400; color: var(--text-muted); font-size: 11px; margin-left: 6px; }
.see-all { color: var(--link); font-weight: 500; font-size: 12px; }

/* Breadcrumb */
.breadcrumb { font-size: 11px; color: var(--text-muted); margin-bottom: 16px; }
.breadcrumb a { color: var(--link); }
.breadcrumb a:hover { text-decoration: underline; }

/* ═══════════════════════════════════
   CATEGORIES GRID (category/search pages)
   ═══════════════════════════════════ */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.category-card {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 18px 14px;
  text-align: center;
  transition: all 0.2s;
  border: 1px solid var(--border-light);
  display: block;
  text-decoration: none !important;
}
.category-card:hover { box-shadow: var(--shadow-md); border-color: var(--sun); }
.category-icon { font-size: 1.8rem; margin-bottom: 8px; display: block; }
.category-name { font-weight: 700; font-size: 12px; color: var(--blue); line-height: 1.3; }
.category-count { font-size: 10px; color: var(--text-muted); margin-top: 3px; }

/* ═══════════════════════════════════
   NEIGHBORHOODS SCROLL (kept for other pages)
   ═══════════════════════════════════ */
.neighborhoods-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.neighborhoods-scroll::-webkit-scrollbar { display: none; }
.hood-chip {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 50px;
  background: var(--white);
  font-size: 11px;
  font-weight: 500;
  transition: all 0.2s;
  border: 1px solid var(--border-light);
  white-space: nowrap;
  color: var(--text);
  text-decoration: none !important;
}
.hood-chip:hover, .hood-chip.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ═══════════════════════════════════
   LISTINGS GRID (category/search pages)
   ═══════════════════════════════════ */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.listing-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.2s;
  border: 1px solid var(--border-light);
  display: block;
  text-decoration: none !important;
  color: inherit;
}
.listing-card:hover { box-shadow: var(--shadow-md); }

.listing-img-wrap { position: relative; overflow: hidden; }
.listing-img-wrap img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  transition: transform 0.3s;
}
.listing-card:hover .listing-img-wrap img { transform: scale(1.03); }
.listing-img-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--cloud);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
}

.card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge-featured { background: rgba(245,166,35,.9); color: #fff; }
.badge-urgent { background: rgba(232,67,42,.9); color: #fff; }
.badge-new { background: rgba(46,204,113,.9); color: #fff; }

.listing-body { padding: 14px; }
.listing-price {
  font-size: 15px;
  font-weight: 800;
  color: var(--sunset);
  display: flex;
  align-items: center;
  gap: 6px;
}
.listing-price.price-free, .price-free { color: var(--green); }
.price-tag {
  font-size: 9px;
  font-weight: 600;
  background: var(--cloud);
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 3px;
}
.listing-title {
  font-weight: 500;
  font-size: 12px;
  margin-top: 3px;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.listing-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  font-size: 10px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

/* ═══════════════════════════════════
   FILTER BAR
   ═══════════════════════════════════ */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-select {
  padding: 8px 30px 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--white);
  font-size: 12px;
  cursor: pointer;
  outline: none;
  appearance: none;
}
.filter-select:focus { border-color: var(--blue); }

/* ═══════════════════════════════════
   LISTING DETAIL PAGE
   ═══════════════════════════════════ */
.listing-detail {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
  background: var(--white);
}
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  margin-top: 16px;
}
.detail-main { min-width: 0; }

.gallery { margin-bottom: 20px; }
.gallery-main { border-radius: var(--radius); overflow: hidden; }
.gallery-main img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.gallery-placeholder {
  aspect-ratio: 16/10;
  background: var(--cloud);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  border-radius: var(--radius);
}
.gallery-thumbs { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; }
.gallery-thumb {
  width: 70px; height: 52px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.6;
  transition: all 0.2s;
  flex-shrink: 0;
}
.gallery-thumb.active, .gallery-thumb:hover { border-color: var(--blue); opacity: 1; }

.detail-section { margin-bottom: 24px; }
.detail-section h2 { font-size: 13pt; font-weight: 800; color: var(--blue); margin-bottom: 12px; }
.detail-description { line-height: 1.7; color: #444; font-size: 12px; }

.detail-price {
  font-size: 20pt;
  font-weight: 800;
  color: var(--sunset);
  display: flex;
  align-items: center;
  gap: 8px;
}
.detail-meta-row {
  display: flex;
  gap: 6px;
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.detail-table { border: 1px solid var(--border-light); border-radius: var(--radius-sm); overflow: hidden; }
.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 12px;
  border-bottom: 1px solid var(--border-light);
}
.detail-row:last-child { border-bottom: none; }
.detail-row:nth-child(even) { background: rgba(0,0,0,.015); }
.detail-label { color: var(--text-muted); font-weight: 500; }

.detail-map { height: 220px; border-radius: var(--radius); z-index: 1; }
.hood-map { height: 180px; border-radius: var(--radius); margin-bottom: 20px; z-index: 1; }

.detail-sidebar { display: flex; flex-direction: column; gap: 14px; }
.sidebar-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px;
  border: 1px solid var(--border-light);
}
.sidebar-card h3 { font-weight: 800; font-size: 13px; color: var(--blue); margin-bottom: 12px; }

.seller-row { display: flex; align-items: center; gap: 12px; }
.seller-name { font-weight: 700; }
.seller-since { font-size: 10px; color: var(--text-muted); }

.msg-form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  resize: vertical;
  font-size: 12px;
  margin-bottom: 8px;
  outline: none;
}
.msg-form textarea:focus { border-color: var(--blue); }

.sidebar-actions { display: flex; flex-direction: column; gap: 3px; padding: 6px 10px; }
.action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 6px;
  background: none;
  border: none;
  font-size: 12px;
  color: var(--text);
  border-radius: 6px;
  transition: background 0.12s;
  width: 100%;
  text-align: left;
  text-decoration: none;
}
.action-btn:hover { background: var(--cloud); text-decoration: none; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; font-weight: 600; }
.text-muted { color: var(--text-muted); font-size: 11px; }
.text-muted a { color: var(--link); text-decoration: underline; }

/* ═══════════════════════════════════
   AUTH PAGES
   ═══════════════════════════════════ */
.auth-page {
  min-height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  max-width: 1000px;
  margin: 0 auto;
  background: var(--white);
}
.auth-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 36px 40px;
  max-width: 460px;
  width: 100%;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
}
.auth-card h1 { font-size: 18pt; font-weight: 800; color: var(--blue); margin-bottom: 4px; }
.auth-subtitle { color: var(--text-muted); margin-bottom: 20px; font-size: 12px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-footer { text-align: center; margin-top: 16px; font-size: 12px; color: var(--text-muted); }
.auth-footer a { color: var(--link); font-weight: 600; }
.auth-demo { text-align: center; }
.auth-demo p { color: var(--text-muted); font-size: 10px; margin-top: 12px; }

/* ═══════════════════════════════════
   FORMS
   ═══════════════════════════════════ */
.form-page { max-width: 1000px; margin: 0 auto; }
.form-header { text-align: center; margin-bottom: 24px; }
.form-header h1 { font-size: 18pt; font-weight: 800; color: var(--blue); }
.form-header p { color: var(--text-muted); margin-top: 4px; font-size: 12px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; font-size: 12px; margin-bottom: 5px; color: var(--text); }
.req { color: var(--sunset); }
.form-hint { display: block; font-size: 10px; color: var(--text-muted); margin-top: 3px; }
.form-terms { font-size: 10px; color: var(--text-muted); text-align: center; margin: 12px 0; }

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group textarea,
.form-group select,
.post-form input[type="text"],
.post-form textarea,
.post-form select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s;
  background: var(--white);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { border-color: var(--blue); }

.form-row { display: flex; gap: 14px; }
.form-half { flex: 1; }

.radio-group { display: flex; flex-direction: column; gap: 6px; }
.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 12px;
}
.radio-label:has(input:checked) { border-color: var(--blue); background: rgba(72,61,139,.04); }
.radio-label input { accent-color: var(--blue); }

.photo-preview { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.preview-thumb { width: 70px; height: 70px; object-fit: cover; border-radius: 6px; }

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  margin-bottom: 16px;
}
.alert-error { background: #fce4ec; color: var(--danger); border: 1px solid #f8bbd0; }
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }

.success-card {
  text-align: center;
  background: var(--white);
  padding: 48px 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  max-width: 480px;
  margin: 0 auto;
  border: 1px solid var(--border-light);
}
.success-icon { font-size: 3.5rem; margin-bottom: 14px; }
.success-card h1 { font-size: 16pt; color: var(--blue); margin-bottom: 6px; }
.success-actions { display: flex; gap: 10px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }

/* ═══════════════════════════════════
   MAP PAGE
   ═══════════════════════════════════ */
.map-page {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: calc(100vh - var(--header-h));
  max-width: 1000px;
  margin: 0 auto;
  background: var(--white);
  border-left: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
}
.map-sidebar {
  padding: 16px;
  overflow-y: auto;
  background: var(--white);
  border-right: 1px solid var(--border-light);
}
.map-sidebar h2 { font-size: 14pt; font-weight: 800; color: var(--blue); }
.map-filters { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.map-container { height: 100%; min-height: 400px; z-index: 1; }
.map-results { margin-top: 8px; }
.map-loading { padding: 16px; text-align: center; color: var(--text-muted); }

.map-result-item {
  display: flex;
  gap: 10px;
  padding: 10px 6px;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.12s;
  align-items: center;
}
.map-result-item:hover { background: var(--cloud); }
.map-result-icon { font-size: 1.4rem; flex-shrink: 0; }
.map-result-info { min-width: 0; }
.map-result-price { font-weight: 800; color: var(--sunset); }
.map-result-title { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-result-hood { font-size: 10px; color: var(--text-muted); }

.map-popup { font-family: var(--font-body); }
.map-popup strong { color: var(--sunset); font-size: 13px; }
.map-popup a { color: var(--link); }
.empty-state-sm { padding: 16px; text-align: center; color: var(--text-muted); font-size: 11px; }

/* ═══════════════════════════════════
   MY ADS / MESSAGES / SAFETY / ERROR
   ═══════════════════════════════════ */
.my-ads-list { display: flex; flex-direction: column; gap: 10px; }
.my-ad-row {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  gap: 14px;
  transition: box-shadow 0.2s;
}
.my-ad-row:hover { box-shadow: var(--shadow-sm); }
.my-ad-main { display: flex; gap: 14px; align-items: center; flex: 1; min-width: 0; }
.my-ad-img { flex-shrink: 0; width: 70px; height: 70px; border-radius: var(--radius-sm); overflow: hidden; }
.my-ad-img img { width: 100%; height: 100%; object-fit: cover; }
.my-ad-info { min-width: 0; }
.my-ad-title { font-weight: 500; font-size: 12px; }
.my-ad-actions { display: flex; gap: 6px; flex-shrink: 0; }
.listing-img-placeholder.sm { aspect-ratio: 1; width: 70px; height: 70px; font-size: 1.3rem; border-radius: var(--radius-sm); }

.conversations-list { display: flex; flex-direction: column; }
.conversation-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 10px;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.12s;
}
.conversation-row:hover { background: rgba(0,0,0,.02); }
.conversation-row.unread { background: rgba(72,61,139,.03); }
.conv-info { flex: 1; min-width: 0; }
.conv-top { display: flex; justify-content: space-between; align-items: center; }
.conv-name { font-weight: 700; font-size: 12px; }
.conv-time { font-size: 10px; color: var(--text-muted); }
.conv-listing { font-size: 10px; color: var(--link); margin-top: 2px; }
.conv-preview { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

.thread-page { max-width: 660px; }
.back-link { color: var(--link); font-size: 12px; display: inline-block; margin-bottom: 14px; }
.thread-listing-bar {
  background: var(--cloud);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.thread-listing-bar a { color: var(--link); font-weight: 600; }
.listing-price.sm { font-size: 12px; }

.thread-header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.thread-header h2 { font-size: 13px; }
.thread-messages {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  max-height: 450px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--border-light);
}
.msg-bubble { max-width: 80%; padding: 10px 14px; border-radius: 14px; font-size: 12px; }
.msg-mine {
  align-self: flex-end;
  background: var(--blue);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.msg-theirs {
  align-self: flex-start;
  background: var(--cloud);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.msg-time { font-size: 9px; opacity: 0.6; margin-top: 3px; }

.thread-compose { display: flex; gap: 8px; margin-top: 14px; }
.thread-compose input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border-light);
  border-radius: 50px;
  font-size: 12px;
  outline: none;
}
.thread-compose input:focus { border-color: var(--blue); }

.avatar-md {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}
.sidebar-title { font-size: 13px; line-height: 1.3; margin: 6px 0 3px; }

.safety-page { max-width: 1000px; margin: 0 auto; }
.safety-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.safety-card {
  background: var(--white);
  padding: 22px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
}
.safety-icon { font-size: 1.8rem; margin-bottom: 10px; }
.safety-card h3 { font-weight: 700; margin-bottom: 6px; font-size: 13px; color: var(--blue); }
.safety-card p { font-size: 12px; color: #555; line-height: 1.6; }

.error-page {
  text-align: center;
  padding: 60px 20px;
  max-width: 460px;
  margin: 0 auto;
}
.error-icon { font-size: 4rem; margin-bottom: 16px; }
.error-page h1 { font-size: 18pt; color: var(--blue); margin-bottom: 8px; }
.error-page p { color: var(--text-muted); margin-bottom: 20px; font-size: 12px; }

.empty-state {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
}
.empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty-state p { margin-bottom: 16px; }

.listing-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 6px;
}
.tag-featured { background: rgba(245,166,35,.12); color: #B8841A; }
.seller-rating { font-size: 11px; margin-top: 2px; }

/* ═══════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.anim-fade {
  animation: fadeUp 0.4s ease-out forwards;
  opacity: 0;
}

/* ═══════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════ */
@media (max-width: 1100px) {
  .main-layout, .listing-detail, .section, .cta-wrap, .site-footer { max-width: 100%; }
  #page { width: 100%; }
}

@media (max-width: 860px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  .sb-left {
    border-right: none;
    border-bottom: 1px solid var(--border-light);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px;
    padding: 14px 16px;
  }
  .site-title { grid-column: 1 / -1; margin-bottom: 8px; }
  .sbox { grid-column: 1 / -1; margin-top: 4px; }
  .sb-label { text-align: left; margin: 6px 0 3px; }
  .sb-lang { grid-column: 1 / -1; }
  .sb-right {
    border-left: none;
    border-top: 1px solid var(--border-light);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 12px;
  }
  .cat-dir { grid-template-columns: 1fr 1fr; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-sidebar { order: -1; }
  .map-page { grid-template-columns: 1fr; }
  .map-sidebar { max-height: 260px; }
  .post-cta { flex-direction: column; text-align: center; padding: 24px 16px; }
}

@media (max-width: 768px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: flex !important; }
  .header-inner { padding: 8px 12px; }
  .section { padding: 20px 14px; }
  .listing-detail { padding: 14px; }
  .filter-bar { flex-direction: column; }
  .filter-select { width: 100%; }
  .form-row { flex-direction: column; gap: 0; }
  .my-ad-row { flex-direction: column; align-items: flex-start; }
  .my-ad-actions { width: 100%; justify-content: flex-end; }
  .footer-inner { flex-direction: column; gap: 6px; }
}

@media (max-width: 600px) {
  .sb-left { grid-template-columns: 1fr; }
  .sb-right { grid-template-columns: 1fr; }
  .cat-dir { grid-template-columns: 1fr; }
  .listings-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .listing-body { padding: 10px; }
  .listing-price { font-size: 13px; }
  .listing-title { font-size: 11px; }
  .listing-meta { font-size: 9px; }
  .categories-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .auth-card { padding: 24px 16px; }
  .map-page { grid-template-columns: 1fr; height: auto; }
  .map-sidebar { max-height: none; border-right: none; border-bottom: 1px solid var(--border-light); }
  .map-container { height: 55vh; }
  .safety-grid { grid-template-columns: 1fr; }
}

/* Leaflet overrides */
.leaflet-popup-content-wrapper { border-radius: 8px !important; }
.leaflet-popup-content { margin: 10px 14px !important; font-size: 12px; }
.map-page { height: calc(100vh - 60px); min-height: 450px; }
.map-container { height: 100% !important; min-height: 450px; }
#main-map { height: 100% !important; min-height: 450px; }
