/* ================================================================
   vc-marquee.css  —  VAN-CAR Marquee Component
   Zero-gap, zero-jump infinite scroll calibrated by vc-marquee.js.

   HTML structure (canonical — always exactly 2 groups):

   <div class="vc-marquee vc-marquee--brands" aria-label="Importowane marki">
     <div class="vc-marquee__track">
       <ul class="vc-marquee__group">
         <li><img src="assets/brands/ram.svg" alt="RAM" width="80" height="32"></li>
         …more logos…
       </ul>
       <!-- second group is an aria-hidden clone for seamless loop -->
       <ul class="vc-marquee__group" aria-hidden="true">
         …identical items…
       </ul>
     </div>
   </div>

   Variants:
     .vc-marquee--brands   → logo SVGs, fixed height 32px, opacity filter
     .vc-marquee--cars     → car strip webp images, fixed height 54-68px

   Attributes on .vc-marquee:
     data-marquee-speed="44"      → duration in seconds (default 44)
     data-marquee-dir="reverse"   → reverses direction

   vc-marquee.js sets --vc-marquee-move to -<groupWidth>px via ResizeObserver.
   Until JS runs, --vc-marquee-move defaults to -50% which works for 2 equal
   groups as a safe CSS-only fallback.
   ================================================================ */

/* ── Root ───────────────────────────────────────────────────────── */
.vc-marquee {
  overflow: hidden;
  position: relative;
  /* Edge fade — masks first/last ~5% to hide cut-off */
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent 0%,
    #000 5%,
    #000 95%,
    transparent 100%
  );
  mask-image: linear-gradient(
    90deg,
    transparent 0%,
    #000 5%,
    #000 95%,
    transparent 100%
  );
}

/* ── Track ──────────────────────────────────────────────────────── */
.vc-marquee__track {
  display: flex;
  width: max-content;   /* expands to fit both groups side-by-side */
  will-change: transform;
  animation: vcMarqueeScroll var(--vc-marquee-speed, 44s) linear infinite;
}

/* Direction override */
.vc-marquee[data-marquee-dir="reverse"] .vc-marquee__track {
  animation-direction: reverse;
}

/* Pause on hover / keyboard focus */
.vc-marquee:hover .vc-marquee__track,
.vc-marquee:focus-within .vc-marquee__track {
  animation-play-state: paused;
}

/* ── Keyframe ───────────────────────────────────────────────────── */
@keyframes vcMarqueeScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(var(--vc-marquee-move, -50%)); }
}

/* ── Group ──────────────────────────────────────────────────────── */
.vc-marquee__group {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: clamp(40px, 5vw, 80px);
  padding: 0 clamp(20px, 2.5vw, 40px);
  margin: 0;
  padding-inline-start: 0;  /* reset UA list padding */
  list-style: none;
}

/* ── Variant: brand logos ───────────────────────────────────────── */
.vc-marquee--brands {
  padding-block: 20px;
}

.vc-marquee--brands .vc-marquee__group {
  gap: clamp(48px, 6vw, 96px);
}

.vc-marquee--brands img,
.vc-marquee--brands svg {
  display: block;
  height: 28px;
  width: auto;
  flex-shrink: 0;
  object-fit: contain;
  /* Unify brand colors, hint at interactivity */
  filter: brightness(0) invert(1) opacity(0.50);
  transition: filter 0.22s ease;
}

.vc-marquee--brands li:hover img,
.vc-marquee--brands li:hover svg {
  filter: brightness(0) invert(1) opacity(1.0);
}

/* ── Variant: car strip ─────────────────────────────────────────── */
.vc-marquee--cars {
  padding-block: 0;
}

.vc-marquee--cars .vc-marquee__group {
  gap: 0;
  padding: 0;
}

.vc-marquee--cars img {
  display: block;
  height: clamp(48px, 6vw, 68px);
  width: auto;
  flex-shrink: 0;
  object-fit: contain;
}

/* ── Variant: carrier / shipping-line strip ─────────────────────── */
.vc-marquee--carriers {
  padding-block: 12px;
  /* Edge fade — matches brand variant */
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    #000 6%,
    #000 94%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    #000 6%,
    #000 94%,
    transparent 100%
  );
}

.vc-marquee--carriers .vc-marquee__group {
  /* gap = padding-inline-start + padding-inline-end → seamless seam */
  gap: 24px;
  padding-inline-start: 12px;
  padding-inline-end: 12px;
}

/* Carrier SVGs keep their original colors — NO brightness/invert filter */
.vc-marquee--carriers .vc-marquee__group li {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vc-marquee--carriers img,
.vc-marquee--carriers svg {
  display: block;
  height: 80px;
  width: auto;
  flex-shrink: 0;
  object-fit: contain;
  /* preserve colors — no filter */
}

/* ── Reduced motion ─────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .vc-marquee {
    overflow-x: auto;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .vc-marquee__track {
    animation: none;
    width: auto;
    flex-wrap: wrap;
    gap: 24px;
    padding: 12px 0;
  }

  /* Hide clone group; show only real content */
  .vc-marquee__group[aria-hidden="true"] {
    display: none;
  }
}
