/* Section Titles Mobile Responsive Fixes */

/* Smooth loading animations with better performance */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}

.fade-in.loaded {
  opacity: 1;
  transform: translateY(0);
}

/* Remove will-change after animation for better performance */
.fade-in.loaded {
  animation: removeWillChange 0.1s 0.8s forwards;
}

@keyframes removeWillChange {
  to { will-change: auto; }
}

/* Enhanced category card animations */
.group.flex.items-center {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.group.flex.items-center:hover {
  will-change: transform;
}

/* Optimized section title animations */
.group.relative.overflow-hidden {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Prevent layout collapse during loading */
section {
  min-height: 50px;
}

.grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Category cards stabilization */
.group.flex.items-center {
  min-height: 100px;
}

/* Section title containers stabilization */
.group.relative.overflow-hidden {
  min-height: 60px;
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Mobile-specific fixes for section titles - EXACT same styling as desktop */
@media (max-width: 768px) {
  /* Section title containers - keep EXACT same styling as desktop */
  section .group.relative.overflow-hidden {
    background: linear-gradient(135deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0.15) 100%) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    padding: 1rem 2rem !important; /* Slightly smaller padding for mobile */
    border-radius: 2rem !important;
    margin: 0 1rem !important;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15), 0 8px 16px rgba(59,130,246,0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    transform: perspective(1000px) !important;
    transition: all 0.3s ease !important;
  }
  
  /* Section title text - keep EXACT same gradient styling as desktop */
  section h2.relative {
    font-size: 1.875rem !important; /* text-3xl but slightly smaller for mobile */
    font-family: 'Montserrat', 'Poppins', sans-serif !important;
    font-weight: 900 !important;
    letter-spacing: 0.08em !important;
    margin: 0 !important;
    text-shadow: 0 4px 20px rgba(255,255,255,0.3) !important;
    line-height: 1.2 !important;
  }
  
  /* Keep the specific gradient colors for each section title */
  section h2.relative {
    background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 50%, #ddd6fe 100%) !important;
    background-clip: text !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
  }
  
  /* Specific gradient overrides for each section */
  section:nth-of-type(4) h2.relative {
    /* Latest Smartphones - blue gradient */
    background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 50%, #ddd6fe 100%) !important;
    background-clip: text !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
  }
  
  section:nth-of-type(5) h2.relative {
    /* High Performance Laptops - green gradient */
    background: linear-gradient(135deg, #ffffff 0%, #dcfce7 50%, #bbf7d0 100%) !important;
    background-clip: text !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
  }
  
  section:nth-of-type(6) h2.relative {
    /* Best Quality Proteins - orange gradient */
    background: linear-gradient(135deg, #ffffff 0%, #fef3c7 50%, #fde68a 100%) !important;
    background-clip: text !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
  }
  
  /* Keep hover effects for mobile touch */
  section .group:hover {
    transform: perspective(1000px) scale(1.02) !important;
  }
  
  section .group h2 span:hover {
    transform: scale(1.05) !important;
  }
  
  /* Keep gradient overlays - they add to the beauty */
  section .absolute.inset-0 {
    display: block !important;
    opacity: 0 !important;
    transition: opacity 0.5s !important;
  }
  
  section .group:hover .absolute.inset-0 {
    opacity: 1 !important;
  }
  
  /* Keep accent lines with proper colors */
  section .absolute.bottom-0 {
    width: 16px !important;
    height: 4px !important;
    opacity: 0.6 !important;
    border-radius: 9999px !important;
  }
  
  /* Blue accent for smartphones */
  section:nth-of-type(4) .absolute.bottom-0 {
    background: linear-gradient(to right, #3b82f6, #8b5cf6) !important;
  }
  
  /* Green accent for laptops */
  section:nth-of-type(5) .absolute.bottom-0 {
    background: linear-gradient(to right, #22c55e, #10b981) !important;
  }
  
  /* Orange accent for proteins */
  section:nth-of-type(6) .absolute.bottom-0 {
    background: linear-gradient(to right, #f97316, #f59e0b) !important;
  }
  
  /* Category cards stabilization */
  .group.flex.items-center {
    min-height: 80px !important;
    padding: 1rem !important;
  }
  
  /* Optimize animations for mobile */
  .fade-in {
    transition: all 0.6s ease !important;
  }
}

/* Extra small mobile devices - keep same styling but slightly smaller */
@media (max-width: 480px) {
  section .group.relative.overflow-hidden {
    padding: 0.75rem 1.5rem !important;
    margin: 0 0.5rem !important;
    border-radius: 1.5rem !important;
  }
  
  section h2.relative {
    font-size: 1.625rem !important; /* text-2xl for very small screens */
    letter-spacing: 0.06em !important;
  }
  
  .group.flex.items-center {
    min-height: 70px !important;
    padding: 0.75rem !important;
  }
  
  /* Faster animations for very small screens */
  .fade-in {
    transition: all 0.4s ease !important;
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .fade-in {
    transition: opacity 0.3s ease !important;
    transform: none !important;
  }
  
  .group.flex.items-center {
    transition: none !important;
  }
  
  .group.relative.overflow-hidden {
    transition: none !important;
  }
  
  html {
    scroll-behavior: auto !important;
  }
}
