/* ===== DIRECTORY SECTION ===== */
.directory-section {
  position: relative;
  padding: 6rem 0 4rem;
  background: var(--bg-primary);
  z-index: 2;
}

.directory-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── Section Header ────────── */
.dir-header {
  text-align: center;
  margin-bottom: 3rem;
}

.dir-header .section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(245, 166, 35, 0.08);
  border: 1px solid rgba(245, 166, 35, 0.15);
  color: var(--accent-orange);
  padding: 0.35rem 1rem;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.dir-header h2 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.8rem;
}

.dir-header p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── Toolbar ───────────────── */
.dir-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.dir-toolbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.dir-search-wrap {
  position: relative;
  flex: 1;
  max-width: 380px;
}

.dir-search-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.dir-search-wrap input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 0.7rem 0.7rem 0.7rem 2.6rem;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.dir-search-wrap input::placeholder {
  color: var(--text-muted);
}

.dir-search-wrap input:focus {
  border-color: rgba(245, 166, 35, 0.3);
  box-shadow: 0 0 20px rgba(245, 166, 35, 0.06);
}

#resultCount {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.dir-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.dir-toolbar-right label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.dir-sort-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-secondary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 0.6rem 2.2rem 0.6rem 0.9rem;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color 0.3s;
}

.dir-sort-select:focus {
  border-color: rgba(245, 166, 35, 0.3);
}

.dir-sort-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* ── Category Chips ────────── */
.category-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-bar::-webkit-scrollbar {
  display: none;
}

.cat-chip {
  flex-shrink: 0;
  padding: 0.45rem 1.1rem;
  border-radius: 50px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.cat-chip:hover {
  border-color: rgba(245, 166, 35, 0.25);
  color: var(--text-primary);
}

.cat-chip.active {
  background: var(--gradient-warm);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}

/* ── Grid ──────────────────── */
.directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

/* ── Business Card ─────────── */
.biz-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.biz-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(245,166,35,0.03), transparent 60%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.biz-card:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 166, 35, 0.2);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.biz-card:hover::before {
  opacity: 1;
}

/* Card Header */
.biz-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.biz-logo-wrap {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
}

.biz-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.biz-logo-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-warm);
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
}

/* Score Ring */
.biz-score-ring {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.biz-score-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(0deg);
}

.biz-score-ring circle:last-child {
  transition: stroke-dasharray 1s ease-out;
}

.ring-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Card Body */
.biz-name {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--text-primary);
}

.biz-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
}

.biz-category {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent-orange);
  background: rgba(245, 166, 35, 0.08);
  padding: 0.15rem 0.6rem;
  border-radius: 6px;
}

.biz-location {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Card Footer */
.biz-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.8rem;
  border-top: 1px solid var(--glass-border);
  margin-top: auto;
}

.biz-verified-tag {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--accent-green);
  font-weight: 500;
}

.biz-tier-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tier-excellent {
  background: rgba(76, 175, 80, 0.12);
  color: #4CAF50;
}

.tier-good {
  background: rgba(212, 225, 87, 0.12);
  color: #D4E157;
}

.tier-average {
  background: rgba(245, 166, 35, 0.12);
  color: #F5A623;
}

.tier-low {
  background: rgba(232, 67, 10, 0.12);
  color: #E8430A;
}

/* ── Load More ─────────────── */
.dir-load-more {
  text-align: center;
  margin-top: 2.5rem;
}

.load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 2rem;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
}

.load-more-btn:hover {
  border-color: rgba(245, 166, 35, 0.25);
  background: rgba(245, 166, 35, 0.06);
}

.load-more-btn.loading {
  pointer-events: none;
  opacity: 0.6;
}

.load-more-btn.loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid var(--glass-border);
  border-top-color: var(--accent-orange);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Skeleton ──────────────── */
.biz-card.skeleton {
  pointer-events: none;
}

.skel-circle {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
}

.skel-ring {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}

.skel-line {
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
}

.skel-pulse {
  animation: skelPulse 1.8s ease-in-out infinite;
}

@keyframes skelPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* ── Empty / Error States ──── */
.directory-empty,
.directory-error {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.directory-empty svg,
.directory-error svg {
  color: var(--text-muted);
  margin-bottom: 1rem;
  opacity: 0.5;
}

.directory-empty h3,
.directory-error h3 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.4rem;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.directory-empty p,
.directory-error p {
  font-size: 0.92rem;
  max-width: 360px;
  margin: 0 auto;
  line-height: 1.6;
}

.retry-btn {
  margin-top: 1.2rem;
  padding: 0.6rem 1.6rem;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--accent-orange);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s;
}

.retry-btn:hover {
  background: rgba(245, 166, 35, 0.08);
  border-color: rgba(245, 166, 35, 0.2);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .directory-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .directory-section {
    padding: 4rem 0 3rem;
  }

  .dir-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .dir-toolbar-left {
    flex-direction: column;
  }

  .dir-search-wrap {
    max-width: 100%;
  }

  .dir-toolbar-right {
    justify-content: space-between;
  }

  .directory-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .directory-container {
    padding: 0 1rem;
  }

  .biz-card {
    padding: 1.2rem;
  }

  .cat-chip {
    padding: 0.35rem 0.9rem;
    font-size: 0.75rem;
  }
}
