/* Sticky search + filter toolbar */
.dir-toolbar {
  position: sticky;
  top: 72px;
  z-index: 50;
  background: var(--cream);
  border-bottom: 1px solid var(--sand-mid);
  padding: 1rem 6vw;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.dir-toolbar-row {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  flex-wrap: wrap;
}

.dir-search {
  flex: 1;
  min-width: 230px;
  position: relative;
}
.dir-search input {
  width: 100%;
  font-family: var(--ff-body);
  font-size: 0.92rem;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  min-height: 44px;
  border: 1.5px solid var(--sand-mid);
  border-radius: 3px;
  background: var(--white);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease;
}
.dir-search input:focus {
  border-color: var(--indigo);
}
.dir-search::before {
  content: '🔍';
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  opacity: 0.55;
  pointer-events: none;
}

.dir-city select {
  font-family: var(--ff-body);
  font-size: 0.88rem;
  padding: 0.72rem 1rem;
  min-height: 44px;
  border: 1.5px solid var(--sand-mid);
  border-radius: 3px;
  background: var(--white);
  color: var(--indigo);
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.dir-city select:focus {
  border-color: var(--indigo);
}

.dir-cats {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 0.2rem;
}
.dir-cats::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  font-family: var(--ff-body);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--indigo);
  background: var(--white);
  border: 1.5px solid var(--sand-mid);
  border-radius: 22px;
  padding: 0.45rem 1rem;
  min-height: 40px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.cat-pill:hover {
  border-color: var(--gold);
}
.cat-pill.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--indigo-dark);
  font-weight: 600;
}

/* Results count */
.dir-section {
  background: var(--cream);
  padding-top: 60px;
}

.dir-count {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 1.4rem;
}

/* Business cards */
#biz-grid,
.biz-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 1.5rem !important;
  width: 100% !important;
}

@media (max-width: 1024px) {
  #biz-grid,
  .biz-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 600px) {
  #biz-grid,
  .biz-grid {
    grid-template-columns: 1fr !important;
  }
}

.biz-card {
  background: var(--white);
  border: 1px solid var(--sand-mid);
  border-radius: 4px;
  padding: 1.7rem 1.7rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.biz-card:hover {
  box-shadow: 0 4px 20px rgba(27, 45, 94, 0.1);
  transform: translateY(-3px);
}

.biz-top {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.biz-logo {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--indigo);
  border: 1.5px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold-light);
  flex-shrink: 0;
  overflow: hidden;
}
/* Owner photo covers the initial; if it fails to load,
   onerror removes it and the initial stays visible */
.biz-logo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: contain;
  object-position: center;
}

.biz-name {
  font-family: var(--ff-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--indigo-dark);
  line-height: 1.25;
}

.biz-badge {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: var(--gold);
  color: var(--indigo-dark);
  padding: 0.26rem 0.7rem;
  border-radius: 20px;
  margin-top: 0.3rem;
}

.biz-loc {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.biz-desc {
  font-size: 0.86rem;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.68;
  flex: 1;
}

.biz-owner {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--indigo);
}
.biz-owner span {
  font-weight: 300;
  color: var(--muted);
}

.biz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.4rem;
}
.biz-actions a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-decoration: none;
  padding: 0.5rem 0.85rem;
  min-height: 40px;
  border-radius: 3px;
  border: 1.5px solid var(--sand-mid);
  color: var(--indigo);
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.biz-actions a:hover {
  border-color: var(--gold);
  color: var(--gold);
}
.biz-actions a.biz-wa {
  background: #1FA855;
  border-color: #1FA855;
  color: var(--white);
}
.biz-actions a.biz-wa:hover {
  background: #178A45;
  border-color: #178A45;
  color: var(--white);
}

.biz-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.8rem;
  border-top: 1px solid var(--sand-mid);
  margin-top: 0.3rem;
}
.biz-type {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
}
.biz-type--owned {
  background: var(--gold);
  color: var(--indigo-dark);
}
.biz-type--friendly {
  background: var(--sand);
  color: var(--indigo);
  border: 1px solid var(--sand-mid);
}

/* Empty state */
.dir-empty {
  display: none;
  grid-column: 1 / -1;
  text-align: center;
  padding: 4.5rem 1.5rem;
}
.dir-empty.show {
  display: block;
}
.dir-empty .empty-icon {
  font-size: 2.8rem;
  opacity: 0.4;
  display: block;
  margin-bottom: 1.1rem;
}
.dir-empty h3 {
  font-family: var(--ff-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--indigo-dark);
  margin-bottom: 0.5rem;
}
.dir-empty p {
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--muted);
  max-width: 440px;
  margin: 0 auto;
}

/* List-your-business banner */
.dir-banner {
  background: var(--indigo);
  border-radius: 4px;
  margin-top: 3rem;
  padding: 2.8rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.dir-banner p {
  font-family: var(--ff-display);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--sand);
  line-height: 1.4;
  max-width: 640px;
}

/* Homepage teaser */
.dir-teaser {
  background: var(--cream);
}
.dir-teaser .biz-grid,
#biz-grid.dir-teaser .biz-grid {
  margin-top: 2.6rem;
}
.dir-teaser .biz-desc {
  font-size: 0.82rem;
}
