/* ==========================================================================
   VER5 — nạp sau styles.css, styles-v3.css, styles-form.css
   Chỉ trình bày: tiêu đề, minh hoạ béc popup, CTA sau bằng chứng,
   quy trình sau khi gửi form, thanh CTA dính đáy trên điện thoại.
   ========================================================================== */

/* ---------- Tiêu đề: tự ngắt dòng cân đối, không để từ mồ côi ---------- */
.hero-title,
.section-title,
.form-title,
.mech-title,
h3,
h4 {
    text-wrap: balance;
}

.btn,
.btn span {
    text-wrap: balance;
}

.hero-title-benefit {
    display: block;
    margin-top: 0.35em;
    font-size: 0.6em;
    font-style: italic;
    font-weight: 400;
    line-height: 1.3;
    color: var(--gold-light);
    letter-spacing: 0;
}

/* ---------- Giải pháp: minh hoạ cơ chế béc popup ---------- */
.mech {
    max-width: 960px;
    margin: 56px auto 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

.mech-media {
    margin: 0;
}

.mech-media img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1060 / 578;
    object-fit: cover;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.mech-media figcaption {
    margin-top: 10px;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
}

.mech-title {
    font-size: 1.6rem;
    margin: 8px 0 16px;
}

.mech-diagram {
    display: block;
    width: 100%;
    max-width: 400px;
    height: auto;
    margin: 0 0 18px;
}

.md-soil { fill: #8A6A4F; }
.md-grass { fill: none; stroke: #3F8F5A; stroke-width: 3; stroke-linejoin: round; }
.md-body { fill: #1F2A26; }
.md-cap { fill: #3A4A44; }
.md-spray { fill: none; stroke: #6FB8DF; stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 2 6; }
.md-label { font: 700 13px var(--font-body); fill: var(--primary-emerald); }
.md-sub { font: 500 12px var(--font-body); fill: var(--text-muted); }

.mech-points {
    margin: 0 0 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mech-points li {
    position: relative;
    padding-left: 26px;
    color: var(--text-main);
    line-height: 1.6;
}

.mech-points li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.45em;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-gold);
    box-shadow: inset 0 0 0 4px #FFF4DD;
}

/* ---------- Đánh giá: dấu ngoặc thay cho 5 sao ---------- */
.testimonial-mark {
    font-family: var(--font-heading);
    font-size: 3.2rem;
    line-height: 0.8;
    height: 28px;
    color: var(--accent-gold);
    margin-bottom: 12px;
}

/* ---------- CTA sau phần bằng chứng ---------- */
.proof-cta {
    max-width: 760px;
    margin: 48px auto 0;
    padding: 28px 32px;
    text-align: center;
    border-radius: var(--radius-md);
    background: var(--bg-white);
    border: 1px solid rgba(197, 160, 89, 0.35);
    box-shadow: var(--shadow-sm);
}

.proof-cta p {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-emerald);
    margin-bottom: 18px;
    text-wrap: balance;
}

/* ---------- Liên hệ: quy trình sau khi gửi (form = bước 1) ---------- */
.journey {
    margin: 32px 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.journey-step {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 12px 0;
}

.journey-step:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 17px;
    top: 50px;
    bottom: -10px;
    width: 2px;
    background: rgba(197, 160, 89, 0.3);
}

.journey-num {
    flex: 0 0 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--gold-light);
    border: 2px solid rgba(197, 160, 89, 0.55);
}

.journey-step.is-now .journey-num {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    color: var(--primary-emerald);
}

.journey-step strong {
    display: block;
    color: var(--text-white);
    font-size: 1rem;
}

.journey-step span:not(.journey-num) {
    display: block;
    color: var(--text-light);
    font-size: 0.92rem;
    line-height: 1.55;
}

.contact-direct {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-direct-phone {
    display: inline-flex;
    flex-direction: column;
    color: var(--text-white);
}

.contact-direct-phone span {
    font-size: 0.8rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent-gold);
    font-weight: 700;
}

.contact-direct-phone strong {
    font-size: 1.5rem;
    letter-spacing: 0.5px;
}

.contact-direct-phone:hover strong {
    color: var(--gold-light);
}

.contact-direct p {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.form-step {
    display: table;
    margin: 0 auto 10px;
    padding: 5px 14px;
    border-radius: 999px;
    background: #FFF4DD;
    color: #8A6A1F;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ---------- Thanh CTA dính đáy (điện thoại / máy tính bảng) ---------- */
.mobile-cta {
    display: none;
}

@media (max-width: 900px) {
    .mobile-cta {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 900;
        display: flex;
        gap: 10px;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
        background: rgba(9, 31, 24, 0.96);
        border-top: 1px solid rgba(197, 160, 89, 0.35);
        backdrop-filter: blur(8px);
        transition: transform 0.25s ease, opacity 0.25s ease;
    }

    .cta-bar-on .mobile-cta {
        transform: none;
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-cta a {
        min-height: 48px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        border-radius: var(--radius-sm);
        font-weight: 700;
        font-size: 0.95rem;
        text-align: center;
        line-height: 1.25;
    }

    .mobile-cta-call {
        flex: 0 0 auto;
        padding: 0 18px;
        color: var(--gold-light);
        border: 1px solid rgba(197, 160, 89, 0.6);
    }

    .mobile-cta-main {
        flex: 1 1 auto;
        padding: 0 12px;
        color: #FFFFFF;
        background: linear-gradient(135deg, var(--accent-gold) 0%, var(--gold-hover) 100%);
    }

    /* Mặc định ẩn. Chỉ hiện khi đã cuộn qua nút CTA đầu trang (.cta-bar-on) và form không đang hiện (.form-in-view) */
    .mobile-cta,
    .cta-bar-on.form-in-view .mobile-cta {
        transform: translateY(110%);
        opacity: 0;
        pointer-events: none;
    }

    /* Chừa chỗ cho thanh CTA để không che chân trang */
    body {
        padding-bottom: 76px;
    }

    .footer {
        padding-bottom: 30px;
    }
}

/* Ver5 bỏ nút "Gọi ngay" nổi của ver3 → bỏ luôn khoảng đệm 90px mà styles-v3.css chừa cho nó */
@media (min-width: 901px) and (max-width: 1024px) {
    .footer {
        padding-bottom: 30px;
    }
}

/* ---------- Sửa lỗi đọc / chạm trên điện thoại ---------- */
.mobile-toggle {
    padding: 12px 8px;
}

@media (max-width: 900px) {
    .mech {
        grid-template-columns: 1fr;
        gap: 28px;
        margin-top: 40px;
    }

    .mech-copy .btn {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .hero-img-badge,
    .hero-split .hero-img-badge {
        font-size: 0.8rem;
    }

    .proof-cta {
        padding: 22px 18px;
    }

    .proof-cta .btn {
        width: 100%;
    }

    .mech-title {
        font-size: 1.35rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mobile-cta {
        transition: none;
    }
}
