/* AstronovAI iOS performance guard
   Applies only when the server detects iPhone/iPad/iPod and adds body.ai-ios-lite. */

body.ai-ios-lite{
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.ai-ios-lite *,
body.ai-ios-lite *::before,
body.ai-ios-lite *::after{
    scroll-behavior: auto !important;
}

/* iOS Safari can stutter on many translucent layers, large shadows and backdrop filters. */
body.ai-ios-lite .ai-site-header,
body.ai-ios-lite .ai-header-search,
body.ai-ios-lite .ai-header-search-panel,
body.ai-ios-lite .ai-hero-shell,
body.ai-ios-lite .home-section,
body.ai-ios-lite .home-tool-mini-card,
body.ai-ios-lite .tool-card,
body.ai-ios-lite .ai-premium-card,
body.ai-ios-lite .ai-static-card,
body.ai-ios-lite .ai-floating-compare,
body.ai-ios-lite .compare-floating,
body.ai-ios-lite .ai-account-card,
body.ai-ios-lite .modern-tool-panel{
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

body.ai-ios-lite .home-section,
body.ai-ios-lite .home-tool-mini-card,
body.ai-ios-lite .tool-card,
body.ai-ios-lite .ai-category-strip,
body.ai-ios-lite .ai-hero-shell,
body.ai-ios-lite .ai-site-footer{
    box-shadow: 0 12px 32px rgba(15,23,42,.08) !important;
}

/* Keep the first hero slide stable on mobile and reduce paint work from hidden slides. */
@media (max-width: 980px){
    body.ai-ios-lite.home .ai-hero-slide:not(.active){
        display:none !important;
    }

    body.ai-ios-lite.home .ai-smart-hero.ai-hero-image-banner .ai-hero-shell,
    body.ai-ios-lite.home .ai-smart-hero.ai-hero-image-banner .ai-hero-shell::after{
        transform:none !important;
        transition:none !important;
        animation:none !important;
    }

    body.ai-ios-lite.home .swiper,
    body.ai-ios-lite.home .swiper-wrapper,
    body.ai-ios-lite.home .swiper-slide{
        transition-duration:0ms !important;
    }
}

@media (prefers-reduced-motion: reduce){
    body.ai-ios-lite *,
    body.ai-ios-lite *::before,
    body.ai-ios-lite *::after{
        animation-duration:0.001ms !important;
        animation-iteration-count:1 !important;
        transition-duration:0.001ms !important;
    }
}

/* =====================================
   iOS homepage fail-safe v17
   If Safari, LiteSpeed delayed JS, or Swiper fails, keep every homepage section
   visible and convert carousels to native horizontal scrolling.
===================================== */

@media (max-width: 980px){
    body.home.ai-ios-lite .home-container,
    body.home.ai-ios-home-fallback .home-container{
        min-height:auto !important;
        height:auto !important;
        overflow:visible !important;
        contain:none !important;
        content-visibility:visible !important;
    }

    body.home.ai-ios-lite .home-section,
    body.home.ai-ios-lite .featured-comparisons-section,
    body.home.ai-ios-lite .ai-stats-strip,
    body.home.ai-ios-lite .latest-blog-section,
    body.home.ai-ios-lite .ai-ad-slot,
    body.home.ai-ios-home-fallback .home-section,
    body.home.ai-ios-home-fallback .featured-comparisons-section,
    body.home.ai-ios-home-fallback .ai-stats-strip,
    body.home.ai-ios-home-fallback .latest-blog-section,
    body.home.ai-ios-home-fallback .ai-ad-slot{
        display:block !important;
        visibility:visible !important;
        opacity:1 !important;
        transform:none !important;
        clip-path:none !important;
        filter:none !important;
        contain:none !important;
        content-visibility:visible !important;
        min-height:0 !important;
    }

    body.home.ai-ios-lite .home-tools-swiper,
    body.home.ai-ios-home-fallback .home-tools-swiper{
        display:block !important;
        visibility:visible !important;
        opacity:1 !important;
        overflow-x:auto !important;
        overflow-y:visible !important;
        -webkit-overflow-scrolling:touch !important;
        scroll-snap-type:x mandatory !important;
        padding:0 14px 34px !important;
        touch-action:pan-x pan-y !important;
    }

    body.home.ai-ios-lite .home-tools-swiper .swiper-wrapper,
    body.home.ai-ios-home-fallback .home-tools-swiper .swiper-wrapper{
        display:flex !important;
        flex-wrap:nowrap !important;
        align-items:stretch !important;
        width:max-content !important;
        height:auto !important;
        transform:none !important;
        transition:none !important;
        will-change:auto !important;
    }

    body.home.ai-ios-lite .home-tools-swiper .swiper-slide,
    body.home.ai-ios-home-fallback .home-tools-swiper .swiper-slide{
        display:block !important;
        visibility:visible !important;
        opacity:1 !important;
        transform:none !important;
        flex:0 0 min(276px, calc(100vw - 92px)) !important;
        width:min(276px, calc(100vw - 92px)) !important;
        min-width:min(276px, calc(100vw - 92px)) !important;
        max-width:min(276px, calc(100vw - 92px)) !important;
        height:auto !important;
        margin-right:12px !important;
        scroll-snap-align:start !important;
    }

    body.home.ai-ios-lite .home-tool-mini-card,
    body.home.ai-ios-home-fallback .home-tool-mini-card{
        display:flex !important;
        visibility:visible !important;
        opacity:1 !important;
        height:auto !important;
        max-height:none !important;
        transform:none !important;
    }

    body.home.ai-ios-lite .home-tools-swiper .swiper-button-prev,
    body.home.ai-ios-lite .home-tools-swiper .swiper-button-next,
    body.home.ai-ios-lite .home-tools-swiper .swiper-pagination,
    body.home.ai-ios-home-fallback .home-tools-swiper .swiper-button-prev,
    body.home.ai-ios-home-fallback .home-tools-swiper .swiper-button-next,
    body.home.ai-ios-home-fallback .home-tools-swiper .swiper-pagination{
        display:none !important;
        visibility:hidden !important;
    }

    body.home.ai-ios-lite .featured-comparisons-grid,
    body.home.ai-ios-home-fallback .featured-comparisons-grid{
        display:grid !important;
        grid-template-columns:1fr !important;
        gap:14px !important;
        opacity:1 !important;
        visibility:visible !important;
    }

    body.home.ai-ios-lite .ai-live-stats-grid,
    body.home.ai-ios-lite .stats-grid,
    body.home.ai-ios-home-fallback .ai-live-stats-grid,
    body.home.ai-ios-home-fallback .stats-grid{
        display:grid !important;
        grid-template-columns:1fr !important;
        opacity:1 !important;
        visibility:visible !important;
    }
}

/* =====================================
   v18 hard iPhone homepage fallback
   Works even when Hostinger/LiteSpeed page cache does not include the server
   body.ai-ios-lite class. The early head marker adds html.ai-ios-client; the
   @supports rule catches iOS Safari/WebKit as a second guard.
===================================== */
@media (max-width: 980px){
    html.ai-ios-client body.home,
    html.ai-ios-client body.home .site,
    html.ai-ios-client body.home #page,
    html.ai-ios-client body.home #content,
    html.ai-ios-client body.home .ast-container,
    html.ai-ios-client body.home .site-content,
    html.ai-ios-client body.home .content-area,
    html.ai-ios-client body.home main,
    html.ai-ios-client body.home .home-container{
        min-height:auto !important;
        height:auto !important;
        max-height:none !important;
        overflow:visible !important;
        contain:none !important;
        content-visibility:visible !important;
    }

    html.ai-ios-client body.home .home-container{
        display:block !important;
        width:100% !important;
        max-width:100% !important;
        padding-left:10px !important;
        padding-right:10px !important;
    }

    html.ai-ios-client body.home .home-section,
    html.ai-ios-client body.home .featured-comparisons-section,
    html.ai-ios-client body.home .ai-stats-strip,
    html.ai-ios-client body.home .latest-blog-section,
    html.ai-ios-client body.home .ai-ad-slot,
    html.ai-ios-client body.home .ai-category-strip,
    html.ai-ios-client body.home .home-search-wrap,
    html.ai-ios-client body.home #tools-results{
        display:block !important;
        visibility:visible !important;
        opacity:1 !important;
        position:relative !important;
        transform:none !important;
        clip-path:none !important;
        filter:none !important;
        contain:none !important;
        content-visibility:visible !important;
        min-height:0 !important;
        height:auto !important;
        max-height:none !important;
        overflow:visible !important;
    }

    html.ai-ios-client body.home .home-tools-swiper{
        display:block !important;
        visibility:visible !important;
        opacity:1 !important;
        width:100% !important;
        max-width:100% !important;
        overflow-x:auto !important;
        overflow-y:visible !important;
        -webkit-overflow-scrolling:touch !important;
        scroll-snap-type:x mandatory !important;
        padding:0 14px 34px !important;
        touch-action:pan-x pan-y !important;
    }

    html.ai-ios-client body.home .home-tools-swiper .swiper-wrapper{
        display:flex !important;
        flex-wrap:nowrap !important;
        align-items:stretch !important;
        gap:12px !important;
        width:max-content !important;
        height:auto !important;
        transform:none !important;
        transition:none !important;
        will-change:auto !important;
    }

    html.ai-ios-client body.home .home-tools-swiper .swiper-slide{
        display:block !important;
        visibility:visible !important;
        opacity:1 !important;
        transform:none !important;
        flex:0 0 min(276px, calc(100vw - 92px)) !important;
        width:min(276px, calc(100vw - 92px)) !important;
        min-width:min(276px, calc(100vw - 92px)) !important;
        max-width:min(276px, calc(100vw - 92px)) !important;
        height:auto !important;
        margin-right:0 !important;
        scroll-snap-align:start !important;
    }

    html.ai-ios-client body.home .home-tool-mini-card,
    html.ai-ios-client body.home .tool-card{
        display:flex !important;
        visibility:visible !important;
        opacity:1 !important;
        height:auto !important;
        max-height:none !important;
        transform:none !important;
    }

    html.ai-ios-client body.home .home-tools-swiper .swiper-button-prev,
    html.ai-ios-client body.home .home-tools-swiper .swiper-button-next,
    html.ai-ios-client body.home .home-tools-swiper .swiper-pagination{
        display:none !important;
        visibility:hidden !important;
    }
}

@supports (-webkit-touch-callout: none){
    @media (max-width: 980px){
        body.home .home-container{
            overflow:visible !important;
            height:auto !important;
            max-height:none !important;
            content-visibility:visible !important;
            contain:none !important;
        }
        body.home .home-section,
        body.home .featured-comparisons-section,
        body.home .ai-stats-strip,
        body.home .latest-blog-section{
            display:block !important;
            visibility:visible !important;
            opacity:1 !important;
            transform:none !important;
            height:auto !important;
            max-height:none !important;
            overflow:visible !important;
        }
        body.home .home-tools-swiper{
            overflow-x:auto !important;
            overflow-y:visible !important;
            -webkit-overflow-scrolling:touch !important;
        }
        body.home .home-tools-swiper .swiper-wrapper{
            display:flex !important;
            transform:none !important;
            width:max-content !important;
        }
    }
}
