/* ===== ROOT ===== */
:root {
  --navy: #0A1628;
  --navy-light: #132040;
  --accent: #2563EB;
  --accent-hover: #1D4ED8;
  --accent-light: #EFF6FF;
  --gold: #F59E0B;
  --gold-light: #FEF3C7;
  --green: #10B981;
  --red: #EF4444;
  --bg: #F1F5F9;
  --white: #FFFFFF;
  --text: #0F172A;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  --border: #E2E8F0;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.15);
  --nav-h: 56px;
  --max-w: 480px;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6;
  max-width: var(--max-w); margin: 0 auto;
  min-height: 100vh; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
input, select, textarea, button { font-family: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

/* ===== PAGE ===== */
.page { min-height: 100vh; padding-top: var(--nav-h); padding-bottom: 80px; }
#homePage { padding-bottom: 0; }

/* ===== NAVBAR ===== */
.navbar {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--max-w); z-index: 1000;
  background: var(--navy); height: var(--nav-h);
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.nav-container {
  height: 100%; display: flex; align-items: center;
  justify-content: space-between; padding: 0 16px;
}
.nav-brand { display: flex; align-items: center; gap: 8px; }
.brand-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--accent), #7C3AED);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  color: white; font-size: 15px;
}
.brand-text { font-size: 20px; font-weight: 800; color: white; }
.brand-accent { color: var(--gold); }
.nav-actions { display: flex; align-items: center; gap: 8px; position: relative; }
.nav-icon-btn {
  background: rgba(255,255,255,0.1); border: none; color: white;
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.user-avatar { cursor: pointer; }
.user-avatar img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); }
.user-menu {
  position: absolute; top: 44px; right: 0;
  background: white; border-radius: var(--radius); box-shadow: var(--shadow-lg);
  min-width: 220px; border: 1px solid var(--border); overflow: hidden; z-index: 2000;
}
.user-menu-header { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: var(--bg); }
.user-menu-header img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.user-menu-header strong { display: block; font-size: 14px; }
.user-menu-header small { color: var(--text-muted); font-size: 12px; }
.user-menu a { display: flex; align-items: center; gap: 10px; padding: 12px 16px; color: var(--text); font-size: 14px; transition: 0.15s; }
.user-menu a:hover { background: var(--bg); }
.user-menu hr { border: none; border-top: 1px solid var(--border); }
.logout-link { color: var(--red) !important; }

/* ===== HERO ===== */
.hero { background: var(--navy); padding: 40px 20px 48px; position: relative; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(37,99,235,0.2) 0%, transparent 70%);
}
.hero-content { position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(245,158,11,0.15); border: 1px solid rgba(245,158,11,0.3);
  color: var(--gold); padding: 5px 12px; border-radius: 20px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 20px;
}
.hero-title { font-size: 36px; font-weight: 900; color: white; line-height: 1.1; margin-bottom: 12px; }
.gradient-text { background: linear-gradient(90deg,#60A5FA,#A78BFA); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-sub { color: rgba(255,255,255,0.7); font-size: 14px; margin-bottom: 32px; line-height: 1.6; }

/* BUY / SELL buttons */
.hero-cta-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 32px; }
.hero-btn-buy, .hero-btn-sell {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 20px 12px; border-radius: 16px; border: none;
  font-weight: 700; transition: 0.2s; box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.hero-btn-buy { background: var(--accent); color: white; }
.hero-btn-sell { background: var(--gold); color: var(--navy); }
.hero-btn-buy:hover { background: var(--accent-hover); transform: translateY(-2px); }
.hero-btn-sell:hover { background: #FBBF24; transform: translateY(-2px); }
.hero-btn-buy i, .hero-btn-sell i { font-size: 28px; }
.hero-btn-buy span, .hero-btn-sell span { font-size: 20px; font-weight: 900; }
.hero-btn-buy small, .hero-btn-sell small { font-size: 12px; opacity: 0.8; font-weight: 400; }

.hero-stats { display: flex; align-items: center; gap: 20px; }
.stat { display: flex; flex-direction: column; }
.stat strong { font-size: 20px; font-weight: 800; color: white; }
.stat span { font-size: 11px; color: rgba(255,255,255,0.55); }
.stat-divider { width: 1px; height: 32px; background: rgba(255,255,255,0.15); }

/* ===== HOME CATEGORIES ===== */
.home-cats { background: white; padding: 20px 16px; border-bottom: 1px solid var(--border); }
.home-cats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.home-cat-item { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; }
.hci { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 20px; transition: 0.2s; }
.home-cat-item:active .hci { transform: scale(0.92); }
.home-cat-item span { font-size: 11px; font-weight: 600; color: var(--text); }
.cars-icon { background: #FEE2E2; color: #EF4444; }
.phones-icon { background: #E0F2FE; color: #0EA5E9; }
.bikes-icon { background: #FEF3C7; color: #F59E0B; }
.elec-icon { background: #EDE9FE; color: #7C3AED; }
.furn-icon { background: #D1FAE5; color: #10B981; }
.prop-icon { background: #FEE2E2; color: #F43F5E; }
.appl-icon { background: #E0F2FE; color: #0284C7; }
.fash-icon { background: #FCE7F3; color: #DB2777; }

/* ===== EMI BANNER ===== */
.emi-banner-section { padding: 20px 16px; }
.emi-banner {
  background: linear-gradient(135deg, var(--navy), #1e3a8a);
  border-radius: 20px; padding: 28px 24px;
}
.emi-banner-badge { display: inline-block; background: var(--gold); color: white; font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 5px; letter-spacing: 1px; margin-bottom: 14px; }
.emi-banner h2 { font-size: 20px; font-weight: 800; color: white; margin-bottom: 10px; }
.emi-banner p { color: rgba(255,255,255,0.75); font-size: 13px; line-height: 1.6; margin-bottom: 18px; }
.emi-features { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 24px; }
.emi-feat { color: rgba(255,255,255,0.85); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.emi-feat i { color: var(--green); font-size: 12px; }
.btn-emi-cta { background: var(--gold); color: var(--navy); border: none; padding: 12px 24px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }

/* ===== FOOTER ===== */
.footer { background: var(--navy); color: white; padding: 32px 20px 20px; }
.footer-top { margin-bottom: 28px; }
.footer-top .footer-brand { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.footer-tagline { color: rgba(255,255,255,0.6); font-size: 13px; line-height: 1.6; margin-bottom: 18px; }
.footer-social { display: flex; gap: 10px; }
.footer-social a { width: 36px; height: 36px; background: rgba(255,255,255,0.08); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.7); font-size: 15px; }
.footer-links { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; margin-bottom: 28px; }
.footer-col h4 { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,0.45); margin-bottom: 12px; }
.footer-col a { display: block; color: rgba(255,255,255,0.65); font-size: 13px; margin-bottom: 8px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 16px; display: flex; justify-content: space-between; align-items: center; }
.footer-bottom p { color: rgba(255,255,255,0.4); font-size: 11px; }
.admin-link { color: rgba(255,255,255,0.2); font-size: 11px; }

/* ===== BUY PAGE ===== */
.buy-header {
  position: sticky; top: var(--nav-h); z-index: 100;
  background: white; padding: 10px 12px;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
}
.back-btn { background: none; border: none; font-size: 18px; color: var(--text); padding: 4px 8px; flex-shrink: 0; }
.buy-search-wrap {
  flex: 1; display: flex; align-items: center;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden; padding-left: 10px;
}
.buy-search-wrap i { color: var(--text-muted); font-size: 14px; }
.buy-search-wrap input { flex: 1; border: none; background: transparent; padding: 9px 8px; font-size: 14px; outline: none; }
.buy-search-go { background: var(--accent); color: white; border: none; padding: 9px 14px; font-size: 13px; font-weight: 600; }
.cat-scroll { display: flex; gap: 6px; padding: 10px 12px; overflow-x: auto; background: white; border-bottom: 1px solid var(--border); scrollbar-width: none; }
.cat-scroll::-webkit-scrollbar { display: none; }
.cat-pill { flex-shrink: 0; background: var(--bg); border: 1.5px solid var(--border); color: var(--text-muted); padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; display: flex; align-items: center; gap: 5px; transition: 0.2s; }
.cat-pill.active { background: var(--accent); border-color: var(--accent); color: white; }
.filter-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: white; border-bottom: 1px solid var(--border); }
.filter-toggle-btn { background: var(--bg); border: 1.5px solid var(--border); padding: 6px 12px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.sort-select { border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 6px 8px; font-size: 12px; background: var(--bg); margin-left: auto; flex-shrink: 0; }
.filter-chips { display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; }
.filter-panel { background: white; border-bottom: 1px solid var(--border); padding: 16px 12px; }
.filter-panel-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.filter-group { display: flex; flex-direction: column; gap: 6px; }
.filter-group label { font-size: 12px; font-weight: 600; color: var(--text); }
.filter-group input[type="number"], .filter-group input[type="text"] { border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 13px; width: 100%; }
.price-inputs { display: flex; align-items: center; gap: 6px; }
.price-inputs input { width: calc(50% - 10px); }
.price-inputs span { color: var(--text-muted); font-size: 12px; }
.toggle-label { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.toggle-label input { accent-color: var(--accent); }
.btn-clear-filters { grid-column: 1/-1; background: none; border: 1.5px solid var(--red); color: var(--red); padding: 8px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; }
.buy-results-count { padding: 10px 12px; font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* ===== LISTINGS GRID ===== */
.listings-grid { padding: 0 12px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.listing-card { background: white; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); cursor: pointer; transition: 0.2s; border: 1.5px solid transparent; }
.listing-card:active { transform: scale(0.98); border-color: var(--accent); }
.listing-img { position: relative; height: 140px; overflow: hidden; background: var(--bg); }
.listing-img img { width: 100%; height: 100%; object-fit: cover; }
.listing-img-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 40px; background: var(--bg); }
.listing-save-btn { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; background: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--text-muted); box-shadow: var(--shadow); border: none; }
.listing-condition { position: absolute; top: 8px; left: 8px; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 10px; }
.cond-like_new { background: #D1FAE5; color: #065F46; }
.cond-good { background: #DBEAFE; color: #1E40AF; }
.cond-fair { background: var(--gold-light); color: #92400E; }
.cond-for_parts { background: #FEE2E2; color: #991B1B; }
.listing-body { padding: 10px; }
.listing-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }
.listing-price { font-size: 16px; font-weight: 800; color: var(--navy); margin-bottom: 4px; }
.listing-price span { font-size: 11px; font-weight: 400; color: var(--text-muted); }
.listing-location { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 3px; margin-bottom: 6px; }
.listing-emi-tag { font-size: 10px; font-weight: 600; background: var(--gold-light); color: #92400E; padding: 2px 7px; border-radius: 6px; display: inline-flex; align-items: center; gap: 4px; }

/* ===== PRODUCT MODAL ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 3000; display: flex; align-items: flex-end; justify-content: center; backdrop-filter: blur(3px); }
.modal-box { background: white; width: 100%; max-width: var(--max-w); max-height: 92vh; overflow-y: auto; border-radius: 20px 20px 0 0; position: relative; padding: 20px; }
.product-modal-box { padding: 0; }
.modal-close { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; background: rgba(0,0,0,0.08); border: none; border-radius: 50%; font-size: 13px; color: var(--text); display: flex; align-items: center; justify-content: center; z-index: 10; }

/* Product detail layout */
.pm-images { position: relative; height: 260px; background: var(--bg); overflow: hidden; }
.pm-images img { width: 100%; height: 100%; object-fit: cover; }
.pm-img-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 72px; }
.pm-img-count { position: absolute; bottom: 10px; right: 10px; background: rgba(0,0,0,0.5); color: white; font-size: 12px; padding: 3px 10px; border-radius: 12px; }
.pm-body { padding: 16px; }
.pm-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.pm-badge { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px; }
.pm-title { font-size: 18px; font-weight: 800; margin-bottom: 8px; line-height: 1.3; }
.pm-price-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.pm-price { font-size: 26px; font-weight: 900; color: var(--navy); }
.pm-negotiable { font-size: 12px; color: var(--green); font-weight: 600; background: #D1FAE5; padding: 2px 8px; border-radius: 10px; }
.pm-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.pm-meta-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-muted); }
.pm-meta-item i { color: var(--accent); font-size: 12px; }
.pm-desc { font-size: 14px; color: var(--text-muted); line-height: 1.8; margin-bottom: 20px; white-space: pre-line; }
.pm-seller { display: flex; align-items: center; gap: 12px; background: var(--bg); border-radius: var(--radius); padding: 14px; margin-bottom: 20px; }
.pm-seller-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--accent-light); display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--accent); font-weight: 700; flex-shrink: 0; overflow: hidden; }
.pm-seller-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pm-seller-name { font-size: 14px; font-weight: 700; }
.pm-seller-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.pm-seller-verified { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--green); font-weight: 600; }
.pm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.pm-actions-full { grid-template-columns: 1fr; }
.btn-chat { background: var(--accent); color: white; border: none; padding: 14px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-call { background: var(--green); color: white; border: none; padding: 14px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-emi-product { grid-column: 1/-1; background: var(--gold-light); color: #92400E; border: 1px solid #FCD34D; padding: 12px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; }
.pm-safety { background: #FFF3CD; border: 1px solid #FFC107; border-radius: var(--radius-sm); padding: 12px; font-size: 12px; color: #856404; display: flex; gap: 8px; line-height: 1.5; }

/* ===== CHAT MODAL ===== */
.chat-modal-box { padding: 0; display: flex; flex-direction: column; height: 85vh; border-radius: 20px 20px 0 0; }
.chat-modal-header { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.modal-close-inline { background: none; border: none; font-size: 18px; color: var(--text); padding: 4px; }
.chat-seller-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-light); display: flex; align-items: center; justify-content: center; font-size: 16px; color: var(--accent); font-weight: 700; flex-shrink: 0; overflow: hidden; }
.chat-seller-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-seller-name { font-size: 14px; font-weight: 700; }
.chat-product-title { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.chat-notice { background: #FFF3CD; border: 1px solid #FFC107; border-radius: var(--radius-sm); padding: 10px 12px; font-size: 12px; color: #856404; display: flex; align-items: flex-start; gap: 8px; line-height: 1.5; }
.chat-msg { max-width: 80%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.5; }
.chat-msg.sent { background: var(--accent); color: white; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-msg.received { background: white; color: var(--text); align-self: flex-start; border-bottom-left-radius: 4px; box-shadow: var(--shadow); }
.chat-msg-time { font-size: 10px; opacity: 0.6; margin-top: 4px; }
.chat-input-area { border-top: 1px solid var(--border); padding: 10px 12px; flex-shrink: 0; }
.chat-quick-msgs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 10px; scrollbar-width: none; }
.chat-quick-msgs::-webkit-scrollbar { display: none; }
.chat-quick-msgs button { flex-shrink: 0; background: var(--bg); border: 1.5px solid var(--border); padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.chat-input-row { display: flex; gap: 8px; }
.chat-input-row input { flex: 1; border: 1.5px solid var(--border); border-radius: 24px; padding: 10px 16px; font-size: 14px; outline: none; }
.chat-input-row input:focus { border-color: var(--accent); }
.chat-send-btn { width: 42px; height: 42px; background: var(--accent); color: white; border: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }

/* ===== SELL PAGE ===== */
.page-header { position: sticky; top: var(--nav-h); background: white; z-index: 100; padding: 12px 16px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
.page-header h2 { font-size: 17px; font-weight: 700; flex: 1; }
.header-action-btn { background: var(--accent-light); color: var(--accent); border: none; width: 32px; height: 32px; border-radius: 8px; font-size: 16px; display: flex; align-items: center; justify-content: center; }
.header-count { font-size: 13px; color: var(--text-muted); }
.sell-form-wrap { padding: 16px; }
.sell-section { background: white; border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.sell-section h3 { font-size: 15px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.sell-step { width: 24px; height: 24px; background: var(--accent); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.sell-hint { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; margin-top: -8px; }
.photo-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.photo-preview { width: 80px; height: 80px; border-radius: 8px; overflow: hidden; position: relative; flex-shrink: 0; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview .photo-remove { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; background: rgba(0,0,0,0.5); color: white; border: none; border-radius: 50%; font-size: 10px; display: flex; align-items: center; justify-content: center; }
.photo-add-btn { width: 80px; height: 80px; border-radius: 8px; background: var(--bg); border: 2px dashed var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--text-muted); font-size: 12px; cursor: pointer; flex-shrink: 0; }
.photo-add-btn i { font-size: 22px; }
.sell-cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.sell-cat-item { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 12px 6px; border-radius: 10px; border: 2px solid var(--border); cursor: pointer; font-size: 11px; font-weight: 600; text-align: center; transition: 0.2s; }
.sell-cat-item i { font-size: 20px; color: var(--text-muted); }
.sell-cat-item.selected { border-color: var(--accent); background: var(--accent-light); color: var(--accent); }
.sell-cat-item.selected i { color: var(--accent); }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 11px 12px; font-size: 14px; color: var(--text); transition: 0.2s; background: white; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.form-group textarea { resize: vertical; min-height: 100px; }
.req { color: var(--red); }
.price-input-wrap { display: flex; align-items: center; border: 1.5px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.price-prefix { padding: 0 12px; font-size: 16px; font-weight: 700; color: var(--text-muted); background: var(--bg); border-right: 1.5px solid var(--border); height: 44px; display: flex; align-items: center; }
.price-input-wrap input { border: none; border-radius: 0; flex: 1; }
.price-input-wrap input:focus { box-shadow: none; }
.pincode-result { display: block; margin-top: 4px; font-size: 12px; color: var(--green); font-weight: 500; }
.sell-submit-btn { margin-top: 8px; padding: 16px; font-size: 16px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.sell-note { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 12px; }
.sell-note a { color: var(--accent); }

/* ===== AUTH MODAL ===== */
.modal-box { border-radius: 20px 20px 0 0; }
.modal-tabs { display: flex; margin-bottom: 24px; border-bottom: 2px solid var(--border); }
.tab-btn { flex: 1; background: none; border: none; padding: 12px; font-size: 15px; font-weight: 600; cursor: pointer; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: 0.2s; }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.auth-form h2 { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.auth-sub { color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.forgot-link { display: block; text-align: right; font-size: 13px; color: var(--accent); margin-bottom: 16px; }
.auth-error { background: #FEF2F2; border: 1px solid #FECACA; color: #B91C1C; font-size: 13px; padding: 10px 12px; border-radius: var(--radius-sm); margin-bottom: 14px; }
.btn-primary { background: var(--accent); color: white; border: none; padding: 13px 20px; border-radius: var(--radius-sm); font-size: 15px; font-weight: 700; transition: 0.2s; }
.btn-primary:active { background: var(--accent-hover); transform: scale(0.98); }
.full-width { width: 100%; }

/* ===== EMI MODAL ===== */
.emi-modal-box { border-radius: 20px 20px 0 0; }
.emi-header { text-align: center; margin-bottom: 20px; }
.emi-icon { width: 56px; height: 56px; background: var(--gold-light); border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: var(--gold); margin: 0 auto 12px; }
.emi-header h2 { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.emi-header p { color: var(--text-muted); font-size: 13px; }
.emi-product-label { background: var(--accent-light); color: var(--accent); font-size: 12px; font-weight: 600; padding: 8px 12px; border-radius: var(--radius-sm); margin-bottom: 16px; text-align: center; }
.emi-calculator { background: var(--bg); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.emi-price-display { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.emi-label { font-size: 13px; color: var(--text-muted); }
.emi-amount { font-size: 22px; font-weight: 800; color: var(--navy); }
.emi-result { background: white; border-radius: var(--radius-sm); padding: 12px; margin-top: 14px; border: 1px solid var(--border); }
.emi-result-item { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.emi-result-item:last-child { border-bottom: none; }
.emi-result-item strong.highlight { color: var(--accent); font-size: 17px; }
.emi-note { display: flex; gap: 8px; background: #FFF3CD; border: 1px solid #FFC107; border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 16px; font-size: 12px; color: #856404; }

/* ===== PAGE CONTENT ===== */
.page-content { padding: 12px; }
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state i { font-size: 48px; color: var(--border); margin-bottom: 16px; display: block; }
.empty-state h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }
.no-results { text-align: center; padding: 60px 20px; }
.no-results i { font-size: 48px; color: var(--border); margin-bottom: 16px; display: block; }
.no-results h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.no-results p { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }
.buy-loading { text-align: center; padding: 40px; color: var(--text-muted); font-size: 14px; }

/* ===== MY LISTINGS ===== */
.my-listing-card { background: white; border-radius: var(--radius); padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow); display: flex; gap: 12px; }
.my-listing-img { width: 80px; height: 80px; border-radius: 8px; object-fit: cover; background: var(--bg); flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 28px; }
.my-listing-img img { width: 100%; height: 100%; object-fit: cover; }
.my-listing-info { flex: 1; min-width: 0; }
.my-listing-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.my-listing-price { font-size: 16px; font-weight: 800; color: var(--navy); margin-bottom: 4px; }
.my-listing-meta { font-size: 12px; color: var(--text-muted); }
.my-listing-actions { display: flex; gap: 6px; margin-top: 8px; }
.btn-sm { padding: 5px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; border: none; cursor: pointer; }
.btn-sm-red { background: #FEE2E2; color: var(--red); }
.btn-sm-blue { background: var(--accent-light); color: var(--accent); }
.listing-status-pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; margin-bottom: 4px; }
.status-active { background: #D1FAE5; color: #065F46; }
.status-sold { background: #FEE2E2; color: #991B1B; }
.status-pending { background: var(--gold-light); color: #92400E; }

/* ===== CHATS LIST ===== */
.chat-list-item { background: white; border-radius: var(--radius); padding: 14px; margin-bottom: 8px; box-shadow: var(--shadow); display: flex; gap: 12px; cursor: pointer; }
.chat-list-item:active { background: var(--bg); }
.chat-list-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--accent-light); display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--accent); font-weight: 700; flex-shrink: 0; overflow: hidden; }
.chat-list-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-list-info { flex: 1; min-width: 0; }
.chat-list-name { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.chat-list-product { font-size: 12px; color: var(--accent); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list-last { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list-time { font-size: 11px; color: var(--text-light); flex-shrink: 0; }
.chat-unread { background: var(--accent); color: white; font-size: 11px; font-weight: 700; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ===== PROFILE ===== */
.profile-wrap { padding: 16px; }
.profile-avatar-section { text-align: center; padding: 20px 0; }
.profile-avatar-wrap { position: relative; width: 90px; height: 90px; margin: 0 auto 12px; }
.profile-avatar-wrap img { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent); }
.avatar-edit-btn { position: absolute; bottom: 0; right: 0; width: 28px; height: 28px; background: var(--accent); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; cursor: pointer; }
.profile-name { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.profile-email-sm { font-size: 13px; color: var(--text-muted); }
.profile-nav { display: flex; gap: 6px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.profile-nav::-webkit-scrollbar { display: none; }
.profile-nav-btn { flex-shrink: 0; background: var(--bg); border: 1.5px solid var(--border); padding: 8px 14px; border-radius: 20px; font-size: 13px; font-weight: 600; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.profile-nav-btn.active { background: var(--accent); border-color: var(--accent); color: white; }
.profile-card { background: white; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.profile-msg { font-size: 13px; padding: 10px 12px; border-radius: var(--radius-sm); margin-bottom: 12px; }
.success-msg { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; }
.error-msg { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.stat-card { background: var(--bg); border-radius: var(--radius); padding: 14px; display: flex; align-items: center; gap: 12px; }
.stat-card-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.stat-card strong { display: block; font-size: 22px; font-weight: 800; }
.stat-card span { font-size: 12px; color: var(--text-muted); }
.member-since { text-align: center; font-size: 13px; color: var(--text-muted); padding-top: 12px; border-top: 1px solid var(--border); }

/* ===== EMI STATUS ===== */
.emi-app-card { background: white; border-radius: var(--radius); padding: 14px; margin-bottom: 10px; display: flex; gap: 12px; box-shadow: var(--shadow); }
.emi-app-img { width: 70px; height: 70px; border-radius: 8px; overflow: hidden; background: var(--bg); flex-shrink: 0; }
.emi-app-img img { width: 100%; height: 100%; object-fit: cover; }
.emi-app-info { flex: 1; min-width: 0; }
.emi-app-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.emi-app-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11px; color: var(--text-muted); }
.emi-app-status { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.emi-app-amount { font-size: 13px; font-weight: 700; color: var(--navy); }
.status-pill { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.status-pending { background: var(--gold-light); color: #92400E; }
.status-approved { background: #D1FAE5; color: #065F46; }
.status-review { background: #DBEAFE; color: #1E40AF; }
.status-rejected { background: #FEE2E2; color: #991B1B; }
.status-dropdown { font-size: 12px; padding: 5px 8px; border-radius: 6px; border: 1.5px solid var(--border); background: white; }

/* ===== ADMIN ===== */
.admin-login-wrap { display: flex; align-items: center; justify-content: center; min-height: 60vh; padding: 20px; }
.admin-login-card { background: white; border-radius: var(--radius-lg); padding: 32px 24px; width: 100%; box-shadow: var(--shadow-lg); text-align: center; }
.admin-login-card h2 { font-size: 20px; font-weight: 800; margin-bottom: 4px; margin-top: 12px; }
.admin-header { padding: 16px; }
.admin-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.admin-filters { display: flex; gap: 6px; padding: 0 16px 12px; overflow-x: auto; scrollbar-width: none; }
.admin-filters::-webkit-scrollbar { display: none; }
.admin-filter-btn { flex-shrink: 0; background: var(--bg); border: 1.5px solid var(--border); color: var(--text-muted); padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.admin-filter-btn.active { background: var(--accent); border-color: var(--accent); color: white; }
.admin-table-wrap { overflow-x: auto; margin: 0 16px 80px; border-radius: var(--radius); box-shadow: var(--shadow); }
.admin-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.admin-table th { background: var(--bg); padding: 10px 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); text-align: left; }
.admin-table td { padding: 12px; border-top: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
.admin-product-cell { display: flex; align-items: center; gap: 8px; }
.admin-product-cell img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; }

/* ===== TOAST ===== */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px); background: var(--navy); color: white; padding: 12px 20px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); z-index: 9999; transition: 0.3s; white-space: nowrap; max-width: calc(var(--max-w) - 32px); text-align: center; }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { border-left: 4px solid var(--green); }
.toast.error { border-left: 4px solid var(--red); }
.toast.info { border-left: 4px solid var(--accent); }

/* ===== DESKTOP SCALING ===== */
@media (min-width: 481px) {
  body { box-shadow: 0 0 60px rgba(0,0,0,0.15); }
  .navbar { border-radius: 0; }
  .modal-overlay { align-items: center; }
  .modal-box { border-radius: var(--radius-lg); max-height: 85vh; }
  .chat-modal-box { border-radius: var(--radius-lg); height: 80vh; }
  .product-modal-box { border-radius: var(--radius-lg); }
  .emi-modal-box { border-radius: var(--radius-lg); }
}
