/* ==========================================================
   A2Z — Design Tokens
   ==========================================================
   Brand direction: an Indian local-marketplace feel — warm,
   trustworthy, distinct from OLX's corporate blue. Deep wine/
   maroon as the primary (signals trust + is memorable against
   every blue-branded competitor), warm marigold as the single
   accent (reused consistently for CTAs, the verified badge,
   and "new" tags — not scattered across random elements).
   ========================================================== */

:root {
  /* Color */
  --color-primary: #6B1E3C;        /* deep wine — nav, headers, primary buttons */
  --color-primary-dark: #4A1329;   /* pressed states, dark nav on scroll */
  --color-accent: #E8A33D;         /* marigold — CTAs, verified badge, highlights */
  --color-accent-dark: #C4831F;
  --color-bg: #FFFFFF;
  --color-bg-soft: #FAF7F3;        /* section backgrounds, card hover */
  --color-text: #221C1E;
  --color-text-muted: #6E6468;
  --color-border: #E9E2DD;
  --color-success: #2E7D5B;        /* used sparingly: "active"/"live" status only */
  --color-danger: #B23A2E;         /* rejected/error states */

  /* Type */
  --font-heading: 'Poppins', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;

  /* Layout */
  --radius: 10px;
  --radius-sm: 6px;
  --nav-height: 60px;
  --max-width: 480px; /* mobile-first: this is the app-shell width even on desktop */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg-soft);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .heading {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-text);
}

a { color: inherit; text-decoration: none; }

/* ---------------- App shell ---------------- */
.app-shell {
  max-width: var(--max-width);
  margin: 0 auto;
  background: var(--color-bg);
  min-height: 100vh;
  position: relative;
  padding-bottom: calc(var(--nav-height) + 12px);
}

/* ---------------- Top bar ---------------- */
.topbar {
  background: var(--color-primary);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar .logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.02em;
}
.topbar .logo span { color: var(--color-accent); }

.topbar .location {
  font-size: 0.8rem;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ---------------- Search bar ---------------- */
.search-bar {
  margin: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 10px 14px;
  background: var(--color-bg);
}
.search-bar input {
  border: none; outline: none; flex: 1; font-size: 0.95rem;
  font-family: var(--font-body);
}

/* ---------------- Category grid (home) ---------------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px 8px;
  padding: 8px 16px 20px;
}
.category-grid .cat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.category-grid .cat-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--color-bg-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  border: 1px solid var(--color-border);
}
.category-grid .cat-label {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  line-height: 1.2;
}

/* ---------------- Categories page (sidebar + subcategory grid) ---------------- */
.categories-page { display: flex; min-height: calc(100vh - var(--nav-height)); }
.cat-sidebar {
  width: 84px;
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
}
.cat-sidebar .sidebar-item {
  padding: 14px 6px;
  text-align: center;
  font-size: 0.68rem;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
}
.cat-sidebar .sidebar-item.active {
  background: var(--color-bg-soft);
  color: var(--color-primary);
  font-weight: 600;
  border-left: 3px solid var(--color-primary);
}
.cat-sidebar .sidebar-icon { font-size: 1.3rem; display: block; margin-bottom: 4px; }

.subcategory-panel { flex: 1; padding: 16px; }
.subcategory-panel h2 { font-size: 1.05rem; margin-bottom: 14px; }
.subcategory-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px 8px;
}
.subcategory-grid .subcat-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center; font-size: 0.72rem; color: var(--color-text-muted);
}
.subcategory-grid .subcat-icon {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  background: var(--color-bg-soft); border: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}

.sell-cta {
  margin-top: 18px;
  padding: 12px 14px;
  background: #FDF6E9;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.85rem; font-weight: 500;
}

/* ---------------- Verified badge ---------------- */
.verified-badge {
  display: flex; align-items: center; gap: 10px;
  background: #FDF6E9;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 12px 16px;
}
.verified-badge .badge-icon {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--color-accent);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.verified-badge .badge-text { flex: 1; font-size: 0.85rem; }
.verified-badge .badge-cta {
  background: var(--color-primary); color: #fff;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 0.82rem; font-weight: 600; white-space: nowrap;
}
/* When already verified — same slot, different message, no CTA needed */
.verified-badge.is-verified {
  background: #EEF6F1; border-color: var(--color-success);
}
.verified-badge.is-verified .badge-icon { background: var(--color-success); }

/* ---------------- Listing card ---------------- */
.listing-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-bg);
}
.listing-card .thumb { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--color-bg-soft); }
.listing-card .body { padding: 10px; }
.listing-card .price { font-family: var(--font-heading); font-weight: 700; font-size: 1rem; }
.listing-card .title { font-size: 0.8rem; color: var(--color-text-muted); margin: 3px 0 6px; }
.listing-card .location { font-size: 0.7rem; color: var(--color-text-muted); display: flex; gap: 3px; align-items: center; }

.status-pill {
  display: inline-block; font-size: 0.7rem; font-weight: 600;
  padding: 4px 10px; border-radius: 4px; color: #fff;
}
.status-pill.rejected { background: var(--color-danger); }
.status-pill.active { background: var(--color-success); }
.status-pill.pending { background: var(--color-text-muted); }

/* ---------------- Bottom nav (matches the 5-tab pattern shown: Home, Chats, Sell, My Ads, Account) ---------------- */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--max-width);
  height: var(--nav-height);
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  display: flex; align-items: center;
  z-index: 50;
}
.bottom-nav .nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 0.65rem; color: var(--color-text-muted);
}
.bottom-nav .nav-item.active { color: var(--color-primary); font-weight: 600; }
.bottom-nav .nav-icon { font-size: 1.15rem; }

/* Center "Sell" button — raised, filled with the accent so it reads as
   the primary action on every screen, same role as OLX's center button
   but visually A2Z's own (accent gold ring, not a rainbow gradient) */
.bottom-nav .nav-sell {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  margin-top: -26px;
  border: 4px solid var(--color-bg);
  box-shadow: 0 2px 8px rgba(107, 30, 60, 0.25);
}

.unread-dot {
  position: absolute; top: -2px; right: -2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--color-danger); color: #fff;
  font-size: 0.55rem; display: flex; align-items: center; justify-content: center;
}

/* ---------------- Account page rows ---------------- */
.account-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px;
}
.account-header .avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--color-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-weight: 700; font-size: 1.2rem;
}
.account-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
}
.account-row .row-icon { font-size: 1.2rem; color: var(--color-primary); width: 24px; }
.account-row .row-text .row-title { font-size: 0.9rem; font-weight: 500; }
.account-row .row-text .row-sub { font-size: 0.75rem; color: var(--color-text-muted); }
.account-row .row-arrow { margin-left: auto; color: var(--color-text-muted); }
