/**
 * Mobile polish — load sau custom CSS của từng trang.
 * Tối ưu landing page import HTML + block builder trên điện thoại.
 */

@media (max-width: 991.98px) {
    .lp-page :is(.hero-grid, .form-wrap, .adaptive-card, .price-card, .final-grid) {
        grid-template-columns: 1fr !important;
        gap: 1.25rem;
    }

    .lp-page :is(.feature-grid, .feature-grid-4, .skill-grid) {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 1rem;
    }
}

@media (max-width: 767.98px) {
    body.lp-page {
        overflow-x: clip;
        font-size: 16px;
        line-height: 1.6;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    .lp-page .container,
    .lp-page .lp-container {
        width: min(100% - 32px, 1180px);
        --lp-content-gutter: 16px;
    }

    /* ── Navigation ── */
    .lp-page .topbar {
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .lp-page .nav {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0.75rem 0;
    }

    .lp-page .brand {
        justify-content: center;
        text-align: center;
        font-size: 0.95rem;
    }

    .lp-page .nav-cta {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }

    .lp-page .nav-cta .mini-pill {
        display: none;
    }

    .lp-page .nav-cta .btn {
        width: 100%;
        justify-content: center;
        min-height: 48px;
    }

    /* ── Typography ── */
    .lp-page :is(h1, .hero h1) {
        font-size: clamp(1.65rem, 7.5vw, 2.35rem) !important;
        line-height: 1.12 !important;
        letter-spacing: -0.02em !important;
        word-break: normal;
        overflow-wrap: break-word;
    }

    .lp-page :is(h2, .section-title h2, .form-intro h2) {
        font-size: clamp(1.35rem, 5.5vw, 1.85rem) !important;
        line-height: 1.15 !important;
        letter-spacing: -0.01em !important;
    }

    .lp-page :is(h3, .feature h3) {
        font-size: 1.05rem !important;
        line-height: 1.3 !important;
    }

    .lp-page :is(p, .feature p, .subline) {
        font-size: 0.95rem;
        line-height: 1.55;
    }

    .lp-heading {
        font-size: clamp(1.35rem, 5.5vw, 1.85rem);
        line-height: 1.15;
    }

    /* ── Sections & spacing ── */
    .lp-page :is(.hero, .section, .top-image-section) {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    .lp-page .form-section {
        margin-top: 0;
    }

    .lp-page .section-title {
        margin-bottom: 1.25rem;
        padding-inline: 0.25rem;
    }

    /* ── Hero ── */
    .lp-page .hero-grid {
        gap: 1rem !important;
    }

    .lp-page .hero-copy {
        padding: 1.35rem 1.15rem !important;
    }

    .lp-page .shape-card {
        border-radius: 20px;
    }

    .lp-page .visual-card {
        min-height: auto !important;
        padding: 1.25rem !important;
    }

    .lp-page .edu-icons {
        display: none;
    }

    .lp-page .student-ill {
        width: min(300px, 88%);
        margin-inline: auto;
    }

    .lp-page .hero-actions {
        display: grid !important;
        gap: 0.65rem;
        width: 100%;
    }

    .lp-page .hero-actions .btn {
        width: 100%;
        min-height: 48px;
    }

    .lp-page .benefits {
        gap: 0.5rem;
        justify-content: center;
    }

    .lp-page .benefits li {
        font-size: 0.8rem;
        padding: 0.45rem 0.75rem;
    }

    .lp-page .trust-note {
        text-align: center;
        font-size: 0.82rem;
    }

    /* ── Feature / skill cards ── */
    .lp-page :is(.feature-grid, .feature-grid-4, .skill-grid, .form-row) {
        grid-template-columns: 1fr !important;
        gap: 0.85rem !important;
    }

    .lp-page .feature,
    .lp-page .skill-card {
        padding: 1.15rem !important;
        border-radius: 18px;
    }

    .lp-page .feature-icon {
        width: 48px;
        height: 48px;
        font-size: 1.35rem;
        border-radius: 14px;
        margin-bottom: 0.75rem;
    }

    .lp-page .feature p,
    .lp-page .skill-card p {
        font-size: 0.9rem;
    }

    /* ── Form ── */
    .lp-page .form-wrap {
        gap: 1rem !important;
    }

    .lp-page .form-intro {
        padding: 1.35rem !important;
        border-radius: 20px;
        text-align: center;
    }

    .lp-page :is(.lead-form, .final-form) {
        padding: 1.15rem !important;
        border-radius: 18px;
        gap: 0.85rem;
    }

    .lp-page .field label {
        font-size: 0.82rem;
        margin-bottom: 0.35rem;
    }

    .lp-page .field :is(input:not([type="radio"]):not([type="checkbox"]), select, textarea) {
        font-size: 16px !important;
        min-height: 48px;
        padding: 0.75rem 0.9rem !important;
        border-radius: 14px !important;
    }

    .lp-page .privacy {
        font-size: 0.75rem;
        line-height: 1.45;
        text-align: center;
    }

    /* ── Price / adaptive / final CTA ── */
    .lp-page .price-card {
        padding: 1.35rem !important;
        text-align: center;
        gap: 1rem !important;
    }

    .lp-page .adaptive-card {
        gap: 1rem !important;
    }

    .lp-page .final-lead {
        padding: 1.35rem !important;
        border-radius: 20px;
    }

    .lp-page .final-grid {
        gap: 1rem !important;
    }

    .lp-page .hotline-pill {
        width: 100%;
        justify-content: center;
    }

    /* ── Buttons ── */
    .lp-page .btn,
    .lp-page .lp-btn {
        width: 100%;
        max-width: 100%;
        min-height: 48px;
        padding: 0.8rem 1.15rem;
        white-space: normal;
        text-align: center;
        justify-content: center;
        font-size: 0.95rem;
        border-radius: 999px;
    }

    .lp-page .hero-actions .btn,
    .lp-page .nav-cta .btn {
        max-width: none;
    }

    /* ── Images & media ── */
    .lp-page :is(img, video, iframe, svg) {
        max-width: 100%;
        height: auto;
    }

    .lp-page .top-image-card {
        border-radius: 18px;
    }

    .lp-page .top-image-card img {
        aspect-ratio: 16 / 10;
    }

    .lp-page .map-svg {
        padding: 0.75rem;
        border-radius: 16px;
    }

    /* ── Layout blocks ── */
    .lp-row-block {
        --lp-block-width: 100%;
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    .lp-flex-layout-split,
    .lp-flex-layout-grid {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }

    .lp-flex-layout-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .lp-flex-layout-free {
        min-height: 0;
    }

    .lp-flex-layout-free .lp-flex-el {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 0.75rem;
    }

    .lp-flex-col-left,
    .lp-flex-col-right {
        width: 100%;
        max-width: 100%;
    }

    .lp-flex-inline-form .form-control,
    .lp-flex-inline-form .form-select {
        font-size: 16px;
        min-height: 48px;
    }

    /* ── Floating CTA ── */
    .lp-page :is(.floating-cta, .lp-floating-cta) {
        left: 12px;
        right: 12px;
        bottom: max(12px, env(safe-area-inset-bottom));
    }

    .lp-page :is(.floating-cta .btn, .lp-floating-cta .lp-btn) {
        width: 100%;
        box-shadow: 0 8px 28px rgba(15, 76, 129, 0.22);
    }

    /* ── Footer ── */
    .lp-page .footer {
        padding: 2rem 0 2.5rem;
        font-size: 0.85rem;
        line-height: 1.5;
    }
}

@media (max-width: 380px) {
    .lp-page .container,
    .lp-page .lp-container {
        width: min(100% - 24px, 1180px);
    }

    .lp-page .hero-copy {
        padding: 1.1rem 0.95rem !important;
    }

    .lp-page .feature,
    .lp-page .skill-card {
        padding: 1rem !important;
    }
}
