/* =========================
   TAXONOMY GRID
   ========================= */

.jb-taxonomy-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr); /* 7 items op 1 rij op desktop */
  gap: 20px;
  align-items: start;
}

.jb-taxonomy-card {
  display: block;
  text-decoration: none;
  color: inherit;
  text-align: center;
}

.jb-taxonomy-card:hover {
  color: inherit;
}

.jb-taxonomy-card-image {
  width: 100%;
  max-width: 170px; /* Exact gelijk aan slider */
  height: auto;
  aspect-ratio: 1 / 1; /* Houdt de afbeelding altijd perfect rond */
  margin: 0 auto;
  border-radius: 50%;
  overflow: hidden;
}

.jb-taxonomy-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* placeholder als geen afbeelding is ingevuld */
.jb-taxonomy-card-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #e9e4dc;
}

.jb-taxonomy-card-title {
  margin-top: 12px; /* Gelijk aan slider */
  font-size: 16px; /* Gelijk aan slider */
  line-height: 1.3;
  font-weight: 700;
  color: var(--wd-primary-color);
  text-align: center;
  white-space: normal;
}


/* =========================
   HOMEPAGE TAX SLIDER
   ========================= */

.jb-tax-slider-block {
  width: 100%;
  box-sizing: border-box;
}

.jb-tax-slider-viewport {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.jb-tax-slider-viewport::-webkit-scrollbar {
  display: none;
}

.jb-tax-slider-track {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 30px; 
  width: max-content;
  min-width: 100%;
  margin: 0;
  padding: 0;
}

.jb-tax-slider-item {
  flex: 0 0 170px; 
  width: 170px;
  min-width: 170px;
  max-width: 170px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  user-select: none;
}

.jb-tax-slider-item:hover {
  color: inherit;
}

.jb-tax-slider-image {
  width: 170px; 
  height: 170px; 
  margin: 0 auto;
  border-radius: 50%;
  overflow: hidden;
}

.jb-tax-slider-image img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 100%;
  max-width: none;
  object-fit: cover;
}

.jb-tax-slider-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #e9e4dc;
}

.jb-tax-slider-title {
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.3;
  font-weight: 700;
  text-align: center;
  color: var(--wd-primary-color);
  white-space: normal;
}

.jb-tax-slider-progress {
  position: relative;
  width: 100%;
  height: 3px; 
  margin-top: 18px;
  background: #ddd8cf;
  border-radius: 999px;
  overflow: hidden;
}

.jb-tax-slider-progress-bar {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  background: var(--wd-primary-color);
  border-radius: 999px;
  transform: translate3d(0,0,0);
}

@media (min-width: 768px) {
  .jb-tax-slider-viewport {
    overflow: hidden; 
  }

  .jb-tax-slider-track {
    width: 100%;
    min-width: 100%;
    justify-content: space-between; 
    gap: 10px; 
  }

  .jb-tax-slider-item {
    flex: 1 1 0; 
    min-width: 0; 
    max-width: 170px; 
    width: auto;
  }

  .jb-tax-slider-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1; 
    max-width: 170px;
  }

  .jb-tax-slider-viewport img,
  .jb-tax-slider-viewport a {
    -webkit-user-drag: none;
    user-select: none;
  }

  .jb-tax-slider-progress {
    display: none;
  }
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 1024px) {
  /* Tablet views (iPad) */
  .jb-taxonomy-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }

  .jb-taxonomy-card-image {
    max-width: 160px;
  }

  .jb-taxonomy-card-title {
    font-size: 17px;
  }
}

@media (max-width: 767px) {
  /* Mobiele views */
  .jb-taxonomy-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 12px;
    row-gap: 24px;
  }

  .jb-taxonomy-card-image {
    width: 120px;
    height: 120px;
    max-width: none;     /* Reset de desktop aspect-ratio hack voor mobiel */
    aspect-ratio: auto;  /* Reset de desktop aspect-ratio hack voor mobiel */
  }

  .jb-taxonomy-card-title {
    margin-top: 14px;
    font-size: 16px;
  }

  /* --- SLIDER AANPASSINGEN MOBIEL --- */
  .jb-tax-slider-viewport {
    scroll-snap-type: x mandatory;
    overflow-x: auto; 
  }

  .jb-tax-slider-track {
    gap: 20px; 
    justify-content: flex-start;
    width: max-content;
  }

  .jb-tax-slider-item {
    scroll-snap-align: start;
    flex: 0 0 137px; 
    width: 137px;
    min-width: 137px;
    max-width: 137px;
  }

  .jb-tax-slider-image {
    width: 137px; 
    height: 137px; 
  }
}

@media (max-width: 480px) {
  .jb-taxonomy-grid {
    column-gap: 10px;
    row-gap: 20px;
  }

  .jb-taxonomy-card-image {
    width: 110px;
    height: 110px;
  }

  .jb-taxonomy-card-title {
    font-size: 15px;
  }
}

/* =========================
   ALLERGENEN ICONS
   ========================= */

.allergy-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.allergy-icons img {
  width: 75px;
  height: 75px;
  object-fit: contain;
  display: block;
}