/**
 * [brand_list_az] — page « Toutes les marques » (inc/shortcodes/brands-az.php)
 * Module indépendant : uniquement des classes .pw-maz, aucune règle partagée
 * avec [brand_list_optimized] (.pw-alpha).
 */
.pw-maz {
  --maz-ink: #1e2a38;
  --maz-muted: #9a948d;
  --maz-line: #e8e2db;
  --maz-soft: #f7f4f1;
  font-family: "Poppins", sans-serif;
  color: var(--maz-ink);
}
.pw-maz *,
.pw-maz *::before,
.pw-maz *::after { box-sizing: border-box; }

/* ---------- Recherche ---------- */
.pw-maz__search {
  position: relative;
  max-width: 520px;
  margin: 0 auto 24px;
}
.pw-maz__search svg {
  position: absolute;
  top: 50%;
  left: 20px;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--maz-ink);
  stroke-width: 1.6;
  stroke-linecap: round;
  pointer-events: none;
}
.pw-maz .pw-maz__search input {
  width: 100%;
  height: 52px;
  margin: 0;
  padding: 0 24px 0 52px;
  border: 1px solid var(--maz-ink);
  border-radius: 50px;
  background: #fff;
  color: var(--maz-ink);
  font-family: inherit;
  font-size: 15px;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}
.pw-maz .pw-maz__search input::placeholder { color: var(--maz-muted); }
.pw-maz .pw-maz__search input:focus { outline: 0; box-shadow: 0 0 0 3px rgba(30, 42, 56, .12); }
.pw-maz__search input::-webkit-search-cancel-button { cursor: pointer; }

/* ---------- Barre de lettres (pastilles rondes) ---------- */
.pw-maz__nav {
  position: sticky;
  top: var(--maz-offset, 0px);
  z-index: 20;
  margin: 0 0 36px;
  padding: 12px 0;
  background: rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.admin-bar .pw-maz__nav { top: calc(var(--maz-offset, 0px) + 32px); }

.pw-maz__letters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.pw-maz .pw-maz__letter,
.pw-maz .pw-maz__letter:hover,
.pw-maz .pw-maz__letter:focus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--maz-line);
  border-radius: 50%;
  background: #fff;
  color: var(--maz-ink);
  font-family: "Poppins", sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: background-color .2s, border-color .2s, color .2s;
}
.pw-maz a.pw-maz__letter:hover { border-color: var(--maz-ink); }
.pw-maz .pw-maz__letter.is-active,
.pw-maz .pw-maz__letter.is-active:hover { border-color: var(--maz-ink); background: var(--maz-ink); color: #fff; }
.pw-maz .pw-maz__letter.is-empty { border-color: transparent; background: none; color: #d3cdc6; cursor: default; }
.pw-maz .pw-maz__letter:focus-visible { outline: 2px solid var(--maz-ink); outline-offset: 2px; }
.pw-maz .pw-maz__letter--all,
.pw-maz .pw-maz__letter--all:hover,
.pw-maz .pw-maz__letter--all:focus {
  width: auto;
  padding: 0 16px;
  border-radius: 50px;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
}

/* ---------- Groupes ---------- */
.pw-maz__group {
  margin: 0 0 44px;
  scroll-margin-top: calc(var(--maz-offset, 0px) + 110px);
}
.pw-maz__group[hidden] { display: none; }

.pw-maz__head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
}
.pw-maz__head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--maz-line);
}
.pw-maz__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 46px;
  height: 46px;
  background: var(--maz-ink);
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
}
.pw-maz__total {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--maz-muted);
}

/* ---------- Cartes marques ---------- */
.pw-maz .pw-maz__grid {
  display: grid;
  grid-template-columns: repeat(var(--maz-cols, 4), minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pw-maz__item { margin: 0; padding: 0; }
.pw-maz__item[hidden] { display: none; }

.pw-maz .pw-maz__card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 100%;
  padding: 16px 18px;
  border: 1px solid var(--maz-line);
  border-radius: 4px;
  background: #fff;
  color: var(--maz-ink);
  text-decoration: none;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.pw-maz .pw-maz__card:hover,
.pw-maz .pw-maz__card:focus-visible {
  border-color: var(--maz-ink);
  box-shadow: 0 6px 18px rgba(30, 42, 56, .08);
  transform: translateY(-2px);
  outline: 0;
}
.pw-maz__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pw-maz__name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: .06em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.pw-maz__count { font-size: 12px; color: var(--maz-muted); }
.pw-maz__arrow {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--maz-ink);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity .2s, transform .2s;
}
.pw-maz__card:hover .pw-maz__arrow,
.pw-maz__card:focus-visible .pw-maz__arrow { opacity: 1; transform: none; }

.pw-maz__none { margin: 12px 0 0; text-align: center; font-size: 15px; color: var(--maz-muted); }
.pw-maz__none[hidden] { display: none; }

/* ---------- Tablette ---------- */
@media (max-width: 1024px) {
  .pw-maz .pw-maz__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Mobile ---------- */
@media (max-width: 782px) {
  .admin-bar .pw-maz__nav { top: calc(var(--maz-offset, 0px) + 46px); }
}
@media (max-width: 767px) {
  .pw-maz__search { margin-bottom: 16px; }
  .pw-maz .pw-maz__search input { height: 48px; font-size: 14px; }
  .pw-maz__nav { margin-bottom: 24px; padding: 10px 0; }
  /* Pastilles sur une ligne qui défile horizontalement */
  .pw-maz__letters {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding: 2px 2px 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .pw-maz__letters::-webkit-scrollbar { display: none; }
  .pw-maz__group { margin-bottom: 32px; scroll-margin-top: calc(var(--maz-offset, 0px) + 80px); }
  .pw-maz__badge { width: 40px; height: 40px; font-size: 18px; }
  .pw-maz .pw-maz__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pw-maz .pw-maz__card { padding: 13px 14px; }
  .pw-maz__name { font-size: 12px; }
  .pw-maz__arrow { display: none; }
}
