/* public/garages/garage-filter-bar.css */
/**
 * garage-filter-bar.css — Styles for the two-row filter bar.
 *
 * Structure:
 *   .gd-filter-bar           — the outer container (the toolbar's chip slot)
 *     .gd-filter-tabs        — the five-tab row (underlined tab pattern)
 *       .gd-filter-tab       — one tab
 *       .gd-filter-tab__dot  — the "has active filter" indicator
 *     .gd-filter-chips       — the chip row (pill pattern)
 *       .gd-chip             — one chip
 *       .gd-chip--roadside   — the roadside variant
 *       .gd-filter-empty     — fallback when a tab has no options
 *
 * The .gd-chip and .gd-chip--roadside classes were previously declared in
 * garage-directory.css. They have moved here because only the filter bar
 * uses them. Removing them from garage-directory.css is required in the
 * same commit — leaving both copies would produce two sources of truth.
 */

/* ─── Outer container ─────────────────────────────────────────────────── */

.gd-filter-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
  min-width: 0;              /* allows the inner scroll containers to shrink */
}

/* ─── Tab row (underlined tabs) ───────────────────────────────────────── */

.gd-filter-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  border-bottom: 1px solid var(--gd-border);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;             /* Firefox */
  -webkit-overflow-scrolling: touch; /* iOS momentum */
}

.gd-filter-tabs::-webkit-scrollbar {
  display: none;                     /* Chromium / WebKit */
}

.gd-filter-tab {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: -1px;               /* overlaps the row's bottom border */
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--gd-text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease-out, border-color 0.15s ease-out;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.gd-filter-tab:hover {
  color: var(--gd-text);
}

.gd-filter-tab--active {
  color: var(--gd-accent);
  border-bottom-color: var(--gd-accent);
}

.gd-filter-tab:focus-visible {
  outline: 2px solid var(--gd-accent);
  outline-offset: -2px;
  border-radius: 4px;
}

/* The dot is rendered as a sibling flex item after the label text. It
   never overlaps short or long labels because flex gap handles spacing. */
.gd-filter-tab__dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gd-accent);
}

/* ─── Chip row (pills) ────────────────────────────────────────────────── */

.gd-filter-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.gd-filter-chips::-webkit-scrollbar {
  display: none;
}

/* ─── Chips ───────────────────────────────────────────────────────────── */

.gd-chip {
  flex-shrink: 0;
  padding: 7px 14px;
  background: transparent;
  border: 1px solid var(--gd-border);
  border-radius: var(--gd-radius-pill);
  color: var(--gd-text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease-out, border-color 0.15s ease-out, color 0.15s ease-out;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.gd-chip:hover {
  border-color: var(--gd-accent);
  color: var(--gd-accent);
}

.gd-chip[aria-pressed="true"] {
  background: var(--gd-accent);
  border-color: var(--gd-accent);
  color: #1e2a3a;
}

.gd-chip:focus-visible {
  outline: 2px solid var(--gd-accent);
  outline-offset: 2px;
}

/* Roadside variant — blue accent, distinct from the amber used by the
   location, specialty, vehicle, and language chips. Reinforces that
   roadside is a capability filter, not a category filter. */
.gd-chip--roadside:hover {
  border-color: var(--gd-blue);
  color: var(--gd-blue);
}

.gd-chip--roadside[aria-pressed="true"] {
  background: var(--gd-blue);
  border-color: var(--gd-blue);
  color: #ffffff;
}

/* ─── Empty state ─────────────────────────────────────────────────────── */

.gd-filter-empty {
  flex: 0 0 100%;                    /* full-width as a flex item */
  width: 100%;
  margin: 0;
  padding: 6px 0;
  font-size: 0.82rem;
  font-style: italic;
  color: var(--gd-text-dim);
  line-height: 1.4;
}

/* ─── Responsive ──────────────────────────────────────────────────────── */

/* On tablets and narrow desktops, tighten the tab paddings slightly so
   the five tabs still fit without scroll at ~500px. */
@media (max-width: 720px) {
  .gd-filter-tabs {
    gap: 2px;
  }

  .gd-filter-tab {
    padding: 10px 12px;
    font-size: 0.82rem;
  }

  .gd-chip {
    padding: 8px 13px;
    font-size: 0.78rem;
  }
}

/* On phones, ensure touch targets meet the 44px minimum recommended by
   both Apple HIG and Google Material. */
@media (max-width: 480px) {
  .gd-filter-tab {
    padding: 12px 12px;
    min-height: 44px;
  }

  .gd-chip {
    padding: 11px 14px;
    min-height: 40px;
    font-size: 0.78rem;
  }

  .gd-filter-chips {
    gap: 6px;
  }
}

/* ─── Reduced motion ──────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .gd-filter-tab,
  .gd-chip {
    transition: none;
  }
}