/* =====================================================
   COMPLETE MOBILE FIX - Production Ready
   All issues fixed in one comprehensive update
   ===================================================== */

@media (max-width: 768px) {
    /* ========== NAVIGATION - PERFECT LAYOUT ========== */
    .nav {
        padding: 10px 0 !important;
        background: rgba(15, 15, 26, 0.98) !important;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        height: auto;
        min-height: 60px;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
    }
    
    .nav-inner {
        padding: 0 12px !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 8px !important;
        width: 100%;
        max-width: 100%;
        flex-wrap: nowrap;
        overflow: visible;
        box-sizing: border-box;
    }
    
    /* Logo - Perfect Size */
    .logo {
        flex-shrink: 0;
        max-width: 125px;
        min-width: 0;
    }
    
    .logo-icon {
        height: 28px !important;
        max-height: 28px !important;
        width: auto;
    }
    
    .logo-text-group {
        display: flex !important;
        flex-direction: column;
        gap: 0;
    }
    
    .logo-name {
        font-size: 0.9rem !important;
        line-height: 1.2;
        white-space: nowrap;
    }
    
    .logo-tagline {
        font-size: 0.5rem !important;
        line-height: 1.2;
        white-space: nowrap;
    }
    
    /* Hide desktop nav completely */
    .nav-desktop {
        display: none !important;
        visibility: hidden !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
        position: absolute !important;
    }
    
    /* Menu Button - ALWAYS VISIBLE */
    .nav-menu-btn {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 5px !important;
        padding: 10px 16px !important;
        min-width: 70px !important;
        min-height: 44px !important;
        background: rgba(255, 255, 255, 0.2) !important;
        border: 2px solid rgba(255, 255, 255, 0.4) !important;
        border-radius: 8px !important;
        color: white !important;
        font-size: 0.8rem !important;
        font-weight: 600 !important;
        cursor: pointer !important;
        transition: all 0.2s ease;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        -webkit-tap-highlight-color: transparent;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
        z-index: 1002 !important;
        position: relative !important;
        margin: 0 !important;
    }
    
    .nav-menu-btn:active {
        background: rgba(255, 255, 255, 0.2);
        transform: scale(0.97);
    }
    
    .nav-menu-btn.active {
        background: rgba(255, 255, 255, 0.25);
    }
    
    .nav-menu-btn svg {
        width: 14px;
        height: 14px;
        transition: transform 0.2s ease;
    }
    
    .nav-menu-btn.active svg {
        transform: rotate(180deg);
    }
    
    /* Dropdown Menu - All Nav Options */
    .nav-mobile {
        position: absolute;
        top: calc(100% + 12px);
        right: 12px;
        min-width: 200px;
        max-width: calc(100vw - 24px);
        background: rgba(15, 15, 26, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 12px;
        padding: 12px;
        display: none !important;
        flex-direction: column;
        gap: 8px;
        z-index: 1001;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
        opacity: 0;
        transform: translateY(-12px);
        transition: opacity 0.25s ease, transform 0.25s ease;
        pointer-events: none;
    }
    
    .nav-mobile.active {
        display: flex !important;
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
    
    .nav-mobile a {
        font-size: 0.9rem !important;
        font-weight: 500;
        padding: 14px 18px !important;
        min-height: 48px;
        color: white !important;
        border-radius: 8px;
        transition: background 0.2s ease;
        text-align: left;
        white-space: nowrap;
        display: flex;
        align-items: center;
        -webkit-tap-highlight-color: transparent;
        width: 100%;
    }
    
    .nav-mobile a:active {
        background: rgba(255, 255, 255, 0.15);
    }
    
    /* Theme Toggle - Perfect Size */
    .theme-toggle {
        flex-shrink: 0;
        width: 44px !important;
        height: 44px !important;
        min-width: 44px;
        min-height: 44px;
        position: static;
        -webkit-tap-highlight-color: transparent;
    }
    
    .theme-toggle svg {
        width: 18px;
        height: 18px;
    }
    
    /* CTA Button - Visible and Touchable */
    .nav-cta {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        padding: 10px 14px !important;
        min-height: 44px;
        font-size: 0.7rem !important;
        white-space: nowrap;
        flex-shrink: 0;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* ========== HERO SECTION - PERFECT SPACING ========== */
    .hero {
        padding-top: calc(70px + clamp(1.5rem, 5vw, 2.5rem)) !important;
        padding-bottom: clamp(2rem, 6vw, 3rem) !important;
        padding-left: clamp(1rem, 4vw, 1.5rem) !important;
        padding-right: clamp(1rem, 4vw, 1.5rem) !important;
        min-height: auto;
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }
    
    .hero-content {
        gap: clamp(1rem, 4vw, 1.5rem);
        max-width: 100%;
        padding: 0;
        width: 100%;
    }
    
    .hero-title {
        font-size: clamp(1.5rem, 5.5vw, 2.3rem) !important;
        line-height: 1.2 !important;
        margin-bottom: clamp(0.75rem, 3vw, 1rem);
        white-space: nowrap !important;
        overflow: visible !important;
        text-overflow: clip !important;
        max-width: 100%;
        padding: 0 clamp(0.5rem, 2vw, 1rem) !important;
        letter-spacing: -0.01em;
        width: 100%;
        box-sizing: border-box;
        text-align: center;
        word-spacing: 0.15em;
    }
    
    .hero-title span {
        display: inline !important;
        white-space: nowrap !important;
        margin: 0;
        padding: 0;
    }
    
    /* ========== SECTIONS - PERFECT SPACING ========== */
    .section {
        padding: clamp(2.5rem, 7vw, 4rem) 0 !important;
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }
    
    .container {
        padding: 0 clamp(1rem, 4vw, 1.5rem) !important;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .section-header {
        padding: 0 clamp(0.5rem, 2vw, 1rem) !important;
        margin-bottom: clamp(2rem, 6vw, 3rem) !important;
    }
    
    .section-title {
        font-size: clamp(1.75rem, 6vw, 2.5rem) !important;
        line-height: 1.3 !important;
        margin-bottom: clamp(1rem, 3vw, 1.5rem) !important;
        text-align: center;
    }
    
    .section-desc {
        font-size: clamp(1rem, 3vw, 1.125rem) !important;
        line-height: 1.6 !important;
        padding: 0 clamp(0.5rem, 2vw, 1rem) !important;
        text-align: center;
    }
    
    /* ========== CARDS AND GRIDS ========== */
    .product-card,
    .impact-card,
    .mission-card {
        padding: clamp(1.5rem, 5vw, 2rem) !important;
        margin-bottom: clamp(1rem, 3vw, 1.5rem);
    }
    
    .products-grid,
    .impact-grid,
    .capabilities-grid {
        grid-template-columns: 1fr;
        gap: clamp(1.5rem, 4vw, 2rem);
    }
    
    /* ========== BUTTONS ========== */
    .btn {
        min-height: 44px;
        padding: 12px 24px;
        font-size: 0.9rem;
    }
    
    /* ========== NO OVERFLOW ========== */
    * {
        max-width: 100%;
    }
    
    html, body {
        overflow-x: hidden !important;
        width: 100%;
        max-width: 100vw;
    }
}

/* ========== SMALLER MOBILE (480px) ========== */
@media (max-width: 480px) {
    .nav {
        padding: 8px 0 !important;
        min-height: 56px;
    }
    
    .nav-inner {
        padding: 0 10px !important;
        gap: 6px !important;
    }
    
    .logo {
        max-width: 110px;
    }
    
    .logo-icon {
        height: 26px !important;
    }
    
    .logo-name {
        font-size: 0.85rem !important;
    }
    
    .logo-tagline {
        font-size: 0.48rem !important;
    }
    
    .nav-menu-btn {
        padding: 8px 12px;
        min-width: 58px;
        font-size: 0.7rem;
    }
    
    .nav-menu-btn svg {
        width: 12px;
        height: 12px;
    }
    
    .theme-toggle {
        width: 40px !important;
        height: 40px !important;
    }
    
    .theme-toggle svg {
        width: 16px;
        height: 16px;
    }
    
    .nav-cta {
        padding: 8px 12px !important;
        font-size: 0.65rem !important;
    }
    
    .hero {
        padding-top: calc(64px + clamp(1.25rem, 4vw, 2rem)) !important;
    }
    
    .hero-title {
        font-size: clamp(1.3rem, 5vw, 2rem) !important;
    }
}

/* ========== EXTRA SMALL (320px) ========== */
@media (max-width: 320px) {
    .nav-inner {
        padding: 0 8px !important;
        gap: 4px !important;
    }
    
    .logo {
        max-width: 95px;
    }
    
    .logo-icon {
        height: 24px !important;
    }
    
    .logo-name {
        font-size: 0.75rem !important;
    }
    
    .logo-tagline {
        display: none !important;
    }
    
    .nav-menu-btn-text {
        display: none;
    }
    
    .nav-menu-btn {
        padding: 8px;
        min-width: 40px;
    }
    
    .theme-toggle {
        width: 36px !important;
        height: 36px !important;
    }
    
    .nav-cta {
        padding: 6px 10px !important;
        font-size: 0.6rem !important;
    }
    
    .hero-title {
        font-size: clamp(1.1rem, 4.5vw, 1.7rem) !important;
    }
}

