/* ===============================================
   ESTILOS EXCLUSIVOS PARA DISPOSITIVOS MÓVILES
   Este archivo NO afecta la versión de escritorio
   =============================================== */

/* Aplicar SOLO en dispositivos móviles y tablets */
@media screen and (max-width: 768px) {
    
    /* ===== FONDO OPTIMIZADO PARA MÓVIL ===== */
    body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw !important;
        height: 100vh !important;
        background: 
            radial-gradient(circle at 30% 60%, rgba(0, 170, 255, 0.08) 0%, transparent 40%),
            radial-gradient(circle at 70% 30%, rgba(0, 255, 255, 0.06) 0%, transparent 45%),
            radial-gradient(circle at 50% 80%, rgba(0, 136, 204, 0.07) 0%, transparent 35%) !important;
        background-size: 100% 100% !important;
        background-position: center !important;
        background-attachment: scroll !important; /* Mejor para móvil */
        z-index: -1;
        animation: backgroundShiftMobile 25s ease-in-out infinite !important;
        overflow: hidden !important;
    }

    /* Animación específica para móvil */
    @keyframes backgroundShiftMobile {
        0%, 100% { 
            opacity: 0.8;
            transform: scale(1);
        }
        33% { 
            opacity: 0.6;
            transform: scale(1.02);
        }
        66% { 
            opacity: 0.9;
            transform: scale(0.98);
        }
    }

    /* ===== PREVENCIÓN DE OVERFLOW HORIZONTAL ===== */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
        position: relative;
    }

    /* Contenedores principales */
    .container {
        max-width: 100% !important;
        padding: 0 1rem !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }

    .section {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* ===== HERO SECTION MÓVIL ===== */
    .hero {
        width: 100% !important;
        max-width: 100vw !important;
        overflow: hidden !important;
        background-attachment: scroll !important;
        padding: 2rem 1rem 3rem 1rem !important;
        min-height: 100vh !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .hero-content {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-align: center !important;
        padding: 0 !important;
    }

    .hero-content h1 {
        font-size: 2.2rem !important;
        line-height: 1.3 !important;
        word-wrap: break-word !important;
        margin-bottom: 1.5rem !important;
    }

    .hero-content p {
        font-size: 1.1rem !important;
        line-height: 1.6 !important;
        margin-bottom: 2.5rem !important;
        padding: 0 0.5rem !important;
    }

    /* Botón del hero optimizado */
    .hero-content .btn {
        width: 100% !important;
        max-width: 280px !important;
        padding: 16px 24px !important;
        font-size: 1rem !important;
        margin: 0 auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        border-radius: 25px !important;
        box-shadow: 0 4px 15px rgba(0, 170, 255, 0.3) !important;
        white-space: nowrap !important;
        overflow: hidden !important;
    }

    .hero-content .btn span {
        margin-right: 8px !important;
    }

    .hero-content .btn i {
        flex-shrink: 0 !important;
    }

    /* ===== NAVEGACIÓN MÓVIL MEJORADA ===== */
    .nav-toggle {
        display: flex !important;
        z-index: 10000 !important;
        transition: all 0.3s ease !important;
        border-radius: 8px !important;
        padding: 8px !important;
    }

    .nav-toggle:hover {
        background: rgba(0, 170, 255, 0.1) !important;
        transform: scale(1.05) !important;
        box-shadow: 0 4px 15px rgba(0, 170, 255, 0.3) !important;
    }

    .nav-toggle:active {
        transform: scale(0.95) !important;
        transition: all 0.1s ease !important;
    }

    /* Animación del hamburger */
    .hamburger {
        transition: all 0.3s ease !important;
    }

    .nav-toggle:hover .hamburger {
        box-shadow: 0 0 10px rgba(0, 170, 255, 0.5) !important;
    }

    /* Efecto del botón de tema */
    #themeToggleMobile {
        transition: all 0.3s ease !important;
        border-radius: 50% !important;
        padding: 10px !important;
    }

    #themeToggleMobile:hover {
        background: rgba(0, 170, 255, 0.1) !important;
        transform: scale(1.1) rotate(15deg) !important;
        box-shadow: 0 4px 15px rgba(0, 170, 255, 0.3) !important;
    }

    #themeToggleMobile:active {
        transform: scale(0.9) rotate(-15deg) !important;
        transition: all 0.1s ease !important;
    }

    .theme-toggle-icon {
        transition: all 0.3s ease !important;
    }

    #themeToggleMobile:hover .theme-toggle-icon {
        color: var(--secondary-color) !important;
        text-shadow: 0 0 10px var(--secondary-color) !important;
    }

    .nav-links {
        position: fixed !important;
        top: 0 !important;
        right: -100% !important;
        width: 80% !important;
        max-width: 320px !important;
        height: 100vh !important;
        background: linear-gradient(135deg, rgba(26, 26, 46, 0.98), rgba(10, 10, 26, 0.95)) !important;
        backdrop-filter: blur(20px) !important;
        border-left: 3px solid var(--primary-color) !important;
        box-shadow: -15px 0 40px rgba(0, 0, 0, 0.3) !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: stretch !important;
        padding: 6rem 2rem 2rem !important;
        gap: 0 !important;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
        z-index: 10000 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        pointer-events: auto !important;
    }

    .nav-links.active {
        right: 0 !important;
    }

    .nav-links li {
        width: 100% !important;
        margin: 0 !important;
    }

    .nav-links a {
        width: 100% !important;
        padding: 16px 20px !important;
        margin-bottom: 12px !important;
        background: rgba(0, 170, 255, 0.1) !important;
        border: 2px solid rgba(0, 170, 255, 0.3) !important;
        border-radius: 12px !important;
        text-align: center !important;
        font-size: 1.1rem !important;
        font-weight: 600 !important;
        transition: all 0.3s ease !important;
        display: block !important;
        color: var(--text-color) !important;
        position: relative !important;
        z-index: 10001 !important;
    }

    .nav-links a:hover,
    .nav-links a.active {
        background: linear-gradient(45deg, rgba(0, 170, 255, 0.3), rgba(0, 255, 255, 0.2)) !important;
        border-color: var(--secondary-color) !important;
        color: var(--secondary-color) !important;
        transform: translateX(10px) scale(1.02) !important;
        box-shadow: 0 8px 25px rgba(0, 255, 255, 0.4) !important;
        text-shadow: 0 0 10px rgba(0, 255, 255, 0.6) !important;
    }

    /* Efecto adicional para dispositivos táctiles */
    .nav-links a:active {
        transform: translateX(8px) scale(0.98) !important;
        transition: all 0.1s ease !important;
    }

    /* Animación de pulso para el enlace activo */
    .nav-links a.active {
        animation: pulseGlow 2s ease-in-out infinite !important;
    }

    @keyframes pulseGlow {
        0%, 100% {
            box-shadow: 0 8px 25px rgba(0, 255, 255, 0.4) !important;
        }
        50% {
            box-shadow: 0 8px 30px rgba(0, 255, 255, 0.6) !important;
        }
    }

    /* Efecto de brillo en hover */
    .nav-links a::before {
        content: '' !important;
        position: absolute !important;
        top: 0 !important;
        left: -100% !important;
        width: 100% !important;
        height: 100% !important;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent) !important;
        transition: all 0.6s ease !important;
        border-radius: 12px !important;
    }

    .nav-links a:hover::before {
        left: 100% !important;
    }

    /* Overlay para cerrar menú - solo parte izquierda */
    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 20%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.3);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 9999;
        pointer-events: auto;
    }

    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* ===== GRIDS RESPONSIVOS ===== */
    .about-intro {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    .services-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        padding: 0 1rem !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
    }

    /* ===== SECCIÓN DE CLIENTES MÓVIL ===== */
    #clients {
        padding: 3rem 0 !important;
        margin: 2rem 0 !important;
    }

    .client-carousel {
        overflow: visible !important;
    }

    .client-logos {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 2rem !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .client-logo-item {
        width: 100% !important;
        max-width: 260px !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 1.2rem !important;
        background: rgba(0, 170, 255, 0.05) !important;
        border-radius: 15px !important;
        border: 1px solid rgba(0, 170, 255, 0.1) !important;
        transition: all 0.3s ease !important;
    }

    .client-logo-item:hover {
        background: rgba(0, 170, 255, 0.1) !important;
        border-color: rgba(0, 170, 255, 0.3) !important;
        transform: translateY(-5px) !important;
    }

    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
        text-align: center !important;
    }

    /* ===== ELEMENTOS ESPECÍFICOS ===== */
    .about-intro-card,
    .service-card {
        max-width: 100% !important;
        width: 100% !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        padding: 1.5rem !important;
    }

    .client-carousel {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .client-logo-item {
        flex: 0 0 auto !important;
        min-width: 120px !important;
    }

    .client-logo-item img {
        max-width: 130px !important;
        height: auto !important;
    }

    /* ===== BOTONES RESPONSIVOS ===== */
    .cta-buttons {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
        align-items: center !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 1rem !important;
    }

    .btn {
        width: 100% !important;
        max-width: 280px !important;
        padding: 16px 24px !important;
        text-align: center !important;
        justify-content: center !important;
        display: flex !important;
        align-items: center !important;
        font-size: 1rem !important;
        border-radius: 25px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* ===== SECCIÓN CTA ESPECÍFICA ===== */
    #cta {
        padding: 3rem 1rem !important;
        margin: 3rem 0 !important;
        text-align: center !important;
    }

    #cta .container {
        padding: 0 1rem !important;
    }

    #cta .cta-content {
        width: 100% !important;
        max-width: 100% !important;
    }

    #cta h2 {
        font-size: 1.8rem !important;
        line-height: 1.3 !important;
        margin-bottom: 1rem !important;
        padding: 0 0.5rem !important;
    }

    #cta p {
        font-size: 1rem !important;
        line-height: 1.5 !important;
        margin-bottom: 2rem !important;
        padding: 0 0.5rem !important;
    }

    #cta .cta-buttons .btn {
        margin: 0 auto !important;
    }

    #cta .cta-buttons .btn i {
        margin-left: 8px !important;
        flex-shrink: 0 !important;
    }

    /* ===== TÍTULOS RESPONSIVOS ===== */
    .section-title {
        font-size: 2rem !important;
        line-height: 1.3 !important;
        margin-bottom: 2rem !important;
    }

    h1 {
        font-size: 2.5rem !important;
    }

    h2 {
        font-size: 2rem !important;
    }

    h3 {
        font-size: 1.5rem !important;
    }

    /* ===== ELEMENTOS FLOTANTES DESHABILITADOS ===== */
    .hero-shapes {
        display: none !important;
    }

    .floating-elements,
    .particles-container {
        display: none !important;
    }

    /* ===== PÁGINA DE CONTACTO ESPECÍFICA ===== */
    /* Título principal del contacto */
    .section-title {
        margin-bottom: 2.5rem !important;
        padding: 0 1rem !important;
        line-height: 1.3 !important;
        margin-top: 2rem !important;
    }

    /* Subtítulo del contacto con mayor separación */
    .section-subtitle {
        font-size: 1rem !important;
        line-height: 1.8 !important;
        margin-bottom: 4rem !important;
        margin-top: 2rem !important;
        padding: 1rem 1.5rem !important;
        text-align: center !important;
        opacity: 0.9 !important;
        color: var(--text-color) !important;
        background: rgba(0, 170, 255, 0.05) !important;
        border-radius: 15px !important;
        border: 1px solid rgba(0, 170, 255, 0.1) !important;
    }

    .section-subtitle br {
        display: block !important;
        content: "" !important;
        margin-bottom: 0.5rem !important;
    }

    /* Contact grid responsivo */
    .contact-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 2.5rem !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .contact-details,
    .contact-form-container {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }

    /* Contact cards */
    .contact-card {
        margin-bottom: 1.5rem !important;
        padding: 1.5rem !important;
        background: var(--card-bg-color) !important;
        border-radius: 15px !important;
        border: 1px solid rgba(0, 170, 255, 0.2) !important;
        text-align: center !important;
    }

    .contact-card h4 {
        margin-bottom: 0.8rem !important;
        font-size: 1.2rem !important;
    }

    .contact-card p {
        margin-bottom: 1rem !important;
        font-size: 0.9rem !important;
        opacity: 0.8 !important;
    }

    .contact-card a {
        font-weight: 600 !important;
        color: var(--primary-color) !important;
    }

    /* Formulario de contacto */
    .contact-form-modern {
        padding: 0 !important;
    }

    .form-group-modern {
        margin-bottom: 1.5rem !important;
    }

    .form-group-modern label {
        display: block !important;
        margin-bottom: 0.5rem !important;
        font-weight: 600 !important;
        color: var(--text-color) !important;
    }

    .input-wrapper-modern {
        position: relative !important;
        width: 100% !important;
    }

    .input-wrapper-modern input,
    .input-wrapper-modern textarea {
        width: 100% !important;
        padding: 14px 16px 14px 45px !important;
        font-size: 16px !important;
        border: 2px solid rgba(0, 170, 255, 0.3) !important;
        border-radius: 10px !important;
        background: rgba(26, 26, 46, 0.8) !important;
        color: var(--text-color) !important;
        transition: all 0.3s ease !important;
    }

    .input-wrapper-modern input:focus,
    .input-wrapper-modern textarea:focus {
        outline: none !important;
        border-color: var(--primary-color) !important;
        box-shadow: 0 0 15px rgba(0, 170, 255, 0.3) !important;
    }

    .input-wrapper-modern i {
        position: absolute !important;
        left: 15px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        color: var(--primary-color) !important;
        z-index: 2 !important;
    }

    .submit-btn-modern {
        width: 100% !important;
        max-width: 280px !important;
        margin: 2rem auto 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* ===== OPTIMIZACIONES DE PERFORMANCE ===== */
    .floating-icon,
    .particle,
    .sparkle {
        animation-duration: 4s !important;
    }

    .service-card:hover,
    .about-intro-card:hover {
        transform: translateY(-5px) scale(1.02) !important;
    }
}

/* ===== DISPOSITIVOS EXTRA PEQUEÑOS ===== */
@media screen and (max-width: 480px) {
    
    /* Fondo aún más optimizado */
    body::before {
        background: 
            radial-gradient(circle at 40% 70%, rgba(0, 170, 255, 0.06) 0%, transparent 35%),
            radial-gradient(circle at 60% 25%, rgba(0, 255, 255, 0.04) 0%, transparent 40%) !important;
        animation: backgroundShiftSmall 30s ease-in-out infinite !important;
    }

    @keyframes backgroundShiftSmall {
        0%, 100% { 
            opacity: 0.7;
            transform: translateX(0%) translateY(0%);
        }
        50% { 
            opacity: 0.5;
            transform: translateX(2%) translateY(-2%);
        }
    }

    .container {
        padding: 0 0.8rem !important;
    }

    .hero {
        padding: 1.5rem 0.8rem !important;
    }

    .hero-content h1 {
        font-size: 2rem !important;
    }

    .section-title {
        font-size: 1.8rem !important;
    }

    /* Hero aún más optimizado */
    .hero {
        padding: 1.5rem 0.8rem 2.5rem 0.8rem !important;
    }

    .hero-content h1 {
        font-size: 1.9rem !important;
    }

    .hero-content .btn {
        max-width: 260px !important;
        padding: 14px 20px !important;
        font-size: 0.95rem !important;
    }

    /* CTA más compacto */
    #cta {
        padding: 2.5rem 0.8rem !important;
    }

    #cta h2 {
        font-size: 1.6rem !important;
    }

    #cta .btn {
        max-width: 260px !important;
        padding: 14px 20px !important;
        font-size: 0.95rem !important;
    }

    /* Clientes más compactos */
    .client-logo-item {
        max-width: 230px !important;
        padding: 1rem !important;
    }

    .client-logo-item img {
        max-width: 156px !important;
    }

    .nav-links {
        width: 90% !important;
        max-width: 280px !important;
    }

    /* Contacto en pantallas pequeñas */
    .section-subtitle {
        font-size: 0.95rem !important;
        margin-bottom: 2.5rem !important;
    }

    .contact-card {
        padding: 1.2rem !important;
        margin-bottom: 1.2rem !important;
    }

    .contact-card h4 {
        font-size: 1.1rem !important;
    }

    .input-wrapper-modern input,
    .input-wrapper-modern textarea {
        padding: 12px 14px 12px 40px !important;
        font-size: 16px !important;
    }

    .input-wrapper-modern i {
        left: 12px !important;
    }
}

/* ===== ACCESIBILIDAD Y PERFORMANCE ===== */
@media screen and (max-width: 768px) {
    
    /* Reducir movimiento para usuarios que lo prefieren */
    @media (prefers-reduced-motion: reduce) {
        *,
        *::before,
        *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
        
        body::before {
            animation: none !important;
        }
    }

    /* Scroll suave optimizado */
    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }

    /* Táctil mejorado */
    * {
        -webkit-tap-highlight-color: transparent;
    }

    /* Áreas de toque mínimas */
    .btn,
    .nav-links a,
    .social-links a {
        min-height: 44px !important;
        min-width: 44px !important;
    }
}