/* Ported from production: components-internal/teaser/productTeaser.styled.ts + CustomProductTeaser.tsx */

.category-teaser {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  padding: 0 40px;
  box-sizing: border-box;
}

@media (max-width: 599.95px) {
  .category-teaser {
    padding: 0 20px;
  }
}

.category-teaser__stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  min-width: 0;
}

.category-teaser__heading {
  margin: 0;
  text-align: start;
  font-size: 1.75rem; /* titleBase 28px */
  font-weight: 400;
  line-height: 1;
  color: #000000;
}

@media (max-width: 599.95px) {
  .category-teaser__heading {
    font-size: 1rem;
    text-align: center;
  }
}

.category-teaser__track {
  display: block;
  width: 100%;
  min-width: 0;
  position: relative;
}

/* Swiper shell — height from slides; GPU-friendly transforms */
.category-teaser__track .Swipper,
.category-teaser__track .swiper {
  width: 100%;
  height: auto;
  overflow: hidden;
  touch-action: pan-x;
}

.category-teaser__track .swiper-wrapper {
  display: flex;
  align-items: stretch;
  will-change: transform;
}

.category-teaser__track .swiper-slide {
  width: 87px;
  height: auto;
  flex-shrink: 0;
  box-sizing: border-box;
  backface-visibility: hidden;
}

@media (min-width: 600px) {
  .category-teaser__track .swiper-slide {
    width: 158px;
  }
}

.category-teaser__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex-shrink: 0;
  width: 87px;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

@media (min-width: 600px) {
  .category-teaser__card {
    width: 158px;
    gap: 18.4px;
  }
}

.category-teaser__image-box {
  position: relative;
  overflow: hidden;
  background-color: #fff;
  flex-shrink: 0;
  width: 87px;
  height: 95px;
  min-width: 87px;
  min-height: 95px;
}

@media (min-width: 600px) {
  .category-teaser__image-box {
    width: 158px;
    height: 187px;
    min-width: 158px;
    min-height: 187px;
  }
}

.category-teaser__image-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #fff;
  transition: transform 0.4s ease-out;
  will-change: auto;
}

.category-teaser__card:hover .category-teaser__image-box img {
  transform: scale(1.08);
}

/* Hover scale fights drag transforms — disable while interacting */
.category-teaser__track.is-dragging .category-teaser__image-box img,
.category-teaser__track.is-dragging .category-teaser__card:hover .category-teaser__image-box img {
  transform: none !important;
  transition: none !important;
}

.category-teaser__title {
  width: 100%;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.2;
  margin: 0;
}

.category-teaser__slide {
  width: 87px;
  height: auto;
  min-height: 140px;
  box-sizing: border-box;
}

@media (min-width: 600px) {
  .category-teaser__slide {
    width: 158px;
    height: 240px;
    min-height: 240px;
  }
}

/*
 * Live arrowsmall: 21×23, rgba(248,248,248,0.66) plate, no border,
 * chevron centered, vertically centered on the image box (not the label).
 */
.category-teaser__track .carousel-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  /* Center on the image box (95px mobile / 187px desktop), not full slide height */
  top: 47.5px;
  z-index: 10;
  transform: translateY(-50%);
  width: 21px;
  height: 23px;
  min-width: 21px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: rgba(248, 248, 248, 0.66);
  color: #000000;
  box-shadow: none;
  outline: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  cursor: pointer;
  line-height: 0;
  -webkit-appearance: none;
  appearance: none;
}

@media (min-width: 600px) {
  .category-teaser__track .carousel-arrow {
    top: 93.5px; /* 187px image box / 2 */
  }
}

.category-teaser__track .carousel-arrow[aria-label="Previous slide"] {
  left: 10px !important;
  right: auto !important;
}

.category-teaser__track .carousel-arrow[aria-label="Next slide"] {
  right: 10px !important;
  left: auto !important;
}

.category-teaser__track .carousel-arrow > svg {
  width: 18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
}

.category-teaser__track .swiper:hover > .carousel-arrow,
.category-teaser__track:hover .carousel-arrow {
  opacity: 1;
  pointer-events: auto;
}

.category-teaser__track .carousel-arrow:hover,
.category-teaser__track .carousel-arrow:focus,
.category-teaser__track .carousel-arrow:active {
  background: rgba(248, 248, 248, 0.85);
  border: 0;
  box-shadow: none;
  outline: none;
}

.category-teaser__track .carousel-arrow.swiper-button-disabled,
.category-teaser__track .carousel-arrow:disabled {
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (hover: none) {
  .category-teaser__track .carousel-arrow {
    opacity: 1;
    pointer-events: auto;
  }
}

/* Hide arrows on small phones — swipe is the primary gesture */
@media (max-width: 599.95px) {
  .category-teaser__track .carousel-arrow {
    display: none !important;
  }
}
