/* ---------- Chips ---------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  border: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}

.chip.active {
  background: var(--brand);
  color: var(--on-brand);
  border-color: var(--brand);
}

.toggle-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.toggle-btn {
  flex: 1;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.toggle-btn.active {
  background: var(--brand);
  color: var(--on-brand);
  border-color: var(--brand);
}

.list-map-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 12px;
}

.list-map-toggle button {
  padding: 6px 14px;
  border: none;
  background: var(--surface);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.list-map-toggle button.active {
  background: var(--brand);
  color: var(--on-brand);
}

.result-count {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.clear-filter {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  flex: none;
  white-space: nowrap;
}

.sort-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0 0 8px;
}

.sort-label {
  flex: none;
  font-size: 12px;
  color: var(--text-muted);
}

.sort-row .sort-chip { padding: 5px 8px; }

.sort-chip.active {
  background: var(--brand);
  color: var(--on-brand);
  border-color: var(--brand);
}

.sort-note {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------- Cards ---------- */

.card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Keyboard focus rings. Controls inside overflow-clipped containers get an inset ring so it can't be cut off. */
.view-btn:focus-visible,
.rv-row:focus-visible,
.flyout-item:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

.mode-btn:focus-visible,
.refine-chip:focus-visible,
.sort-chip:focus-visible,
.match-btn:focus-visible,
.selected-chip:focus-visible,
.link-pill:focus-visible,
.rv-tile:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.category-tile:focus-visible { outline: none; }
.category-tile:focus-visible .category-icon-box { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--focus-ring); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Vendor links (website + socials) ---------- */

.vendor-links { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }

.link-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.link-pill:hover { border-color: var(--brand-text); color: var(--brand-text); }
.link-detail { color: var(--text-muted); font-weight: 400; }

/* ---------- Vendor Type / Size filter (Vendors tab) ---------- */

.type-filter { margin: 0 0 8px; }

.type-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
}

/* Size sits under Type, indented, and only while Supermarkets is chosen */
.type-row-nested {
  margin-left: 10px;
  padding-left: 10px;
  border-left: 2px solid var(--border);
}

.type-label { flex: none; min-width: 30px; font-size: 12px; color: var(--text-muted); }

.type-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.type-chip:hover { border-color: var(--brand-text); }
.type-chip:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.type-chip.is-empty:not(.active) { color: var(--text-muted); }
.type-count { font-weight: 600; color: var(--text-muted); }

.type-chip.active {
  background: var(--brand);
  color: var(--on-brand);
  border-color: var(--brand);
}

.type-chip.active .type-count { color: inherit; }

/* Labels on a vendor: its kind and size ("Large supermarket") and "Chain" */
.vendor-labels { margin: 4px 0 6px; }

.vendor-label {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  font-weight: 500;
}

/* ---------- Result views (list / grids) ---------- */

.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 12px;
}

.result-row .result-count { margin: 0; }

.view-toggle {
  flex: none;
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}

.view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  border: none;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.view-btn:last-child { border-right: none; }
.view-btn:hover { color: var(--text); }

.view-btn.active {
  background: var(--brand-tint);
  color: var(--brand-text);
}

.card-list.view-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.card-list.view-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.card-list > .empty-state { grid-column: 1 / -1; }

