/* ===== ItsForSale – baby-blue marketplace design ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green: #7EC8E3;
  --green-dark: #7EC8E3;
  --green-light: #EFFAFF;
  --yellow: #f5b800;
  --yellow-dark: #d9a000;
  --blue: #1a73e8;
  --red: #e53935;
  --text: #0f1419;
  --text-muted: #5f6b76;
  --border: #e8eaed;
  --bg: #f4f5f7;
  --white: #ffffff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 10px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --nav-h: 68px;
  --top-h: 58px;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--nav-h) + 24px);
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* ===== Top bar ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(0,0,0,0.03);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--top-h);
  padding: 0 14px;
  max-width: 1200px;
  margin: 0 auto;
}
.logo {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.7px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.logo .brand-main { color: var(--text); }
.logo .brand-accent { color: var(--green); }
.topbar-actions { display: flex; gap: 2px; }
.icon-btn {
  width: 42px; height: 42px;
  border: none; background: transparent;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
}
.icon-btn:active, .icon-btn:hover { background: var(--bg); }

.search-drawer {
  display: none;
  padding: 0 12px 12px;
  max-width: 1200px;
  margin: 0 auto;
}
.search-drawer.open { display: block; }
.search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border-radius: 14px;
  padding: 11px 14px;
  border: 1px solid transparent;
}
.search-row:focus-within {
  border-color: var(--green);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(126,200,227,0.12);
}
.search-row i { color: #999; font-size: 15px; }
.search-row input {
  flex: 1; border: none; background: transparent;
  outline: none; font-size: 15px; color: var(--text);
}
.search-row input::placeholder { color: #aaa; }
.search-row select {
  border: none; background: transparent;
  font-size: 13px; font-weight: 600; color: var(--green);
  outline: none; max-width: 110px; cursor: pointer;
}

/* ===== Feed tabs ===== */
.feed-header {
  position: sticky;
  top: var(--top-h);
  z-index: 90;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
}
.feed-tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  max-width: 1200px;
  margin: 0 auto;
}
.feed-tabs::-webkit-scrollbar { display: none; }
.feed-tab {
  flex-shrink: 0;
  border: none;
  background: var(--bg);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13.5px;
  padding: 9px 18px;
  border-radius: 22px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.feed-tab.active {
  background: var(--green);
  color: white;
  box-shadow: 0 2px 8px rgba(126,200,227,0.3);
}
.feed-tab:not(.active):active { background: #e0e2e5; }

/* ===== Feed grid – photo first ===== */
.feed {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-width: 1200px;
  margin: 0 auto;
}
@media (min-width: 640px) {
  .feed { grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 16px; }
}
@media (min-width: 1024px) {
  .feed { grid-template-columns: repeat(4, 1fr); gap: 16px; }
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.card:hover { box-shadow: var(--shadow-lg); }
.card:active { transform: scale(0.97); }

.card-img {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #eef0f3;
  overflow: hidden;
}
.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.card:hover .card-img img { transform: scale(1.04); }

.card-badge {
  position: absolute;
  top: 9px;
  left: 9px;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  z-index: 2;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.badge-free { background: var(--yellow); color: #111; }
.badge-new { background: var(--blue); color: white; }
.badge-hot { background: var(--red); color: white; }

.card-save {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.92);
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 1px 5px rgba(0,0,0,0.12);
  transition: all 0.15s;
}
.card-save:active { transform: scale(0.9); }
.card-save.saved {
  background: #ffebee;
  color: var(--red);
}

.card-body {
  padding: 11px 12px 13px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card-price {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 3px;
  letter-spacing: -0.3px;
}
.card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
  margin-bottom: 8px;
  flex: 1;
}
.card-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-meta .dist {
  color: var(--green);
  font-weight: 600;
}

/* ===== Floating action button ===== */
.fab {
  position: fixed;
  right: 18px;
  bottom: calc(var(--nav-h) + 18px);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--green), var(--green-dark));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 6px 20px rgba(126,200,227,0.4);
  z-index: 80;
  transition: transform 0.15s, box-shadow 0.15s;
}
.fab:active { transform: scale(0.92); }
.fab:hover { box-shadow: 0 8px 28px rgba(126,200,227,0.5); }

/* ===== Bottom navigation ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 12px rgba(0,0,0,0.04);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 600;
  height: 100%;
  transition: color 0.15s;
}
.nav-item i { font-size: 20px; }
.nav-item.active { color: var(--green); }
.nav-item.nav-post { position: relative; }
.post-pill {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--green), var(--green-dark));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-top: -18px;
  box-shadow: 0 4px 14px rgba(126,200,227,0.35);
}
.nav-item.nav-post span:last-child { margin-top: 2px; }

/* ===== Secondary page header ===== */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; max-width: 1100px; margin: 0 auto; padding: 0 16px;
}
.header .logo { font-size: 19px; font-weight: 800; letter-spacing: -0.5px; gap: 4px; }
.header .logo .brand-accent { color: var(--green); }
.header-actions { display: flex; gap: 8px; align-items: center; }
.nav-desktop { display: none; gap: 22px; }
.nav-desktop a { font-weight: 600; font-size: 14px; color: var(--text-muted); }
.nav-desktop a:hover, .nav-desktop a.active { color: var(--green); }
.menu-toggle {
  background: none; border: none; font-size: 20px; cursor: pointer; padding: 6px;
}
.mobile-menu {
  display: none; flex-direction: column;
  background: white; border-top: 1px solid var(--border);
  padding: 8px 16px 16px;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  padding: 13px 0; font-weight: 500; border-bottom: 1px solid var(--border);
}
.mobile-post { color: var(--green) !important; font-weight: 700 !important; }

/* ===== Forms & buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-primary {
  background: linear-gradient(145deg, var(--green), var(--green-dark));
  color: white;
  box-shadow: 0 3px 12px rgba(126,200,227,0.3);
}
.btn-primary:active { transform: scale(0.98); }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--green); color: var(--green); }
.btn-block { width: 100%; }

.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  background: var(--white);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(126,200,227,0.12);
}
.form-textarea { min-height: 110px; resize: vertical; }

.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* ===== Ad cards on secondary pages ===== */
.ad-card {
  background: white; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform 0.15s;
}
.ad-card:active { transform: scale(0.98); }
.ad-image { height: 150px; background: #eef0f3; position: relative; overflow: hidden; }
.ad-image img { width: 100%; height: 100%; object-fit: cover; }
.ad-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--green); color: white;
  font-size: 10px; font-weight: 700; padding: 3px 7px; border-radius: 5px;
  text-transform: uppercase;
}
.ad-badge.dealer { background: var(--blue); }
.ad-badge.free { background: var(--yellow); color: #111; }
.ad-body { padding: 12px 13px 14px; }
.ad-price { font-size: 16px; font-weight: 800; margin-bottom: 3px; }
.ad-title {
  font-size: 13.5px; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.3; margin-bottom: 6px;
}
.ad-meta {
  font-size: 11.5px; color: var(--text-muted);
  display: flex; justify-content: space-between;
}

/* ===== Footer ===== */
.footer {
  background: #0c1a16; color: #a8b5b0; padding: 40px 0 28px; margin-top: 24px;
}
.footer a { color: #c5d4ce; }
.footer a:hover { color: white; }
.footer-bottom {
  text-align: center; font-size: 12px; color: #6a7a74;
  padding-top: 18px; border-top: 1px solid #1a2e28;
}

/* ===== Modal ===== */
.modal {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 200;
  align-items: center; justify-content: center; padding: 20px;
}
.modal.open { display: flex; }
.modal-content {
  background: white; border-radius: 18px; padding: 26px;
  max-width: 360px; width: 100%; text-align: center; position: relative;
  box-shadow: var(--shadow-lg);
}
.modal-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; font-size: 26px; cursor: pointer; color: #999;
}

/* ===== Empty / helper states ===== */
.feed-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 70px 24px;
  color: var(--text-muted);
}
.feed-empty i { font-size: 42px; color: #ccc; margin-bottom: 14px; display: block; }
.feed-empty h3 { font-size: 18px; color: var(--text); margin-bottom: 6px; }
.feed-empty p { font-size: 14px; margin-bottom: 18px; }

.page-hero {
  background: linear-gradient(160deg, var(--green-light), #fff 70%);
  padding: 28px 16px 22px;
  text-align: center;
}
.page-hero h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 6px; }
.page-hero p { color: var(--text-muted); font-size: 14.5px; }

/* Legal pages */
.legal {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 18px 60px;
  background: var(--white);
  min-height: 70vh;
}
.legal h1 { font-size: 26px; margin-bottom: 8px; }
.legal h2 { font-size: 17px; margin: 28px 0 10px; color: var(--green-dark); }
.legal p, .legal li { font-size: 14.5px; color: #333; margin-bottom: 10px; line-height: 1.55; }
.legal ul { padding-left: 20px; margin-bottom: 12px; }

@media (min-width: 900px) {
  .nav-desktop { display: flex; }
  .menu-toggle { display: none; }
  .fab { display: none; }
}

.safe-bottom { padding-bottom: env(safe-area-inset-bottom); }

/* ===== How it works strip ===== */
.how-strip {
  background: linear-gradient(160deg, var(--green-light), #fff 85%);
  padding: 14px 14px 12px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.how-tagline {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.how-steps {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}
.how-step {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.how-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* ===== ItsForSale brand refresh ===== */
.logo {
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  line-height: 1;
}
.logo-mark {
  display: block;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  object-fit: contain;
}
.brand-wordmark {
  display: inline-flex;
  align-items: baseline;
  letter-spacing: -0.75px;
  font-family: "Poppins", sans-serif;
  font-weight: 800;
}
.logo .brand-main { color: #000000; }
.logo .brand-accent { color: #7EC8E3; }
.topbar-inner { min-height: 62px; }
.topbar .logo {
  font-size: 22px;
  gap: 6px;
  letter-spacing: -0.75px;
}
.header .logo { font-size: 20px; }
.icon-btn { color: #000000; }
.feed-tab.active {
  background: #7EC8E3;
  color: #FFFFFF;
  box-shadow: 0 3px 10px rgba(126, 200, 227, .28);
}
.fab, .post-pill, .btn-primary {
  background: #7EC8E3;
  color: #FFFFFF;
}
.fab:hover, .btn-primary:hover { background: #7EC8E3; filter: brightness(.97); }
.nav-item.active, .mobile-post { color: #7EC8E3 !important; }
.card-meta .dist, .filters h3 a, .breadcrumb a { color: #7EC8E3; }
@media (max-width: 380px) {
  .topbar .logo { font-size: 19px; gap: 3px; }
  .topbar .logo-mark { width: 38px; height: 38px; }
  .topbar-actions { gap: 0; }
  .icon-btn { width: 38px; height: 40px; }
}
  .topbar .logo-mark { width: 30px; height: 30px; }
  .topbar-actions { gap: 0; }
  .icon-btn { width: 38px; height: 40px; }
}
