/* Performance Optimizations CSS */

/* Social Share Buttons Styling */
.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  margin: 4px;
}

.facebook-btn {
  background: #1877f2;
  color: white;
}

.facebook-btn:hover {
  background: #166fe5;
  transform: translateY(-1px);
}

.twitter-btn {
  background: #1da1f2;
  color: white;
}

.twitter-btn:hover {
  background: #1a91da;
  transform: translateY(-1px);
}

.pinterest-btn {
  background: #bd081c;
  color: white;
}

.pinterest-btn:hover {
  background: #a50710;
  transform: translateY(-1px);
}

.copy-btn {
  background: #6b7280;
  color: white;
}

.copy-btn:hover {
  background: #4b5563;
  transform: translateY(-1px);
}

/* Image Optimization Classes */
.responsive-img {
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.responsive-img:hover {
  transform: scale(1.05);
}

/* Lazy Loading Optimization */
.lazy-load {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lazy-load.loaded {
  opacity: 1;
}

/* Performance Critical CSS - Above the fold */
.critical-content {
  font-display: swap;
  contain: layout style paint;
}

/* SEO Optimized Headings with Keywords */
.seo-h1 {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: #1f2937;
}

.seo-h2 {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.75rem;
  color: #374151;
}

/* Affiliate Link Optimization */
.affiliate-link {
  position: relative;
  display: inline-block;
  text-decoration: none;
  transition: all 0.2s ease;
}

.affiliate-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.affiliate-link::after {
  content: "affiliate";
  position: absolute;
  top: -8px;
  right: -8px;
  background: #f59e0b;
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.affiliate-link:hover::after {
  opacity: 1;
}

/* Deal Badge Optimization */
.deal-badge {
  background: linear-gradient(45deg, #ef4444, #f97316);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
  animation: pulse-deal 2s infinite;
}

@keyframes pulse-deal {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Product Grid Optimization */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  padding: 20px 0;
}

@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
  }
}

/* Performance: Reduce Layout Shift */
.aspect-ratio-container {
  position: relative;
  width: 100%;
  padding-bottom: 75%; /* 4:3 aspect ratio */
  overflow: hidden;
  border-radius: 12px;
}

.aspect-ratio-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Search Optimization */
.search-highlight {
  background: linear-gradient(120deg, #fbbf24 0%, #f59e0b 100%);
  color: #1f2937;
  padding: 2px 4px;
  border-radius: 3px;
  font-weight: 600;
}

/* Loading States */
.skeleton-loader {
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Cache-friendly animations */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
}

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

/* CTA Button Optimization */
.cta-button {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.cta-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
  transform: translate(-50%, -50%);
}

.cta-button:active::before {
  width: 300px;
  height: 300px;
}

/* Mobile Optimization */
@media (max-width: 640px) {
  .seo-h1 {
    font-size: 2rem;
  }
  
  .seo-h2 {
    font-size: 1.5rem;
  }
  
  .social-btn {
    padding: 8px 12px;
    font-size: 12px;
  }
}

/* Print Styles */
@media print {
  .social-btn,
  .cta-button {
    display: none !important;
  }
  
  .affiliate-link::after {
    display: none !important;
  }
}