/* cg_category_links 1.0.3 : liens sur une seule ligne, en carrousel s'ils débordent.
   Les styles des liens eux-mêmes (.subcategories-links-list a) restent ceux du thème. */

.cg-category-links .cgcl-carousel {
  position: relative;
  min-width: 0;
}

/* Une seule ligne, défilement horizontal natif (tactile, trackpad, molette + Maj) */
.cg-category-links .subcategories-links-list {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 2px;      /* aimantation alignée sur la marge intérieure ci-dessous */
  scrollbar-width: none;           /* Firefox */
  -webkit-overflow-scrolling: touch;
  padding: 2px;                    /* bordure au survol / contour du focus non rognés */
}
.cg-category-links .subcategories-links-list::-webkit-scrollbar { display: none; }

.cg-category-links .subcategories-links-list li {
  flex: 0 0 auto;
  scroll-snap-align: start;
}
.cg-category-links .subcategories-links-list a { white-space: nowrap; }
/* Vignettes avec image : largeur fixe du thème, le nom peut passer sur 2 lignes */
.cg-category-links .subcategories-links-list a:has(.subcategory-thumb) { white-space: normal; }

/* Débordement : place pour les flèches + fondu sur le bord où il reste des liens */
.cg-category-links .cgcl-carousel.is-overflow { padding: 0 34px; }
.cg-category-links .cgcl-carousel.is-overflow .subcategories-links-list {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
          mask-image: linear-gradient(to right, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
}
.cg-category-links .cgcl-carousel.is-overflow.is-start .subcategories-links-list {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent 100%);
          mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent 100%);
}
.cg-category-links .cgcl-carousel.is-overflow.is-end .subcategories-links-list {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 24px);
          mask-image: linear-gradient(to right, transparent 0, #000 24px);
}

/* Flèches (même dessin que les carrousels du thème) */
.cg-category-links .cgcl-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .15s ease;
}
.cg-category-links .cgcl-arrow[hidden] { display: none; }
.cg-category-links .cgcl-prev { left: 0; }
.cg-category-links .cgcl-next { right: 0; }
.cg-category-links .cgcl-arrow svg { width: 24px; height: 24px; }
.cg-category-links .cgcl-arrow svg path { stroke: #2E2722; }
.cg-category-links .cgcl-arrow:disabled { opacity: .25; cursor: default; }
.cg-category-links .cgcl-arrow:not(:disabled):hover svg path { stroke: var(--third-color, #c3a88b); }
