/* ==========================================================================
   Component: tabs  →  snippets/collection-tabs.liquid + assets/component-tabs.css
   Section tab row (Best Seller, Popular Category): Inter 500 14px, 4px apart, each with a
   16px icon slot — active = dot #080808 + text #080808, inactive = bar #bfbfbf + text #747474.
   Behaviour (ARIA tabs, roving tabindex) lives in assets/js/components/collection-tabs.js.
   ========================================================================== */
.tabs {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tabs__tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-body-m-size);
  font-weight: 500;
  line-height: 1.2;
  color: var(--color-text-tertiary);
  white-space: nowrap;
  transition: color var(--duration-fast) ease;
}

/* The slot is centred between the two label boxes, but the dot should sit centred between the
   letters themselves. The exported dot is drawn 0.4px left of its 16px box's centre (path centre
   x = 7.6); collection-tabs.js adds --dot-shift for the glyph side bearings either side (an M starts
   about 1px inside its box, an A almost at its edge) and --dot-snap, which keeps the svg on whole
   pixels so the browser does not round its position (the fraction rides in the translate). */
.tabs__tab .icon-dot {
  position: relative;
  left: var(--dot-snap, 0px);
  display: none;
  color: var(--color-icon-primary);
  translate: calc(0.4px + var(--dot-shift, 0px)) 0;
}

.tabs__tab .icon-bar {
  color: var(--color-icon-tertiary);
}

/* The bar separates two tabs, so the first tab never shows one. Its slot stays reserved (the
   active tab's dot fills the same slot), so the labels hold still when the selection changes. */
.tabs__tab:first-child .icon-bar {
  visibility: hidden;
}

.tabs__tab:hover {
  color: var(--color-text-primary);
}

.tabs__tab[aria-selected="true"] {
  color: var(--color-text-primary);
}

.tabs__tab[aria-selected="true"] .icon-dot {
  display: block;
}

.tabs__tab[aria-selected="true"] .icon-bar {
  display: none;
}

/* Body/S labels (12px), as Product Of The Week sets its tab row: 14px line boxes and labels
   rounded up to whole pixels, the way Figma sizes them, so the row ends on the page edge */
.tabs--sm .tabs__tab {
  font-size: var(--text-body-s-size);
  line-height: 14px;
}

.tabs--sm .tabs__tab > span {
  width: var(--width-whole-px);
}

.tabs__tab:focus-visible {
  outline: 2px solid var(--color-black);
  outline-offset: 2px;
}
