/* Theme 5 mobile acceptance follow-up.
 * Keep language switching visible in the mobile header, avoid stacking two
 * proof/list systems at the Hero -> Trust transition, and keep the final
 * phone composition compact enough to scan without flattening the hierarchy.
 */

body.vntech-theme5 .vn-language-switcher--mobile-header {
    display: none;
}

@media (max-width: 720px) {
    body.vntech-theme5 {
        /* Keep the Back-to-top control and AI launcher on one shared mobile
         * floating rail. iOS safe-area insets can lift the AI root above the
         * nominal edge, so the scroll control must resolve from the same edge. */
        --t5-floating-bottom-edge: max(var(--t5-floating-edge), env(safe-area-inset-bottom, 0px));
        --t5-ai-launcher-size: 46px;
        --t5-floating-size: 46px;
        --t5-floating-gap: 10px;
    }

    body.vntech-theme5 .site-header__actions {
        gap: 6px;
    }

    body.vntech-theme5 .site-header__actions > .vn-language-switcher--desktop {
        display: none;
    }

    body.vntech-theme5 .site-header__actions > .vn-language-switcher--mobile-header {
        display: inline-flex;
        flex: 0 0 auto;
        padding: 2px;
        border-radius: 7px;
    }

    body.vntech-theme5 .vn-language-switcher--mobile-header .vn-language-switcher__link {
        min-width: 30px;
        min-height: 34px;
        padding: 4px 5px;
        border-radius: 5px;
        font-size: 11px;
    }

    /* VNTech AI Core owns the widget itself; the theme only coordinates the
     * closed launcher with the other site-level floating control. */
    body.vntech-theme5 .vntech-ai-widget:not(.is-open) {
        right: var(--t5-floating-edge) !important;
        bottom: var(--t5-floating-bottom-edge) !important;
        left: auto !important;
        width: var(--t5-ai-launcher-size);
        height: var(--t5-ai-launcher-size);
        /* The legacy homepage stylesheet previously scaled the closed widget
         * at this breakpoint. Keep the Theme 5 acceptance size literal. */
        transform: none !important;
    }

    body.vntech-theme5 .scroll-top--t5 {
        right: var(--t5-floating-edge) !important;
        bottom: calc(var(--t5-floating-bottom-edge) + var(--t5-ai-launcher-size) + var(--t5-floating-gap)) !important;
        left: auto !important;
        width: var(--t5-floating-size) !important;
        height: var(--t5-floating-size) !important;
    }
}

@media (max-width: 620px) {
    /* Theme 5.5.15 embeds the Trust principles into the Hero proof rail.
     * Keep that proof surface visible on phones; the standalone Trust section
     * is suppressed by the final homepage polish layer. */
    body.vntech-theme5 .t5-owner--hero .t5-hero__proof {
        display: block;
        padding-left: 0;
        border-left: 0;
    }

    body.vntech-theme5 .t5-owner--hero .t5-hero__grid {
        gap: 24px;
    }

    /* Trust is a quick proof index on phones, not a dense information card.
     * Preserve the supporting descriptions in the accessibility tree while
     * keeping the visual band readable in one contained column. */
    body.vntech-theme5 .t5-owner--trust .t5-trust__group--static {
        grid-template-columns: minmax(0, 1fr);
    }

    body.vntech-theme5 .t5-owner--trust .t5-trust__group--static article {
        position: relative;
        min-height: 64px;
        grid-template-columns: 28px minmax(0, 1fr);
        gap: 10px;
        align-items: center;
        padding: 11px 12px;
        border-right: 0;
        border-bottom: 1px solid #e5ebf2;
    }

    body.vntech-theme5 .t5-owner--trust .t5-trust__group--static article:last-child {
        border-bottom: 0;
    }

    body.vntech-theme5 .t5-owner--trust .t5-trust__icon {
        width: 28px;
        height: 28px;
        font-size: 8.5px;
    }

    body.vntech-theme5 .t5-owner--trust .t5-trust__group--static strong {
        font-size: 11.75px;
        line-height: 1.28;
    }

    body.vntech-theme5 .t5-owner--trust .t5-trust__group--static small {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    /* Phone sections should feel like one editorial sequence. Projects joins
     * the same compact rhythm instead of retaining the desktop top/bottom gap. */
    body.vntech-theme5 .t5-owner--services .t5-services,
    body.vntech-theme5 .t5-owner--projects .t5-projects,
    body.vntech-theme5 .t5-owner--why .t5-why,
    body.vntech-theme5 .t5-owner--ai-product .t5-ai-product {
        padding-block: 38px;
    }

    body.vntech-theme5 .t5-owner--services .t5-services .t5-section-head,
    body.vntech-theme5 .t5-owner--projects .t5-projects .t5-section-head,
    body.vntech-theme5 .t5-owner--why .t5-section-head {
        margin-bottom: 18px;
    }

    body.vntech-theme5 :is(.t5-owner--services, .t5-owner--projects, .t5-owner--why) .t5-section-head h2 {
        font-size: clamp(28px, 7.8vw, 32px);
        line-height: 1.04;
    }

    body.vntech-theme5 :is(.t5-owner--services, .t5-owner--projects, .t5-owner--why) .t5-section-head > p:not(.t5-eyebrow),
    body.vntech-theme5 .t5-owner--why .t5-why__intro {
        font-size: 12.5px;
        line-height: 1.5;
    }

    /* Services become compact editorial rows: number at left, useful copy at
     * right. This removes the repeated icon-above-copy whitespace that made
     * the mobile page unnecessarily long. */
    body.vntech-theme5 .t5-owner--services .t5-service-card {
        display: grid;
        min-height: 0;
        grid-template-columns: 32px minmax(0, 1fr);
        column-gap: 12px;
        align-items: start;
        padding: 15px 0;
    }

    body.vntech-theme5 .t5-owner--services .t5-service-card__icon {
        grid-column: 1;
        grid-row: 1 / span 3;
        width: 30px;
        height: 30px;
        margin: 1px 0 0;
        border-radius: 7px;
    }

    body.vntech-theme5 .t5-owner--services .t5-service-card h3,
    body.vntech-theme5 .t5-owner--services .t5-service-card p,
    body.vntech-theme5 .t5-owner--services .t5-service-card > a {
        grid-column: 2;
    }

    body.vntech-theme5 .t5-owner--services .t5-service-card h3 {
        max-width: none;
        margin: 0 0 4px;
        font-size: 16px;
        line-height: 1.22;
    }

    body.vntech-theme5 .t5-owner--services .t5-service-card p {
        margin: 0 0 8px;
        font-size: 12.25px;
        line-height: 1.44;
    }

    body.vntech-theme5 .t5-owner--services .t5-service-card > a {
        display: inline-flex;
        min-height: 28px;
        align-items: center;
        margin-top: 0;
        font-size: 11.25px;
    }

    body.vntech-theme5 .t5-owner--projects .t5-projects__grid {
        gap: 12px;
    }

    body.vntech-theme5 .t5-owner--projects .t5-project-card__media {
        background: linear-gradient(135deg, #eef3f9 0%, #e5edf7 100%);
    }

    body.vntech-theme5 .t5-owner--projects .t5-project-card__body {
        padding: 14px 15px 16px;
    }

    body.vntech-theme5 .t5-owner--why .t5-why__grid article {
        display: grid;
        min-height: 0;
        grid-template-columns: 34px minmax(0, 1fr);
        column-gap: 12px;
        align-items: start;
        padding: 16px 0;
    }

    body.vntech-theme5 .t5-owner--why .t5-why__grid article::after {
        display: none;
    }

    body.vntech-theme5 .t5-owner--why .t5-why__grid article > span {
        grid-row: 1 / span 2;
        width: 34px;
        height: 28px;
        margin: 0;
        border-radius: 7px;
    }

    body.vntech-theme5 .t5-owner--why .t5-why__grid h3 {
        max-width: none;
        margin: 0 0 5px;
        font-size: 14px;
        line-height: 1.26;
    }

    body.vntech-theme5 .t5-owner--why .t5-why__grid p {
        grid-column: 2;
        font-size: 11.5px;
        line-height: 1.44;
    }

    /* AI remains a feature section, but the phone headline should not consume
     * most of a viewport before useful description/actions appear. */
    body.vntech-theme5 .t5-owner--ai-product .t5-ai-product__surface {
        gap: 22px;
    }

    body.vntech-theme5 .t5-owner--ai-product .t5-ai-product__copy h2 {
        max-width: none;
        margin-bottom: 9px;
        font-size: clamp(27px, 7.4vw, 31px);
        line-height: 1.07;
    }

    body.vntech-theme5 .t5-owner--ai-product .t5-ai-product__copy > p:not(.t5-eyebrow) {
        font-size: 12.75px;
        line-height: 1.5;
    }

    body.vntech-theme5 .t5-owner--ai-product .t5-ai-product__copy ul {
        gap: 6px;
        margin-block: 13px 17px;
    }

    /* Give the conversion close its own blue-navy band before the darker
     * footer so the final page does not read as one continuous dark block. */
    body.vntech-theme5 .t5-owner--contact .t5-contact {
        padding-top: 28px;
        background: linear-gradient(180deg, #eef4fb 0%, #e6eef8 100%);
    }

    body.vntech-theme5 .t5-owner--contact .t5-contact__surface {
        gap: 18px;
        padding: 22px;
        background: linear-gradient(135deg, #082553, #0d3b7c);
    }

    body.vntech-theme5 .t5-owner--contact .t5-contact__surface h2 {
        font-size: clamp(27px, 7.6vw, 32px);
        line-height: 1.06;
    }

    body.vntech-theme5 .site-footer--t5 .site-footer__inner {
        padding-block: 20px 12px;
    }

    body.vntech-theme5 .site-footer--t5 .site-footer__grid {
        gap: 12px;
    }
}

@media (max-width: 360px) {
    body.vntech-theme5 .site-header__actions {
        gap: 4px;
    }

    body.vntech-theme5 .vn-language-switcher--mobile-header .vn-language-switcher__link {
        min-width: 27px;
        min-height: 32px;
        padding-inline: 4px;
        font-size: 10px;
    }

    body.vntech-theme5 .t5-owner--trust .t5-trust__group--static article {
        padding-inline: 10px;
    }

    body.vntech-theme5 .t5-owner--trust .t5-trust__group--static strong {
        font-size: 11.25px;
    }
}
