/* BazaarKhoj — mobile-first business directory */
:root {
  --brand: #0d6e4f;
  --brand-dark: #08553c;
  --brand-light: #e8f5ef;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --text: #1a1a1a;
  --muted: #5c6b66;
  --border: #e2e8e5;
  --bg: #f7faf8;
  --card: #ffffff;
  --danger: #dc2626;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(13, 110, 79, 0.08);
  --shadow-lg: 0 8px 28px rgba(13, 110, 79, 0.12);
  --max: 1100px;
  --font: "Segoe UI", system-ui, -apple-system, "Noto Sans", Roboto, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* —— Header —— */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--brand);
  text-decoration: none;
}

.logo:hover { text-decoration: none; color: var(--brand-dark); }

.logo-mark {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--brand), #14a87a);
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nav a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  text-decoration: none;
}

.nav a:hover { background: var(--brand-light); color: var(--brand); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.15rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  text-decoration: none;
  font-family: inherit;
}

.btn:active { transform: scale(0.98); }
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--brand);
  color: #fff;
}
.btn-primary:hover { background: var(--brand-dark); color: #fff; }

.btn-accent {
  background: var(--accent);
  color: #1a1a1a;
}
.btn-accent:hover { background: var(--accent-dark); color: #fff; }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--brand);
  color: var(--brand);
}
.btn-outline:hover { background: var(--brand-light); }

.btn-call {
  background: #16a34a;
  color: #fff;
}
.btn-call:hover { background: #15803d; color: #fff; }

.btn-wa {
  background: #25d366;
  color: #fff;
}
.btn-wa:hover { background: #1da851; color: #fff; }

.btn-sm { padding: 0.45rem 0.85rem; font-size: 0.85rem; }
.btn-block { width: 100%; }

.btn-add {
  background: var(--brand);
  color: #fff !important;
  padding: 0.45rem 0.9rem !important;
}
.btn-add:hover { background: var(--brand-dark) !important; }

/* —— Hero / Search —— */
.hero {
  background: linear-gradient(160deg, #0d6e4f 0%, #0a8f66 55%, #14a87a 100%);
  color: #fff;
  padding: 2.25rem 1rem 2.75rem;
}

.hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 800;
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}

.hero p {
  opacity: 0.92;
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

.search-box {
  background: var(--card);
  border-radius: 14px;
  padding: 0.75rem;
  display: grid;
  gap: 0.6rem;
  box-shadow: var(--shadow-lg);
  max-width: 720px;
  margin: 0 auto;
  text-align: left;
}

@media (min-width: 640px) {
  .search-box {
    grid-template-columns: 1fr 160px auto;
    align-items: stretch;
  }
}

.search-box label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

.search-field {
  display: flex;
  flex-direction: column;
}

.search-box input,
.search-box select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
}

.search-box input:focus,
.search-box select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(13, 110, 79, 0.15);
}

.search-box .btn {
  align-self: stretch;
  padding: 0.75rem 1.25rem;
}

@media (min-width: 640px) {
  .search-box .btn { align-self: end; height: 46px; }
}

/* —— Layout —— */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1rem;
  width: 100%;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.section-title a {
  font-size: 0.875rem;
  font-weight: 600;
}

.badge {
  display: inline-block;
  background: var(--accent);
  color: #1a1a1a;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-new {
  background: #dbeafe;
  color: #1e40af;
}

/* —— Categories grid —— */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 480px) {
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 768px) {
  .cat-grid { grid-template-columns: repeat(5, 1fr); }
}

.cat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 0.75rem;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.1s;
  box-shadow: var(--shadow);
}

.cat-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--brand);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--text);
}

.cat-icon {
  font-size: 1.75rem;
  margin-bottom: 0.4rem;
  line-height: 1;
}

.cat-card h3 {
  font-size: 0.85rem;
  font-weight: 600;
}

.cat-count {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

/* —— Listing cards —— */
.listing-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .listing-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .listing-grid { grid-template-columns: repeat(3, 1fr); }
}

.listing-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: box-shadow 0.15s;
}

.listing-card:hover { box-shadow: var(--shadow-lg); }

.listing-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.listing-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
}

.listing-card h3 a { color: var(--text); text-decoration: none; }
.listing-card h3 a:hover { color: var(--brand); }

.meta {
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
}

.meta span::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  background: var(--muted);
  border-radius: 50%;
  margin-right: 0.4rem;
  vertical-align: middle;
  opacity: 0.5;
}

.meta span:first-child::before { display: none; }

.listing-card .desc {
  font-size: 0.875rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

/* —— Filters bar —— */
.filters {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.25rem;
  display: grid;
  gap: 0.75rem;
  box-shadow: var(--shadow);
}

@media (min-width: 640px) {
  .filters {
    grid-template-columns: 1fr 160px 160px auto;
    align-items: end;
  }
}

.filters label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 0.25rem;
}

.filters input,
.filters select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
}

.filters input:focus,
.filters select:focus {
  outline: none;
  border-color: var(--brand);
}

.results-meta {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  color: var(--muted);
}

.empty-state strong { color: var(--text); display: block; margin-bottom: 0.35rem; }

/* —— Detail page —— */
.detail {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .detail {
    grid-template-columns: 1fr 300px;
    align-items: start;
  }
}

.detail-main {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.detail-main h1 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.detail-sidebar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 72px;
}

.detail-sidebar h2 {
  font-size: 1rem;
  margin-bottom: 0.85rem;
}

.cta-stack {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.info-row {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.info-item dt {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.info-item dd {
  font-size: 0.95rem;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.breadcrumb a { color: var(--brand); }

/* —— Form —— */
.form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  max-width: 560px;
  margin: 0 auto;
}

.form-card h1 {
  font-size: 1.35rem;
  margin-bottom: 0.35rem;
}

.form-card .lead {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.35rem;
}

.form-group .hint {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 400;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
}

.form-group textarea { min-height: 100px; resize: vertical; }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(13, 110, 79, 0.15);
}

.form-group.error input,
.form-group.error select,
.form-group.error textarea {
  border-color: var(--danger);
}

.error-msg {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 0.25rem;
  display: none;
}

.form-group.error .error-msg { display: block; }

.form-success {
  background: var(--brand-light);
  border: 1px solid #a7d9c4;
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  display: none;
}

.form-success.show { display: block; }
.form-success h2 { color: var(--brand); margin-bottom: 0.5rem; }

/* —— Footer —— */
.site-footer {
  margin-top: auto;
  background: #0a3d2e;
  color: rgba(255,255,255,0.85);
  padding: 2rem 1rem 1.5rem;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .footer-inner {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.footer-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 0.4rem;
}

.site-footer p { font-size: 0.875rem; line-height: 1.6; }
.site-footer a { color: #a7f3d0; }
.site-footer h4 {
  color: #fff;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 0.35rem; font-size: 0.875rem; }

.footer-bottom {
  max-width: var(--max);
  margin: 1.5rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  text-align: center;
}

/* —— Cities strip —— */
.cities-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1.25rem;
}

.city-chip {
  background: rgba(255,255,255,0.18);
  color: #fff;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.25);
}

.city-chip:hover {
  background: rgba(255,255,255,0.3);
  text-decoration: none;
  color: #fff;
}

/* —— Page title bar —— */
.page-bar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 1rem;
}

.page-bar-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.page-bar h1 {
  font-size: 1.35rem;
  font-weight: 800;
}

/* —— Utility —— */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
.text-muted { color: var(--muted); }

/* Quote form on listing detail */
.quote-form input,
.quote-form textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font: inherit;
  margin-bottom: 0.5rem;
  background: #fff;
}
.quote-form input:focus,
.quote-form textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(13, 110, 79, 0.15);
}

/* —— Mobile polish (phones) —— */
@media (max-width: 639px) {
  .header-inner { padding: 0.65rem 0.85rem; gap: 0.5rem; }
  .logo { font-size: 1.1rem; }
  .logo-mark { width: 32px; height: 32px; font-size: 0.9rem; }
  .nav a:not(.btn-add) { padding: 0.35rem 0.45rem; font-size: 0.82rem; }
  .nav a[href="business/login.php"] { display: none; }
  .hero { padding: 1.75rem 0.85rem 2.1rem; }
  .hero p { font-size: 0.92rem; margin-bottom: 1.15rem; }
  .search-box { padding: 0.85rem; border-radius: 16px; }
  .search-box .btn { width: 100%; min-height: 48px; font-size: 1rem; }
  .cities-strip { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; padding-bottom: 0.25rem; }
  .city-chip { flex: 0 0 auto; }
  .container { padding: 1.25rem 0.85rem 2rem; }
  .section-title { font-size: 1.1rem; }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; }
  .listing-grid { grid-template-columns: 1fr; gap: 0.85rem; }
  .listing-card .card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem; }
  .listing-card .card-actions .btn-outline { grid-column: 1 / -1; }
  .site-footer .footer-inner { grid-template-columns: 1fr; gap: 1.25rem; }
}

/* —— Share / viral —— */
.btn-share {
  cursor: pointer;
  font: inherit;
}
.btn-share-wa {
  font-weight: 600;
}
.share-promo a {
  font-weight: 600;
}
@media (max-width: 560px) {
  .listing-card .card-actions .btn-share {
    grid-column: 1 / -1;
  }
}

/* —— Invite sticky bar (home) —— */
.invite-sticky {
  position: sticky;
  top: 57px;
  z-index: 90;
  background: #ecfdf5;
  border-bottom: 1px solid #bbf7d0;
  text-align: center;
  padding: 0.45rem 0.75rem;
  font-size: 0.9rem;
}
.invite-sticky a {
  color: var(--brand-dark);
  font-weight: 700;
  text-decoration: none;
}
.invite-sticky a:hover { text-decoration: underline; }

/* —— Invite / grow pages —— */
.invite-hero {
  background: linear-gradient(160deg, #0d6e4f 0%, #0a8f66 55%, #25d366 100%);
  color: #fff;
  padding: 2rem 1rem 2.5rem;
  text-align: center;
}
.invite-hero-grow {
  background: linear-gradient(160deg, #0d6e4f 0%, #0a8f66 70%, #14a87a 100%);
}
.invite-hero-inner {
  max-width: 640px;
  margin: 0 auto;
}
.invite-kicker {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.9;
  margin-bottom: 0.5rem;
  font-weight: 600;
}
.invite-hero h1 {
  font-size: clamp(1.45rem, 4.5vw, 2rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}
.invite-hero p {
  font-size: 1rem;
  opacity: 0.95;
  margin-bottom: 1.25rem;
  line-height: 1.45;
}
.invite-cta-row {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  align-items: stretch;
}
.btn-invite-lg {
  min-height: 52px;
  font-size: 1.05rem;
  padding: 0.85rem 1.25rem;
  border-radius: 12px;
  font-weight: 700;
}
.invite-hero .btn-outline {
  background: rgba(255,255,255,0.15);
  border-color: #fff;
  color: #fff;
}
.invite-hero .btn-outline:hover {
  background: rgba(255,255,255,0.28);
  color: #fff;
}
.invite-copied {
  margin-top: 0.75rem;
  font-weight: 600;
  color: #dcfce7;
}
.invite-main .invite-lead {
  margin-bottom: 1.25rem;
}
.invite-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.invite-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1rem 1.25rem;
  box-shadow: var(--shadow);
}
.invite-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.65rem;
  color: var(--brand-dark);
}
.invite-msg {
  background: var(--brand-light);
  border-left: 4px solid var(--brand);
  padding: 0.75rem 0.9rem;
  margin: 0 0 0.85rem;
  font-size: 0.92rem;
  border-radius: 0 8px 8px 0;
  color: var(--text);
  font-style: normal;
  line-height: 1.45;
}
.mt-invite-copy { margin-top: 0.5rem; }
.invite-tips-list {
  padding-left: 1.2rem;
  color: var(--muted);
}
.invite-tips-list li { margin-bottom: 0.45rem; }

.grow-captions {
  list-style: decimal;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.grow-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.grow-item p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
}
.grow-hashtags {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--brand-dark);
  word-break: break-word;
}

@media (min-width: 640px) {
  .invite-cta-row {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
  }
  .invite-cta-row .btn { min-width: 220px; }
  .invite-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .grow-item {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .grow-item p { flex: 1; padding-right: 0.75rem; }
}

@media (max-width: 560px) {
  .invite-sticky { top: 52px; font-size: 0.82rem; }
  .nav a[href="invite.html"] { color: var(--brand); font-weight: 700; }
}

/* —— Popular / SEO keyword searches —— */
.popular-searches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.popular-searches-section {
  padding: 0.25rem 0 0.5rem;
}
.seo-intro {
  color: var(--muted);
  line-height: 1.55;
  max-width: 46rem;
  margin: 0 0 0.5rem;
}
.seo-breadcrumb a {
  color: var(--muted);
}
.site-footer .footer-bottom:only-child {
  border-top: none;
  padding-top: 1rem;
}
