:root {
  --navy:      #0B1F3A;
  --navy-mid:  #14304D;
  --gold:      #D4AF37;
  --gold-lt:   #E8C84A;
  --white:     #FFFFFF;
  --light:     #F2F4F7;
  --body:      #4A5568;
  --text:      #1C2B3A;
  --radius:    12px;
  --tr:        all .3s ease;
  --shadow:    0 4px 20px rgba(11,31,58,.10);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; background: var(--light); color: var(--body); }
a { text-decoration: none; color: inherit; }
h1,h2,h3,h4,h5 { font-family: 'Playfair Display', serif; }

/* ── HEADER ── */
.dir-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  padding: 20px 0 0;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 4px 24px rgba(0,0,0,.25);
}
.dir-header-top {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 16px;
  flex-wrap: wrap; gap: 12px;
}
.dir-logo { display: flex; align-items: center; gap: 10px; }
.dir-logo .vp {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem; font-weight: 700; color: var(--gold);
  border: 2px solid var(--gold); width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center; border-radius: 6px;
}
.dir-logo span { color: #fff; font-size: 1rem; font-weight: 600; }
.dir-back {
  background: rgba(212,175,55,.15); border: 1px solid rgba(212,175,55,.4);
  color: var(--gold); font-size: .82rem; font-weight: 600;
  padding: 8px 18px; border-radius: 50px; display: flex; align-items: center; gap: 6px;
  transition: var(--tr);
}
.dir-back:hover { background: var(--gold); color: var(--navy); }

/* Title bar */
.dir-title-bar {
  text-align: center;
  padding: 10px 0 20px;
}
.dir-title-bar h1 {
  font-size: clamp(1.4rem, 3vw, 2rem); color: #fff; margin-bottom: 4px;
}
.dir-title-bar p { font-size: .85rem; color: rgba(255,255,255,.6); }

/* Search bar */
.search-wrap {
  background: rgba(255,255,255,.06);
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 14px 0;
}
.search-inner {
  position: relative; max-width: 640px; margin: 0 auto;
}
.search-inner i {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--gold); font-size: 1rem; pointer-events: none;
}
#searchInput {
  width: 100%; padding: 13px 16px 13px 46px;
  background: rgba(255,255,255,.1); border: 1.5px solid rgba(212,175,55,.3);
  border-radius: 50px; color: #fff; font-size: .95rem;
  outline: none; transition: var(--tr);
}
#searchInput::placeholder { color: rgba(255,255,255,.45); }
#searchInput:focus { border-color: var(--gold); background: rgba(255,255,255,.14); }

/* ── FILTERS ── */
.filters-bar {
  background: #fff; border-bottom: 1px solid rgba(11,31,58,.07);
  padding: 14px 0; position: sticky; top: 195px; z-index: 99;
  box-shadow: var(--shadow);
}
.cat-tabs {
  display: flex; gap: 8px; overflow-x: auto;
  padding-bottom: 4px; scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-btn {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 7px;
  padding: 8px 18px; border-radius: 50px; border: 1.5px solid rgba(11,31,58,.15);
  background: transparent; font-size: .82rem; font-weight: 600;
  color: var(--text); cursor: pointer; transition: var(--tr); white-space: nowrap;
}
.cat-btn i { font-size: .85rem; }
.cat-btn.active, .cat-btn:hover {
  border-color: var(--gold); background: var(--gold); color: var(--navy);
}

.loc-select {
  flex-shrink: 0;
  padding: 8px 16px; border-radius: 50px;
  border: 1.5px solid rgba(11,31,58,.15);
  font-size: .82rem; font-weight: 600; color: var(--text);
  background: #fff; cursor: pointer; outline: none; transition: var(--tr);
}
.loc-select:focus { border-color: var(--gold); }

/* ── GRID ── */
.dir-body { padding: 28px 0 60px; }

.results-info {
  font-size: .82rem; color: var(--body);
  margin-bottom: 18px; padding: 0 4px;
}
.results-info strong { color: var(--navy); }

.dir-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.dir-card {
  background: #fff; border-radius: var(--radius);
  border: 1px solid rgba(11,31,58,.07);
  box-shadow: var(--shadow); overflow: hidden;
  transition: var(--tr); display: flex; flex-direction: column;
}
.dir-card:hover { transform: translateY(-4px); box-shadow: 0 12px 36px rgba(11,31,58,.14); border-color: rgba(212,175,55,.3); }

.card-top {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 18px 18px 14px;
}
.card-icon {
  width: 46px; height: 46px; min-width: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.icon-ambulance  { background: #FFF0F0; color: #E53E3E; }
.icon-hospital   { background: #F0F8FF; color: #2B6CB0; }
.icon-medicine   { background: #F0FFF4; color: #276749; }
.icon-doctor     { background: #FAF5FF; color: #6B46C1; }
.icon-water      { background: #EBF8FF; color: #2C7A7B; }
.icon-emergency  { background: #FFFAF0; color: #C05621; }
.icon-blood      { background: #FFF5F5; color: #C53030; }

.card-info { flex: 1; min-width: 0; }
.card-name {
  font-family: 'Playfair Display', serif;
  font-size: .98rem; font-weight: 700; color: var(--text);
  margin-bottom: 4px; line-height: 1.3;
}
.card-address {
  font-size: .78rem; color: #718096;
  display: flex; align-items: flex-start; gap: 5px; line-height: 1.4;
}
.card-address i { margin-top: 2px; color: var(--gold); font-size: .7rem; flex-shrink: 0; }

.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px 14px; gap: 8px;
}
.card-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge-cat {
  font-size: .68rem; font-weight: 700; letter-spacing: .5px;
  padding: 3px 10px; border-radius: 50px; text-transform: uppercase;
}
.badge-ambulance { background: #FFF0F0; color: #C53030; }
.badge-hospital  { background: #EBF4FF; color: #2B6CB0; }
.badge-medicine  { background: #F0FFF4; color: #276749; }
.badge-doctor    { background: #FAF5FF; color: #6B46C1; }
.badge-water     { background: #EBF8FF; color: #2C7A7B; }
.badge-emergency { background: #FFFAF0; color: #C05621; }
.badge-blood     { background: #FFF5F5; color: #C53030; }

.badge-loc {
  font-size: .68rem; font-weight: 600;
  background: rgba(212,175,55,.12); color: #744210;
  padding: 3px 10px; border-radius: 50px;
}
.call-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--navy); color: #fff;
  padding: 8px 16px; border-radius: 50px;
  font-size: .78rem; font-weight: 700;
  transition: var(--tr); white-space: nowrap; flex-shrink: 0;
  border: none; cursor: pointer;
}
.call-btn:hover { background: var(--gold); color: var(--navy); }
.call-btn i { font-size: .8rem; }

.no-results {
  text-align: center; padding: 60px 20px; color: var(--body);
  display: none; grid-column: 1/-1;
}
.no-results i { font-size: 3rem; color: var(--gold); margin-bottom: 16px; display: block; }

/* ── FOOTER ── */
.dir-footer {
  background: var(--navy); color: rgba(255,255,255,.5);
  text-align: center; font-size: .8rem; padding: 20px;
  border-top: 1px solid rgba(255,255,255,.07);
}
.dir-footer a { color: var(--gold); }

/* WhatsApp float */
#waFloat {
  position: fixed; bottom: 28px; right: 28px;
  width: 52px; height: 52px; background: #25D366;
  color: #fff; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 1.5rem;
  z-index: 999; box-shadow: 0 6px 20px rgba(37,211,102,.4);
  transition: var(--tr);
}
#waFloat:hover { transform: scale(1.1); }

@media (max-width: 576px) {
  .filters-bar { top: 180px; }
  .dir-grid { grid-template-columns: 1fr; }
}
