/**
 * Brands directory — findability layout (Tab 5)
 * Scoped to .ww-brands only — do not reuse these selectors on other pages.
 */
.ww-brands {
  --wwb-plum: #874390;
  --wwb-ink: #262525;
  --wwb-muted: #8b8790;
  --wwb-line: #cfc8d6;
  --wwb-soft: #e7e4ea;
  padding-bottom: 48px;
}

.ww-brands__hero {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 0 14px;
}

.ww-brands__title {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--wwb-ink);
  line-height: 1.15;
}

/* Brands directory only: mock stacks "N brands" + tiles note on the title-row right. */
.ww-brands__hero-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
}

.ww-brands__count {
  margin: 0;
  font-size: 15px;
  color: var(--wwb-muted);
  white-space: nowrap;
}

.ww-brands__tiles-note {
  margin: 0;
  text-align: right;
  font-size: 12.5px;
  color: var(--wwb-muted);
}

.ww-brands__tiles {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

/* Brands directory only: explicit pointer on photo tiles (global link CSS may omit it). */
.ww-brands__tile {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  /* Brands directory only: grey + placeholder until CDN/source probe succeeds. */
  background-color: #ddd;
  background-image: url('../images/placeholder.png');
  background-size: cover;
  background-position: center;
  text-decoration: none !important;
  cursor: pointer;
}

.ww-brands__tile::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 40%, rgba(0, 0, 0, 0.72));
}

.ww-brands__tile-cap {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 1;
  color: #fff;
}

.ww-brands__tile-name {
  display: block;
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ww-brands__tile-count {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  opacity: 0.92;
}

.ww-brands__tools {
  position: sticky;
  top: 74px;
  z-index: 40;
  background: #fff;
  padding: 10px 0 8px;
  border-bottom: 1px solid var(--wwb-soft);
  margin-bottom: 8px;
}

.ww-brands__tools-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* Brands directory only: mock search field with left magnifier (scoped; not global header search). */
.ww-brands__search-wrap {
  position: relative;
  width: 320px;
  max-width: 100%;
}

.ww-brands__search-wrap::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -8px;
  border: 1.5px solid var(--wwb-muted);
  border-radius: 50%;
  box-sizing: border-box;
  pointer-events: none;
  opacity: 0.75;
}

.ww-brands__search-wrap::after {
  content: '';
  position: absolute;
  left: 24px;
  top: 50%;
  width: 6px;
  height: 1.5px;
  margin-top: 4px;
  background: var(--wwb-muted);
  transform: rotate(45deg);
  pointer-events: none;
  opacity: 0.75;
}

.ww-brands__search {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--wwb-line);
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  color: var(--wwb-ink);
  box-sizing: border-box;
}

.ww-brands__search:focus {
  outline: none;
  border-color: var(--wwb-plum);
}

.ww-brands__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Brands directory only: soft square chips to match page_brands-b (scoped). */
.ww-brands__chip {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--wwb-line);
  border-radius: 0;
  background: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: var(--wwb-ink);
  cursor: pointer;
}

.ww-brands__chip.is-on {
  background: var(--wwb-plum);
  border-color: var(--wwb-plum);
  color: #fff;
  font-weight: 600;
}

.ww-brands__letters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 10px;
  padding-top: 4px;
}

/* Brands directory only: pointer on active A–Z jumps. */
.ww-brands__letter {
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--wwb-plum);
  text-decoration: none !important;
  border-bottom: 2px solid transparent;
  line-height: 1.4;
  scroll-margin-top: 170px;
  cursor: pointer;
}

.ww-brands__letter:hover,
.ww-brands__letter.is-current {
  border-bottom-color: var(--wwb-plum);
}

/* Brands directory only: empty letters stay non-clickable (no pointer). */
.ww-brands__letter.is-empty {
  color: var(--wwb-line);
  pointer-events: none;
  cursor: default;
  border-bottom-color: transparent;
}

.ww-brands__group {
  padding: 22px 0 4px;
  scroll-margin-top: 170px;
}

.ww-brands__group[hidden] {
  display: none !important;
}

.ww-brands__group-letter {
  margin: 0 0 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--wwb-plum);
  line-height: 1.2;
}

.ww-brands__list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  column-gap: 24px;
}

/* Brands directory only: pointer on brand list rows. */
.ww-brands__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 0;
  text-decoration: none !important;
  font-size: 14px;
  color: var(--wwb-ink);
  min-width: 0;
  cursor: pointer;
}

.ww-brands__row[hidden] {
  display: none !important;
}

.ww-brands__row-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.ww-brands__row-count {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--wwb-muted);
  font-variant-numeric: tabular-nums;
}

.ww-brands__row.is-zero {
  color: var(--wwb-muted);
}

.ww-brands__row.is-zero .ww-brands__row-count {
  color: var(--wwb-line);
}

.ww-brands__row:hover .ww-brands__row-name {
  color: var(--wwb-plum);
}

.ww-brands__empty {
  display: none;
  padding: 40px 0;
  text-align: center;
  color: var(--wwb-muted);
  font-size: 15px;
}

.ww-brands__empty.is-shown {
  display: block;
}

/* Brands directory only: brief placeholder while client paints compact JSON rows. */
.ww-brands__loading {
  margin: 24px 0 40px;
  color: var(--wwb-muted);
  font-size: 14px;
}

@media (max-width: 1100px) {
  .ww-brands__tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .ww-brands__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .ww-brands__hero {
    flex-direction: column;
    align-items: flex-start;
  }
  /* Brands directory only: left-align stacked meta on narrow viewports. */
  .ww-brands__hero-meta {
    align-items: flex-start;
    text-align: left;
  }
  .ww-brands__tiles-note {
    text-align: left;
  }
  .ww-brands__tools {
    top: 60px;
  }
  .ww-brands__search-wrap {
    width: 100%;
  }
  .ww-brands__tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ww-brands__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
