/* ══════════════════════════════════════════════════════════════════════════════
   ADVANCED LOGO CAROUSEL - SMOOTH AUTO-SCROLLING WITH TWO-ROW OPTION
   ══════════════════════════════════════════════════════════════════════════════ */

.advanced-logo-carousel-section {
  position: relative;
  width: 100%;
  background-color: #ffffff;
  padding: 60px 0;
  overflow: hidden;
}

/* ══════════════════════════════════════════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════════════════════════════════════════ */

.carousel-header {
  text-align: center;
  margin-bottom: 40px;
}

.carousel-header-title {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.carousel-header-subtitle {
  font-size: 16px;
  font-weight: 400;
  color: #666666;
  letter-spacing: 0.02em;
}

/* ══════════════════════════════════════════════════════════════════════════════
   LEFT SIDE HEADER LAYOUT (2 COLUMNS)
   ══════════════════════════════════════════════════════════════════════════════ */

.header-left .advanced-logo-carousel-section {
  display: flex;
  align-items: center;
  gap: 60px;
}

.header-left .carousel-header {
  flex: 0 0 auto;
  min-width: 200px;
  max-width: 300px;
  text-align: left;
  margin-bottom: 0;
}

.header-left .carousel-wrapper {
  flex: 1 1 auto;
}

.header-left .carousel-header-title {
  font-size: 14px;
  margin-bottom: 5px;
}

.header-left .carousel-header-subtitle {
  font-size: 18px;
  color: #999999;
}

/* ══════════════════════════════════════════════════════════════════════════════
   SINGLE ROW LAYOUT (DEFAULT)
   ══════════════════════════════════════════════════════════════════════════════ */

.desktop-single-row .carousel-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
}

.desktop-single-row .carousel-track {
  display: flex;
  width: fit-content;
  animation: smoothScroll 30s linear infinite;
  will-change: transform;
}

/* ══════════════════════════════════════════════════════════════════════════════
   TWO ROW LAYOUT (STACKED) - LIKE YOUR IMAGE
   ══════════════════════════════════════════════════════════════════════════════ */

.desktop-two-rows .carousel-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 40px;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
}

.desktop-two-rows .carousel-track {
  display: flex;
  width: fit-content;
  animation: smoothScroll 30s linear infinite;
  will-change: transform;
}

/* Second row scrolls in opposite direction for visual interest */
.desktop-two-rows .carousel-wrapper > .carousel-track:last-child {
  animation-direction: reverse;
}

/* ══════════════════════════════════════════════════════════════════════════════
   CAROUSEL ANIMATIONS
   ══════════════════════════════════════════════════════════════════════════════ */

@keyframes smoothScroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.pause-on-hover .carousel-track:hover {
  animation-play-state: paused;
}

/* ══════════════════════════════════════════════════════════════════════════════
   CAROUSEL GROUP
   ══════════════════════════════════════════════════════════════════════════════ */

.carousel-group {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════════════════════
   LOGO ITEMS - FIX BLUR ISSUE
   ══════════════════════════════════════════════════════════════════════════════ */

.logo-item {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 80px;
  transition: all 0.3s ease;
}

.logo-item img {
  height: 50px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  opacity: 0.6;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  filter: grayscale(0);
  
  /* CRITICAL: Prevent blur - proper image rendering */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: high-quality;
  
  /* Force sharp rendering on all browsers */
  -ms-interpolation-mode: bicubic;
  
  /* Hardware acceleration WITHOUT blur */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  
  /* Anti-aliasing */
  -webkit-font-smoothing: subpixel-antialiased;
  -moz-osx-font-smoothing: auto;
  
  /* Prevent text rendering settings from affecting images */
  text-rendering: auto;
}

.logo-item:hover img {
  opacity: 1;
  transform: scale(1.05) translateZ(0);
  -webkit-transform: scale(1.05) translateZ(0);
}

.grayscale-logos .logo-item img {
  filter: grayscale(100%);
}

.grayscale-logos .logo-item:hover img {
  filter: grayscale(0);
}

.logo-item a {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

/* ══════════════════════════════════════════════════════════════════════════════
   MOBILE BEHAVIORS
   ══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  /* Touch Swipe Mode */
  .mobile-swipe .carousel-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-direction: row;
    gap: 0;
  }

  .mobile-swipe .carousel-wrapper::-webkit-scrollbar {
    display: none;
  }

  .mobile-swipe .carousel-track {
    animation: none;
  }

  .mobile-swipe .logo-item {
    scroll-snap-align: center;
    margin-right: 40px;
  }

  /* Static Grid Mode */
  .mobile-static-grid .carousel-wrapper {
    mask-image: none;
    -webkit-mask-image: none;
    flex-direction: column;
  }

  .mobile-static-grid .carousel-track {
    animation: none;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    width: 100%;
    padding: 0 20px;
  }

  .mobile-static-grid .carousel-group {
    display: contents;
  }

  .mobile-static-grid .carousel-group:last-child {
    display: none;
  }

  .mobile-static-grid .logo-item {
    margin-right: 0;
  }

  .mobile-static-grid .logo-item img {
    height: 40px;
  }

  /* Auto Scroll Mode */
  .mobile-auto-scroll .carousel-track {
    animation-duration: 20s;
  }

  .mobile-auto-scroll .logo-item {
    margin-right: 50px;
  }

  .mobile-auto-scroll .logo-item img {
    height: 40px;
  }

  .mobile-auto-scroll.desktop-two-rows .carousel-wrapper {
    gap: 30px;
  }
}

@media (max-width: 480px) {
  .mobile-static-grid .carousel-track {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

/* ══════════════════════════════════════════════════════════════════════════════
   TABLET RESPONSIVE
   ══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) and (min-width: 769px) {
  .logo-item {
    margin-right: 60px;
  }

  .logo-item img {
    height: 45px;
  }

  .desktop-two-rows .carousel-wrapper {
    gap: 30px;
  }
  
  .header-left .advanced-logo-carousel-section {
    gap: 40px;
  }
  
  .header-left .carousel-header {
    min-width: 180px;
  }
}

/* ══════════════════════════════════════════════════════════════════════════════
   SMALL MOBILE RESPONSIVE
   ══════════════════════════════════════════════════════════════════════════════ */

/* Stack header on top for mobile */
@media (max-width: 768px) {
  .header-left .advanced-logo-carousel-section {
    flex-direction: column;
    gap: 30px;
  }
  
  .header-left .carousel-header {
    text-align: center;
    max-width: 100%;
    margin-bottom: 0;
  }
}

/* ══════════════════════════════════════════════════════════════════════════════
   ELEMENTOR EDITOR MODE
   ══════════════════════════════════════════════════════════════════════════════ */

.elementor-editor-active .carousel-track,
.elementor-edit-mode .carousel-track {
  animation-duration: 60s !important;
}

.elementor-editor-active .logo-item img,
.elementor-edit-mode .logo-item img {
  opacity: 0.7 !important;
}

/* ══════════════════════════════════════════════════════════════════════════════
   ACCESSIBILITY
   ══════════════════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .carousel-track {
    animation: none;
  }
}

.logo-item a:focus {
  outline: 2px solid #4a90e2;
  outline-offset: 4px;
  border-radius: 4px;
}

.logo-item a:focus img {
  opacity: 1;
  transform: scale(1.05);
}

/* ══════════════════════════════════════════════════════════════════════════════
   PERFORMANCE
   ══════════════════════════════════════════════════════════════════════════════ */

.carousel-track {
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
