/*
 * Linov HP Catégories - grille de vignettes.
 * Palette alignée sur les autres modules Linov (linovmenu / linovboutique) :
 * marine des titres, gris des textes secondaires, rouge de la charte pour
 * l'accent des flèches de pagination.
 */

.lnv-hpcat {
  --lnv-hpcat-text: #1c2947;
  --lnv-hpcat-muted: #64748b;
  --lnv-hpcat-accent: #d4202c;
  --lnv-hpcat-border: #e6e8ee;
  --lnv-hpcat-radius: 14px;
  --lnv-hpcat-gap: 28px;
  --lnv-hpcat-columns: 3;
  /* Marge intérieure des pages : laisse respirer les ombres portées des
     cartes, que le viewport (overflow hidden) couperait sinon. */
  --lnv-hpcat-bleed: 12px;

  max-width: 1280px;
  margin: 0 auto;
  padding: 8px 0 0;
}

/* ------------------------------------------------------------------ *
 * Piste + pages
 * ------------------------------------------------------------------ */

.lnv-hpcat__viewport {
  overflow: hidden;
  margin: 0 calc(-1 * var(--lnv-hpcat-bleed));
}

.lnv-hpcat__track {
  display: flex;
  align-items: flex-start;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.lnv-hpcat__page {
  flex: 0 0 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: var(--lnv-hpcat-bleed);
}

.lnv-hpcat__grid {
  display: grid;
  grid-template-columns: repeat(var(--lnv-hpcat-columns), minmax(0, 1fr));
  gap: var(--lnv-hpcat-gap);
  list-style: none;
  margin: 0;
  padding: 0;
}

.lnv-hpcat__cell {
  min-width: 0;
}

/* ------------------------------------------------------------------ *
 * Vignette
 * ------------------------------------------------------------------ */

.lnv-hpcat__card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--lnv-hpcat-border);
  border-radius: var(--lnv-hpcat-radius);
  text-decoration: none !important;
  color: inherit;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.lnv-hpcat__card:hover,
.lnv-hpcat__card:focus-visible {
  transform: translateY(-3px);
  border-color: #d9dde6;
}

.lnv-hpcat__card:focus-visible {
  outline: 2px solid var(--lnv-hpcat-accent);
  outline-offset: 2px;
}

.lnv-hpcat__media {
  display: block;
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #f1f3f7;
}

/* Repli pour les navigateurs sans aspect-ratio. */
@supports not (aspect-ratio: 16 / 9) {
  .lnv-hpcat__media {
    height: 0;
    padding-bottom: 56.25%;
  }
}

.lnv-hpcat__img {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.lnv-hpcat__img--empty {
  background: linear-gradient(135deg, #eef1f6 0%, #e2e6ee 100%);
}

.lnv-hpcat__card:hover .lnv-hpcat__img {
  transform: scale(1.04);
}

.lnv-hpcat__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 1 1 auto;
  padding: 18px 20px;
}

.lnv-hpcat__title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--lnv-hpcat-text);
}

.lnv-hpcat__arrow {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--lnv-hpcat-muted);
  transition: color 0.25s ease, transform 0.25s ease;
}

.lnv-hpcat__card:hover .lnv-hpcat__arrow {
  color: var(--lnv-hpcat-accent);
  transform: translateX(4px);
}

/* ------------------------------------------------------------------ *
 * Pagination (flèches + points) - jamais automatique
 * ------------------------------------------------------------------ */

.lnv-hpcat__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 28px;
	margin-bottom: 15px;
}

.lnv-hpcat__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  background: #fff;
  color: var(--lnv-hpcat-text);
  border: 1px solid var(--lnv-hpcat-border);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.lnv-hpcat__btn:hover:not(:disabled) {
  background: var(--lnv-hpcat-accent);
  border-color: var(--lnv-hpcat-accent);
  color: #fff;
}

.lnv-hpcat__btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.lnv-hpcat__dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lnv-hpcat__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  background: #cbd2df;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: width 0.2s ease, background-color 0.2s ease;
}

.lnv-hpcat__dot--active {
  width: 22px;
  border-radius: 4px;
  background: var(--lnv-hpcat-accent);
}

/* ------------------------------------------------------------------ *
 * Responsive
 * ------------------------------------------------------------------ */

@media (max-width: 991px) {
  .lnv-hpcat {
    --lnv-hpcat-columns: 2;
    --lnv-hpcat-gap: 20px;
  }
}

@media (max-width: 575px) {
  .lnv-hpcat {
    /* On garde 2 colonnes comme sur tablette, juste un peu plus serré. */
    --lnv-hpcat-gap: 14px;
  }

  .lnv-hpcat__footer {
    padding: 12px 14px;
  }

  .lnv-hpcat__title {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lnv-hpcat__track,
  .lnv-hpcat__img,
  .lnv-hpcat__card,
  .lnv-hpcat__arrow {
    transition: none;
  }
}
