/**
 * CatWalk Theme - Brand Logos Section
 * Infinite marquee animation with custom cursor effect (reference theme inspired)
 */

.catwalk-brand-logos {
  padding: 80px 0;
  background: #fafafa;
  position: relative;
  overflow: hidden;
  cursor: none; /* Hide default cursor for custom effect */
}

/* Custom Cursor - Smooth movement with color inversion */
.catwalk-brand-logos::before {
  content: "";
  position: fixed;
  width: 50px;
  height: 50px;
  border: none;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  /* Smoother cubic-bezier transition */
  transition: left 0.08s cubic-bezier(0.16, 1, 0.3, 1),
    top 0.08s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease,
    transform 0.2s ease;
  z-index: 9999;
  opacity: 0;
  /* Dark black background with color inversion */
  background: #000;
  mix-blend-mode: difference;
}

.catwalk-brand-logos:hover::before {
  opacity: 1;
}

/* Section Header */
.brand-logos-header {
  margin-bottom: 60px;
}

.brand-subtitle {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #999;
  margin-bottom: 10px;
  font-weight: 500;
}

.brand-title {
  font-size: 36px;
  font-weight: 300;
  color: #000;
  margin: 0;
  line-height: 1.2;
}

/* Marquee Container */
.brand-logos-grid {
  display: flex;
  overflow: hidden; /* Hide scrollbar */
  overflow-x: hidden; /* Explicitly hide horizontal scrollbar */
  position: relative;
  width: 100%;
  user-select: none;
}

/* Marquee Track - Infinite scroll effect */
.brand-logos-grid::before,
.brand-logos-grid::after {
  content: "";
  position: absolute;
  top: 0;
  width: 100px;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.brand-logos-grid::before {
  left: 0;
  background: linear-gradient(to right, #fafafafa, transparent);
}

.brand-logos-grid::after {
  right: 0;
  background: linear-gradient(to left, #fafafa, transparent);
}

/* Marquee Inner - holds the scrolling content */
.brand-marquee-inner {
  display: flex;
  flex-wrap: nowrap; /* Prevent wrapping */
  width: max-content; /* Let content determine width */
  animation: marquee 20s linear infinite; /* Faster animation: 20s instead of 30s */
  will-change: transform;
}

/* Removed hover pause - animation continues on mouse over */

/* Duplicate set for seamless loop */
.brand-marquee-inner .brand-logo-item {
  flex-shrink: 0;
  width: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 40px;
  transition: transform 0.3s ease;
}

/* Logo Image */
.brand-logo-img {
  width: 100%;
  height: auto;
  max-height: 60px;
  object-fit: contain;
  filter: grayscale(100%) brightness(0.4);
  opacity: 0.5;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.catwalk-brand-logos:hover .brand-logo-img {
  filter: grayscale(0%) brightness(1);
  opacity: 1;
}

.brand-logo-item:hover .brand-logo-img {
  transform: scale(1.05);
}

/* Marquee Animation */
@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Responsive Design */

/* Large Tablets and Small Desktops */
@media (max-width: 1199px) {
  .brand-marquee-inner .brand-logo-item {
    width: 180px;
    padding: 25px 35px;
  }

  .brand-title {
    font-size: 32px;
  }
}

/* Tablets */
@media (max-width: 991px) {
  .catwalk-brand-logos {
    padding: 60px 0;
  }

  .brand-marquee-inner .brand-logo-item {
    width: 160px;
    padding: 20px 30px;
  }

  .brand-logos-header {
    margin-bottom: 40px;
  }

  .brand-title {
    font-size: 28px;
  }

  /* Disable custom cursor on touch devices */
  .catwalk-brand-logos {
    cursor: default;
  }

  .catwalk-brand-logos::before {
    display: none;
  }
}

/* Mobile Landscape */
@media (max-width: 767px) {
  .catwalk-brand-logos {
    padding: 50px 0;
  }

  .brand-marquee-inner .brand-logo-item {
    width: 140px;
    padding: 15px 25px;
  }

  .brand-logo-img {
    max-height: 50px;
  }

  .brand-title {
    font-size: 24px;
  }

  .brand-subtitle {
    font-size: 12px;
    letter-spacing: 1.5px;
  }
}

/* Mobile Portrait */
@media (max-width: 575px) {
  .catwalk-brand-logos {
    padding: 40px 0;
  }

  .brand-marquee-inner .brand-logo-item {
    width: 120px;
    padding: 12px 20px;
  }

  .brand-logo-img {
    max-height: 40px;
  }

  .brand-title {
    font-size: 22px;
  }

  .brand-logos-header {
    margin-bottom: 30px;
  }

  /* Faster animation on mobile */
  .brand-marquee-inner {
    animation-duration: 20s;
  }
}

/* Accessibility - Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .brand-marquee-inner {
    animation: none;
  }

  /* Keep overflow hidden even when animation is disabled */
  .brand-logos-grid {
    overflow-x: hidden; /* Changed from auto to hidden */
    /* Users can still see all logos by using drag or arrow keys */
  }
}

/* Performance Optimization */
.brand-marquee-inner {
  transform: translateZ(0);
  backface-visibility: hidden;
}
