/* === WC Category Swiper – Flexibel bredd & jämnt mellanrum === */

.wc-category-swiper {
  max-width: 1280px;
  width: 100%;
  margin: 20px auto;
  padding: 0 10px;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
  z-index: 1;
}

/* Swiper-wrapper med jämnt mellanrum */
.wc-category-swiper-wrapper {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  padding: 12px 30px;
  box-sizing: border-box;
}

/* Varje slide */
.wc-category-slide {
  flex: 0 0 auto;
  display: flex; /* så länken kan fylla slide */
}

/* Kategorilänk (knappen) */
.wc-category-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  text-decoration: none;
  background: #fff;
  color: #257b7b;
  border: 1.5px solid #257b7b;
  border-radius: 4px;
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  height: auto;
  width: auto;
  max-width: 100%;   /* viktig: tillåt flexibel bredd */
  box-sizing: border-box;
  cursor: pointer;
}

/* Text i knappen */
.wc-category-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1;
}

/* Bild i kategori (valfritt) */
.wc-category-link img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 4px;
}

/* Hover-effekt */
.wc-category-link:hover {
  background: #257b7b;
  color: #fff;
  transform: scale(1.03);
  box-shadow: 0 2px 6px rgba(37, 123, 123, 0.25);
}

/* Aktiv kategori */
.wc-category-link.current-cat {
  background: #f18631;
  color: #fff;
  border-color: #f18631;
  font-weight: 700;
}
.wc-category-link.current-cat:hover {
  background: #e07528;
  border-color: #e07528;
}

/* Fokus (för tangentbord) */
.wc-category-link:focus {
  outline: 2px solid #f18631;
  outline-offset: 2px;
}

/* Swiper-pilar */
.wc-category-swiper .swiper-button-prev,
.wc-category-swiper .swiper-button-next {
  position: absolute;
  top: 50%;
  width: 26px;
  height: 26px;
  margin-top: -13px;
  color: #257b7b;
  z-index: 3;
  background: #fff;
  border-radius: 50%;
  font-size: 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* === Responsivt === */
@media screen and (max-width: 768px) {
  .wc-category-swiper-wrapper {
    padding: 10px 20px;
    gap: 10px;
  }

  .wc-category-link {
    font-size: 12px;
    padding: 5px 12px;
  }

  .wc-category-link img {
    width: 26px;
    height: 26px;
  }

  .wc-category-swiper .swiper-button-prev,
  .wc-category-swiper .swiper-button-next {
    width: 22px;
    height: 22px;
    font-size: 14px;
    margin-top: -11px;
  }
}

div.wc-category-swiper.swiper div.wc-category-swiper-wrapper.swiper-wrapper div.wc-category-slide.swiper-slide {
  margin-right: 0 !important;
  margin-left: 0 !important;
  margin-inline: 0 !important;
  width: auto !important;
}
