/**
 * Faixa Preta Custom Styles
 * Premium BJJ E-commerce Site
 */

/* ========================================
   PRODUCT CARDS - Consistent & Premium
======================================== */

.product-card {
  @apply bg-white rounded-lg border border-gray-200 overflow-hidden transition-all duration-300;
  @apply hover:shadow-xl hover:border-gold;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.product-card-image {
  @apply relative overflow-hidden bg-gray-100;
  aspect-ratio: 3/4;
  width: 100%;
}

.product-card-image img {
  @apply w-full h-full object-cover transition-transform duration-500;
}

/* Best Practice: Subtle zoom on hover (better UX than image swap) */
.product-card:hover .product-card-image img {
  transform: scale(1.05);
}

.product-card-content {
  @apply p-4 flex flex-col flex-1;
}

.product-card-title {
  @apply text-lg font-bold text-charcoal mb-2;
  @apply line-clamp-2;
  min-height: 3.5rem;
}

.product-card-description {
  @apply text-sm text-gray-600 mb-3 line-clamp-2;
  flex: 1;
}

.product-card-actions {
  @apply mt-auto pt-3 border-t border-gray-100;
}

.product-card-price {
  @apply text-2xl font-bold text-charcoal mb-2;
}

.product-card-price-sale {
  @apply text-2xl font-bold text-burgundy mb-2;
}

.product-card-price-original {
  @apply text-sm text-gray-400 line-through ml-2;
}

.product-card-cta {
  @apply text-gold text-sm font-medium inline-flex items-center gap-1;
  @apply transition-all duration-300;
}

.product-card:hover .product-card-cta {
  @apply gap-2;
}

/* Sale Badge - UX Best Practice: Top-right, high contrast */
.product-card-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  background-color: #8b1538; /* burgundy */
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  transition: transform 0.3s ease;
}

.product-card:hover .product-card-badge,
.group:hover .product-card-badge {
  transform: scale(1.1);
}

/* Featured Badge - UX Best Practice: Top-left, complementary to sale */
.product-card-badge-featured {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 10;
  background-color: #c9a961; /* gold */
  color: #2d2d2d; /* charcoal */
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border: 2px solid #2d2d2d;
  transition: transform 0.3s ease;
}

.product-card:hover .product-card-badge-featured,
.group:hover .product-card-badge-featured {
  transform: scale(1.1);
}

/* Mobile Menu Body Scroll Lock */
body.mobile-menu-open {
  overflow: hidden;
}

/* Hero Section Animations */
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

/* Lightning Background Canvas */
#lightning-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.7;
}

/* Hero Section Layering */
.hero-section {
  position: relative;
  perspective: 1000px;
}

.hero-section canvas {
  filter: blur(1px);
}

/* 3D Floating Logo Animation */
@keyframes float3d {
  0% {
    transform: translateY(0px) rotateX(0deg) rotateY(0deg);
  }
  25% {
    transform: translateY(-20px) rotateX(5deg) rotateY(-5deg);
  }
  50% {
    transform: translateY(-30px) rotateX(-5deg) rotateY(10deg);
  }
  75% {
    transform: translateY(-20px) rotateX(5deg) rotateY(-5deg);
  }
  100% {
    transform: translateY(0px) rotateX(0deg) rotateY(0deg);
  }
}

@keyframes glow {
  0%, 100% {
    filter: drop-shadow(0 0 20px rgba(220, 20, 60, 0.5))
            drop-shadow(0 0 40px rgba(220, 20, 60, 0.3));
  }
  50% {
    filter: drop-shadow(0 0 30px rgba(220, 20, 60, 0.8))
            drop-shadow(0 0 60px rgba(220, 20, 60, 0.5));
  }
}

.floating-logo-3d {
  animation: float3d 6s ease-in-out infinite;
  transform-style: preserve-3d;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
}

.logo-3d {
  transform-style: preserve-3d;
  animation: glow 3s ease-in-out infinite;
  transition: all 0.5s ease;
  will-change: transform;
}

/* Hover Effects */
.floating-logo-3d:hover {
  animation-play-state: paused;
  transform: scale(1.15) rotateY(15deg) rotateX(10deg) translateZ(50px);
}

.floating-logo-3d:hover .logo-3d {
  filter: drop-shadow(0 0 40px rgba(220, 20, 60, 1))
          drop-shadow(0 0 80px rgba(220, 20, 60, 0.8))
          drop-shadow(0 0 120px rgba(220, 20, 60, 0.6))
          brightness(1.2);
  transform: rotateY(-10deg) translateZ(30px);
}

/* Active/Click Effect */
.floating-logo-3d:active {
  transform: scale(0.95) rotateY(0deg) rotateX(0deg) translateZ(0px);
}

/* Responsive Logo Size */
@media (max-width: 768px) {
  .floating-logo-3d {
    animation: float3d 5s ease-in-out infinite;
  }
  
  .logo-3d {
    width: 250px !important;
  }
  
  /* Hide hero image on mobile - show only logo and lightning */
  .hero-section picture {
    display: none !important;
  }
  
  /* Adjust lightning opacity for better visibility without image */
  #lightning-bg {
    opacity: 0.7;
  }
}

@media (max-width: 480px) {
  .logo-3d {
    width: 200px !important;
  }
  
  .floating-logo-3d:hover {
    transform: scale(1.1) rotateY(10deg) rotateX(5deg) translateZ(30px);
  }
  
  /* Ensure hero image is hidden on small mobile */
  .hero-section picture {
    display: none !important;
  }
  
  /* Increase lightning intensity on smaller screens */
  #lightning-bg {
    opacity: 0.8;
  }
}

/* Floating Favicon Background Animation */
.floating-favicon-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.floating-icon {
  position: absolute;
  opacity: 0.12;
  filter: grayscale(60%) brightness(1.3);
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  will-change: transform;
  transition: opacity 0.3s ease;
}

.floating-icon-1 {
  top: 10%;
  left: 5%;
  width: 120px;
  height: auto;
  animation: floatDrift1 20s infinite;
}

.floating-icon-2 {
  top: 60%;
  right: 8%;
  width: 100px;
  height: auto;
  animation: floatDrift2 25s infinite;
}

.floating-icon-3 {
  bottom: 15%;
  left: 15%;
  width: 90px;
  height: auto;
  animation: floatDrift3 22s infinite;
}

.floating-icon-4 {
  top: 30%;
  right: 20%;
  width: 110px;
  height: auto;
  animation: floatDrift4 28s infinite;
}

/* Physics-based animations disabled - using JS physics instead */
@keyframes floatDrift1 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes floatDrift2 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes floatDrift3 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes floatDrift4 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
}

/* Responsive sizes for floating icons */
@media (max-width: 768px) {
  .floating-icon-1 {
    width: 80px;
  }
  
  .floating-icon-2 {
    width: 70px;
  }
  
  .floating-icon-3 {
    width: 60px;
  }
  
  .floating-icon-4 {
    width: 75px;
  }
}

@media (max-width: 480px) {
  .floating-icon {
    opacity: 0.06;
  }
  
  .floating-icon-1 {
    width: 60px;
  }
  
  .floating-icon-2 {
    width: 50px;
  }
  
  .floating-icon-3 {
    width: 45px;
  }
  
  .floating-icon-4 {
    width: 55px;
  }
}

/* Size Guide Image Animations */
.size-guide-image {
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-origin: center center;
  opacity: 0;
  transform: translateY(50px) scale(0.9);
}

.size-guide-image.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.size-guide-image:hover {
  transform: scale(1.03);
  box-shadow: 0 25px 50px -12px rgba(220, 20, 60, 0.6),
              0 0 50px rgba(220, 20, 60, 0.3);
  filter: brightness(1.1);
}

.size-guide-image:active {
  transform: scale(0.98);
}

/* Scroll Fade Background */
.scroll-fade-bg {
  opacity: 0;
  transition: opacity 0.3s ease-out;
  z-index: 0;
}

.scroll-fade-bg.fading {
  /* Opacity will be set dynamically by JS */
}

/* AOS Custom Animations - Buttery Smooth */
[data-aos] {
  transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Ensure smooth 60fps animations */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* GPU acceleration for smooth animations */
.size-guide-image,
[data-aos],
.floating-logo-3d,
.product-card {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* Stock Indicator */
.product-card-stock {
  @apply text-xs font-medium mt-2;
}

.product-card-stock-in {
  @apply text-green-600;
}

.product-card-stock-low {
  @apply text-orange-500;
}

.product-card-stock-out {
  @apply text-red-500;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
======================================== */

@media (max-width: 640px) {
  .product-card-title {
    @apply text-base;
    min-height: 2.5rem;
  }

  .product-card-price {
    @apply text-xl;
  }
}
