/* Jaipur Doctors — mobile-first medical directory */
:root {
  --teal-50: #f0fdfa;
  --teal-100: #ccfbf1;
  --teal-200: #99f6e4;
  --teal-500: #14b8a6;
  --teal-600: #0d9488;
  --teal-700: #0f766e;
  --teal-800: #115e59;
  --emerald-600: #059669;
  --wa: #25d366;
  --wa-dark: #1da851;
  --bg: #f3f4f6;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --star: #f59e0b;
  --danger: #dc2626;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.04);
  --shadow-lg: 0 8px 30px rgba(15,118,110,.12);
  --max: 720px;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Noto Sans", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--teal-700); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
button, input, select { font: inherit; }
textarea { font: inherit; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.site-header {
  background: linear-gradient(135deg, var(--teal-700), var(--teal-600) 55%, var(--emerald-600));
  color: #fff;
  padding: 14px 0 18px;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 2px 12px rgba(15,118,110,.25);
}
.site-header .wrap { display: flex; align-items: center; gap: 12px; }
.brand {
  display: flex; align-items: center; gap: 10px;
  color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem;
}
.brand:hover { text-decoration: none; opacity: .95; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(255,255,255,.18);
  display: grid; place-items: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.brand-sub { display: block; font-size: .7rem; font-weight: 500; opacity: .85; letter-spacing: .02em; }
.header-actions { margin-left: auto; display: flex; gap: 8px; }
.header-link {
  color: #fff; font-size: .85rem; padding: 6px 10px;
  border-radius: 8px; background: rgba(255,255,255,.12);
  text-decoration: none;
}
.header-link:hover { background: rgba(255,255,255,.22); text-decoration: none; }

/* Hero */
.hero {
  background: linear-gradient(180deg, var(--teal-700) 0%, var(--teal-600) 40%, transparent 100%);
  color: #fff;
  padding: 8px 0 28px;
  margin-top: -1px;
}
.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.45rem, 5vw, 1.85rem);
  font-weight: 750;
  letter-spacing: -.02em;
}
.hero p { margin: 0 0 16px; opacity: .92; font-size: .98rem; }
.search-box {
  display: flex; gap: 8px; background: #fff; border-radius: 12px;
  padding: 6px; box-shadow: var(--shadow-lg);
}
.search-box input {
  flex: 1; border: 0; outline: 0; padding: 12px 14px;
  border-radius: 10px; color: var(--text); min-width: 0;
}
.search-box button {
  border: 0; background: var(--teal-600); color: #fff;
  padding: 10px 16px; border-radius: 10px; font-weight: 600; cursor: pointer;
  white-space: nowrap;
}
.search-box button:hover { background: var(--teal-700); }

/* Cards & sections */
main { flex: 1; padding: 20px 0 40px; }
.section-title {
  font-size: 1.05rem; font-weight: 700; margin: 0 0 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.section-title span.muted { font-weight: 500; font-size: .85rem; color: var(--muted); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Specialty grid */
.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 540px) {
  .spec-grid { grid-template-columns: repeat(3, 1fr); }
}
.spec-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none; color: inherit;
  transition: transform .12s, box-shadow .12s, border-color .12s;
  min-height: 96px;
}
.spec-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--teal-200);
  text-decoration: none;
}
.spec-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--teal-50); color: var(--teal-700);
  display: grid; place-items: center; font-size: 1.1rem;
}
.spec-name { font-weight: 650; font-size: .92rem; line-height: 1.25; }
.spec-count { font-size: .78rem; color: var(--muted); }

/* Doctor list cards */
.filters {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px;
  align-items: center;
}
.filters input[type="search"], .filters select {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; background: #fff; min-width: 0;
}
.filters input[type="search"] { flex: 1 1 160px; }
.filters select { flex: 0 0 auto; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: #fff;
  font-size: .82rem; cursor: pointer; user-select: none;
}
.chip input { accent-color: var(--teal-600); }
.chip.on { background: var(--teal-50); border-color: var(--teal-200); color: var(--teal-800); }

.doc-list { display: flex; flex-direction: column; gap: 10px; }
.doc-card {
  display: block; padding: 14px; color: inherit;
  transition: border-color .12s, box-shadow .12s;
}
.doc-card:hover {
  border-color: var(--teal-200); box-shadow: var(--shadow-lg);
}
.doc-card-main {
  display: block; text-decoration: none; color: inherit;
}
.doc-card-main:hover { text-decoration: none; }
.doc-card-top {
  display: flex; justify-content: space-between; gap: 10px; align-items: flex-start;
}
.doc-name { font-weight: 700; font-size: 1.02rem; margin: 0 0 4px; color: var(--text); }
.doc-meta { font-size: .82rem; color: var(--muted); margin: 0; }
.doc-addr {
  font-size: .82rem; color: var(--muted); margin: 8px 0 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.doc-actions {
  display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap;
}
.rating {
  display: inline-flex; align-items: center; gap: 4px;
  background: #fffbeb; color: #92400e;
  border: 1px solid #fde68a;
  padding: 3px 8px; border-radius: 8px;
  font-size: .8rem; font-weight: 700; white-space: nowrap;
}
.rating .star { color: var(--star); }
.badge {
  display: inline-block; font-size: .7rem; font-weight: 600;
  padding: 2px 8px; border-radius: 999px;
  background: var(--teal-50); color: var(--teal-800);
  border: 1px solid var(--teal-100);
}
.badge-open { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.badge-closed { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 16px; border-radius: 11px; font-weight: 650;
  border: 0; cursor: pointer; text-decoration: none; font-size: .92rem;
  transition: transform .1s, background .12s;
}
.btn:active { transform: scale(.98); }
.btn:hover { text-decoration: none; }
.btn-wa {
  background: var(--wa); color: #fff;
  box-shadow: 0 4px 14px rgba(37,211,102,.35);
}
.btn-wa:hover { background: var(--wa-dark); color: #fff; }
.btn-call {
  background: var(--teal-50); color: var(--teal-800);
  border: 1px solid var(--teal-200);
}
.btn-call:hover { background: var(--teal-100); color: var(--teal-800); }
.btn-ghost {
  background: #fff; color: var(--text); border: 1px solid var(--border);
}
.btn-block { width: 100%; }
.btn-lg { padding: 14px 18px; font-size: 1rem; }

/* Doctor profile */
.profile-hero {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.profile-hero h1 {
  margin: 0 0 6px; font-size: 1.35rem; letter-spacing: -.02em;
}
.profile-cta {
  display: flex; flex-direction: column; gap: 10px;
  margin: 16px 0;
  position: sticky; bottom: 12px; z-index: 20;
}
.profile-cta .pair { display: flex; gap: 8px; }
.profile-cta .pair .btn { flex: 1; }
.info-list { display: flex; flex-direction: column; gap: 0; }
.info-row {
  display: grid; grid-template-columns: 28px 1fr;
  gap: 10px; padding: 14px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.info-row:last-child { border-bottom: 0; }
.info-icon { font-size: 1.1rem; line-height: 1.4; }
.info-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.info-value { font-size: .95rem; word-break: break-word; }
.info-value a { font-weight: 600; }

.breadcrumb {
  font-size: .8rem; color: var(--muted); margin: 0 0 14px;
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
}
.breadcrumb a { color: var(--teal-700); }
.breadcrumb .sep { opacity: .5; }

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

/* Footer */
.site-footer {
  background: #fff; border-top: 1px solid var(--border);
  padding: 22px 0; font-size: .8rem; color: var(--muted);
  margin-top: auto;
}
.site-footer strong { color: var(--text); }

/* Search results page */
#search-results .doc-card { cursor: pointer; }
.hidden { display: none !important; }

.intro-note {
  background: var(--teal-50); border: 1px solid var(--teal-100);
  border-radius: var(--radius); padding: 12px 14px;
  font-size: .88rem; color: var(--teal-800); margin-bottom: 18px;
}

/* Live search suggestions */
.search-box-live { position: relative; }
.search-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-lg); z-index: 40; overflow: hidden;
  max-height: min(70vh, 420px); overflow-y: auto; text-align: left;
}
.search-suggest.hidden { display: none; }
.suggest-group {
  padding: 10px 14px 4px; font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
}
.suggest-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 14px; text-decoration: none; color: inherit;
  border-top: 1px solid #f1f5f9;
}
.suggest-item:hover, .suggest-item:focus { background: var(--teal-50); outline: none; }
.suggest-main { font-weight: 650; font-size: .95rem; color: #0f172a; }
.search-suggest, .search-suggest a { color: #0f172a; }
.suggest-meta { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-all { font-weight: 700; color: var(--teal-800); background: #f8fffc; }
.suggest-empty { padding: 14px; color: var(--muted); font-size: .9rem; }

.spec-shortcuts { margin: 0 0 14px; }
.spec-shortcuts.hidden { display: none; }
.spec-shortcuts-label { font-size: .78rem; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.spec-shortcuts-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-link {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 8px 12px; border-radius: 999px; font-size: .85rem; font-weight: 600;
  background: #fff; border: 1px solid var(--border); color: var(--text); text-decoration: none;
}
.chip-link:hover { border-color: var(--teal-200); background: var(--teal-50); color: var(--teal-800); }

/* WhatsApp intent modal — solid card, no blur on form */
body.wa-modal-open { overflow: hidden; }
.wa-modal.hidden { display: none !important; }
.wa-modal {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  padding: 16px;
}
.wa-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.wa-modal-card {
  position: relative; z-index: 1;
  width: min(440px, 100%);
  max-height: min(90vh, 640px);
  overflow: auto;
  background: #ffffff;
  color: #0f172a;
  border-radius: 16px;
  padding: 22px 18px 16px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.35);
  isolation: isolate;
}
.wa-modal-card h2 { margin: 0 36px 6px 0; font-size: 1.2rem; color: #0f172a; }
.wa-modal-sub { margin: 0 0 14px; color: #64748b; font-size: .9rem; }
.wa-modal-x {
  position: absolute; top: 10px; right: 10px;
  width: 36px; height: 36px;
  border: 0; border-radius: 999px;
  background: #f1f5f9; color: #0f172a;
  font-size: 1.4rem; line-height: 1; cursor: pointer;
}
#wa-form { display: flex; flex-direction: column; gap: 10px; }
#wa-form label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: .82rem; font-weight: 650; color: #334155;
}
#wa-form input, #wa-form select {
  border: 1px solid #cbd5e1; border-radius: 10px; padding: 11px 12px;
  font: inherit; font-weight: 500; color: #0f172a; background: #fff;
}
#wa-form input:focus, #wa-form select:focus {
  outline: 3px solid #ccfbf1; border-color: #0d9488;
}
.wa-skip {
  border: 0; background: none; color: #64748b; font-size: .85rem;
  cursor: pointer; padding: 6px; text-decoration: underline;
}
