/* ==========================================================================
   Term landing pages — brands / tags / devices
   Prefixed with `tax-` to stay isolated from the main theme stylesheet.
   Uses main.css design tokens only (--c-*, --cp-*, --cs-*, --r-*, --grad-*, --shadow-*).
   ========================================================================== */

.tax-archive {
  padding: 34px 0 70px;
  background: var(--c-bg);
}

/* ─── Term index (hub only) ─────────────────────────────────────────── */

.tax-terms {
  position: relative;
  margin-bottom: 34px;
  padding: 28px 26px 26px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  background: var(--c-surface);
  animation: fadeUp .6s var(--ease-out) both;
}

.tax-terms__head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--c-border);
}

.tax-terms__title {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.6;
  color: var(--c-text);
}

.tax-terms__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--grad-h);
  color: #fff;
  box-shadow: 0 6px 16px rgba(15, 118, 110, .26);
  flex-shrink: 0;
}

.tax-terms__total {
  padding: 5px 14px;
  border-radius: var(--r-pill);
  background: var(--cp-50);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, .12);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.8;
  color: var(--cp-700);
}

/* ─── Brand cards ──────────────────────────────────────────────── */

.tax-terms__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tax-term-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  padding: 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-bg);
  transition: transform .22s var(--ease-spring), border-color .22s var(--ease-out), background .22s var(--ease-out), box-shadow .22s var(--ease-out);
}

a.tax-term-card:hover {
  transform: translateY(-3px);
  border-color: var(--cp-300);
  background: var(--c-surface);
  box-shadow: var(--shadow-md);
}

a.tax-term-card:focus-visible {
  outline: 2px solid var(--cp-500);
  outline-offset: 2px;
}

.tax-term-card__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 13px;
  background: var(--cp-100);
  color: var(--cp-700);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  transition: background .22s var(--ease-out), color .22s var(--ease-out), transform .22s var(--ease-spring);
}

a.tax-term-card:hover .tax-term-card__mark {
  background: var(--grad-h);
  color: #fff;
  transform: scale(1.04);
}

.tax-term-card__body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  flex: 1 1 auto;
}

.tax-term-card__name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.6;
  color: var(--c-text);
  overflow-wrap: anywhere;
}

.tax-term-card__count {
  align-self: flex-start;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  background: var(--cp-50);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.8;
  color: var(--cp-700);
}

.tax-archive--tag .tax-term-card__count {
  background: rgba(99, 102, 241, .12);
  color: #4338CA;
}

.tax-archive--device .tax-term-card__count {
  background: var(--cs-100);
  color: var(--cs-600);
}

/* A brand no salon uses yet: honest, but visually recessive. */
.tax-term-card--empty {
  background: transparent;
  border-style: dashed;
}

.tax-term-card--empty .tax-term-card__mark {
  background: var(--c-border);
  color: var(--c-muted);
}

.tax-term-card--empty .tax-term-card__count {
  background: transparent;
  padding: 0;
  color: var(--c-muted);
  opacity: .85;
  font-weight: 600;
}

.tax-term-card--empty:hover .tax-term-card__mark {
  background: var(--grad-h);
  color: #fff;
}

.tax-archive--tag .tax-terms__total,
.tax-archive--tag .tax-term-card__mark {
  background: rgba(99, 102, 241, .12);
  color: #4338CA;
}

.tax-archive--tag a.tax-term-card:hover .tax-term-card__mark {
  background: linear-gradient(135deg, #6366F1, #A5B4FC);
}

.tax-archive--device .tax-terms__total,
.tax-archive--device .tax-term-card__mark {
  background: var(--cs-100);
  color: var(--cs-600);
}

.tax-archive--device a.tax-term-card:hover .tax-term-card__mark {
  background: var(--grad-g);
}

.tax-terms__empty,
.tax-terms__more {
  margin: 0;
  font-size: 14px;
  line-height: 2;
  color: var(--c-muted);
}

.tax-terms__more {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--c-border);
  font-size: 13.5px;
}

/* Per-type accent so the three hubs are visually distinguishable. */
.tax-archive--tag .tax-terms__icon {
  background: linear-gradient(135deg, #6366F1, #A5B4FC);
  box-shadow: 0 4px 12px rgba(99, 102, 241, .22);
}

.tax-archive--tag .tax-terms__total {
  background: rgba(99, 102, 241, .12);
  color: #4338CA;
}

.tax-archive--device .tax-terms__icon {
  background: var(--grad-g);
  box-shadow: 0 4px 12px rgba(212, 163, 115, .28);
}

.tax-archive--device .tax-terms__total {
  background: var(--cs-100);
  color: var(--cs-600);
}

/* ─── Selected term panel (description above the salon list) ─────────── */

.tax-term-detail {
  position: relative;
  margin-bottom: 26px;
  padding: 24px 26px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  background: var(--c-surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  animation: fadeUp .6s var(--ease-out) .04s both;
}

.tax-term-detail::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 4px;
  background: var(--grad-h);
}

.tax-archive--tag .tax-term-detail::before {
  background: linear-gradient(135deg, #6366F1, #A5B4FC);
}

.tax-archive--device .tax-term-detail::before {
  background: var(--grad-g);
}

.tax-term-detail__head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.tax-term-detail__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--grad-h);
  color: #fff;
  box-shadow: 0 4px 12px rgba(15, 118, 110, .22);
  flex-shrink: 0;
}

.tax-archive--tag .tax-term-detail__mark {
  background: linear-gradient(135deg, #6366F1, #A5B4FC);
  box-shadow: 0 4px 12px rgba(99, 102, 241, .22);
}

.tax-archive--device .tax-term-detail__mark {
  background: var(--grad-g);
  box-shadow: 0 4px 12px rgba(212, 163, 115, .28);
}

.tax-term-detail__headings {
  min-width: 0;
}

.tax-term-detail__eyebrow {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.8;
  color: var(--c-muted);
}

.tax-term-detail__title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.6;
  color: var(--c-text);
  overflow-wrap: anywhere;
}

.tax-term-detail__reset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-inline-start: auto;
  padding: 7px 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-pill);
  background: var(--c-bg);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--cp-600);
  transition: color .25s var(--ease-out), border-color .25s var(--ease-out), background .25s var(--ease-out);
}

.tax-term-detail__reset:hover {
  color: var(--cp-700);
  border-color: var(--cp-300);
  background: var(--cp-50);
}

.tax-term-detail__reset svg {
  transform: none;
}

.tax-term-detail__body {
  font-size: 15px;
  line-height: 2.1;
  color: var(--c-text);
  overflow-wrap: anywhere;
}

.tax-term-detail__body > *:first-child {
  margin-top: 0;
}

.tax-term-detail__body > *:last-child {
  margin-bottom: 0;
}

.tax-term-detail__body a {
  color: var(--cp-600);
  border-bottom: 1px solid rgba(15, 118, 110, .28);
}

.tax-term-detail__body ul,
.tax-term-detail__body ol {
  margin: 10px 0;
  padding-inline-start: 22px;
}

.tax-term-detail__body li {
  margin-bottom: 4px;
}

.tax-term-detail__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.tax-term-detail__fact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-pill);
  background: var(--c-bg);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--c-muted);
}

.tax-term-detail__fact-num {
  font-size: 15px;
  font-weight: 800;
  color: var(--cp-700);
}

.tax-archive--tag .tax-term-detail__fact-num {
  color: #4338CA;
}

.tax-archive--device .tax-term-detail__fact-num {
  color: var(--cs-600);
}

.tax-term-detail__fact--cities {
  flex: 1 1 100%;
  align-items: flex-start;
  flex-direction: column;
  gap: 10px;
  border-radius: var(--r-md);
  padding: 12px 16px;
}

.tax-term-detail__cities {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tax-term-detail__city {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--cp-100);
  font-size: 13px;
  font-weight: 600;
  color: var(--cp-700);
}

.tax-archive--tag .tax-term-detail__city {
  background: rgba(99, 102, 241, .12);
  color: #4338CA;
}

.tax-archive--device .tax-term-detail__city {
  background: var(--cs-100);
  color: var(--cs-600);
}

.tax-term-detail__city-count {
  font-size: 12px;
  opacity: .75;
}

/* ─── Term salon list (selected term only) ─────────────────────────── */

.tax-term-salons {
  margin-bottom: 30px;
}

/* Bigger salon tile on the term pages: the shared card uses a 100×100 one, and
   main.css turns it into a full-width banner below 720px — so the override is
   desktop-only and the mobile layout keeps its own proportions. */
@media (min-width: 721px) {
  .tax-term-salons .card__img {
    width: 200px;
    height: 200px;
  }
}

.tax-term-salons__head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--c-border);
}

.tax-term-salons__title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.7;
  color: var(--c-text);
}

.tax-term-salons__count {
  padding: 3px 12px;
  border-radius: var(--r-pill);
  background: var(--cp-100);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.8;
  color: var(--cp-700);
}

.tax-archive--tag .tax-term-salons__count {
  background: rgba(99, 102, 241, .12);
  color: #4338CA;
}

.tax-archive--device .tax-term-salons__count {
  background: var(--cs-100);
  color: var(--cs-600);
}

/* ─── Panel wrapper ─────────────────────────────────────────────────── */

.tax-archive__body {
  animation: fadeUp .7s var(--ease-out) .08s both;
}

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

@media (max-width: 1024px) {
  .tax-archive {
    padding: 26px 0 56px;
  }

  .tax-terms {
    padding: 20px 18px;
  }

  .tax-term-detail {
    padding: 20px 18px;
  }

  .tax-term-detail__title {
    font-size: 21px;
  }

  .tax-term-salons__title {
    font-size: 18px;
  }

  .tax-terms__grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

@media (max-width: 640px) {
  .tax-terms__title {
    font-size: 17px;
  }

  .tax-terms__icon {
    width: 32px;
    height: 32px;
  }

  .tax-term-detail {
    padding: 18px 15px;
  }

  .tax-term-detail__mark {
    width: 38px;
    height: 38px;
  }

  .tax-term-detail__title {
    font-size: 19px;
  }

  .tax-term-detail__reset {
    width: auto;
    max-width: 100%;
    margin-inline-start: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tax-archive,
  .tax-terms,
  .tax-term-detail,
  .tax-term-card,
  .tax-archive__body {
    animation: none;
  }

  .tax-term-card {
    transition: none;
  }
}
