/* ════════════════════════════════════════
   KISAN360 — Responsive CSS
   Mobile-first → Tablet → Full Desktop
   ════════════════════════════════════════ */

:root {
  --g1: #0d3d20; --g2: #1a6b3a; --g3: #2d9154; --g4: #48b870;
  --gl: #e8f5ec; --gm: #c3e6cc;
  --amber: #c97c0a; --al: #fff8e6;
  --blue: #185fa5; --bl: #e8f0fe;
  --red: #a32d2d; --rl: #fcebeb;
  --surface: #ffffff; --card: #ffffff;
  --border: #e0ead8; --border2: #ccdbc0;
  --text: #18241a; --muted: #5a6e5c; --hint: #9aaa94;
  --topnav-h: 64px;
  --bottomnav-h: 64px;
  --side-w: 240px;
  --max-w: 1280px;
}

*,*::before,*::after { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html { font-size:16px; -webkit-text-size-adjust:100%; scroll-behavior:smooth; }
body { font-family:'DM Sans',system-ui,sans-serif; background:var(--surface); color:var(--text); line-height:1.5; overflow-x:hidden; }
a { text-decoration:none; color:inherit; }
img { display:block; max-width:100%; }
button { font-family:inherit; cursor:pointer; border:none; background:none; }

/* ════════ TOP NAV ════════ */
.topnav {
  position:fixed; top:0; left:0; right:0;
  height:var(--topnav-h);
  background:#fff; border-bottom:1px solid var(--border);
  display:flex; align-items:center; padding:0 16px; gap:10px; z-index:200;
}
.nav-logo {
  font-family:'Playfair Display',Georgia,serif;
  font-size:22px; font-weight:700; color:var(--g1);
  display:flex; align-items:center; gap:8px; white-space:nowrap;
}
.logo-dot { width:9px; height:9px; background:var(--g3); border-radius:50%; flex-shrink:0; }
.nav-search { display:none; }
.nav-auth { display:none; }
.nav-actions { margin-left:auto; display:flex; align-items:center; gap:8px; flex-shrink:0; }
.icon-btn {
  width:38px; height:38px; border-radius:8px;
  border:1px solid var(--border); background:#fff;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; position:relative; flex-shrink:0; transition:background 0.15s;
}
.icon-btn:hover { background:var(--surface); }
.icon-btn svg { width:17px; height:17px; stroke:var(--muted); fill:none; stroke-width:1.8; }
.notif-dot { position:absolute; top:6px; right:6px; width:7px; height:7px; background:#e24b4a; border-radius:50%; border:1.5px solid #fff; }
.sell-pill {
  background:var(--g3); color:#fff; font-size:13px; font-weight:500;
  padding:9px 16px; border-radius:20px; border:none; cursor:pointer;
  white-space:nowrap; display:inline-block; transition:background 0.15s;
}
.sell-pill:hover { background:var(--g2); }

/* ════════ SIDEBAR — hidden on mobile ════════ */
.sidebar { display:none; }

/* ════════ PAGE WRAPPER — block on mobile ════════ */
.page-wrapper { display:block; margin-top:var(--topnav-h); }

/* ════════ SCROLL AREA ════════ */
.scroll-area { padding-bottom:calc(var(--bottomnav-h) + 16px); min-height:100vh; }

/* ════════ MOBILE SEARCH ════════ */
.search-wrap { padding:14px 16px 10px; }
.search-box {
  display:flex; align-items:center; background:#fff;
  border:1.5px solid var(--border); border-radius:12px;
  padding:0 14px; gap:10px; transition:border-color 0.2s;
}
.search-box:focus-within { border-color:var(--g3); }
.search-box > svg { width:16px; height:16px; stroke:var(--hint); fill:none; stroke-width:2; flex-shrink:0; }
.search-box input {
  flex:1; border:none; outline:none; font-size:14px;
  padding:12px 0; font-family:'DM Sans',sans-serif;
  color:var(--text); background:transparent; min-width:0;
}
.search-box input::placeholder { color:var(--hint); }
.filter-icon-btn {
  width:30px; height:30px; background:var(--gl); border-radius:8px;
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0; cursor:pointer; border:none;
}
.filter-icon-btn svg { width:14px; height:14px; stroke:var(--g2); stroke-width:2; fill:none; }

/* ════════ HERO ════════ */
.hero-card {
  margin:4px 16px 16px;
  background:linear-gradient(135deg,var(--g1) 0%,var(--g2) 55%,var(--g3) 100%);
  border-radius:20px; padding:24px 20px; position:relative; overflow:hidden;
}
.hero-card::before { content:''; position:absolute; top:-40px; right:-40px; width:180px; height:180px; border-radius:50%; background:rgba(255,255,255,0.05); pointer-events:none; }
.hero-card::after  { content:''; position:absolute; bottom:-50px; left:-20px; width:140px; height:140px; border-radius:50%; background:rgba(255,255,255,0.04); pointer-events:none; }
.hero-tag {
  display:inline-flex; align-items:center; gap:5px;
  background:rgba(255,255,255,0.15); color:#b8f0cc;
  font-size:11px; font-weight:500; padding:4px 10px;
  border-radius:12px; margin-bottom:12px; border:1px solid rgba(255,255,255,0.15);
}
.hero-card h1 { font-family:'Playfair Display',Georgia,serif; font-size:24px; font-weight:700; color:#fff; line-height:1.2; margin-bottom:8px; }
.hero-card > p { font-size:13px; color:#a8e6bc; margin-bottom:18px; }
.hero-btns { display:flex; gap:10px; flex-wrap:wrap; }
.hero-btn { padding:10px 18px; border-radius:12px; font-size:13px; font-weight:500; cursor:pointer; font-family:'DM Sans',sans-serif; display:inline-block; transition:opacity 0.2s,transform 0.15s; border:none; }
.hero-btn:active { opacity:0.88; transform:scale(0.98); }
.hero-btn.white { background:#fff; color:var(--g1); }
.hero-btn.outline { background:rgba(255,255,255,0.12); color:#fff; border:1px solid rgba(255,255,255,0.3); }
.hero-stats { display:flex; margin-top:18px; padding-top:16px; border-top:1px solid rgba(255,255,255,0.15); }
.hero-stat { flex:1; text-align:center; }
.hero-stat:not(:last-child) { border-right:1px solid rgba(255,255,255,0.15); }
.hero-stat b { display:block; font-size:16px; font-weight:600; color:#fff; }
.hero-stat span { font-size:10px; color:#a8e6bc; }

/* ════════ SECTION HEADERS ════════ */
.sec-head { display:flex; align-items:center; justify-content:space-between; padding:0 16px; margin-bottom:12px; }
.sec-title { font-size:15px; font-weight:600; color:var(--text); }
.sec-link { font-size:13px; color:var(--g3); font-weight:500; }

/* ════════ CATEGORIES ════════ */
.cats-scroll {
  padding:0 16px; overflow-x:auto;
  display:flex; gap:10px;
  -webkit-overflow-scrolling:touch; margin-bottom:20px; scrollbar-width:none;
}
.cats-scroll::-webkit-scrollbar { display:none; }
.cat-circle { width:60px; height:60px; border-radius:10px; background:#fff; border:1.5px solid var(--border); display:flex; align-items:center; justify-content:center; transition:all 0.2s; }
.cat-circle svg { width:24px; height:24px; stroke:var(--muted); fill:none; stroke-width:1.5; transition:stroke 0.2s; }
.cat-pill.active .cat-circle,.cat-pill:hover .cat-circle { background:var(--gl); border-color:var(--g3); }
.cat-pill.active .cat-circle svg,.cat-pill:hover .cat-circle svg { stroke:var(--g2); }
.cat-pill p { font-size:11px; font-weight:900; color:black; text-align:center; white-space:nowrap; }
.cat-pill.active p { color:var(--g2); }

/* ════════ FILTER CHIPS ════════ */
.chips-scroll { padding:0 16px; overflow-x:auto; display:flex; gap:7px; margin-bottom:18px; scrollbar-width:none; }
.chips-scroll::-webkit-scrollbar { display:none; }
.chip { flex-shrink:0; padding:7px 14px; border-radius:20px; font-size:12px; font-weight:500; border:1px solid var(--border); background:#fff; color:var(--muted); cursor:pointer; white-space:nowrap; transition:all 0.2s; user-select:none; }
.chip.active,.chip:hover { background:var(--gl); border-color:var(--g3); color:var(--g1); }

/* ════════ TAG BADGES ════════ */
.tag { display:inline-block; font-size:9px; font-weight:600; padding:2px 7px; border-radius:4px; margin-bottom:5px; letter-spacing:0.3px; text-transform:uppercase; }
.tag.green { background:var(--gl); color:var(--g2); }
.tag.blue  { background:var(--bl); color:var(--blue); }
.tag.amber { background:var(--al); color:var(--amber); }

/* ════════ FEATURED CARDS ════════ */
.featured-scroll { padding:0 16px; overflow-x:auto; display:flex; gap:12px; margin-bottom:24px; -webkit-overflow-scrolling:touch; scrollbar-width:none; }
.featured-scroll::-webkit-scrollbar { display:none; }
.fcard { flex-shrink:0; width:200px; background:#fff; border-radius:5px ; border:1px solid var(--border); overflow:hidden; display:block; transition:transform 0.15s,box-shadow 0.15s; }
.fcard:hover { transform:translateY(-3px); box-shadow:0 8px 24px rgba(26,107,58,0.10); }
.fcard-img { height:125px; overflow:hidden; position:relative;margin:5px !important; background:var(--gl); }
.fcard-img img { width:100%; height:100%; object-fit:cover; transition:transform 0.3s; }
.fcard:hover .fcard-img img { transform:scale(1.04); }
.fcard-badge { position:absolute; top:8px; left:8px; background:var(--g1); color:#fff; font-size:9px; font-weight:600; padding:3px 7px; border-radius:5px; letter-spacing:0.4px; pointer-events:none; }
.fcard-fav { position:absolute; top:8px; right:8px; width:28px; height:28px; background:rgba(255,255,255,0.92); border-radius:50%; display:flex; align-items:center; justify-content:center; border:none; cursor:pointer; transition:transform 0.15s; }
.fcard-fav:active { transform:scale(0.88); }
.fcard-fav svg { width:13px; height:13px; stroke:var(--hint); fill:none; stroke-width:2; transition:stroke 0.2s,fill 0.2s; }
.fcard-fav.saved svg { stroke:#e24b4a; fill:#e24b4a; }
.fcard-body { padding:11px 12px; }
.fcard-body h3 { font-size:13px; font-weight:600; color:var(--text); margin-bottom:4px; line-height:1.3; }
.fcard-body .price { font-size:14px; font-weight:600; color:var(--g1); margin-bottom:6px; }
.fcard-body .loc { display:flex; align-items:center; gap:3px; font-size:11px; color:var(--muted); }
.fcard-body .loc svg { width:10px; height:10px; stroke:currentColor; fill:none; stroke-width:2; flex-shrink:0; }

/* ════════ GRID LISTINGS ════════ */
.grid-list { padding:0 16px; display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:20px; }
.gcard { background:#fff; border-radius:5px; border:1px solid var(--border); overflow:hidden; display:block; transition:transform 0.15s,box-shadow 0.15s; text-decoration:none; }
.gcard:hover { transform:translateY(-2px); box-shadow:0 6px 20px rgba(26,107,58,0.09); }
.gcard-img { height:110px; overflow:hidden; position:relative; background:var(--gl); }
.gcard-img img { width:100%; height:100%; object-fit:cover; transition:transform 0.3s; }
.gcard:hover .gcard-img img { transform:scale(1.04); }
.gcard-badge { position:absolute; top:7px; left:7px; background:var(--g1); color:#fff; font-size:8px; font-weight:700; padding:2px 6px; border-radius:4px; letter-spacing:0.4px; }
.gcard-fav { position:absolute; top:7px; right:7px; width:26px; height:26px; background:rgba(255,255,255,0.92); border-radius:50%; display:flex; align-items:center; justify-content:center; border:none; cursor:pointer; transition:transform 0.15s; }
.gcard-fav:active { transform:scale(0.88); }
.gcard-fav svg { width:12px; height:12px; stroke:var(--hint); fill:none; stroke-width:2; transition:stroke 0.2s,fill 0.2s; }
.gcard-fav.saved svg { stroke:#e24b4a; fill:#e24b4a; }
.gcard-body { padding:10px 12px; }
.gcard-body h3 { font-size:15px; font-weight:900; color:var(--text); margin-bottom:4px; line-height:1.3; }
.gcard-body .price { font-size:14px; font-weight:600; color:var(--g1); margin-bottom:5px; }
.gcard-body .loc { display:flex; align-items:center; gap:3px; font-size:11px; color:var(--muted); }
.gcard-body .loc svg { width:10px; height:10px; stroke:currentColor; fill:none; stroke-width:2; flex-shrink:0; }
.gcard-body .age { font-size:10px; color:var(--hint); margin-top:3px; }

/* ════════ SELL BANNER ════════ */
.sell-banner { margin:4px 16px 20px; background:linear-gradient(135deg,#fef3db,#fff8e6); border:1px solid #f0d89a; border-radius:16px; padding:18px 16px; display:flex; align-items:center; gap:14px; }
.sell-banner-icon { width:46px; height:46px; background:var(--amber); border-radius:13px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.sell-banner-icon svg { width:22px; height:22px; stroke:#fff; fill:none; stroke-width:1.8; }
.sell-banner-text { flex:1; min-width:0; }
.sell-banner-text h4 { font-size:14px; font-weight:600; color:var(--text); margin-bottom:2px; }
.sell-banner-text p { font-size:12px; color:var(--muted); }
.sell-banner-btn { background:var(--amber); color:#fff; border:none; padding:10px 16px; border-radius:10px; font-size:13px; font-weight:500; cursor:pointer; white-space:nowrap; font-family:'DM Sans',sans-serif; flex-shrink:0; display:inline-block; transition:background 0.15s; text-decoration:none; }
.sell-banner-btn:hover { background:#b56b07; }

/* ════════ TRUST ROW ════════ */
.trust-row { padding:0 16px; display:flex; gap:10px; margin-bottom:28px; flex-wrap:wrap; }
.trust-item { flex:1; min-width:90px; background:#fff; border:1px solid var(--border); border-radius:12px; padding:14px 10px; text-align:center; }
.trust-icon { width:36px; height:36px; background:var(--gl); border-radius:10px; margin:0 auto 8px; display:flex; align-items:center; justify-content:center; }
.trust-icon svg { width:18px; height:18px; stroke:var(--g3); fill:none; stroke-width:1.8; }
.trust-item h5 { font-size:12px; font-weight:600; color:var(--text); margin-bottom:2px; }
.trust-item p { font-size:11px; color:var(--muted); line-height:1.3; }

/* ════════ BOTTOM NAV — mobile ════════ */
.bottomnav { position:fixed; bottom:0; left:0; right:0; height:var(--bottomnav-h); background:#fff; border-top:1px solid var(--border); display:flex; align-items:center; z-index:200; padding-bottom:env(safe-area-inset-bottom,0); }
.bnav-item { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; padding:6px 0; text-decoration:none; cursor:pointer; }
.bnav-item svg { width:20px; height:20px; stroke:var(--hint); fill:none; stroke-width:1.8; transition:stroke 0.2s; }
.bnav-item span { font-size:10px; color:var(--hint); font-weight:500; transition:color 0.2s; }
.bnav-item.active svg { stroke:var(--g2); }
.bnav-item.active span { color:var(--g2); }
.bnav-center { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; text-decoration:none; }
.bnav-fab { width:48px; height:48px; background:var(--g3); border-radius:16px; display:flex; align-items:center; justify-content:center; box-shadow:0 4px 16px rgba(45,145,84,0.4); margin-top:-20px; transition:background 0.2s,transform 0.15s; }
.bnav-fab:active { transform:scale(0.95); }
.bnav-fab svg { width:22px; height:22px; stroke:#fff; fill:none; stroke-width:2.2; }
.bnav-fab-label { font-size:10px; color:var(--g2); font-weight:600; }

/* ════════════════════════════════════════
   TABLET — 640px
   ════════════════════════════════════════ */
@media (min-width:640px) {
  .grid-list { grid-template-columns:repeat(3,1fr); gap:14px; }
  .gcard-img { height:130px; }
  .fcard { width:220px; }
  .hero-card h1 { font-size:28px; }
}

/* ════════════════════════════════════════
   DESKTOP — 1024px
   Full layout: fixed nav + sidebar + main
   ════════════════════════════════════════ */
@media (min-width:1024px) {

  body { background:#eef2eb; }

  /* ── Top nav becomes full-width website header ── */
  .topnav { padding:0 40px; gap:24px; }

  .nav-search {
    display:flex; flex:1; max-width:500px;
    align-items:center; background:var(--surface);
    border:1.5px solid var(--border); border-radius:10px;
    padding:0 14px; gap:10px; transition:border-color 0.2s;
  }
  .nav-search:focus-within { border-color:var(--g3); }
  .nav-search svg { width:15px; height:15px; stroke:var(--hint); fill:none; stroke-width:2; flex-shrink:0; }
  .nav-search input { flex:1; border:none; outline:none; font-size:14px; padding:10px 0; font-family:'DM Sans',sans-serif; background:transparent; color:var(--text); min-width:0; }
  .nav-search input::placeholder { color:var(--hint); }

  .nav-auth { display:flex; align-items:center; gap:10px; flex-shrink:0; }
  .nav-auth-link { font-size:13px; font-weight:500; color:var(--muted); padding:8px 14px; border-radius:8px; border:1px solid var(--border); background:#fff; text-decoration:none; transition:background 0.15s; }
  .nav-auth-link:hover { background:var(--surface); }

  /* Hide mobile-only elements */
  .search-wrap { display:none; }
  .bottomnav { display:none; }

  /* ── Page wrapper becomes flex: sidebar + main ── */
  .page-wrapper {
    display:flex; align-items:flex-start;
    max-width:var(--max-w); margin:var(--topnav-h) auto 0;
    padding:24px 40px; gap:28px;
  }

  /* ── SIDEBAR ── */
  .sidebar {
    display:flex; flex-direction:column;
    width:var(--side-w); flex-shrink:0;
    position:sticky; top:calc(var(--topnav-h) + 20px);
    gap:12px;
  }

  .sidebar-sell-btn {
    display:flex; align-items:center; justify-content:center; gap:8px;
    width:100%; background:var(--g3); color:#fff; border:none;
    border-radius:12px; padding:13px; font-size:14px; font-weight:600;
    cursor:pointer; font-family:'DM Sans',sans-serif;
    text-decoration:none; transition:background 0.15s;
  }
  .sidebar-sell-btn:hover { background:var(--g2); }
  .sidebar-sell-btn svg { width:16px; height:16px; stroke:#fff; fill:none; stroke-width:2.5; }

  .sidebar-section { background:#fff; border:1px solid var(--border); border-radius:16px; padding:16px; }

  .sidebar-label { font-size:10px; font-weight:600; color:var(--hint); text-transform:uppercase; letter-spacing:0.6px; margin-bottom:10px; padding:0 4px; display:block; }

  .sidebar-nav-item {
    display:flex; align-items:center; gap:10px; padding:10px 12px;
    border-radius:10px; font-size:13px; font-weight:500; color:var(--muted);
    cursor:pointer; transition:background 0.15s,color 0.15s; text-decoration:none;
  }
  .sidebar-nav-item svg { width:18px; height:18px; stroke:currentColor; fill:none; stroke-width:1.8; flex-shrink:0; }
  .sidebar-nav-item:hover { background:var(--surface); color:var(--text); }
  .sidebar-nav-item.active { background:var(--gl); color:var(--g2); font-weight:600; }
  .sidebar-nav-item.active svg { stroke:var(--g3); }

  .sidebar-cat-item {
    display:flex; align-items:center; gap:10px; padding:9px 12px;
    border-radius:10px; font-size:13px; color:var(--muted);
    cursor:pointer; transition:background 0.15s,color 0.15s; text-decoration:none;
  }
  .sidebar-cat-item svg { width:16px; height:16px; stroke:currentColor; fill:none; stroke-width:1.5; flex-shrink:0; }
  .sidebar-cat-item:hover { background:var(--surface); color:var(--text); }
  .sidebar-cat-item.active { background:var(--gl); color:var(--g2); }

  /* ── MAIN CONTENT ── */
  .scroll-area { flex:1; min-width:0; padding-bottom:48px; }

  /* Remove mobile side padding from all content inside scroll-area */
  .sec-head,
  .cats-scroll,
  .chips-scroll,
  .featured-scroll,
  .grid-list,
  .sell-banner,
  .trust-row { padding-left:0; padding-right:0; margin-left:0; margin-right:0; }

  .hero-card { margin:0 0 24px; padding:36px 40px; border-radius:24px; }
  .hero-card h1 { font-size:36px; }
  .hero-card > p { font-size:15px; }
  .hero-stats { margin-top:24px; padding-top:20px; }
  .hero-stat b { font-size:20px; }
  .hero-stat span { font-size:12px; }

  /* Categories — wrap instead of scroll on desktop */
  .cats-scroll { overflow-x:visible; flex-wrap:wrap; gap:12px; padding:0; }
  .cat-pill { flex-shrink:1; }
  .cat-circle { width:66px; height:66px; }

  /* Filter chips — wrap */
  .chips-scroll { overflow-x:visible; flex-wrap:wrap; gap:8px; padding:0; }

  /* Featured — allow stretch */
  .featured-scroll { padding:0; gap:16px; flex-wrap:wrap; overflow-x:visible; }
  .fcard { width:calc(25% - 12px); min-width:180px; flex-shrink:0; }
  .fcard-img { height:145px; }

  /* Grid — 3 columns */
  .grid-list { grid-template-columns:repeat(3,1fr); gap:18px; padding:0; }
  .gcard-img { height:150px; }
  .gcard-body h3 { font-size:14px; }
  .gcard-body .price { font-size:15px; }

  /* Sell banner */
  .sell-banner { margin:8px 0 24px; padding:22px 28px; border-radius:20px; }
  .sell-banner-text h4 { font-size:16px; }
  .sell-banner-text p { font-size:13px; }

  /* Trust */
  .trust-row { margin-bottom:32px; gap:16px; padding:0; }
  .trust-item { padding:18px 16px; }
  .trust-item h5 { font-size:13px; }
  .trust-item p { font-size:12px; }

  /* Section heads */
  .sec-head { padding:0; }
  .sec-title { font-size:17px; }
}

/* ════════════════════════════════════════
   LARGE DESKTOP — 1280px
   ════════════════════════════════════════ */
@media (min-width:1280px) {
  :root { --side-w:260px; }
  .page-wrapper { padding:28px 48px; gap:32px; }
  .grid-list { grid-template-columns:repeat(4,1fr); }
  .fcard { width:calc(20% - 13px); }
}
