/* Performance, mobile UX, accessibility */

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

img {
    max-width: 100%;
    height: auto;
}

/* Default lazy images unless marked high priority */
img:not([loading="eager"]) {
    loading: lazy;
    decoding: async;
}

img[loading="eager"],
.asb-logo-img,
.asb-brand img {
    loading: eager;
}

/* Below-fold sections: faster initial paint on long pages */
.asb-home section:not(.hero-section),
.asb-product-single section:not(.asb-ps-hero-shell) {
    content-visibility: auto;
    contain-intrinsic-size: auto 480px;
}

/* Marquee: promote layer only while animating */
.asb-clients-track {
    will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
    .asb-clients-track {
        will-change: auto;
    }

    html {
        scroll-behavior: auto;
    }
}

/* Touch-friendly targets (WCAG ~44px) */
.asb-btn-quote,
.global-cta-btn,
.asb-hamburger,
.asb-icon-link,
.asb-drawer-action,
.asb-drawer-search-btn,
.open-quote-modal {
    min-height: 44px;
}

/* Hero CTAs — vertically center label + iconify icons */
.hero-section .btn-warning,
.hero-section .btn-outline-light {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center;
    gap: 0.5rem;
    line-height: 1.25;
}

.hero-section .btn-warning > span,
.hero-section .btn-outline-light > span {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.hero-section .btn-warning .iconify,
.hero-section .btn-outline-light .iconify {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.15em;
    height: 1.15em;
    line-height: 1;
    vertical-align: middle;
}

.hero-section .btn-warning .iconify svg,
.hero-section .btn-outline-light .iconify svg {
    display: block;
}

@media (max-width: 767px) {
    .hero-section {
        padding: 48px 16px 40px !important;
    }

    .hero-section h1,
    .hero-section .display-4 {
        font-size: clamp(1.5rem, 5.5vw, 2rem) !important;
        line-height: 1.2 !important;
    }

    .hero-section p {
        font-size: 15px !important;
        line-height: 1.55 !important;
    }

    .btn-warning,
    .btn-outline-light {
        width: 100% !important;
        max-width: 100%;
    }

    .hero-section .d-flex.flex-wrap {
        flex-direction: column;
        align-items: stretch !important;
    }

    .cont-from-st .form-control,
    .quote-right .form-control,
    #quoteModal .form-control {
        font-size: 16px; /* prevents iOS zoom on focus */
    }

    .global-cta-wrap {
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    body {
        padding-bottom: calc(72px + env(safe-area-inset-bottom, 0));
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .hero-section h1,
    .hero-section .display-4 {
        font-size: clamp(1.75rem, 4vw, 2.5rem) !important;
        line-height: 1.2 !important;
    }
}

/* CMS rich text — same heading color in descriptions (h2–h5) */
.asb-about-prose h2,
.asb-about-prose h3,
.asb-about-prose h4,
.asb-about-prose h5,
.asb-app-prose h2,
.asb-app-prose h3,
.asb-app-prose h4,
.asb-app-prose h5,
.asb-application-prose h2,
.asb-application-prose h3,
.asb-application-prose h4,
.asb-application-prose h5,
.asb-article-body h2,
.asb-article-body h3,
.asb-article-body h4,
.asb-article-body h5,
.content-text h2,
.content-text h3,
.content-text h4,
.content-text h5,
.content .content-text h2,
.content .content-text h3,
.content .content-text h4,
.content .content-text h5,
.product-text h2,
.product-text h3,
.product-text h4,
.product-text h5,
.sale-card h2,
.sale-card h3,
.sale-card h4,
.sale-card h5,
.manu-content h2,
.manu-content h3,
.manu-content h4,
.manu-content h5 {
    color: #0f172a !important;
}

/* Product overview dark card — keep headings light, body #94a3b8 */
.asb-product-single .asb-ps-overview-prose.manu-content h2,
.asb-product-single .asb-ps-overview-prose.manu-content h3,
.asb-product-single .asb-ps-overview-prose.manu-content h4,
.asb-product-single .asb-ps-overview-prose.manu-content h5,
.asb-product-single .asb-ps-overview-prose .manu-content h2,
.asb-product-single .asb-ps-overview-prose .manu-content h3,
.asb-product-single .asb-ps-overview-prose .manu-content h4,
.asb-product-single .asb-ps-overview-prose .manu-content h5,
.asb-product-single .asb-ps-overview-prose h2,
.asb-product-single .asb-ps-overview-prose h3,
.asb-product-single .asb-ps-overview-prose h4,
.asb-product-single .asb-ps-overview-prose h5 {
    color: #f8fafc !important;
}

/* CMS rich text — same in-content link style (about, product, application, blog) */
.asb-about-prose a,
.asb-app-prose a,
.asb-application-prose a,
.asb-article-body a,
.content-text a,
.content .content-text a {
    color: #bd9007;
    font-weight: 600;
    text-decoration: none;
}

.asb-about-prose a:hover,
.asb-app-prose a:hover,
.asb-application-prose a:hover,
.asb-article-body a:hover,
.content-text a:hover,
.content .content-text a:hover {
    color: #1e293b;
    text-decoration: none;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
