/* MOBILE FIXES - CRITICAL OVERRIDES - SIMPLIFIED APPROACH */

/* Force mobile styles with high specificity */
@media screen and (max-width: 768px) {
  /* Logo size fixes */
  .nav-logo .logo-img,
  .logo-img {
    width: 120px !important;
    height: 30px !important;
    max-width: 120px !important;
  }
  
  .footer-logo .footer-logo-img,
  .footer-logo-img {
    width: 120px !important;
    height: 30px !important;
    max-width: 120px !important;
  }
  
  /* Navigation container fixes - optimized for logo left, lang+hamburger right */
  .nav-container {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 4px !important; /* Smaller gap since lang+hamburger are grouped */
    padding: 15px 15px 15px 15px !important;
    position: relative !important;
    overflow: visible !important;
  }
  
  .nav-logo {
    order: 1 !important;
    flex: 1 !important;
  }
  
  .nav-menu {
    order: 5 !important; /* Mobile menu goes to bottom when active */
  }
  
  /* OVERRIDE NAV-ACTIONS AND MOVE LANGUAGE SWITCHER TO RIGHT */
  .nav-actions {
    order: 3 !important; /* Move the entire nav-actions container to the right */
    margin-left: auto !important; /* Push to right side */
    flex-shrink: 0 !important;
    gap: 2px !important; /* Minimal gap between elements */
  }
  
  .language-switcher {
    z-index: 100 !important;
    position: relative !important;
    margin-right: 2px !important; /* Minimal gap between language and hamburger */
  }
  
  /* CLICKABLE HAMBURGER MENU - PROPER COLORS */
  .nav-toggle,
  #nav-toggle {
    order: 4 !important; /* Keep hamburger as last item */
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    width: 48px !important;
    height: 48px !important;
    background: #0066ff !important;
    border: 2px solid #ffffff !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    padding: 10px !important;
    box-shadow: 0 4px 12px rgba(0,102,255,0.3) !important;
    position: relative !important;
    z-index: 999999 !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    flex-shrink: 0 !important;
  }
  
  .nav-toggle:hover,
  #nav-toggle:hover {
    background: #0052cc !important;
    transform: scale(1.05) !important;
  }
  
  .nav-toggle:active,
  #nav-toggle:active {
    background: #004299 !important;
    transform: scale(0.95) !important;
  }
  
  .nav-toggle i,
  #nav-toggle i {
    font-size: 20px !important;
    color: white !important;
    font-weight: bold !important;
    pointer-events: none !important;
  }
  
  /* COMPLETELY REWRITE MOBILE MENU - SIMPLE APPROACH */
  .nav-menu,
  #nav-menu {
    order: 4 !important;
    width: 100% !important;
    display: none !important;
    flex-direction: column !important;
    gap: 0 !important;
    position: static !important;
    background: white !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  .nav-menu.active,
  #nav-menu.active {
    display: flex !important;
    position: static !important;
    width: 100% !important;
    background: #f8fafc !important;
    border-top: 2px solid #0066ff !important;
    border-bottom: 2px solid #0066ff !important;
    padding: 15px 0 !important;
    margin-top: 10px !important;
  }
  
  /* SIMPLE MOBILE MENU LINKS */
  .nav-menu .nav-link,
  #nav-menu .nav-link {
    display: block !important;
    padding: 15px 20px !important;
    text-align: center !important;
    color: #1a365d !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    font-size: 18px !important;
    background: white !important;
    border-bottom: 1px solid #e2e8f0 !important;
    margin: 2px 10px !important;
    border-radius: 5px !important;
  }
  
  .nav-menu .nav-link:hover,
  .nav-menu .nav-link.active,
  #nav-menu .nav-link:hover,
  #nav-menu .nav-link.active {
    background: #0066ff !important;
    color: white !important;
  }
  
  /* LANGUAGE SWITCHER MOBILE FIXES - POSITIONED RIGHT OF HAMBURGER */
  .language-switcher {
    position: relative !important;
    z-index: 100 !important;
    margin-right: 2px !important;
    margin-left: auto !important;
    /* Compact size to fit next to hamburger */
    max-width: 60px !important;
    flex-shrink: 0 !important;
  }
  
  .lang-current {
    background: rgba(255,255,255,0.9) !important;
    border: 1px solid #ccc !important;
    color: #333 !important;
    padding: 8px 12px !important;
    border-radius: 5px !important;
    font-size: 14px !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    white-space: nowrap !important;
  }
  
  .lang-current i {
    font-size: 12px !important;
    margin-left: 4px !important;
  }
  
  .lang-flag {
    font-size: 16px !important;
    line-height: 1 !important;
  }
  
  .lang-code {
    font-size: 14px !important;
    font-weight: 600 !important;
  }
  
  /* Fix dropdown positioning - align to right edge since lang switcher is on far right */
  .lang-dropdown {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    /* Ensure dropdown doesn't go off-screen - positioned from right edge */
    transform: translateX(0) !important;
    max-width: 180px !important;
    z-index: 10001 !important;
    /* Prevent overflow off right edge */
    margin-right: 0 !important;
  }
  
  /* HERO STATS MOBILE LAYOUT FIX */
  .hero-stats {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important; /* Keep 3 columns but make them smaller */
    gap: var(--space-2) !important;
    padding-top: var(--space-6) !important;
    border-top: 1px solid var(--gray-200) !important;
    margin: 0 auto !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }
  
  .stat {
    text-align: center !important;
    padding: var(--space-2) !important;
    min-width: 0 !important; /* Allow content to shrink */
  }
  
  .stat-number {
    font-size: var(--font-size-lg) !important; /* Smaller on mobile */
    font-weight: var(--font-weight-bold) !important;
    color: var(--electric-blue) !important;
    margin-bottom: var(--space-1) !important;
    line-height: 1.2 !important;
  }
  
  .stat-label {
    font-size: var(--font-size-xs) !important; /* Smaller text */
    color: var(--gray-600) !important;
    font-weight: var(--font-weight-medium) !important;
    line-height: 1.3 !important;
    word-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Hide demo button in nav actions on mobile to save space */
  .nav-actions .btn,
  .nav-actions .header-demo-btn {
    display: none !important;
  }
  
  /* HIDE AUTOMATION PREVIEW CARDS ON MOBILE - THEY CAUSE OVERFLOW */
  .automation-preview {
    display: none !important;
  }
  
  .hero-visual {
    display: none !important;
  }
  
  .preview-card {
    display: none !important;
  }
  
  /* MAKE HERO SINGLE COLUMN WHEN VISUAL IS HIDDEN */
  .hero-container {
    grid-template-columns: 1fr !important;
    gap: var(--space-6) !important;
    text-align: center !important;
  }
  
  .hero-content {
    max-width: 100% !important;
    margin: 0 auto !important;
  }
  
  /* Contact section mobile centering fixes */
  .contact {
    text-align: center !important;
  }
  
  .contact-grid {
    grid-template-columns: 1fr !important;
    gap: var(--space-6) !important;
    text-align: center !important;
  }
  
  .contact-info {
    text-align: center !important;
  }
  
  .contact-item {
    text-align: center !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: var(--space-4) !important;
  }
  
  .contact-details {
    text-align: center !important;
    width: 100% !important;
  }
  
  .contact-options {
    text-align: center !important;
    align-items: center !important;
  }
  
  .contact-options .contact-link {
    text-align: center !important;
    display: block !important;
    margin: 0 auto !important;
  }
  
  .business-hours-item {
    text-align: center !important;
  }
  
  .contact-form-container {
    text-align: left !important;
    margin: 0 auto !important;
    max-width: 100% !important;
  }
  
  /* Clean hamburger menu without debug labels */
}

@media screen and (max-width: 480px) {
  /* Extra small screens */
  .nav-logo .logo-img,
  .logo-img {
    width: 100px !important;
    height: 25px !important;
    max-width: 100px !important;
  }
  
  .footer-logo .footer-logo-img,
  .footer-logo-img {
    width: 100px !important;
    height: 25px !important;
    max-width: 100px !important;
  }
  
  .nav-container {
    padding: 8px 12px !important;
    gap: 6px !important;
  }
  
  .language-switcher {
    margin-right: 2px !important;
    max-width: 50px !important; /* Even more compact on very small screens */
  }
  
  .lang-current {
    padding: 6px 10px !important;
    font-size: 12px !important;
  }
  
  .lang-current .lang-code {
    display: none !important;
  }
  
  /* VERY SMALL SCREEN HERO STATS - SINGLE COLUMN IF NEEDED */
  .hero-stats {
    grid-template-columns: 1fr !important;
    gap: var(--space-3) !important;
    padding-top: var(--space-4) !important;
  }
  
  .stat {
    padding: var(--space-3) !important;
  }
  
  .stat-number {
    font-size: var(--font-size-xl) !important;
  }
  
  .stat-label {
    font-size: var(--font-size-sm) !important;
  }

  /* Smaller mobile marquee adjustments */
  .logos-marquee-container {
    height: 40px !important;
  }

  .logo-item {
    width: 100px !important;
    height: 32px !important;
    font-size: 11px !important;
  }

  .logos-track {
    gap: 10px !important;
    animation: mobileMarquee 18s linear infinite !important;
  }
  
  /* Marquee Mobile Fixes - Force proper behavior */
  .social-proof {
    padding: 16px 0 !important;
    background: #fff !important;
    overflow: hidden !important;
  }

  .logos-marquee-container {
    width: 100% !important;
    height: 45px !important;
    overflow: hidden !important;
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
  }

  .logos-track {
    display: flex !important;
    width: 300% !important;
    gap: 12px !important;
    animation: mobileMarquee 20s linear infinite !important;
    align-items: center !important;
    will-change: transform !important;
  }

  .logo-item {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 110px !important;
    height: 35px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-radius: 5px !important;
    font-weight: 600 !important;
    color: #333 !important;
    font-size: 12px !important;
    margin: 0 !important;
    transition: none !important;
    overflow: visible !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    text-overflow: clip !important;
  }

  /* Mobile-specific animation */
  @keyframes mobileMarquee {
    0% {
      transform: translateX(0);
    }
    100% {
      transform: translateX(-33.333%);
    }
  }

  /* AI Chat Mobile Fixes */
  #aria-chat-widget {
    bottom: 12px !important;
    right: 12px !important;
    z-index: 999999 !important;
    position: fixed !important;
  }
  
  .aria-chat-window {
    position: fixed !important;
    bottom: 65px !important;
    right: 12px !important;
    left: 12px !important;
    width: auto !important;
    height: 70vh !important;
    max-height: 400px !important;
    min-height: 300px !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3) !important;
    transform: none !important;
    margin: 0 !important;
  }
  
  .aria-chat-window.active {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) scale(1) !important;
  }
  
  .aria-chat-bubble {
    width: 48px !important;
    height: 48px !important;
  }
  
  .aria-bubble-tooltip {
    bottom: 60px !important;
    right: 0 !important;
    left: auto !important;
    max-width: 150px !important;
    font-size: 12px !important;
  }
}