/* ===== MOBILE FIXES - COMPREHENSIVE SOLUTION ===== */

/* Reset básico para móvil */
* {
  box-sizing: border-box;
}

/* Prevenir overflow horizontal */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

.container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ===== NAVBAR MOBILE FIXES ===== */
@media (max-width: 768px) {
  /* Ocultar navbar desktop completamente */
  .navbar,
  header .navbar,
  .header {
    display: none !important;
  }
  
  /* Mostrar navbar móvil */
  .mobile-navbar {
    display: block !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1000 !important;
    height: 60px !important;
    background: rgba(0, 0, 0, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid rgba(0, 212, 255, 0.3) !important;
  }
  
  /* Contenedor del navbar móvil */
  .mobile-nav-container {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 1rem !important;
    height: 100% !important;
  }
  
  /* Logo móvil */
  .mobile-logo {
    display: flex !important;
    align-items: center !important;
    gap: 0.8rem !important;
  }
  
  .mobile-logo-container {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
  }
  
  .mobile-logo-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
  }
  
  .mobile-logo-title {
    font-size: 1.1rem !important;
    font-weight: bold !important;
    color: #00d4ff !important;
    letter-spacing: 0.1em !important;
  }
  
  /* Botón hamburguesa */
  .mobile-hamburger {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    width: 32px !important;
    height: 32px !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    padding: 4px !important;
    z-index: 10001 !important;
    position: relative !important;
  }
  
  .mobile-hamburger span {
    display: block !important;
    width: 24px !important;
    height: 2px !important;
    background: #00d4ff !important;
    margin: 2px 0 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    transform-origin: center !important;
  }
  
  /* Animación del hamburger cuando está activo */
  .mobile-hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px) !important;
  }
  
  .mobile-hamburger.active span:nth-child(2) {
    opacity: 0 !important;
  }
  
  .mobile-hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px) !important;
  }
  
  /* Menú móvil - Override para evitar doble línea */
  .mobile-menu {
    border: none !important;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3) !important;
  }
  
  /* Header del menú móvil - Override para evitar doble línea */
  .mobile-menu-header {
    border-bottom: 1px solid rgba(0, 212, 255, 0.1) !important;
    background: rgba(0, 0, 0, 0.3) !important;
  }
  
  .mobile-menu-logo {
    display: flex !important;
    align-items: center !important;
    gap: 0.8rem !important;
  }
  
  .mobile-menu-logo-container {
    width: 35px !important;
    height: 35px !important;
    border-radius: 50% !important;
    overflow: hidden !important;
  }
  
  .mobile-menu-logo-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
  }
  
  .mobile-menu-logo-title {
    font-size: 1rem !important;
    font-weight: bold !important;
    color: #00d4ff !important;
  }
  
  /* Botón cerrar */
  .mobile-close {
    width: 32px !important;
    height: 32px !important;
    background: transparent !important;
    border: 1px solid rgba(0, 212, 255, 0.3) !important;
    border-radius: 50% !important;
    color: #00d4ff !important;
    font-size: 1.2rem !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
  }
  
  .mobile-close:hover {
    background: rgba(0, 212, 255, 0.1) !important;
    border-color: rgba(0, 212, 255, 0.5) !important;
  }
  
  /* Contenido del menú */
  .mobile-menu-content {
    padding: 1rem !important;
  }
  
  .mobile-menu-section {
    margin-bottom: 2rem !important;
  }
  
  .mobile-menu-title {
    font-size: 0.9rem !important;
    color: rgba(255, 255, 255, 0.6) !important;
    margin-bottom: 1rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
  }
  
  .mobile-menu-links {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
  }
  
  .mobile-menu-link {
    display: flex !important;
    align-items: center !important;
    gap: 0.8rem !important;
    padding: 0.8rem !important;
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    background: transparent !important;
    border: 1px solid transparent !important;
  }
  
  .mobile-menu-link:hover,
  .mobile-menu-link.active {
    background: rgba(0, 212, 255, 0.1) !important;
    border-color: rgba(0, 212, 255, 0.3) !important;
    color: #00d4ff !important;
  }
  
  .mobile-menu-icon {
    font-size: 1.1rem !important;
    width: 20px !important;
    text-align: center !important;
  }
  
  /* Ajustar contenido principal */
  main,
  .main-content {
    margin-top: 60px !important;
    padding-top: 0 !important;
  }
  
  /* Contenedor principal */
  .container {
    padding: 0 1rem !important;
    max-width: 100% !important;
  }
  
  /* Prevenir scroll cuando el menú está abierto */
  body.mobile-menu-open {
    overflow: hidden !important;
  }
}

/* ===== HERO SECTION FIXES ===== */
@media (max-width: 768px) {
  .quantum-hero {
    min-height: auto !important;
    height: auto !important;
    padding: 2rem 0 !important;
    overflow: hidden !important;
  }
  
  .quantum-hero-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 2rem !important;
    padding: 1rem !important;
    max-width: 100% !important;
  }
  
  .hero-text-section {
    width: 100% !important;
    max-width: 100% !important;
    text-align: center !important;
    order: 1 !important;
    padding: 0 1rem !important;
  }
  
  .hero-visual-section {
    width: 100% !important;
    max-width: 100% !important;
    order: 2 !important;
    height: 300px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 1rem 0 !important;
  }
  
  .quantum-title {
    font-size: 2rem !important;
    line-height: 1.2 !important;
    margin-bottom: 1rem !important;
    text-align: center !important;
    word-wrap: break-word !important;
  }
  
  .quantum-description {
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
    margin-bottom: 2rem !important;
    text-align: center !important;
    padding: 0 1rem !important;
  }
  
  .quantum-stats {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    width: 100% !important;
    margin: 2rem 0 !important;
    padding: 0 1rem !important;
  }
  
  .stat-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    padding: 1rem !important;
    width: 100% !important;
    max-width: 100% !important;
    text-align: left !important;
    margin-bottom: 1rem !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border-radius: 12px !important;
    border: 1px solid rgba(0, 212, 255, 0.2) !important;
  }
  
  .stat-icon {
    width: 40px !important;
    height: 40px !important;
    margin-right: 1rem !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(0, 212, 255, 0.1) !important;
    border-radius: 8px !important;
    color: #00d4ff !important;
  }
  
  .stat-content {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
  }
  
  .stat-number,
  .stat-value {
    font-size: 1.5rem !important;
    margin-bottom: 0.2rem !important;
    color: #ffffff !important;
    font-weight: bold !important;
  }
  
  .stat-label {
    font-size: 0.8rem !important;
    color: rgba(255, 255, 255, 0.7) !important;
  }
  
  .quantum-actions {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    width: 100% !important;
    padding: 0 1rem !important;
    align-items: center !important;
  }
  
  .quantum-btn {
    width: 100% !important;
    max-width: 280px !important;
    padding: 1rem 1.5rem !important;
    font-size: 0.9rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    text-decoration: none !important;
    border-radius: 12px !important;
    border: 2px solid transparent !important;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(255, 0, 255, 0.2)) !important;
    color: #ffffff !important;
    position: relative !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
  }
  
  .quantum-btn .btn-icon {
    margin-right: 0.5rem !important;
    font-size: 1rem !important;
  }
  
  .quantum-btn .btn-text {
    flex: 1 !important;
    text-align: center !important;
  }
  
  .quantum-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.3) !important;
  }
  
  /* Visualización 3D simplificada para móvil */
  .blockchain-core {
    width: 250px !important;
    height: 250px !important;
    position: relative !important;
    margin: 0 auto !important;
    transform: none !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
  }
  
  .quantum-node {
    width: 30px !important;
    height: 30px !important;
    font-size: 0.6rem !important;
  }
  
  .floating-tech {
    display: none !important;
  }
}

/* ===== TECHNOLOGY SECTION FIXES ===== */
@media (max-width: 768px) {
  .quantum-technology {
    padding: 3rem 0 !important;
    overflow: hidden !important;
  }
  
  .quantum-tech-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 2rem !important;
    padding: 0 1rem !important;
  }
  
  .quantum-tech-card {
    width: 100% !important;
    max-width: 100% !important;
    padding: 1.5rem !important;
    margin: 0 !important;
  }
  
  .tech-card-header {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 1rem !important;
    margin-bottom: 1.5rem !important;
  }
  
  .tech-icon-container {
    width: 60px !important;
    height: 60px !important;
    margin: 0 auto !important;
  }
  
  .tech-features-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
  }
  
  .tech-feature {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    padding: 1rem !important;
  }
  
  .tech-feature-icon {
    width: 35px !important;
    height: 35px !important;
    margin-bottom: 0.5rem !important;
  }
}

/* ===== FOOTER FIXES ===== */
@media (max-width: 768px) {
  .quantum-footer {
    padding: 3rem 0 1rem 0 !important;
    overflow: hidden !important;
  }
  
  .footer-main-content {
    display: flex !important;
    flex-direction: column !important;
    gap: 2rem !important;
    padding: 0 1rem !important;
  }
  
  .footer-links-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 2rem !important;
  }
  
  .footer-brand-section {
    text-align: center !important;
    margin-bottom: 2rem !important;
  }
  
  .footer-links-column {
    text-align: center !important;
  }
  
  .newsletter-container {
    padding: 1.5rem !important;
    margin: 1rem 0 !important;
  }
  
  .form-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
  }
  
  .newsletter-input {
    width: 100% !important;
  }
  
  .newsletter-btn {
    width: 100% !important;
  }
}

/* ===== MOBILE SMALL SCREENS ===== */
@media (max-width: 480px) {
  .container {
    padding: 0 0.5rem !important;
  }
  
  .quantum-hero {
    padding: 1.5rem 0 !important;
  }
  
  .quantum-hero-content {
    padding: 0.5rem !important;
    gap: 1.5rem !important;
  }
  
  .hero-text-section,
  .quantum-stats,
  .quantum-actions {
    padding: 0 0.5rem !important;
  }
  
  .quantum-title {
    font-size: 1.8rem !important;
  }
  
  .quantum-description {
    font-size: 0.85rem !important;
  }
  
  .stat-card {
    padding: 0.8rem !important;
  }
  
  .quantum-btn {
    padding: 0.8rem 1.2rem !important;
    font-size: 0.85rem !important;
  }
  
  .blockchain-core {
    width: 200px !important;
    height: 200px !important;
  }
  
  .quantum-node {
    width: 25px !important;
    height: 25px !important;
    font-size: 0.5rem !important;
  }
  
  .quantum-tech-card {
    padding: 1rem !important;
  }
  
  .tech-icon-container {
    width: 50px !important;
    height: 50px !important;
  }
}

/* ===== EXTRA SMALL SCREENS ===== */
@media (max-width: 360px) {
  .container {
    padding: 0 0.3rem !important;
  }
  
  .quantum-title {
    font-size: 1.6rem !important;
  }
  
  .quantum-description {
    font-size: 0.8rem !important;
  }
  
  .blockchain-core {
    width: 180px !important;
    height: 180px !important;
  }
  
  .quantum-node {
    width: 20px !important;
    height: 20px !important;
    font-size: 0.45rem !important;
  }
}

/* ===== SECTIONS GENERAL FIXES ===== */
@media (max-width: 768px) {
  /* Todas las secciones */
  section {
    padding: 3rem 0 !important;
    overflow: hidden !important;
  }
  
  .section-title,
  .quantum-section-title {
    font-size: 2rem !important;
    text-align: center !important;
    margin-bottom: 1rem !important;
    padding: 0 1rem !important;
  }
  
  .section-description,
  .quantum-section-description {
    font-size: 1rem !important;
    text-align: center !important;
    margin-bottom: 2rem !important;
    padding: 0 1rem !important;
    line-height: 1.5 !important;
  }
  
  /* Grids generales */
  .features-grid,
  .performance-grid,
  .ecosystem-grid,
  .community-stats {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.5rem !important;
    padding: 0 1rem !important;
  }
  
  /* Cards generales */
  .feature-card,
  .performance-card,
  .ecosystem-card,
  .community-stat {
    width: 100% !important;
    max-width: 100% !important;
    padding: 1.5rem !important;
    text-align: center !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border-radius: 12px !important;
    border: 1px solid rgba(0, 212, 255, 0.2) !important;
  }
  
  /* Iconos generales */
  .feature-icon,
  .ecosystem-icon {
    width: 50px !important;
    height: 50px !important;
    margin: 0 auto 1rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(0, 212, 255, 0.1) !important;
    border-radius: 8px !important;
    color: #00d4ff !important;
    font-size: 1.2rem !important;
  }
  
  /* Títulos de cards */
  .feature-title,
  .ecosystem-title,
  .performance-title {
    font-size: 1.2rem !important;
    margin-bottom: 0.8rem !important;
    color: #ffffff !important;
  }
  
  /* Descripciones de cards */
  .feature-description,
  .ecosystem-description,
  .performance-description {
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
    color: rgba(255, 255, 255, 0.8) !important;
  }
  
  /* Métricas */
  .performance-metric,
  .community-number {
    font-size: 2rem !important;
    margin-bottom: 0.5rem !important;
    color: #00d4ff !important;
    font-weight: bold !important;
  }
  
  .performance-label,
  .community-label {
    font-size: 0.8rem !important;
    color: rgba(255, 255, 255, 0.7) !important;
  }
}

/* ===== UTILITY FIXES ===== */
@media (max-width: 768px) {
  /* Prevenir elementos que se salen de la pantalla */
  * {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Arreglar imágenes responsivas */
  img {
    max-width: 100% !important;
    height: auto !important;
  }
  
  /* Arreglar contenedores flexibles */
  .flex-container {
    flex-wrap: wrap !important;
  }
  
  /* Arreglar grids */
  .grid-container {
    grid-template-columns: 1fr !important;
  }
  
  /* Ocultar elementos decorativos en móvil */
  .desktop-only {
    display: none !important;
  }
  
  /* Asegurar que los textos no se desborden */
  h1, h2, h3, h4, h5, h6, p, span, div {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Arreglar elementos que causan overflow horizontal */
  .quantum-particles,
  .tech-particles,
  .footer-particles {
    width: 100% !important;
    overflow: hidden !important;
  }
  
  /* Arreglar animaciones que causan problemas en móvil */
  .floating-tech,
  .tech-energy-waves,
  .footer-waves {
    display: none !important;
  }
  
  /* Simplificar efectos complejos en móvil */
  .quantum-field,
  .tech-field,
  .footer-field {
    opacity: 0.3 !important;
    animation: none !important;
  }
}
