.page-localized .language-menu a[aria-current="page"] {
    color: var(--primary-color, #1685c5);
    font-weight: 700;
}

html[dir="rtl"] body {
    direction: rtl;
    text-align: right;
}

/* Arabic pages use one consistent reading and layout direction. */
html[dir="rtl"] main,
html[dir="rtl"] main section,
html[dir="rtl"] main .container,
html[dir="rtl"] main header,
html[dir="rtl"] main article,
html[dir="rtl"] main aside,
html[dir="rtl"] main div,
html[dir="rtl"] main form,
html[dir="rtl"] footer,
html[dir="rtl"] footer .container {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6,
html[dir="rtl"] p,
html[dir="rtl"] li,
html[dir="rtl"] dt,
html[dir="rtl"] dd,
html[dir="rtl"] label,
html[dir="rtl"] legend,
html[dir="rtl"] th,
html[dir="rtl"] td,
html[dir="rtl"] figcaption {
    text-align: right !important;
}

html[dir="rtl"] main .products-hero-content,
html[dir="rtl"] main .home-hero-content,
html[dir="rtl"] main .article-hero-inner,
html[dir="rtl"] main .hero-content,
html[dir="rtl"] main .section-header,
html[dir="rtl"] main .section-intro {
    text-align: right !important;
}

html[dir="rtl"] body :is(.home-hero, .about-hero, .case-hero, .certs-hero, .contact-hero, .downloads-hero, .faq-hero, .partners-hero, .advisor-hero, .article-hero, .insights-hero, .legal-hero, .page-hero) :is(.hero-title, h1, h2, p) {
    text-align: right !important;
}

html[dir="rtl"] .header-content,
html[dir="rtl"] .top-utility-content,
html[dir="rtl"] .nav-menu,
html[dir="rtl"] .hero-buttons,
html[dir="rtl"] .footer-content,
html[dir="rtl"] .footer-bottom,
html[dir="rtl"] .breadcrumb,
html[dir="rtl"] .partner-contact-row,
html[dir="rtl"] .inline-contact-row {
    direction: rtl;
}

html[dir="rtl"] .header-content,
html[dir="rtl"] .main-nav,
html[dir="rtl"] .nav-menu,
html[dir="rtl"] .top-utility-content,
html[dir="rtl"] .top-utility-nav,
html[dir="rtl"] .footer-content,
html[dir="rtl"] .footer-bottom {
    text-align: right;
}

html[dir="rtl"] .hero-buttons,
html[dir="rtl"] .card-actions,
html[dir="rtl"] .product-actions,
html[dir="rtl"] .article-meta,
html[dir="rtl"] .breadcrumb {
    justify-content: flex-start;
}

html[dir="rtl"] ul,
html[dir="rtl"] ol {
    padding-right: 1.35em;
    padding-left: 0;
}

html[dir="rtl"] .nav-menu,
html[dir="rtl"] .language-menu,
html[dir="rtl"] .sub-menu,
html[dir="rtl"] .footer-links {
    padding-right: 0;
}

html[dir="rtl"] .sub-menu,
html[dir="rtl"] .site-search-results {
    left: auto;
    right: 0;
    text-align: right;
}

html[dir="rtl"] .language-menu {
    left: 0;
    right: auto;
    text-align: right;
}

html[dir="rtl"] input,
html[dir="rtl"] select,
html[dir="rtl"] textarea {
    text-align: right;
}

html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] a[href^="mailto:"],
html[dir="rtl"] a[href^="tel:"] {
    direction: ltr;
    unicode-bidi: embed;
}

html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="tel"] {
    text-align: right;
}

html[dir="rtl"] .fa-chevron-right,
html[dir="rtl"] .fa-arrow-right,
html[dir="rtl"] .fa-arrow-left {
    transform: scaleX(-1);
}

/* Arabic visual alignment: reading content stays RTL, presentation CTAs stay centered. */
html[dir="rtl"] :is(.b2b-content, .b2b-cta-content, .become-partner-cta, .faq-contact-cta, .downloads-cta .cta-content) {
    direction: rtl;
    text-align: center !important;
}

html[dir="rtl"] :is(.b2b-content, .b2b-cta-content, .become-partner-cta, .faq-contact-cta, .downloads-cta .cta-content) :is(h2, h3, p) {
    text-align: center !important;
}

html[dir="rtl"] :is(.b2b-content, .b2b-cta-content, .become-partner-cta, .faq-contact-cta, .downloads-cta .cta-content) :is(.hero-buttons, .cta-buttons) {
    justify-content: center !important;
}

html[dir="rtl"] :is(.b2b-content, .b2b-cta-content, .become-partner-cta, .faq-contact-cta, .downloads-cta .cta-content) > .btn,
html[dir="rtl"] :is(.b2b-content, .b2b-cta-content, .become-partner-cta, .faq-contact-cta, .downloads-cta .cta-content) .cta-buttons .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    height: auto;
    text-align: center !important;
}

html[dir="rtl"] .b2b-features {
    direction: rtl;
    justify-content: center;
}

html[dir="rtl"] .b2b-feature {
    direction: rtl;
    justify-content: center;
    text-align: center !important;
}

/* Editorial statements and ordinary cards follow the Arabic reading edge. */
html[dir="rtl"] :is(.manifesto-content, .manifesto-content blockquote, .manifesto-signature) {
    direction: rtl;
    text-align: right !important;
}

html[dir="rtl"] :is(.about-card, .about-region, .category-card, .home-insight-card) {
    direction: rtl;
    text-align: right !important;
}

html[dir="rtl"] :is(.about-card, .about-region, .category-card, .home-insight-card) :is(h2, h3, p) {
    text-align: right !important;
}

/* Insights landing page uses dedicated hero and newsletter components. */
html[dir="rtl"] body.page-insights:not(.page-insight-article) .insights-hero,
html[dir="rtl"] body.page-insights:not(.page-insight-article) .insights-hero .container {
    direction: rtl;
    text-align: right !important;
}

html[dir="rtl"] body.page-insights:not(.page-insight-article) .insights-hero :is(h1, h2, p) {
    margin-right: 0;
    margin-left: auto;
    text-align: right !important;
}

html[dir="rtl"] body.page-insights:not(.page-insight-article) .insights-hero .hero-actions {
    direction: rtl;
    justify-content: flex-start !important;
}

html[dir="rtl"] body.page-insights:not(.page-insight-article) .newsletter-content {
    direction: rtl;
    text-align: center !important;
}

html[dir="rtl"] body.page-insights:not(.page-insight-article) .newsletter-content :is(i, h2, p) {
    display: block;
    text-align: center !important;
}

html[dir="rtl"] body.page-insights:not(.page-insight-article) .newsletter-content .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    text-align: center !important;
}

/* Downloads uses its own custom request CTA above the footer. */
html[dir="rtl"] body.page-downloads .custom-request .request-content {
    direction: rtl;
    text-align: center !important;
}

html[dir="rtl"] body.page-downloads .custom-request .request-content :is(i, h2, p) {
    display: block;
    text-align: center !important;
}

html[dir="rtl"] body.page-downloads .custom-request .request-buttons {
    direction: rtl;
    justify-content: center !important;
}

html[dir="rtl"] body.page-downloads .custom-request .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    text-align: center !important;
}

html[dir="rtl"] .about-card .about-fa-icon {
    margin-right: 0;
    margin-left: auto;
}

/* Footer contact rows: icon at the Arabic start edge, text alongside it. */
html[dir="rtl"] .footer-contact-item,
html[dir="rtl"] .footer-icon-link {
    direction: rtl !important;
    text-align: right !important;
    min-width: 0;
    max-width: 100%;
}

html[dir="rtl"] .footer-icon-link {
    justify-content: flex-start;
}

html[dir="rtl"] .footer-icon-link span {
    text-align: right !important;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

html[dir="rtl"] .footer-icon-link[href^="mailto:"] span,
html[dir="rtl"] .footer-icon-link[href^="tel:"] span,
html[dir="rtl"] .footer-icon-link[href*="wa.me"] span {
    direction: ltr;
    unicode-bidi: isolate;
}

/* Keep anti-spam fields accessible to form logic without widening RTL pages. */
html[dir="rtl"] .form-honeypot {
    position: fixed !important;
    inset: 0 auto auto 0 !important;
    clip-path: inset(50%) !important;
}

html[lang="ar"] body.page-products .page-hero {
    background-image:
        linear-gradient(270deg, rgba(30, 41, 59, .92) 0%, rgba(71, 85, 105, .78) 43%, rgba(148, 163, 184, .22) 72%, rgba(203, 213, 225, .04) 100%),
        url("../images/banners/products-retail-shelf-ar.webp") !important;
    background-position: center center !important;
}

/* Mirror the desktop visual weight of photographic heroes for RTL copy. */
@media (min-width: 769px) {

    html[dir="rtl"] body.page-home .home-hero-media {
        transform: scaleX(-1);
    }

    html[dir="rtl"] body.page-home .home-hero-overlay {
        background: linear-gradient(270deg, rgba(15, 124, 193, .96) 0%, rgba(15, 124, 193, .80) 43%, rgba(15, 124, 193, .22) 76%, rgba(15, 124, 193, .06) 100%) !important;
    }

    html[dir="rtl"] body.page-contact .contact-hero {
        background: linear-gradient(270deg, rgba(7, 38, 68, .78) 0%, rgba(15, 124, 193, .5) 44%, rgba(255, 255, 255, .12) 100%), url("../images/contact-banner.webp") center center / cover no-repeat !important;
    }

    html[dir="rtl"] body.page-partners .partners-hero {
        background: linear-gradient(270deg, rgba(9, 42, 73, .96) 0%, rgba(22, 88, 139, .9) 55%, rgba(46, 116, 181, .72) 100%), url("../images/for-partners.webp") center / cover no-repeat !important;
    }

    html[dir="rtl"] body.page-insights:not(.page-insight-article) .insights-hero {
        background: linear-gradient(270deg, rgba(7, 38, 68, .78) 0%, rgba(15, 124, 193, .48) 46%, rgba(255, 255, 255, .12) 100%), url("../images/insights-banner.webp") center center / cover no-repeat !important;
    }

    html[dir="rtl"] body.page-case-studies .case-hero.resource-hero {
        background:
            linear-gradient(270deg, rgba(9, 42, 73, .90) 0%, rgba(22, 88, 139, .68) 52%, rgba(46, 116, 181, .18) 100%),
            url("../images/partners-use-cases.png") center center / cover no-repeat !important;
    }

    html[dir="rtl"] body.page-faq .faq-hero.resource-hero {
        background:
            linear-gradient(270deg, rgba(9, 42, 73, .90) 0%, rgba(22, 88, 139, .68) 52%, rgba(46, 116, 181, .20) 100%),
            url("../images/distributor-faq.png") center center / cover no-repeat !important;
    }

    html[dir="rtl"] body.page-certifications .certs-hero.resource-hero {
        background:
            linear-gradient(270deg, rgba(9, 42, 73, .90) 0%, rgba(22, 88, 139, .68) 52%, rgba(46, 116, 181, .20) 100%),
            url("../images/certifications-documentation.webp") center center / cover no-repeat !important;
    }

    html[dir="rtl"] body.page-downloads .downloads-hero.resource-hero {
        background:
            linear-gradient(270deg, rgba(9, 42, 73, .90) 0%, rgba(22, 88, 139, .68) 52%, rgba(46, 116, 181, .20) 100%),
            url("../images/download-center.webp") center center / cover no-repeat !important;
    }
}

/* Russian strings are often substantially longer than their English source. */
html[lang="ru"] main :is(section, article, aside, header, div, form),
html[lang="ru"] main :is(.container, [class*="grid"], [class*="card"], [class*="panel"]),
html[lang="ru"] footer :is(div, ul, li) {
    min-width: 0;
}

html[lang="ru"] :is(h1, h2, h3, h4, h5, h6, p, a, button, label, legend, dt, dd, th, td, summary) {
    overflow-wrap: anywhere;
    word-break: normal;
    hyphens: auto;
}

html[lang="ru"] :is(input, select, textarea) {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
}

html[lang="ru"] :is(.btn, button, input[type="submit"]) {
    white-space: normal;
    height: auto;
    min-height: 48px;
    line-height: 1.3;
    text-align: center;
}

html[lang="ru"] :is(.btn, button, input[type="submit"]) {
    align-items: center;
    justify-content: center;
}

html[lang="ru"] .footer-contact-item,
html[lang="ru"] .footer-contact-item a {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

html[lang="ru"] body.page-products .product-card h3,
html[lang="ru"] body.page-product .product-title {
    max-width: 100%;
    overflow-wrap: anywhere;
}

html[lang="ru"] body.page-product .product-hero,
html[lang="ru"] body.page-product .product-hero > .container,
html[lang="ru"] body.page-product .product-hero-grid,
html[lang="ru"] body.page-product .product-info {
    min-width: 0;
    max-width: 100%;
}

html[lang="ru"] body.page-product .product-hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

html[lang="ru"] body.page-product .product-title {
    font-size: clamp(36px, 3.6vw, 52px);
    line-height: 1.08;
}

html[lang="ru"] body.page-case-studies .case-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

html[lang="ru"] body.page-case-studies .case-stats :is(dt, dd) {
    font-size: 12px;
    overflow-wrap: anywhere;
}

@media (min-width: 993px) {
    html[lang="ru"] .header-content {
        grid-template-columns: 240px minmax(500px, 1fr) 190px;
        gap: 18px;
    }

    html[lang="ru"] .main-nav .nav-menu {
        gap: 14px;
    }

    html[lang="ru"] .main-nav .nav-menu > li > a {
        font-size: 13px;
        letter-spacing: -0.01em;
        white-space: nowrap;
        overflow-wrap: normal;
        word-break: keep-all;
        hyphens: none;
    }

    html[lang="ru"] .site-search {
        width: min(190px, 17vw);
    }

    html[lang="ru"] .header-actions {
        width: 100%;
        min-width: 0;
    }

    html[lang="ru"] body:is(.page-products, .page-product, .page-fulgent-advisor) .product-logo-lockup .brand-logo {
        flex: 0 0 112px;
        width: 112px;
    }

    html[lang="ru"] body:is(.page-products, .page-product, .page-fulgent-advisor) .product-logo-lockup .brand-logo img {
        width: 112px;
        height: auto;
        max-height: 50px;
        flex: none;
    }

    html[lang="ru"] body.page-home .home-hero .hero-title {
        max-width: 820px;
        font-size: clamp(42px, 3.6vw, 50px) !important;
        line-height: 1.04 !important;
    }

    html[lang="ru"] body.page-home .proof-item {
        min-width: 0;
    }

    html[lang="ru"] body.page-home .proof-item span:not(.proof-flag-ca) {
        min-width: 0;
        max-width: 100%;
        font-size: 16px;
        line-height: 1.18;
        overflow-wrap: anywhere;
    }

    html[lang="ru"] body.page-products .page-hero .hero-title {
        max-width: 820px;
        font-size: clamp(40px, 3.3vw, 48px) !important;
        line-height: 1.06 !important;
        letter-spacing: -0.025em;
    }

    html[lang="ru"] body.page-products .page-hero .hero-subtitle {
        max-width: 720px;
        font-size: 17px;
        line-height: 1.55;
    }

    html[lang="ru"] body.page-products .page-hero .hero-buttons .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 52px;
        text-align: center;
    }

    html[lang="ru"] body.page-product .product-hero {
        padding: 38px 0 46px;
    }

    html[lang="ru"] body.page-product .product-hero > .container {
        max-width: 1180px;
    }

    html[lang="ru"] body.page-product .product-hero-grid {
        grid-template-columns: minmax(0, .84fr) minmax(0, 1.16fr);
        gap: 32px;
        align-items: start;
    }

    html[lang="ru"] body.page-product .product-gallery .main-image {
        aspect-ratio: auto;
        height: clamp(460px, 46vw, 520px);
        max-height: 520px;
        padding: 18px;
    }

    html[lang="ru"] body.page-product .product-info {
        align-self: start;
        min-height: 520px;
        padding: 32px;
    }

    html[lang="ru"] body.page-product .product-title {
        font-size: clamp(34px, 2.8vw, 42px) !important;
        line-height: 1.08 !important;
        letter-spacing: -0.025em;
    }
}

@media (min-width: 993px) and (max-width: 1320px) {
    html[lang="ru"] .header-content {
        grid-template-columns: 220px minmax(460px, 1fr) 180px;
        gap: 12px;
    }

    html[lang="ru"] .main-nav .nav-menu {
        gap: 10px;
    }

    html[lang="ru"] .main-nav .nav-menu > li > a {
        font-size: 12px;
    }

    html[lang="ru"] .site-search {
        width: 180px;
    }
}

@media (max-width: 768px) {
    html[lang="ru"] body.page-product .product-hero-grid,
    html[lang="ru"] body.page-case-studies .case-stats {
        grid-template-columns: 1fr;
    }

    html[lang="ru"] body.page-product .product-title {
        font-size: clamp(30px, 9vw, 42px);
    }
}

/* Keep the product-brand lockup in its designed visual order in RTL headers. */
html[dir="rtl"] body:is(.page-products, .page-product, .page-fulgent-advisor) .product-logo-lockup {
    direction: ltr;
    flex-direction: row;
}
