/**
 * MSW Categories — styles du widget Catégories produits.
 * Liste hiérarchique en liens HTML statiques avec support indentation,
 * vignette optionnelle, état actif et ancêtres.
 */

.msw-categories {
  --msw-cat-indent: 16px;
  --msw-cat-link: var(--msw-text, #1a1a1a);
  --msw-cat-link-hover: var(--msw-accent, #3b82f6);
  --msw-cat-active: var(--msw-accent, #3b82f6);
  --msw-cat-count: var(--msw-text-secondary, #6b7280);

  color: var(--msw-cat-link);
  font-size: 14px;
  line-height: 1.4;
  box-sizing: border-box;
}

.msw-categories *,
.msw-categories *::before,
.msw-categories *::after {
  box-sizing: border-box;
}

.msw-categories {
  margin-top: 40px;
  margin-bottom: 20px;
}

.msw-cat-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.msw-cat-list--children {
  padding-left: var(--msw-cat-indent);
  overflow: hidden;
  max-height: 9999px;
  transition: max-height 0.25s ease-in-out;
}

.msw-cat--has-children:not(.msw-cat--expanded) > .msw-cat-list--children {
  max-height: 0;
}

.msw-cat__row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
  padding-bottom: 4px;
}

.msw-cat__thumb {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  object-fit: cover;
}

.msw-cat__link {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: var(--msw-cat-link);
  text-decoration: none;
  transition: color 0.15s ease;
}

.msw-cat__link:hover,
.msw-cat__link:focus-visible {
  color: var(--msw-cat-link-hover);
  text-decoration: none;
}

.msw-cat__name {
  flex: 1 1 auto;
}

.msw-cat__count {
  font-size: 12px;
  color: var(--msw-cat-count);
  font-variant-numeric: tabular-nums;
}

.msw-cat--active > .msw-cat__row .msw-cat__link {
  color: var(--msw-cat-active);
  font-weight: 600;
}

.msw-cat--ancestor > .msw-cat__row .msw-cat__link {
  font-weight: 500;
}

.msw-cat-error {
  padding: 12px 16px;
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: 6px;
}

.msw-cat-empty {
  margin: 0;
  color: var(--msw-cat-count);
  font-style: italic;
  font-size: 13px;
}
