.categorie-page {
  --cat-accent: var(--sm-primary);
  --cat-muted: #6c757d;
  --cat-border: rgba(198, 158, 127, 0.16);
  --cat-shadow: 0 16px 32px rgba(51, 51, 51, 0.06);
  --cat-hero: rgba(198, 158, 127, 0.12);

  padding-top: 0.5rem;

  .categorie-hero {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(249, 245, 241, 0.96));
    border: 1px solid var(--cat-border);
    border-radius: 18px;
    padding: 1.35rem 1.5rem;
    box-shadow: var(--cat-shadow);
    margin-bottom: 1.5rem;
  }

  .categorie-hero-inner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
  }

  .categorie-kicker {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background: var(--cat-hero);
    color: #705846;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
  }

  .categorie-title {
    margin: 0.35rem 0 0;
    font-weight: 700;
    letter-spacing: 0.3px;
  }

  .categorie-subtitle {
    margin: 0.35rem 0 0;
    color: var(--cat-muted);
    max-width: 60ch;
  }

  .categorie-filters {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: min(260px, 100%);
    padding: 0.6rem 0.9rem;
    border-radius: 14px;
    border: 1px solid rgba(198, 158, 127, 0.2);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 24px rgba(51, 51, 51, 0.06);

    span {
      font-size: 0.85rem;
      font-weight: 600;
      color: #705846;
      letter-spacing: 0.2px;
      text-transform: uppercase;
    }

    .form-select {
      border-radius: 12px;
      border-color: rgba(198, 158, 127, 0.3);
      background-color: rgba(255, 255, 255, 0.95);
      box-shadow: inset 0 1px 2px rgba(51, 51, 51, 0.06);
    }
  }

  .categorie-couleur-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--cat-border);
  }

}

/* ── Sidebar catégories ─────────────────────────────────────────── */

.cat-burger-wrap {
  margin-bottom: 1rem;

  &.is-stuck {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1040;
    margin: 0;

    .cat-sidebar-burger {
      padding: 0.6rem;
      border-radius: 50%;
      width: 42px;
      height: 42px;
      justify-content: center;
      box-shadow: 0 4px 16px rgba(51, 51, 51, 0.18);
    }

    .cat-burger-label {
      display: none;
    }
  }
}

.cat-sidebar-burger {
  background: #fff;
  border: 1px solid rgba(198, 158, 127, 0.4);
  color: #705846;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.875rem;
  gap: 0.4rem;
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1rem;
  transition: padding 0.2s ease, border-radius 0.2s ease, width 0.2s ease;

  &:hover, &:focus-visible {
    background: rgba(198, 158, 127, 0.12);
    border-color: rgba(198, 158, 127, 0.7);
    color: #5c4636;
  }
}

.cat-sidebar-offcanvas {
  max-width: 280px;
}

.cat-sidebar {
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(198, 158, 127, 0.18);
  border-radius: 16px;
  padding: 1rem 1rem 1.25rem;
  box-shadow: 0 12px 28px rgba(51, 51, 51, 0.07);
  position: sticky;
  top: 1.5rem;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
}

.cat-sidebar-sticky-filters {
  display: none;
  overflow: hidden;

  &.cat-sticky-filters--visible {
    display: block;
    animation: cat-filters-in 0.25s cubic-bezier(0.3, 1, 0.4, 1) both;
  }
}

@keyframes cat-filters-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cat-sidebar-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #705846;
  margin-bottom: 0.4rem;
}

.cat-sidebar-select {
  border-radius: 10px;
  border-color: rgba(198, 158, 127, 0.3);
  font-size: 0.85rem;
  background-color: rgba(255, 255, 255, 0.95);

  &:focus {
    border-color: rgba(198, 158, 127, 0.7);
    box-shadow: 0 0 0 3px rgba(198, 158, 127, 0.15);
  }
}

.cat-sidebar-couleurs {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;

  .cat-sidebar-couleurs-tous {
    display: block;
    width: 100%;
  }

  .cat-sidebar-couleurs-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;

    .btn-couleur-couleur {
      width: 100%;
      height: auto;
      aspect-ratio: 1;
      border-radius: 50%;
    }
  }
}

.cat-sidebar-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #705846;
  margin-bottom: 0.6rem;
}

.cat-sidebar-parent {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #705846;
  text-decoration: none;
  padding: 0.25rem 0.4rem;
  border-radius: 8px;
  transition: background 0.18s ease, color 0.18s ease;

  &:hover {
    background: rgba(198, 158, 127, 0.14);
    color: #5c4636;
  }
}

.cat-sidebar-sep {
  border-color: rgba(198, 158, 127, 0.25);
  margin: 0.6rem 0;
}

.cat-sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.cat-sidebar-item {
  border-radius: 10px;
  overflow: hidden;

  &--active > .cat-sidebar-link {
    background: rgba(198, 158, 127, 0.18);
    color: #5c4636;
    font-weight: 700;
  }
}

.cat-sidebar-link {
  display: block;
  padding: 0.38rem 0.6rem;
  border-radius: 10px;
  font-size: 0.875rem;
  color: #3b3b3b;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.18s ease, color 0.18s ease;

  &:hover, &--active {
    background: rgba(198, 158, 127, 0.14);
    color: #5c4636;
  }
}

.cat-sidebar-sublist {
  list-style: none;
  padding: 0 0 0.25rem 0.85rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  border-left: 2px solid rgba(198, 158, 127, 0.3);
  margin-left: 0.6rem;
  margin-top: 0.15rem;
}

.cat-sidebar-sublink {
  display: block;
  padding: 0.28rem 0.5rem;
  border-radius: 8px;
  font-size: 0.82rem;
  color: #6c757d;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease;

  &:hover {
    background: rgba(198, 158, 127, 0.12);
    color: #5c4636;
  }
}

/* ── Squelette de chargement ─────────────────────────────────────── */

@keyframes cat-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.cat-skeleton-card {
  width: 250px;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid rgba(198, 158, 127, 0.12);
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 10px;

  .cat-sk-img {
    width: 200px;
    height: 200px;
    border-radius: 12px;
    background: linear-gradient(90deg, #f5ede6 25%, #ede0d7 50%, #f5ede6 75%);
    background-size: 200% 100%;
    animation: cat-shimmer 1.4s ease-in-out infinite;
  }

  .cat-sk-line {
    height: 12px;
    border-radius: 6px;
    width: 80%;
    background: linear-gradient(90deg, #f5ede6 25%, #ede0d7 50%, #f5ede6 75%);
    background-size: 200% 100%;
    animation: cat-shimmer 1.4s ease-in-out infinite;

    &--lg { width: 100%; height: 14px; }
    &--sm { width: 45%; }
  }
}

/* ── Fin sidebar ─────────────────────────────────────────────────── */

.reference-cards {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.reference-cards-modern .card,
.reference-cards .card {
  box-shadow: rgba(99, 99, 99, 0.2) 0 2px 8px 0;
  padding: 20px;
  width: 250px;
  text-align: center;
  text-decoration: none;
  border-radius: 16px;
  border: 1px solid rgba(198, 158, 127, 0.12);
  background: #ffffff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.reference-cards-modern .card:hover,
.reference-cards .card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(51, 51, 51, 0.14);
}

.reference-cards-modern .card .image,
.reference-cards .card .image {
  width: 200px;
  height: 200px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(99, 99, 99, 0.12);
  margin-bottom: 10px;
}

.reference-cards-modern .card .content h5,
.reference-cards .card .content h5 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

}

.reference-cards .card,
.reference-cards-modern .card {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.reference-cards .card.is-visible,
.reference-cards-modern .card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-spinner {
  display: flex;
  justify-content: center;
  padding: 2rem 0;
}

.scroll-spinner::after {
  content: '';
  width: 36px;
  height: 36px;
  border: 3px solid rgba(198, 158, 127, 0.3);
  border-top-color: var(--sm-primary, #c69e7f);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.reference-cards img,
.reference-cards-modern img {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.reference-cards img.is-loaded,
.reference-cards-modern img.is-loaded {
  opacity: 1;
}
