/* KERP Tackle - Compacte subcategorie-carousel v1.5 */
.kerp-cat-carousel {
  --kerp-green: #417f00;
  --kerp-text: #171717;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0 0 16px;
  font-family: inherit;
  box-sizing: border-box;
}
.kerp-cat-carousel *, .kerp-cat-carousel *::before, .kerp-cat-carousel *::after { box-sizing: border-box; }
.kerp-cat-carousel__title {
  margin: 0 0 10px !important;
  font-size: 19px !important;
  line-height: 1.3 !important;
  font-weight: 700 !important;
  color: var(--kerp-text) !important;
}
.kerp-cat-carousel__layout {
  display: grid !important;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-width: 0;
}
.kerp-cat-carousel__arrow {
  display: grid !important;
  place-items: center;
  width: 36px !important;
  height: 36px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 1px solid var(--kerp-green) !important;
  border-radius: 50% !important;
  background: #fff !important;
  color: var(--kerp-green) !important;
  line-height: 1 !important;
  box-shadow: none !important;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, opacity .2s ease;
}
.kerp-cat-carousel__arrow svg { display: block; width: 18px; height: 18px; }
.kerp-cat-carousel__arrow:hover:not(:disabled), .kerp-cat-carousel__arrow:focus-visible {
  background: var(--kerp-green) !important;
  color: #fff !important;
}
.kerp-cat-carousel__arrow:disabled { opacity: .25; cursor: default; }
.kerp-cat-carousel__track {
  display: flex !important;
  align-items: stretch;
  gap: 10px;
  min-width: 0;
  width: 100%;
  padding: 2px 0 5px;
  margin: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 1px;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.kerp-cat-carousel__track::-webkit-scrollbar { display: none; }
.kerp-cat-carousel__item,
.kerp-cat-carousel__item:visited {
  flex: 0 0 clamp(138px, 14vw, 184px) !important;
  width: clamp(138px, 14vw, 184px) !important;
  height: 166px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: none !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 10px 10px 9px !important;
  margin: 0 !important;
  border-radius: 17px !important;
  border: 1px solid #eeeeeb !important;
  background: #fff !important;
  text-decoration: none !important;
  color: var(--kerp-text) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.025) !important;
  scroll-snap-align: start;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.kerp-cat-carousel__item:hover, .kerp-cat-carousel__item:focus-visible {
  border-color: #a5be8c !important;
  box-shadow: 0 6px 18px rgba(40,75,0,.08) !important;
  transform: translateY(-2px);
}
.kerp-cat-carousel__image-wrap {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  flex: 0 0 106px;
  width: 100%;
  height: 106px;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
.kerp-cat-carousel__image-wrap img.kerp-cat-carousel__image {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  margin: 0 auto !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  object-fit: contain !important;
  object-position: center !important;
}
.kerp-cat-carousel__placeholder { width: 44px; height: 44px; color: #b4c4a6; }
.kerp-cat-carousel__name {
  display: -webkit-box !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  width: 100%;
  max-height: 34px;
  min-height: 17px;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--kerp-text) !important;
  font-family: inherit !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 17px !important;
  letter-spacing: normal !important;
  text-align: center !important;
  text-transform: none !important;
  overflow-wrap: anywhere !important;
}
.kerp-cat-carousel__count { font-size: 11px; line-height: 1.2; color: #666; }
.kerp-cat-carousel--show-count .kerp-cat-carousel__item { height: 188px !important; }
.kerp-cat-carousel--fits .kerp-cat-carousel__arrow { visibility: hidden; }
@media (max-width: 1024px) {
  .kerp-cat-carousel__layout { grid-template-columns: 32px minmax(0, 1fr) 32px; gap: 7px; }
  .kerp-cat-carousel__arrow { width: 32px !important; height: 32px !important; }
  .kerp-cat-carousel__item, .kerp-cat-carousel__item:visited { flex-basis: 154px !important; width: 154px !important; height: 152px !important; padding: 9px !important; border-radius: 14px !important; }
  .kerp-cat-carousel__image-wrap { flex-basis: 94px; height: 94px; }
  .kerp-cat-carousel--show-count .kerp-cat-carousel__item { height: 178px !important; }
}
/* Mobiel: swipebare rij met 2 volledige tegels en een gedeeltelijk zichtbare derde. */
@media (max-width: 767px) {
  .kerp-cat-carousel { margin-bottom: 12px; }
  .kerp-cat-carousel__layout {
    display: block !important;
    width: 100%;
    min-width: 0;
  }
  /* Swipe vervangt navigatiepijlen op kleine schermen. */
  .kerp-cat-carousel__arrow { display: none !important; }
  .kerp-cat-carousel__track {
    width: 100%;
    gap: 8px;
    padding: 2px 0 5px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
  }
  /* Voor 320-410px schermen passen er circa 2.45 kaarten naast elkaar. */
  .kerp-cat-carousel__item,
  .kerp-cat-carousel__item:visited {
    flex: 0 0 min(168px, calc(40.8% - 6.5px)) !important;
    width: min(168px, calc(40.8% - 6.5px)) !important;
    height: 134px !important;
    padding: 8px 7px !important;
    border-radius: 12px !important;
    gap: 4px !important;
  }
  .kerp-cat-carousel__image-wrap {
    flex: 0 0 83px;
    height: 83px;
  }
  .kerp-cat-carousel__name {
    font-size: 12px !important;
    line-height: 16px !important;
    max-height: 32px;
  }
  .kerp-cat-carousel--show-count .kerp-cat-carousel__item { height: 156px !important; }
  /* Een subtiele fade aan de rechterkant geeft aan dat je verder kunt swipen.
     De fade verdwijnt automatisch zodra je aan het einde bent. */
  .kerp-cat-carousel--can-scroll-next .kerp-cat-carousel__track {
    -webkit-mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 55px), rgba(0, 0, 0, .20) 100%);
    mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 55px), rgba(0, 0, 0, .20) 100%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .kerp-cat-carousel__track { scroll-behavior: auto; }
  .kerp-cat-carousel__item, .kerp-cat-carousel__arrow { transition: none; }
}

/* v1.5: gekozen subcategorie zichtbaar en subtiel gemarkeerd. */
.kerp-cat-carousel__item--active,
.kerp-cat-carousel__item--active:visited {
  position: relative;
  border-color: var(--kerp-green) !important;
  background: #f7fbf3 !important;
  box-shadow: 0 0 0 1px rgba(65,127,0,.16) !important;
}
.kerp-cat-carousel__item--active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 28%;
  width: 44%;
  height: 3px;
  background: var(--kerp-green);
  border-radius: 3px 3px 0 0;
}
.kerp-cat-carousel__item--active .kerp-cat-carousel__name {
  color: var(--kerp-green) !important;
}
