.tech-carousel-section {
  position: relative;
  width: 100%;
  max-width: 100%;
  padding: clamp(20px, 4vw, 36px) 0;
  overflow: hidden;
  isolation: isolate;
}

.tech-carousel-shell {
  position: relative;
  width: 100%;
  max-width: var(--max-width, 1120px);
  margin: 0 auto;
  padding: 0 var(--page-pad, clamp(16px, 3vw, 32px));
  overflow: hidden;
  min-width: 0;
}

.tech-carousel {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  isolation: isolate;

  /* vigtig: fast højde så absolut track ikke påvirker layout */
  height: clamp(84px, 8vw, 104px);
}

/* VIGTIGT:
   Track er absolut placeret, så den aldrig kan skubbe layout eller gøre siden bredere
*/
.tech-carousel__track {
  position: absolute;
  top: 0;
  left: 0;

  display: flex;
  align-items: center;
  gap: var(--tech-carousel-gap, 20px);
  width: max-content;
  min-width: max-content;

  will-change: transform;
  animation: techCarouselScroll var(--tech-carousel-duration, 28s) linear infinite;
}

.tech-carousel:hover .tech-carousel__track {
  animation-play-state: paused;
}

.tech-carousel__track.is-paused {
  animation-play-state: paused;
}

.tech-carousel__item {
  appearance: none;
  border: 1px solid rgba(15, 23, 42, 0.08);
  position: relative;
  flex: 0 0 auto;
  width: clamp(140px, 14vw, 180px);
  height: clamp(84px, 8vw, 104px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 18px;
  background: rgba(248, 250, 252, 0.72);
  cursor: pointer;
  font: inherit;
  overflow: hidden;
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease,
    background 0.35s ease,
    border-color 0.35s ease;
}

.tech-carousel__item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.45),
    rgba(255,255,255,0.15)
  );
  pointer-events: none;
}

.tech-carousel__item:hover {
  transform: scale(1.03);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
  border-color: rgba(15, 23, 42, 0.14);
  background: rgba(205, 255, 78, 0.94);
}

.tech-carousel__item:focus-visible {
  outline: 3px solid rgba(17, 17, 17, 0.72);
  outline-offset: 4px;
}

.tech-carousel__item.is-selected {
  background: rgba(205, 255, 78, 0.96);
  border-color: rgba(17, 17, 17, 0.14);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
}

.tech-carousel__logo {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 100%;
  max-height: 54px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: saturate(1) contrast(1.02);
  transition:
    transform 0.35s ease,
    filter 0.35s ease,
    opacity 0.35s ease;
}

.tech-carousel__item:hover .tech-carousel__logo {
  transform: scale(1.04);
  filter: saturate(1.08) contrast(1.05);
}

.tech-carousel__item.is-selected .tech-carousel__logo {
  filter: saturate(1.08) contrast(1.05);
  opacity: 0.26;
  transform: scale(0.96);
}

.tech-carousel__name {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 50%;
  z-index: 2;
  color: #3366FF;
  font-family: "Poppins", sans-serif;
  font-size: clamp(0.9rem, 1.45vw, 1.08rem);
  font-weight: 800;
  line-height: 1.08;
  min-width: 0;
  opacity: 0;
  overflow-wrap: anywhere;
  pointer-events: none;
  text-align: center;
  transform: translateY(calc(-50% + 6px));
  white-space: normal;
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
}

.tech-carousel__close {
  position: absolute;
  right: 14px;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 0;
  background: transparent;
  color: #111111;
  font: 600 0.82rem/1 "Poppins", sans-serif;
  opacity: 0;
  pointer-events: none;
  text-transform: uppercase;
  transition:
    opacity 0.22s ease,
    background 0.22s ease,
    transform 0.22s ease;
}

.tech-carousel__item.is-selected .tech-carousel__name,
.tech-carousel__item.is-selected .tech-carousel__close {
  opacity: 1;
  transform: translateY(-50%);
}

.tech-carousel__item.is-selected .tech-carousel__close {
  transform: translateY(-50%);
}

@media (hover: hover) and (pointer: fine) and (min-width: 1025px) {
  .tech-carousel__item {
    cursor: default;
  }

  .tech-carousel__item:hover .tech-carousel__logo {
    opacity: 0.26;
    transform: scale(0.96);
  }

  .tech-carousel__item:hover .tech-carousel__name {
    opacity: 1;
    transform: translateY(-50%);
  }

  .tech-carousel__close {
    display: none;
  }
}

.tech-carousel-fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: clamp(40px, 8vw, 110px);
  z-index: 3;
  pointer-events: none;

  /* fade + blur kombineret */
  mask-image: linear-gradient(to right, black, transparent);
}

/* venstre side */
.tech-carousel-fade--left {
  left: 0;
  mask-image: linear-gradient(to right, black 40%, transparent 100%);
}

/* højre side */
.tech-carousel-fade--right {
  right: 0;
  mask-image: linear-gradient(to left, black 40%, transparent 100%);
}

@keyframes techCarouselScroll {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(calc(-50% - (var(--tech-carousel-gap, 20px) / 2)), 0, 0);
  }
}

/* Tablet */
@media (max-width: 1024px) {
  .tech-carousel {
    height: 92px;
  }

  .tech-carousel__item {
    width: clamp(124px, 20vw, 160px);
    height: 92px;
  }

  .tech-carousel__logo {
    max-height: 48px;
  }

  .tech-carousel__name {
    left: 12px;
    right: 38px;
  }

  .tech-carousel-fade {
    width: 72px;
  }
}

/* Mobil */
@media (max-width: 767px) {
  .tech-carousel-section {
    padding: 18px 0;
  }

  .tech-carousel {
    height: 82px;
  }

  .tech-carousel__item {
    width: clamp(110px, 32vw, 136px);
    height: 82px;
    padding: 12px 14px;
  }

  .tech-carousel__logo {
    max-height: 42px;
  }

  .tech-carousel-fade {
    width: 48px;
  }

  .tech-carousel__name {
    left: 10px;
    right: 34px;
    font-size: 0.78rem;
  }

  .tech-carousel__close {
    right: 11px;
    width: 18px;
    height: 18px;
  }

  .tech-carousel__item.is-selected .tech-carousel__close {
    pointer-events: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tech-carousel__track {
    animation: none;
    position: static;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .tech-carousel {
    height: auto;
    overflow-x: auto;
  }

  .tech-carousel__item {
    scroll-snap-align: start;
  }
}
