/* ============================================================
   List screen — same data as map, vertical scrollable list view.
   Reuses .search-bar and .tabs; adds .filter-btn next to tabs.
   ============================================================ */

.screen--list .screen__top {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  padding-top: calc(var(--space-3) + env(safe-area-inset-top, 0px));
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border-subtle);
}

.screen--list .screen__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--nav-clearance);
}

/* ---------- Tabs row + filter button ---------- */

.list__top-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.list__top-row .tabs {
  flex: 1;
  min-width: 0;
}

.filter-btn {
  position: relative;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-full);
  color: var(--color-text-secondary);
  box-shadow: var(--shadow-sm);
  transition:
    border-color var(--duration-fast) var(--easing-standard),
    background-color var(--duration-fast) var(--easing-standard);
}

.filter-btn:hover {
  border-color: var(--color-border-default);
  background: var(--color-surface-tonal);
}

.filter-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.75;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.filter-btn__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--color-brand-primary);
  color: var(--color-text-on-brand);
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: var(--font-weight-bold);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ---------- Count strip ---------- */

.list__count {
  padding: var(--space-3) var(--space-4) var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
}

.list__count strong {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-semibold);
}

/* ---------- List ---------- */

.list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list__item {
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--color-border-subtle);
  transition: background-color var(--duration-fast) var(--easing-standard);
}

.list__item:hover {
  background: var(--color-surface-tonal);
}

.list__item--highlight {
  animation: list-highlight 1.4s ease-out;
}

@keyframes list-highlight {
  0%   { background: var(--color-brand-primary-tint); }
  100% { background: transparent; }
}

.list__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-top: 2px;
}

.list__icon[data-cat] { background: var(--cat-color); }

.list__icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.75;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.list__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.list__top-line {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

.list__name {
  flex: 1;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list__distance {
  flex-shrink: 0;
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
  font-weight: var(--font-weight-medium);
}

.list__meta {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list__address {
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.list__chip {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  background: var(--color-surface-tonal);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-full);
  font-size: var(--font-size-2xs);
  color: var(--color-text-secondary);
  line-height: 1.3;
}

.list__chip--accent {
  background: var(--color-brand-secondary-tint);
  border-color: var(--color-brand-secondary-soft);
  color: var(--color-brand-secondary);
}

.list__chip--more {
  color: var(--color-text-tertiary);
}

/* ---------- Empty state ---------- */

.list__empty {
  padding: var(--space-12) var(--space-6);
  text-align: center;
  color: var(--color-text-tertiary);
}

.list__empty p {
  margin: 0 0 var(--space-4);
  font-size: var(--font-size-base);
}

.list__reset {
  padding: var(--space-2) var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-full);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  transition: background-color var(--duration-fast) var(--easing-standard);
}

.list__reset:hover {
  background: var(--color-surface-tonal);
}
