@media (max-width: 768px) {
    /* Asegurar scroll vertical funcional en móvil */
    html, body {
        overflow-y: auto !important;
        touch-action: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Layout de navegación móvil: hamburguesa izquierda, logo centro */
    .nav-container {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 1rem;
    }
    
    .logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        margin-left: 0;
        z-index: 1;
    }
    
    .logo img {
        height: 60px; /* Agrandado el logo para móvil */
        width: 120px;
    }
    
    .hamburger {
        position: absolute;
        left: 1rem;
        z-index: 1002;
        order: -1;
        display: flex !important; /* Forzar visibilidad en móvil */
    }
    
    /* Botón de modo oscuro simplificado para móvil */
    #dark-mode-toggle {
        position: absolute;
        right: 1rem;
        z-index: 1002;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        border: 2px solid rgba(99, 102, 241, 0.2);
        background: rgba(255, 255, 255, 0.9);
        color: #4b5563;
        cursor: pointer;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        backdrop-filter: blur(8px);
    }
    
    #dark-mode-toggle i {
        font-size: 16px;
        transition: transform 0.2s ease;
    }
    
    #dark-mode-toggle:hover {
        background: rgba(99, 102, 241, 0.1);
        border-color: rgba(99, 102, 241, 0.4);
        transform: scale(1.05);
    }
    
    #dark-mode-toggle:active {
        transform: scale(0.95);
    }
    
    /* Ocultar botón de modo oscuro cuando el menú está abierto */
    .nav-links.active ~ .nav-container #dark-mode-toggle,
    body.menu-open #dark-mode-toggle {
        opacity: 0 !important;
        visibility: hidden !important;
        transform: scale(0.8) !important;
        pointer-events: none !important;
        transition: all 0.3s ease !important;
    }
    
    /* Ocultar hamburguesa cuando el menú está abierto para diseño más limpio */
    body.menu-open .hamburger {
        opacity: 0;
        transform: scale(0.8);
        pointer-events: none;
        transition: all 0.3s ease;
    }
    
    .section-title { font-size: 2.2rem; }
    .section-title.left-aligned, .section-subtitle.left-aligned { text-align: center; margin-left: auto; margin-right: auto; }
    
    /* Hero content más arriba en móvil */
    .hero-section {
        padding: 20px 0 40px 0;
    }
    
    .hero-container {
        padding: 0 1rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    
    .hero-content {
        margin-top: -1rem;
    }
    
    .hero-intro {
        margin-top: 1rem;
    }
    
    /* Animación de escritura para el título */
    .hero-content h1, .hero-title { 
        font-size: clamp(2rem, 8vw, 2.8rem);
        margin-top: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        margin-top: 0.5rem;
    }
    
    .hero-content h1.typewriter-active {
        overflow: hidden;
        border-right: 3px solid var(--secondary-color);
        white-space: nowrap;
        margin: 0 auto;
        animation: typewriter-cycle 6s steps(40, end) infinite, blink 1s step-end infinite;
        width: 0;
    }
    
    /* Mantener el cursor parpadeando siempre en móvil */
    .hero-content h1.typewriter-complete {
        border-right: 3px solid var(--secondary-color);
        animation: typewriter-cycle 6s steps(40, end) infinite, blink 1s step-end infinite;
        width: 0;
        white-space: nowrap;
        overflow: hidden;
        font-size: clamp(2rem, 8vw, 2.8rem);
    }
    
    @keyframes typewriter-cycle {
        0% { width: 0; }
        50% { width: 100%; }
        100% { width: 0; }
    }
    
    @keyframes blink {
        50% { border-color: transparent; }
    }
    
    .animated-text {
        white-space: normal;
        border-right: none;
        animation: none;
    }
    
    /* Navegación móvil profesional */
    .nav-links {
        position: fixed !important;
        display: flex !important;
        top: 0;
        right: 0;
        height: 100vh;
        width: 100%;
        max-width: 400px;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2rem;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        border-left: 1px solid rgba(229, 231, 235, 0.8);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    }
    
    .nav-links::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
    }
    
    .nav-links.active {
        transform: translateX(0);
    }
    
    .nav-links li {
        width: auto;
        text-align: center;
        opacity: 0;
        transform: translateY(30px) scale(0.9);
        transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .nav-links.active li {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    
    /* Animación escalonada de entrada */
    .nav-links.active li:nth-child(1) { transition-delay: 0.1s; }
    .nav-links.active li:nth-child(2) { transition-delay: 0.15s; }
    .nav-links.active li:nth-child(3) { transition-delay: 0.2s; }
    .nav-links.active li:nth-child(4) { transition-delay: 0.25s; }
    .nav-links.active li:nth-child(5) { transition-delay: 0.3s; }
    .nav-links.active li:nth-child(6) { transition-delay: 0.35s; }
    
    .nav-links a {
        font-size: 1.1rem;
        font-weight: 500;
        padding: 1rem 2.5rem;
        border-radius: 16px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: block;
        min-width: 220px;
        text-align: center;
        position: relative;
        overflow: hidden;
        background: rgba(255, 255, 255, 0.8);
        border: 1px solid rgba(229, 231, 235, 0.5);
        backdrop-filter: blur(10px);
    }
    
    .nav-links a::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.15), transparent);
        transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .nav-links a:hover::before {
        left: 100%;
    }
    
    .nav-links a:hover {
        background: rgba(99, 102, 241, 0.08);
        color: var(--secondary-color);
        transform: translateY(-2px) scale(1.02);
        border-color: rgba(99, 102, 241, 0.3);
        box-shadow: 0 8px 25px rgba(99, 102, 241, 0.15);
    }
    
    .nav-links a:active {
        transform: translateY(0) scale(0.98);
    }
    
    /* Overlay mejorado */
    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 999;
    }
    
    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    .hamburger { 
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Dark mode para navegación móvil */
    body.dark-mode .nav-links {
        background: rgba(15, 23, 42, 0.98);
        border-left-color: rgba(51, 65, 85, 0.8);
    }
    
    body.dark-mode .nav-links::before {
        background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
    }
    
    body.dark-mode .nav-links a {
        background: rgba(30, 41, 59, 0.8);
        border-color: rgba(51, 65, 85, 0.5);
        color: #f8fafc;
    }
    
    body.dark-mode .nav-links a:hover {
        background: rgba(99, 102, 241, 0.15);
        border-color: rgba(99, 102, 241, 0.4);
        color: var(--secondary-color);
    }
    
    body.dark-mode .hamburger-line,
    body.dark-mode .hamburger-line::before,
    body.dark-mode .hamburger-line::after {
        background-color: #f8fafc;
    }
    
    body.dark-mode .hamburger.active .hamburger-line::before,
    body.dark-mode .hamburger.active .hamburger-line::after {
        background-color: var(--secondary-color);
    }
    
    body.dark-mode #dark-mode-toggle {
        background: rgba(30, 41, 59, 0.9);
        color: #f8fafc;
        border-color: rgba(245, 158, 11, 0.3);
    }
    
    body.dark-mode #dark-mode-toggle:hover {
        background: rgba(245, 158, 11, 0.2);
        border-color: rgba(245, 158, 11, 0.5);
        color: #f59e0b;
    }
    
    .form-group { flex-direction: column; }
    .hero-visuals img {
        width: 100% !important;
        margin-left: 0 !important;
        padding-right: 0 !important;
    }
    .container, .hero-container {
        max-width: 100vw;
        overflow-x: hidden;
    }
    .team-grid {
        display: flex !important;
        flex-direction: row;
        overflow-x: auto;
        gap: 1.2rem;
        padding-bottom: 1rem;
        scroll-snap-type: x mandatory;
    }
    .team-member {
        min-width: 80vw;
        max-width: 85vw;
        flex: 0 0 auto;
        scroll-snap-align: start;
    }
    .hosting-plans {
        display: flex !important;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: visible;
        gap: 1.2rem;
        padding-bottom: 1rem;
        /* Simplificar scroll-snap para evitar conflictos */
        scroll-snap-type: x proximity;
        margin-top: 1rem;
        -webkit-overflow-scrolling: touch;
        /* Permitir scroll vertical y horizontal */
        touch-action: auto;
    }
    
    /* Reducir espacio superior del título de planes en móvil */
    .hosting-section {
        padding-top: 2rem; /* Reducir padding superior */
        /* Permitir scroll normal */
        touch-action: auto;
    }
    
    .hosting-section .container {
        overflow: visible;
        /* Permitir scroll normal */
        touch-action: auto;
    }
    
    .hosting-section .section-title {
        margin-top: 0rem; /* Eliminar margen superior del título */
        margin-bottom: 1.5rem; /* Mantener espacio inferior */
    }
    .plan-card {
        min-width: 80vw;
        max-width: 85vw;
        flex: 0 0 auto;
        scroll-snap-align: start;
        /* Mejorar interacción táctil sin bloquear scroll vertical */
        touch-action: auto;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    /* Desactivar animaciones flotantes en móvil para mejor scroll */
    .plan-card:nth-child(odd),
    .plan-card:nth-child(even) {
        animation: none !important;
    }
    .scroll-hint-mobile {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        margin-top: 0.5rem;
        color: #2e8b57;
        font-size: 1.1rem;
        opacity: 0.85;
        animation: hint-bounce 1.5s infinite;
        user-select: none;
    }
    .scroll-hint-mobile i {
        font-size: 2rem;
        margin-top: 0.2rem;
        animation: arrow-move 1.5s infinite;
    }
    
    /* Footer responsive para móvil */
    footer {
        padding: 2rem 0 0 !important;
    }
    
    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
        text-align: center;
        padding: 0 1rem 2rem 1rem !important;
    }
    
    .footer-section.about {
        padding-right: 0 !important;
        order: 1;
        margin-bottom: 1rem;
        text-align: center;
    }
    
    .footer-section.about .logo {
        display: block !important;
        margin-bottom: 1rem;
        text-align: center;
        position: relative;
        z-index: 1;
    }
    
    .footer-section.about .logo img {
        height: 80px !important;
        width: auto !important;
        max-width: 200px;
        display: block;
        margin: 0 auto;
    }
    
    .footer-section.about p {
        font-size: 0.9rem;
        line-height: 1.6;
        margin-bottom: 1.5rem;
        margin-top: 1rem;
        padding: 0 1rem;
        text-align: center;
        clear: both;
    }
    
    /* Separadores visuales entre secciones del footer */
    .footer-section:not(.about) {
        padding-top: 1.5rem;
        border-top: 1px solid rgba(156, 163, 175, 0.2);
        margin-top: 1rem;
    }
    
    .footer-section h3 {
        font-size: 1.1rem !important;
        margin-bottom: 1rem !important;
    }
    
    .footer-section ul li {
        margin-bottom: 0.5rem !important;
        font-size: 0.9rem;
    }
    
    .footer-section ul li i {
        margin-right: 0.5rem;
        width: 16px;
        text-align: center;
    }
    
    .social-links {
        justify-content: center !important;
        margin-top: 1rem;
    }
    
    .footer-divider {
        margin: 2rem 0 1.5rem 0 !important;
    }
    
    .footer-bottom {
        text-align: center !important;
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    .footer-links {
        order: 2;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem 1rem;
    }
    
    .footer-links a {
        font-size: 0.8rem;
    }
    
    .footer-bottom p {
        order: 1;
        font-size: 0.8rem !important;
        line-height: 1.5;
    }
}

/* Media query para pantallas muy pequeñas */
@media (max-width: 480px) {
    .nav-container {
        padding: 0 0.75rem;
    }
    
    .hamburger {
        left: 0.75rem;
    }
    
    #dark-mode-toggle {
        right: 0.75rem;
        width: 36px;
        height: 36px;
    }
    
    #dark-mode-toggle i {
        font-size: 14px;
    }
    
    .logo img {
        height: 50px; /* Logo un poco más grande en pantallas muy pequeñas */
    }
    
    .nav-links {
        max-width: 320px;
    }
    
    /* Footer ajustes para pantallas muy pequeñas */
    .footer-content {
        gap: 1.5rem !important;
        padding: 0 0.5rem !important;
    }
    
    /* Optimizaciones específicas para el scroll de hosting en pantallas pequeñas */
    .hosting-plans {
        scroll-padding-left: 1rem;
        scroll-padding-right: 1rem;
        /* Mejorar rendimiento del scroll sin bloquear el vertical */
        will-change: auto;
    }
    
    .plan-card {
        min-width: 85vw;
        max-width: 90vw;
        /* Permitir comportamiento normal del scroll */
        pointer-events: auto;
        will-change: auto;
    }
    
    /* Asegurar que no haya interferencia con el scroll vertical */
    .hosting-section {
        contain: none;
    }
    
    .footer-section h3 {
        font-size: 1rem !important;
    }
    
    .footer-section ul li {
        font-size: 0.85rem !important;
    }
    
    .footer-bottom p {
        font-size: 0.75rem !important;
    }
    
    .footer-links a {
        font-size: 0.75rem !important;
    }
    
    /* Dark mode para footer en móvil */
    body.dark-mode .footer-section:not(.about) {
        border-top-color: rgba(255, 255, 255, 0.1);
    }
}
