/* Tabs and segmented filters, drawn as one segmented track (polish pass): the options sit in a single sunk
   well, the selected one is a raised tile inside it. Before, each option was its own bevelled box and the
   pick was a shiny brass plate, so a row of six read as six buttons fighting. Markup and ARIA are unchanged:
   .tabs/.tab     role="tablist"/role="tab": switches what one panel shows. Keyboard: arrows, Home, End
                  (bindTabs() in js/lib/ui.js).
   .seg/.seg-btn  filter buttons with aria-pressed (shop categories, gender). Several may sit side by side.
   .plates/.plate the same look under the new names, for new markup (aria-selected, aria-pressed or aria-current).
   On narrow screens tabs scroll sideways with proximity snap instead of wrapping into a pile. No overscroll
   containment: at either end a gesture passes on to the page, so a strip never traps the wheel or a swipe. */

.tabs, .plates, .seg {
  display: flex;
  width: fit-content;
  max-width: 100%;
  gap: 2px;
  padding: 3px;
  background: color-mix(in srgb, var(--ink-00) 70%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  box-shadow: var(--well);
}
.tabs, .plates {
  margin-bottom: var(--s-5);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.plates { margin-bottom: 0; }
.tabs::-webkit-scrollbar, .plates::-webkit-scrollbar { display: none; }

.tab, .plate, .seg-btn {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  min-height: 44px;
  padding: 0 var(--s-4);
  font-family: var(--font-control);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  text-decoration: none;
  white-space: nowrap;
  color: var(--text-2);
  background: transparent;
  border: 0;
  border-radius: var(--r-2);
  cursor: pointer;
  scroll-snap-align: start;
  transition: color var(--dur-1) var(--ease-out), background-color var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out);
}
.tab .icon, .plate .icon, .seg-btn .icon { width: 16px; height: 16px; color: var(--text-3); transition: color var(--dur-1) var(--ease-out); }
.tab:hover, .plate:hover, .seg-btn:hover { color: var(--text); background: var(--tint); }
.tab:hover .icon, .plate:hover .icon, .seg-btn:hover .icon { color: var(--accent); }
.tab:focus-visible, .plate:focus-visible, .seg-btn:focus-visible { outline-offset: -3px; }
/* Doubled class + html: the selected tile outranks older view rules that restyle the selected tab. */
html .tab.tab[aria-selected="true"], html .plate.plate:is([aria-selected="true"], [aria-pressed="true"], [aria-current="page"]),
html .seg-btn.seg-btn:is([aria-pressed="true"], [aria-selected="true"]) {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 14%, var(--ink-3));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent), inset 0 1px 0 rgb(243 237 224 / 0.08), 0 1px 2px rgb(var(--shadow-rgb) / 0.5);
}
html .tab.tab[aria-selected="true"] :is(.icon, svg), html .plate.plate:is([aria-selected="true"], [aria-pressed="true"], [aria-current="page"]) :is(.icon, svg),
html .seg-btn.seg-btn:is([aria-pressed="true"], [aria-selected="true"]) :is(.icon, svg) { color: var(--accent-hi); }
/* A count inside a plate: plain tabular figures, quieter than the name; gold on the picked one. */
.tab .count, .plate .count, .seg-btn .count {
  font-family: var(--font-control);
  font-size: var(--fs-xs);
  letter-spacing: 0;
  font-weight: 600;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
html .tab.tab[aria-selected="true"] .count, html .plate.plate:is([aria-selected="true"], [aria-pressed="true"], [aria-current="page"]) .count,
html .seg-btn.seg-btn:is([aria-pressed="true"], [aria-selected="true"]) .count { color: var(--accent-hi); }

.seg { flex-wrap: wrap; }

/* A plate on its own (a town chip, a topic jump), outside a track: a hairline chip of the same type. */
.plate:not(:is(.plates, .tabs, .seg) .plate) {
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--ink-00) 45%, transparent);
}
.plate:not(:is(.plates, .tabs, .seg) .plate):hover { border-color: var(--accent); }
.seg-small .seg-btn { min-height: 40px; padding: 0 0.85rem; font-size: 0.72rem; }

@media (max-width: 599px) {
  .seg.seg-scroll {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .seg.seg-scroll .seg-btn { flex: none; }
}
