/* ═══════════════════════════════════════════════════════════
   TAN Search Results Page
   ═══════════════════════════════════════════════════════════ */

/* ── Wrap ────────────────────────────────────────────────── */
.tan-results-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  color: #4A5568;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

/* ── Search bar ──────────────────────────────────────────── */
.tan-search-bar {
  background: var(--tan-white, #fff);
  border: 1px solid var(--tan-border, #D0D5DD);
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
  padding: 16px 20px;
  margin: 20px 0 0;
}

.tan-search-bar__inner {
  display: flex;
  gap: 0;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 8px;
}

.tan-search-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 140px;
}

.tan-search-field label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #718096;
}

.tan-search-field select,
.tan-search-field input[type="text"] {
  padding: 9px 12px;
  border: 1px solid #D0D5DD;
  border-radius: 6px;
  font-size: 14px;
  color: #1B2A4A;
  background: #fff;
  font-family: inherit;
  width: 100%;
  transition: border-color .15s;
}

.tan-search-field select:focus,
.tan-search-field input:focus {
  outline: none;
  border-color: #2E86AB;
  box-shadow: 0 0 0 3px rgba(46,134,171,.12);
}

.tan-search-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1B2A4A;
  color: #fff;
  border: none;
  padding: 0 24px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  align-self: flex-end;
  height: 40px;
  font-family: inherit;
  transition: background .15s;
  flex-shrink: 0;
}

.tan-search-btn:hover { background: #C0392B; }
.tan-search-btn svg { width: 15px; height: 15px; }
.tan-search-btn.loading { opacity: .7; pointer-events: none; }

/* Secondary filters */
.tan-search-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #F4F6F8;
}

.tan-filter-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #4A5568;
  font-weight: 500;
  user-select: none;
}

.tan-filter-chip input[type="checkbox"] { accent-color: #2E86AB; }

/* ── View toggle bar ─────────────────────────────────────── */
.tan-view-toggle-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0 10px;
  flex-wrap: wrap;
  gap: 10px;
}

.tan-results-summary {
  font-size: 14px;
  color: #718096;
  font-weight: 500;
}

.tan-results-summary strong { color: #1B2A4A; }

.tan-results-summary__skeleton {
  width: 180px;
  height: 16px;
  background: #eee;
  border-radius: 4px;
  animation: tan-pulse 1.4s ease-in-out infinite;
}

/* ⚡ PROMINENT TOGGLE — center stage */
.tan-view-toggle {
  display: flex;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #1B2A4A;
  background: #fff;
}

.tan-view-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 22px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: #1B2A4A;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, color .15s;
}

.tan-view-btn svg { width: 15px; height: 15px; }

.tan-view-btn.active {
  background: #1B2A4A;
  color: #fff;
}

.tan-view-btn:not(.active):hover { background: #F4F6F8; }

/* ── Listing cards ───────────────────────────────────────── */
.tan-card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tan-listing-card {
  display: flex;
  gap: 16px;
  background: #fff;
  border: 1px solid #D0D5DD;
  border-radius: 10px;
  padding: 18px 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  transition: box-shadow .15s, border-color .15s, transform .15s;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  position: relative;
}

.tan-listing-card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,.1);
  border-color: #2E86AB;
  transform: translateY(-1px);
}

.tan-listing-card.is-featured {
  border-color: #C0392B;
  border-width: 2px;
}

.tan-listing-card.is-active {
  border-color: #2E86AB;
  box-shadow: 0 0 0 3px rgba(46,134,171,.15);
}

/* Featured ribbon */
.tan-listing-card.is-featured::before {
  content: '⭐ Featured';
  position: absolute;
  top: -1px;
  right: 16px;
  background: #C0392B;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 0 0 6px 6px;
}

/* Logo */
.tan-card-logo {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: #F4F6F8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  overflow: hidden;
}

.tan-card-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }

/* Body */
.tan-card-body { flex: 1; min-width: 0; }

.tan-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}

.tan-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #1B2A4A;
  text-decoration: none;
  line-height: 1.3;
}

.tan-card-title:hover { color: #2E86AB; }

.tan-card-distance {
  font-size: 12px;
  font-weight: 600;
  color: #718096;
  white-space: nowrap;
  flex-shrink: 0;
}

.tan-card-badges {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.tan-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

.tan-badge--category { background: #EBF8FF; color: #2B6CB0; }
.tan-badge--verified { background: #F0FFF4; color: #276749; }
.tan-badge--open     { background: #F0FFF4; color: #276749; }
.tan-badge--closed   { background: #FFF5F5; color: #9B2C2C; }

.tan-card-address {
  font-size: 13px;
  color: #718096;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.tan-card-address svg { width: 12px; height: 12px; flex-shrink: 0; }

.tan-card-excerpt {
  font-size: 13px;
  color: #4A5568;
  line-height: 1.5;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tan-card-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tan-card-phone {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: #1B2A4A;
  text-decoration: none;
}

.tan-card-phone:hover { color: #C0392B; }
.tan-card-phone svg { width: 13px; height: 13px; }

.tan-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: opacity .15s;
}

.tan-card-btn:hover { opacity: .85; }
.tan-card-btn--primary   { background: #1B2A4A; color: #fff; }
.tan-card-btn--secondary { background: #F4F6F8; color: #1B2A4A; border: 1px solid #D0D5DD; }
.tan-card-btn--quote     { background: #2E86AB; color: #fff; }

/* No-results / no-coords cards */
.tan-listing-card--no-pin { opacity: .8; }
.tan-no-results {
  text-align: center;
  padding: 48px 24px;
  color: #718096;
}
.tan-no-results h3 { font-size: 18px; color: #1B2A4A; margin-bottom: 8px; }

/* ── Skeleton loading ─────────────────────────────────────── */
.tan-listing-card--skeleton { pointer-events: none; }
.tan-skeleton-box { animation: tan-pulse 1.4s ease-in-out infinite; background: #eee; }
.tan-skeleton-line { background: #eee; border-radius: 4px; animation: tan-pulse 1.4s ease-in-out infinite; }
@keyframes tan-pulse { 0%,100%{opacity:1} 50%{opacity:.45} }

/* ── Pagination ──────────────────────────────────────────── */
.tan-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 20px 0 0;
  flex-wrap: wrap;
}

.tan-page-btn {
  padding: 7px 14px;
  border: 1px solid #D0D5DD;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  color: #1B2A4A;
  transition: background .15s, border-color .15s;
}

.tan-page-btn:hover { background: #F4F6F8; }
.tan-page-btn.active { background: #1B2A4A; color: #fff; border-color: #1B2A4A; }
.tan-page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── Map view ────────────────────────────────────────────── */
.tan-hidden { display: none !important; }

.tan-split-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 0;
  height: calc(100vh - 240px);
  min-height: 500px;
  border: 1px solid #D0D5DD;
  border-radius: 10px;
  overflow: hidden;
}

.tan-split-list {
  overflow-y: auto;
  border-right: 1px solid #D0D5DD;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fff;
}

/* Compact cards in split view */
.tan-split-list .tan-listing-card {
  padding: 12px 14px;
  flex-direction: column;
  gap: 8px;
}

.tan-split-list .tan-card-logo { width: 40px; height: 40px; }
.tan-split-list .tan-card-excerpt { display: none; }

#tan-leaflet-map {
  height: 100%;
  width: 100%;
  z-index: 1;
}

/* Leaflet popup override */
.tan-map-popup { font-family: inherit; min-width: 200px; }
.tan-map-popup h4 { margin: 0 0 4px; font-size: 14px; color: #1B2A4A; }
.tan-map-popup p  { margin: 0 0 8px; font-size: 12px; color: #718096; }
.tan-map-popup a  { font-size: 12px; font-weight: 600; color: #2E86AB; text-decoration: none; }

/* Custom pin markers */
.tan-pin { background: none; border: none; }
.tan-pin-inner {
  width: 32px;
  height: 32px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: #1B2A4A;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  transition: transform .15s;
}
.tan-pin-inner.featured  { background: #C0392B; }
.tan-pin-inner.active    { background: #2E86AB; transform: rotate(-45deg) scale(1.2); }

/* ── Toast ───────────────────────────────────────────────── */
.tan-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1B2A4A;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
  opacity: 0;
  transition: transform .25s, opacity .25s;
  z-index: 9999;
  white-space: nowrap;
  pointer-events: none;
}

.tan-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .tan-search-bar__inner { flex-direction: column; }
  .tan-search-btn { width: 100%; justify-content: center; height: 44px; }

  .tan-split-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
    height: calc(100vh - 200px);
  }

  .tan-split-list {
    border-right: none;
    border-bottom: 1px solid #D0D5DD;
    max-height: 45vh;
  }

  .tan-listing-card { flex-direction: column; gap: 12px; }
  .tan-card-logo { width: 48px; height: 48px; }
}

@media (max-width: 480px) {
  .tan-view-btn { padding: 9px 14px; font-size: 13px; }
  .tan-card-title { font-size: 15px; }
}
