/* ── Reset / Base ───────────────────────────────────────────── */
.ps-tf-wrap *,
.ps-tf-wrap *::before,
.ps-tf-wrap *::after { box-sizing: border-box; margin: 0; padding: 0; }

.ps-tf-wrap {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #0f172a;
  --primary:   #4f46e5;
  --primary-lt:#eef2ff;
  --accent:    #6c7fff;
  --muted:     #64748b;
  --border:    #e2e8f0;
  --bg:        #f8fafc;
  --card-bg:   #ffffff;
  --radius:    14px;
  --radius-sm: 8px;
  --shadow:    0 1px 3px rgba(0,0,0,.07), 0 4px 16px rgba(0,0,0,.05);
  --shadow-md: 0 4px 24px rgba(79,70,229,.10);
}

/* ── Search Bar ─────────────────────────────────────────────── */
.ps-tf-search-bar {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.ps-tf-search-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 140px;
}

.ps-tf-search-group label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

.ps-tf-search-group select,
.ps-tf-search-group input {
  height: 42px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font-size: 14px;
  font-family: inherit;
  color: #0f172a;
  background: #fff;
  outline: none;
  transition: border-color .15s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.ps-tf-search-group input {
  background-image: none;
  padding-right: 12px;
}

.ps-tf-search-group select:focus,
.ps-tf-search-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}

.ps-tf-geo-btn {
  height: 42px;
  padding: 0 16px;
  background: var(--primary-lt);
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background .15s, color .15s;
}

.ps-tf-geo-btn:hover { background: var(--primary); color: #fff; }

.ps-tf-search-btn {
  height: 42px;
  padding: 0 24px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, box-shadow .15s;
}

.ps-tf-search-btn:hover {
  background: #4338ca;
  box-shadow: 0 4px 12px rgba(79,70,229,.3);
}

/* ── Layout ─────────────────────────────────────────────────── */
.ps-tf-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .ps-tf-layout { grid-template-columns: 1fr; }
  .ps-tf-sidebar { order: 2; }
  .ps-tf-main { order: 1; }
}

/* ── Sidebar / Filters ──────────────────────────────────────── */
.ps-tf-sidebar {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  overflow-x: hidden;
}

.ps-tf-sidebar::-webkit-scrollbar { width: 4px; }
.ps-tf-sidebar::-webkit-scrollbar-track { background: transparent; }
.ps-tf-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.ps-tf-sidebar-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ps-tf-sidebar-header h3 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
}

.ps-tf-clear-filters {
  font-size: 12px;
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
  background: none;
  border: none;
  font-family: inherit;
  padding: 0;
}

.ps-tf-clear-filters:hover { text-decoration: underline; }

/* Accordion */
.ps-tf-accordion-item {
  border-bottom: 1px solid var(--border);
}

.ps-tf-accordion-item:last-child { border-bottom: none; }

.ps-tf-accordion-trigger {
  width: 100%;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  text-align: left;
  transition: background .12s;
}

.ps-tf-accordion-trigger:hover { background: var(--bg); }

.ps-tf-accordion-trigger .ps-tf-acc-arrow {
  width: 16px;
  height: 16px;
  color: var(--muted);
  transition: transform .2s;
  flex-shrink: 0;
}

.ps-tf-accordion-item.open .ps-tf-acc-arrow { transform: rotate(180deg); }

.ps-tf-accordion-trigger .ps-tf-filter-count {
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 6px;
  margin-left: 6px;
}

.ps-tf-accordion-body {
  display: none;
  padding: 4px 20px 14px;
  max-height: 260px;
  overflow-y: auto;
}

.ps-tf-accordion-item.open .ps-tf-accordion-body { display: block; }

.ps-tf-accordion-body::-webkit-scrollbar { width: 4px; }
.ps-tf-accordion-body::-webkit-scrollbar-track { background: transparent; }
.ps-tf-accordion-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.ps-tf-filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  cursor: pointer;
  font-size: 13px;
  color: #334155;
}

.ps-tf-filter-option input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.ps-tf-filter-option:hover { color: var(--primary); }

.ps-tf-filter-option.ps-tf-hidden { display: none; }

.ps-tf-show-more {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  padding: 4px 0 0;
  display: block;
}
.ps-tf-show-more:hover { text-decoration: underline; }

/* ── Main Column ────────────────────────────────────────────── */
.ps-tf-main { min-width: 0; }

.ps-tf-toolbar {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: var(--shadow);
}

.ps-tf-result-count {
  font-size: 14px;
  color: var(--muted);
  flex: 1;
}

.ps-tf-result-count strong { color: #0f172a; }

.ps-tf-sort-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.ps-tf-sort-select {
  height: 36px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 32px 0 10px;
  font-size: 13px;
  font-family: inherit;
  color: #0f172a;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 10px center;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  outline: none;
  transition: border-color .15s;
}

.ps-tf-sort-select:focus { border-color: var(--primary); }

/* ── Pagination ─────────────────────────────────────────────── */
.ps-tf-pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.ps-tf-page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 13px;
  font-family: inherit;
  color: #334155;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .12s;
  font-weight: 500;
}

.ps-tf-page-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-lt); }
.ps-tf-page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 700; }
.ps-tf-page-btn:disabled { opacity: .4; cursor: default; }
.ps-tf-page-btn.ellipsis { border-color: transparent; background: transparent; cursor: default; }

/* ── Facility Cards ─────────────────────────────────────────── */
.ps-tf-results {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}

.ps-tf-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow .15s, border-color .15s, transform .15s;
  text-decoration: none;
  color: inherit;
}

.ps-tf-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #c7d2fe;
  transform: translateY(-1px);
}

.ps-tf-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ps-tf-card-name {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
}

.ps-tf-card-name2 {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.ps-tf-distance-badge {
  background: var(--primary-lt);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.ps-tf-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: #475569;
}

.ps-tf-card-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.ps-tf-card-meta svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
  flex-shrink: 0;
}

.ps-tf-card-meta a {
  color: var(--primary);
  text-decoration: none;
}

.ps-tf-card-meta a:hover { text-decoration: underline; }

.ps-tf-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ps-tf-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: .02em;
}

.ps-tf-tag-type {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.ps-tf-tag-insurance {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.ps-tf-tag-more {
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
}

.ps-tf-card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.ps-tf-view-btn {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ps-tf-view-btn:hover { color: #4338ca; }

/* ── Loading / Empty States ─────────────────────────────────── */
.ps-tf-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 16px;
  color: var(--muted);
}

.ps-tf-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: ps-tf-spin .7s linear infinite;
}

@keyframes ps-tf-spin { to { transform: rotate(360deg); } }

.ps-tf-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.ps-tf-empty h3 { font-size: 18px; color: #1e293b; margin-bottom: 8px; }
.ps-tf-empty p { font-size: 14px; }

/* ── Facility Detail Page ───────────────────────────────────── */
.ps-tf-detail-wrap {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #0f172a;
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px;
  --primary:   #4f46e5;
  --primary-lt:#eef2ff;
  --muted:     #64748b;
  --border:    #e2e8f0;
  --bg:        #f8fafc;
  --radius:    14px;
  --shadow:    0 1px 3px rgba(0,0,0,.07), 0 4px 16px rgba(0,0,0,.05);
}

.ps-tf-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 24px;
  transition: color .12s;
}

.ps-tf-detail-back:hover { color: var(--primary); }

.ps-tf-detail-hero {
  background: linear-gradient(135deg, #4f46e5 0%, #6c7fff 100%);
  border-radius: var(--radius);
  padding: 36px 40px;
  color: #fff;
  margin-bottom: 24px;
}

.ps-tf-detail-hero h1 {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 8px;
}

.ps-tf-detail-hero .ps-tf-detail-sub {
  font-size: 14px;
  opacity: .8;
  margin-bottom: 20px;
}

.ps-tf-detail-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.ps-tf-detail-contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s;
}

.ps-tf-detail-contact-btn.phone {
  background: rgba(255,255,255,.2);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,.35);
}

.ps-tf-detail-contact-btn.phone:hover { background: rgba(255,255,255,.3); }

.ps-tf-detail-contact-btn.web {
  background: #fff;
  color: var(--primary);
}

.ps-tf-detail-contact-btn.web:hover { background: var(--primary-lt); }

.ps-tf-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 640px) { .ps-tf-detail-grid { grid-template-columns: 1fr; } }

.ps-tf-detail-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
}

.ps-tf-detail-card h3 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.ps-tf-detail-card p, .ps-tf-detail-card a {
  font-size: 14px;
  color: #1e293b;
  line-height: 1.6;
}

.ps-tf-detail-card a { color: var(--primary); text-decoration: none; }
.ps-tf-detail-card a:hover { text-decoration: underline; }

.ps-tf-services-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.ps-tf-services-section h2 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
  color: #0f172a;
}

.ps-tf-services-category {
  margin-bottom: 20px;
}

.ps-tf-services-category h4 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.ps-tf-services-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ps-tf-service-pill {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--primary-lt);
  color: var(--primary);
  border: 1px solid #c7d2fe;
}

/* ── State / County Landing Pages ───────────────────────────── */
.ps-tf-landing-wrap {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #0f172a;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px;
  --primary:   #4f46e5;
  --primary-lt:#eef2ff;
  --muted:     #64748b;
  --border:    #e2e8f0;
  --bg:        #f8fafc;
  --radius:    14px;
  --shadow:    0 1px 3px rgba(0,0,0,.07), 0 4px 16px rgba(0,0,0,.05);
}

.ps-tf-landing-hero {
  background: linear-gradient(135deg, #4f46e5 0%, #6c7fff 100%);
  border-radius: var(--radius);
  padding: 48px 48px;
  color: #fff;
  margin-bottom: 32px;
}

.ps-tf-landing-hero h1 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 10px;
  line-height: 1.2;
}

.ps-tf-landing-hero p {
  font-size: 16px;
  opacity: .85;
  max-width: 560px;
}

.ps-tf-county-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.ps-tf-county-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  text-decoration: none;
  color: #0f172a;
  box-shadow: var(--shadow);
  transition: box-shadow .15s, border-color .15s, transform .15s;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ps-tf-county-card:hover {
  border-color: #c7d2fe;
  box-shadow: 0 4px 24px rgba(79,70,229,.10);
  transform: translateY(-1px);
}

.ps-tf-county-card .name { font-size: 14px; font-weight: 600; }
.ps-tf-county-card .count { font-size: 12px; color: var(--muted); }

/* ── Mapbox Map ─────────────────────────────────────────────── */
.ps-tf-map-wrap {
  margin: 24px 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.ps-tf-map {
  width: 100%;
  height: 380px;
}

@media (max-width: 640px) {
  .ps-tf-map { height: 260px; }
}

/* ── Finder page full-width map ─────────────────────────────── */
.ps-tf-finder-map-wrap {
  width: 100%;
  margin: 20px 0 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.ps-tf-finder-map {
  width: 100%;
  height: 420px;
}

@media (max-width: 768px) {
  .ps-tf-finder-map { height: 280px; }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  .ps-tf-search-bar { flex-direction: column; }
  .ps-tf-search-group { min-width: 100%; }
  .ps-tf-detail-hero { padding: 24px 20px; }
  .ps-tf-detail-hero h1 { font-size: 20px; }
  .ps-tf-landing-hero { padding: 32px 24px; }
  .ps-tf-landing-hero h1 { font-size: 24px; }
}
