/* PERSONNN MOBILE-FIRST STYLES */
/* Optimized for mobile performance and iOS-style interactions */

/* Mobile-First Base Styles */
@media screen and (max-width: 768px) {
    /* Typography Scaling */
    .hero-title {
        font-size: clamp(32px, 8vw, 48px);
        line-height: 1.1;
        letter-spacing: -0.02em;
    }
    
    .hero-description {
        font-size: 18px;
        line-height: 1.5;
        margin-bottom: 2rem;
    }
    
    .section-title {
        font-size: clamp(24px, 6vw, 32px);
        line-height: 1.2;
    }
    
    /* Container Adjustments */
    .container {
        padding: 0 1rem;
    }
    
    .hero-content {
        padding: 4rem 1rem 2rem;
        text-align: center;
    }
    
    /* Navigation Mobile */
    .nav-content {
        padding: 0 1rem;
        height: 56px;
    }
    
    .nav-menu {
        display: none;
    }
    
    .nav-logo img {
        height: 32px;
        width: auto;
    }
    
    .nav-cta {
        font-size: 14px;
        padding: 0.5rem 1rem;
    }
    
    /* Mobile Menu Toggle */
    .mobile-menu-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 24px;
        color: var(--gray-700);
        cursor: pointer;
        padding: 0.5rem;
        border-radius: 8px;
        transition: all 0.2s ease;
    }
    
    .mobile-menu-toggle:hover {
        background: rgba(0, 0, 0, 0.05);
    }
    
    /* Mobile Menu Overlay */
    .mobile-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        z-index: 9999;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transform: translateY(-100%);
        transition: transform 0.3s ease;
    }
    
    .mobile-menu.active {
        transform: translateY(0);
    }
    
    .mobile-menu-item {
        font-size: 24px;
        font-weight: 600;
        color: var(--gray-900);
        text-decoration: none;
        margin: 1rem 0;
        padding: 1rem 2rem;
        border-radius: 12px;
        transition: all 0.2s ease;
        text-align: center;
        min-width: 200px;
    }
    
    .mobile-menu-item:hover {
        background: rgba(0, 0, 0, 0.05);
        transform: scale(1.05);
    }
    
    .mobile-menu-close {
        position: absolute;
        top: 1rem;
        right: 1rem;
        background: none;
        border: none;
        font-size: 32px;
        color: var(--gray-700);
        cursor: pointer;
        padding: 0.5rem;
        border-radius: 8px;
    }
    
    /* Button Optimizations */
    .btn-primary,
    .btn-secondary {
        width: 100%;
        max-width: 320px;
        padding: 1rem 1.5rem;
        font-size: 16px;
        font-weight: 600;
        border-radius: 12px;
        margin: 0.5rem 0;
        min-height: 48px; /* iOS touch target */
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        width: 100%;
    }
    
    /* Card Optimizations */
    .preview-card {
        margin: 0 1rem;
        padding: 1.5rem;
        border-radius: 16px;
    }
    
    .ecosystem-paths {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-top: 1.5rem;
    }
    
    .ecosystem-path {
        padding: 1.5rem;
        border-radius: 16px;
    }
    
    .ecosystem-item {
        padding: 1.25rem;
        border-radius: 12px;
        margin-bottom: 1rem;
    }
    
    .productos-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .producto-card {
        padding: 1.25rem;
        border-radius: 12px;
    }
    
    /* Hardware Showcase Mobile */
    .hardware-showcase {
        padding: 1.5rem;
        margin: 1.5rem 0;
        border-radius: 16px;
    }
    
    .hardware-device {
        width: 120px;
        height: 120px;
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }
    
    /* Form Optimizations */
    .email-capture-form input[type="email"] {
        width: 100%;
        padding: 1rem;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 12px;
        border: 2px solid var(--gray-200);
        margin-bottom: 1rem;
        min-height: 48px;
    }
    
    .email-capture-form button {
        width: 100%;
        padding: 1rem;
        font-size: 16px;
        font-weight: 600;
        border-radius: 12px;
        min-height: 48px;
    }
    
    /* Modal Mobile Optimizations */
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 1rem;
        border-radius: 16px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .floating-email-capture {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        border-radius: 12px;
    }
    
    /* Touch Optimizations */
    .ecosystem-item,
    .producto-card,
    .caso-card {
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    /* Reduce Motion for Mobile */
    @media (prefers-reduced-motion: reduce) {
        * {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }
}

/* iOS-Specific Optimizations */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari specific styles */
    .btn-primary,
    .btn-secondary {
        -webkit-appearance: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    input[type="email"],
    input[type="text"],
    input[type="tel"] {
        -webkit-appearance: none;
        border-radius: 12px;
    }
    
    /* Fix iOS viewport issues */
    .hero {
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
    
    /* iOS safe area support */
    .nav-bar {
        padding-top: env(safe-area-inset-top);
    }
    
    .floating-email-capture {
        bottom: calc(10px + env(safe-area-inset-bottom));
    }
}

/* High-Performance Animations */
.performance-optimized {
    will-change: transform, opacity;
    transform: translateZ(0); /* Force GPU acceleration */
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* First 3 Seconds Optimization */
.critical-above-fold {
    /* Styles for content that must load in first 3 seconds */
    font-display: swap;
    contain: layout style paint;
}

.hero-title,
.hero-description,
.hero-actions {
    animation: fadeInUp 0.8s ease-out;
    animation-fill-mode: both;
}

.hero-title {
    animation-delay: 0.2s;
}

.hero-description {
    animation-delay: 0.4s;
}

.hero-actions {
    animation-delay: 0.6s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

/* Micro-interactions */
.micro-bounce {
    animation: microBounce 0.3s ease;
}

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

.micro-shake {
    animation: microShake 0.5s ease;
}

@keyframes microShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Accessibility Enhancements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.focus-visible {
    outline: 2px solid var(--primary-color, #007aff);
    outline-offset: 2px;
    border-radius: 4px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .btn-primary {
        border: 2px solid currentColor;
    }
    
    .ecosystem-item,
    .producto-card {
        border: 2px solid currentColor;
    }
}

/* Dark Mode Mobile */
@media (prefers-color-scheme: dark) and (max-width: 768px) {
    .mobile-menu {
        background: rgba(0, 0, 0, 0.95);
        backdrop-filter: blur(20px);
    }
    
    .mobile-menu-item {
        color: white;
    }
    
    .mobile-menu-item:hover {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* Performance Critical CSS */
.critical-path {
    /* Inline critical CSS for above-the-fold content */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    color: #1d1d1f;
    background: #ffffff;
}

/* Tablet Optimizations */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .ecosystem-paths {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    
    .productos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .hero-title {
        font-size: clamp(40px, 6vw, 56px);
    }
    
    .container {
        padding: 0 2rem;
    }
}

/* Ultra-wide Mobile (iPhone Pro Max, etc.) */
@media screen and (max-width: 768px) and (min-height: 800px) {
    .hero-content {
        padding: 6rem 1rem 3rem;
    }
    
    .hero-actions {
        margin-top: 3rem;
    }
}

/* Small Mobile (iPhone SE, etc.) */
@media screen and (max-width: 375px) {
    .hero-title {
        font-size: clamp(28px, 7vw, 36px);
    }
    
    .hero-description {
        font-size: 16px;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 0.875rem 1.25rem;
        font-size: 15px;
    }
    
    .container {
        padding: 0 0.75rem;
    }
    
    .ecosystem-item,
    .producto-card {
        padding: 1rem;
    }
}

/* Landscape Mobile */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding-top: 60px;
    }
    
    .hero-content {
        padding: 2rem 1rem 1rem;
    }
    
    .hero-title {
        font-size: clamp(24px, 5vw, 32px);
        margin-bottom: 1rem;
    }
    
    .hero-description {
        font-size: 16px;
        margin-bottom: 1.5rem;
    }
    
    .hero-actions {
        flex-direction: row;
        gap: 1rem;
        justify-content: center;
    }
    
    .btn-primary,
    .btn-secondary {
        width: auto;
        min-width: 140px;
    }
}

/* Print Styles */
@media print {
    .nav-bar,
    .floating-email-capture,
    .modal,
    .btn-primary,
    .btn-secondary {
        display: none !important;
    }
    
    .hero-title,
    .section-title {
        color: black !important;
        background: none !important;
        -webkit-text-fill-color: black !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}

/* Reduced Data Mode */
@media (prefers-reduced-data: reduce) {
    .hero-background,
    .hardware-device,
    .loading-skeleton {
        background: none !important;
        animation: none !important;
    }
    
    .preview-card {
        backdrop-filter: none;
    }
}