/* ==================== FIX FINAL - TODOS LOS PROBLEMAS ==================== */

/* 1. FIX FOOTER - Prevenir que cause scroll infinito */
.modern-footer {
  position: relative !important;
  overflow: hidden !important; /* ⭐ Prevenir que elementos dentro causen overflow */
  margin-top: 60px;
  padding: 60px 20px 30px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(255, 0, 110, 0.1));
  border-top: 1px solid var(--border-color);
  width: 100% !important;
  max-width: 100vw !important;
}

.modern-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #ff006e, #8b5cf6, transparent);
  /* ⭐ Limitar ancho para no causar overflow */
  max-width: 100%;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  /* ⭐ Prevenir que cause overflow */
  width: 100%;
  overflow: hidden;
}

.footer-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  filter: drop-shadow(0 4px 20px rgba(255, 0, 110, 0.3));
  transition: transform 0.3s ease;
  /* ⭐ Prevenir que la rotación cause overflow */
  will-change: transform;
}

.footer-logo:hover {
  transform: scale(1.1) rotate(5deg);
  /* ⭐ Asegurar que no cause overflow */
  overflow: hidden;
}

/* ⭐ CRÍTICO: Prevenir que CUALQUIER hijo del footer cause overflow */
.modern-footer *,
.modern-footer *::before,
.modern-footer *::after {
  box-sizing: border-box !important;
  max-width: 100% !important;
}

/* 2. BUSCADOR FLOTANTE DE PLATAFORMA */
.platform-search-floating {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 90;
  display: none; /* Oculto por defecto */
  transition: all 0.3s ease;
}

.platform-search-floating.visible {
  display: flex;
}

.platform-search-floating-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff006e, #8b5cf6);
  border: none;
  box-shadow: 0 4px 20px rgba(255, 0, 110, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: all 0.3s ease;
  color: white;
}

.platform-search-floating-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(255, 0, 110, 0.6);
}

.platform-search-floating-btn:active {
  transform: scale(0.95);
}

/* Buscador expandido */
.platform-search-floating-input {
  position: absolute;
  right: 70px;
  bottom: 0;
  width: 0;
  height: 56px;
  background: var(--bg-secondary);
  border: 2px solid #ff006e;
  border-radius: 28px;
  padding: 0;
  font-size: 0.9rem;
  color: var(--text-primary);
  opacity: 0;
  transition: all 0.3s ease;
  overflow: hidden;
}

.platform-search-floating.expanded .platform-search-floating-input {
  width: 280px;
  padding: 0 20px;
  opacity: 1;
}

.platform-search-floating-input::placeholder {
  color: var(--text-secondary);
}

.platform-search-floating-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 0, 110, 0.2);
}

/* Contador de resultados */
.platform-search-floating-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ff006e;
  color: white;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 24px;
  text-align: center;
  display: none;
}

.platform-search-floating.has-results .platform-search-floating-count {
  display: block;
}

/* Responsive */
@media (max-width: 768px) {
  .platform-search-floating {
    bottom: 40px;
    right: 26px;
  }
  
  .platform-search-floating-btn {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
  }
  
  .platform-search-floating.expanded .platform-search-floating-input {
    width: 220px;
  }
}

/* 3. FIX SCROLL - Asegurar que solo body scrollee */
html {
  height: 100% !important;
  overflow: hidden !important;
}

body {
  height: 100vh !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

/* 4. FIX PARA ELEMENTOS QUE PUEDAN CAUSAR OVERFLOW HORIZONTAL */
* {
  box-sizing: border-box;
}

.app-container,
.main-content-wrapper,
.main-content {
  max-width: 100vw !important;
  overflow-x: hidden !important;
}

/* 5. PREVENIR SCROLL HORIZONTAL EN TODO */
body,
html,
.app-container,
.main-content-wrapper,
.main-content,
.premium-content-area {
  overflow-x: hidden !important;
}

/* 6. FIX PARA ANIMACIONES QUE PUEDAN CAUSAR OVERFLOW */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Asegurar que las animaciones no causen overflow */
[style*="transform"],
[class*="slide"],
[class*="carousel"] {
  overflow: hidden;
}

/* 7. FIX ESPECÍFICO PARA CARRUSEL EN HOME */
.carousel-slide,
.featured-carousel-container {
  overflow: hidden !important;
  max-width: 100% !important;
}

/* 8. LIMITAR ANCHO DE IMÁGENES Y CARDS */
img,
.game-card,
.classic-card,
.platform-card {
  max-width: 100% !important;
  height: auto !important;
}