/* mobile.css - Global Responsive Overrides */
@media screen and (max-width: 768px) {

    /* Touch Target Fixes */
    button,
    .nav-btn,
    .cta-button,
    .open-account-btn,
    .register,
    .login-btn-link,
    .signup-btn,
    .mobile-menu-btn,
    .mobile-login-btn,
    .app-button,
    .social-icon,
    .store-btn,
    .footer-links a,
    .legal-links a {
        min-height: 48px !important;
        min-width: 48px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    .footer-links a,
    .legal-links a,
    .nav-btn {
        padding-top: 12px !important;
        padding-bottom: 12px !important;
    }

    /* Prevent overflow globally */
    html,
    body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
    }

    .company-details-grid {
        grid-template-columns: 1fr !important;
        gap: 0.8rem;
    }

    .stats-grid,
    .about-grid,
    .mobile-content-wrapper,
    .features-column,
    .advantages-flex,
    .why-choose-flex,
    .market-grid,
    .feature-grid-lite,
    .steps-grid,
    .premium-contact-details,
    .social-icons,
    .footer-links {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
    }

    .premium-contact-details,
    .social-icons,
    .footer-links,
    .legal-links {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
    }

    /* Override inline flex-direction styles */
    .content-section,
    .hero,
    .about-content [style*="flex-direction"] {
        flex-direction: column !important;
        align-items: center !important;
    }

    /* Padding & Margin adjustments */
    section,
    .hero,
    .mobile-trading,
    .stats-section,
    .trade-pro-section,
    .advantages,
    .why-choose-section,
    .bonus-table-section {
        padding-left: 15px !important;
        padding-right: 15px !important;
        box-sizing: border-box !important;
    }

    .company-details {
        margin: 1rem auto !important;
        padding: 1.2rem !important;
        width: calc(100% - 30px) !important;
    }

    /* Images and Content */
    img,
    .section-image,
    .section-content {
        max-width: 100% !important;
        height: auto !important;
        box-sizing: border-box !important;
    }

    /* Typography scaling */
    h1 {
        font-size: 2rem !important;
    }

    h2 {
        font-size: 1.7rem !important;
    }

    p {
        font-size: 1rem !important;
        line-height: 1.5;
    }

    .hero-title-centered,
    .hero h1 {
        font-size: 1.8rem !important;
    }

    /* Navigation stacking and Keyboard fixes */
    .nav-links {
        display: none;
        position: fixed !important;
        top: 0;
        left: 0;
        width: 100% !important;
        height: 100dvh !important;
        max-width: none !important;
        background: #111111;
        z-index: 100002 !important; /* nav-links */
        flex-direction: column !important;
        padding: 60px 15px 15px 15px !important;
        overflow-y: auto !important;
    }

    .nav-links.active {
        display: flex !important;
    }

    .nav-overlay {
        z-index: 100001 !important; /* nav-overlay */
    }

    .navbar {
        position: sticky !important;
        z-index: 100003 !important; /* navbar */
        width: 100% !important;
    }

    .mobile-nav-controls {
        z-index: 100004 !important; /* mobile-nav-controls */
        display: flex !important;
    }

    /* Prevent keyboard jumps */
    .hero {
        min-height: 100dvh !important;
    }

    /* Form Inputs */
    input,
    textarea,
    select {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        font-size: 16px !important;
        /* Prevents iOS/Android Chrome zoom */
    }

    form,
    .glass-form {
        width: 100% !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .glass-form-group,
    .glass-form-group.full {
        width: 100% !important;
        grid-column: 1 / -1 !important;
    }

    /* Hero Buttons Unblock */
    .hero-image-container {
        margin: 2rem auto 0 !important;
        z-index: 1 !important;
    }

    .hero-buttons,
    .hero-btns-centered {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        position: relative !important;
        z-index: 10 !important;
        margin-top: 1rem !important;
        align-items: center !important;
        gap: 15px !important;
    }

    .hero-secondary-action {
        position: relative !important;
        z-index: 10 !important;
    }

    .why-left,
    .why-right,
    .adv-left,
    .adv-right {
        width: 100% !important;
    }

    .table-container {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        width: 100% !important;
    }

    /* ========== POINTER EVENT FIXES (Fixes unclickable buttons) ========== */
    
    /* The vsh-chat-widget invisible flex-box was covering the entire screen */
    .vsh-chat-widget {
        pointer-events: none !important;
        width: 100% !important;
        max-width: 300px !important;
    }
    
    .vsh-chat-trigger, 
    .vsh-chat-panel.open {
        pointer-events: auto !important;
    }

    .vsh-chat-panel {
        /* Remove it from flex flow to stop extending the invisible bounding box */
        position: absolute !important;
        bottom: 70px !important; 
        right: 0 !important;
    }
    
    /* Ensure the hero container does not block buttons */
    .hero-content {
        pointer-events: none !important;
    }
    
    .hero-content > * {
        pointer-events: auto !important;
    }

    .hero-image-container {
        pointer-events: none !important; 
        /* Let clicks fall through the empty space around the image */
    }
    
    .hero-image-container img {
        pointer-events: auto !important;
    }

    /* Keep Nav overlay out of the way natively */
    .nav-overlay:not(.active) {
        pointer-events: none !important;
    }
    
    /* Make absolutely sure CTA container isn't shifting behind other layers */
    .hero-buttons, .hero-btns-centered {
        z-index: 9999 !important; /* Force to top, but below nav */
    }
    
    .open-account-btn, .cta-button, .register-btn, .btn-blue {
        position: relative !important;
        z-index: 9999 !important; /* Make sure the button itself is heavily prioritized */
        pointer-events: auto !important;
    }


    /* ========== ADDITIONAL POINTER/BUTTON FIXES ========== */
    
    .btn-dark-outline,
    .account-cards button,
    .account-card .open-account-btn {
        pointer-events: auto !important;
        position: relative !important;
        z-index: 9999 !important;
    }
    
    .account-card {
        pointer-events: auto !important;
        z-index: 2 !important;
    }

    /* Tidy up any stray overlays */
    .hero-overlay {
        pointer-events: none !important;
    }


    /* Ensure chat widget rests below the mobile menu overlay */
    .vsh-chat-widget {
        z-index: 100000 !important;
    }


    /* ========== BODY SCROLL LOCK ========== */
    body.mobile-menu-open, 
    html.mobile-menu-open {
        overflow: hidden !important;
        touch-action: none !important;
    }
    
    .nav-links, .nav-overlay {
        touch-action: auto !important;
    }


    /* ========== BACKGROUND SCROLL LOCK ========== */
    
    body.mobile-menu-open {
        overflow: hidden !important;
        height: 100dvh !important;
        touch-action: none !important;
    }
    
    .nav-overlay {
        position: fixed !important;
        top: 0; left: 0;
        width: 100vw !important;
        height: 100dvh !important;
        background: rgba(0,0,0,0.7) !important;
        backdrop-filter: blur(4px);
    }


    /* ========== NAVIGATION STRETCH FIX ========== */
    
    .nav-links, .nav-overlay {
        bottom: 0 !important;
        min-height: 100% !important;
    }


    /* ========== BULLETPROOF SCROLL LOCK ========== */
    
    html.mobile-menu-open,
    body.mobile-menu-open {
        overflow: hidden !important;
        height: 100vh !important;
        width: 100vw !important;
        position: fixed !important; 
    }


    /* Reduce Login button size in the top mobile navbar */
    .mobile-nav-controls .nav-btn,
    .mobile-nav-controls .login-btn-link,
    .mobile-nav-controls .signup-btn {
        min-height: 34px !important;
        height: 34px !important;
        min-width: 60px !important;
        padding: 0 14px !important;
        font-size: 13px !important;
        margin-right: 8px !important; /* give space before hamburger menu */
    }

    /* Ensure the mobile login button scales down properly */
    .mobile-nav-controls .mobile-login-btn {
        min-height: 34px !important;
        height: 34px !important;
        min-width: 60px !important;
        padding: 0 14px !important;
        font-size: 13px !important;
        margin-right: 8px !important;
    }

}