#category #wrapper {
  padding-top: 0 !important;
}

#category .category-breadcrumb-band {
  margin-bottom: 1rem;
  padding: 0.5rem 0;
  background-color: var(--header-category-background, var(--dark));
}

#category .category-breadcrumb-band .breadcrumb {
  flex-wrap: wrap !important;
  justify-content: flex-start !important;
  margin: 0;
  padding: 0;
}

#category .category-breadcrumb-band .breadcrumb-item,
#category .category-breadcrumb-band .breadcrumb-item a,
#category .category-breadcrumb-band .breadcrumb-item::before {
  color: var(--accent);
}

#category .category-breadcrumb-band .text-nowrap {
  white-space: normal !important;
  overflow-wrap: anywhere;
}

#category .category-title {
  margin-bottom: 1rem;
}

#category .category-subcategories-carousel {
  --subcategory-items: 2;
  max-width: 316px;
  margin: 0 0 1rem;
}

#category .category-subcategories-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - (var(--subcategory-items) - 1) * 16px) / var(--subcategory-items));
  gap: 16px;
  margin: 0;
  padding: 0 0 0.25rem;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

#category .category-subcategories-grid::-webkit-scrollbar {
  display: none;
}

#category .category-subcategories-grid > li {
  min-width: 0;
  scroll-snap-align: start;
}

#category .category-subcategories-controls {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

#category .category-subcategories-controls[hidden] {
  display: none;
}

#category .category-subcategories-controls button {
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--accent);
  font-size: 1.5rem;
  line-height: 1;
}

#category .category-subcategory-card {
  display: flex;
  height: 100%;
  flex-direction: column;
  align-items: stretch;
  color: var(--accent);
  text-align: center;
}

#category .category-subcategory-image {
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border-radius: 0.4375rem;
  background-color: var(--light);
}

#category .category-subcategory-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#category .category-subcategory-placeholder {
  width: 40%;
  aspect-ratio: 1;
  border: 1px solid var(--dark);
  border-radius: 0.4375rem;
}

#category .category-subcategory-name {
  padding: 0.75rem 0.25rem;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

#category .category-subcategory-card:hover .category-subcategory-name {
  text-decoration: underline;
}

#category .category-subcategory-card:focus-visible {
  outline: 2px solid var(--accessible-orange-dark, var(--accent));
  outline-offset: -2px;
  border-radius: 0.4375rem;
}

#category .category-description-bottom {
  margin-top: 2rem;
}

@media (min-width: 768px) {
  #category .category-subcategories-carousel {
    --subcategory-items: 4;
    max-width: 648px;
  }
}

@media (min-width: 1200px) {
  #category .category-subcategories-carousel {
    --subcategory-items: 6;
    max-width: 980px;
  }
}

@media (max-width: 575.98px) {
  #category .category-breadcrumb-band {
    margin-bottom: 0.75rem;
  }
}

/* Description de catégorie repliée avant le premier rendu. */
#category .category-description-collapse {
  position: relative;
}

#category .category-description-collapse.is-collapsed .category-description-content {
  max-height: 14rem;
  overflow: hidden;
}

#category .category-description-collapse.is-expanded .category-description-content {
  max-height: none;
  overflow: visible;
}

#category .category-description-collapse.has-overflow.is-collapsed::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 5rem;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff);
  content: "";
  pointer-events: none;
}

#category .btn-category-description {
  z-index: 1;
  display: none;
  align-items: center;
  border-color: var(--accessible-orange-dark, #a84600);
  border-radius: 2rem;
  color: var(--accessible-orange-dark, #a84600);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

#category .btn-category-description[hidden] {
  display: none !important;
}

#category .category-description-collapse.has-overflow .btn-category-description:not([hidden]) {
  display: inline-flex;
}

#category .category-description-collapse.is-collapsed .btn-category-description:not([hidden]) {
  position: absolute;
  bottom: 0.25rem;
  left: 0;
}

#category .category-description-collapse.is-expanded .btn-category-description:not([hidden]) {
  position: relative;
  margin-top: 0.75rem;
}

#category .btn-category-description:hover,
#category .btn-category-description:focus-visible {
  border-color: var(--accessible-orange-dark, #a84600);
  background-color: var(--accessible-orange-dark, #a84600);
  color: #fff;
}

@media (scripting: none) {
  #category .category-description-collapse.is-collapsed .category-description-content {
    max-height: none;
    overflow: visible;
  }

  #category .category-description-collapse::after,
  #category .btn-category-description {
    display: none !important;
  }
}
