/* ==========================================================================
   COMPONENTS.CSS - Các lớp dùng chung trước đây bị thiếu định nghĩa
   (grid, section, button, product card, form, spec table, legal pages).
   Nạp SAU style.css và theme_60_30_10.css. Màu theo DESIGN_SYSTEM.md.
   ========================================================================== */

:root {
    --c-cream: #FAF7F2;
    --c-cream-2: #F3ECE2;
    --c-ink: #1A110B;
    --c-ink-2: #2C1D11;
    --c-walnut: #1A130E;
    --c-line: #DFD1C2;
    --c-line-dark: #382A21;
    --c-brass: #C58940;
    --c-brass-light: #E5A855;
    --c-ok: #2F7D4F;
    --c-warn: #9A5B12;
    --c-err: #B3261E;
}

/* ---------- Section & layout ---------- */
.section { padding: 64px 0; }
.section-dark { background: var(--c-cream-2); border-top: 1px solid var(--c-line); border-bottom: 1px solid var(--c-line); }
.section-header { margin-bottom: 32px; }
.section-header .badge, .container > .badge { display: inline-block; padding: 4px 14px; border-radius: 999px; font-size: 12px; letter-spacing: 0.08em; margin-bottom: 12px; }
.section-title { font-size: clamp(24px, 3.2vw, 34px); line-height: 1.25; margin: 0 0 10px; letter-spacing: 0.01em; }
.section-subtitle, .section-text { font-size: 15.5px; line-height: 1.7; max-width: 720px; }
.text-center { text-align: center; }
.text-center .section-subtitle, .text-center .section-text { margin-left: auto; margin-right: auto; }
.items-center { align-items: center; }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1024px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 22px; border-radius: 999px; font-size: 14px; font-weight: 700;
    letter-spacing: 0.02em; cursor: pointer; text-decoration: none;
    border: 1.5px solid transparent; transition: background .2s, color .2s, border-color .2s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-primary { background: var(--c-brass) !important; color: #fff !important; }
.btn-primary:hover { background: #A9722F !important; }
.btn-outline { background: transparent; color: var(--c-ink); border-color: var(--c-ink-2); }
.btn-outline:hover { background: var(--c-ink-2); color: var(--c-cream); }
.btn-block { display: flex; width: 100%; }

/* ---------- Product cards ---------- */
.spec-note {
    background: rgba(197, 137, 64, .1); border: 1px solid rgba(197, 137, 64, .35);
    border-radius: 12px; padding: 12px 16px; font-size: 14px; margin: 0 0 28px;
}
.spec-note i { color: var(--c-brass); margin-right: 6px; }
.product-card {
    background: #fff; border: 1px solid var(--c-line); border-radius: 18px;
    padding: 18px; display: flex; flex-direction: column;
    box-shadow: 0 10px 30px rgba(44, 29, 17, .06); scroll-margin-top: 90px;
}
.product-card .product-media { aspect-ratio: 4 / 3; overflow: hidden; border-radius: 12px; margin-bottom: 16px; background: var(--c-cream-2); }
.product-card .product-media img { width: 100%; height: 100% !important; object-fit: cover; display: block; }
.product-badge { align-self: flex-start; display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 11.5px; letter-spacing: .08em; }
.product-title { font-size: 21px; margin: 10px 0 6px; letter-spacing: .02em; }
.product-tagline { font-size: 14.5px; margin: 0 0 12px; }
.product-specs-list { list-style: none; padding: 0; margin: 0 0 16px; flex: 1; }
.product-specs-list li { font-size: 14px; padding: 6px 0; border-bottom: 1px dashed var(--c-line); line-height: 1.5; }
.product-specs-list li:last-child { border-bottom: 0; }
.product-specs-list .check { color: var(--c-brass) !important; font-weight: 800; margin-right: 4px; }
.product-price { font-size: 14px; margin-bottom: 14px; }
.product-price b { color: var(--c-ink) !important; font-size: 17px; font-family: var(--font-mono, monospace); }

/* ---------- Spec table ---------- */
.spec-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--c-line); border-radius: 14px; background: #fff; }
.spec-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 14px; }
.spec-table th, .spec-table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--c-line); color: var(--c-ink-2); vertical-align: top; }
.spec-table thead th { background: var(--c-walnut); color: #fff !important; font-weight: 700; letter-spacing: .03em; }
.spec-table tbody td:first-child { font-weight: 700; color: var(--c-ink); white-space: nowrap; }
.spec-table tbody tr:last-child td { border-bottom: 0; }
.spec-table td[colspan] { text-align: center; }

/* ---------- Registration form ---------- */
.multistep-card { background: #fff; border: 1px solid var(--c-line); border-radius: 20px; padding: 28px; box-shadow: 0 16px 40px rgba(44, 29, 17, .08); scroll-margin-top: 90px; }
.form-label { display: block; font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--c-ink) !important; margin: 4px 0 10px; }
.product-radio-list { display: grid; gap: 10px; margin-bottom: 22px; }
.product-radio-card {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer;
    border: 1.5px solid var(--c-line); border-radius: 12px; background: var(--c-cream);
    transition: border-color .2s, background .2s;
}
.product-radio-card:has(input:checked) { border-color: var(--c-brass); background: rgba(197, 137, 64, .08); }
.product-radio-card input { accent-color: var(--c-brass); width: 18px; height: 18px; flex: none; }
.product-radio-card .prc-name { flex: 1; font-weight: 700; color: var(--c-ink) !important; }
.product-radio-card .prc-name small { display: block; font-weight: 500; font-size: 12.5px; color: #6B5B4B; }
.product-radio-card .prc-price { font-weight: 800; color: var(--c-brass) !important; font-family: var(--font-mono, monospace); font-size: 14px; white-space: nowrap; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } .multistep-card { padding: 20px 16px; } }
.form-input {
    width: 100%; display: block; margin-bottom: 12px; padding: 11px 14px; font: inherit; font-size: 14.5px;
    color: var(--c-ink); background: var(--c-cream); border: 1.5px solid var(--c-line); border-radius: 10px;
}
.form-input:focus { outline: none; border-color: var(--c-brass); box-shadow: 0 0 0 3px rgba(197, 137, 64, .18); }
textarea.form-input { resize: vertical; }
.form-error { display: none; color: var(--c-err) !important; font-size: 12.5px; margin: -6px 0 10px; }
.form-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.55; margin: 6px 0 10px; cursor: pointer; }
.form-consent input { margin-top: 3px; accent-color: var(--c-brass); width: 16px; height: 16px; flex: none; }
.form-consent a { color: var(--c-brass); text-decoration: underline; font-weight: 700; }
#preOrderForm .btn-block { margin-top: 8px; }
.form-feedback { margin-top: 14px; font-size: 14px; line-height: 1.55; }
.form-feedback:empty { display: none; }
.form-feedback.success { color: var(--c-ok) !important; background: rgba(47, 125, 79, .08); border: 1px solid rgba(47, 125, 79, .3); border-radius: 10px; padding: 10px 14px; }
.form-feedback.warn { color: var(--c-warn) !important; background: rgba(197, 137, 64, .1); border: 1px solid rgba(197, 137, 64, .35); border-radius: 10px; padding: 10px 14px; }

/* ---------- Misc pieces used on about / technology / store ---------- */
.feature-desc { font-size: 14.5px; line-height: 1.65; }
.stat-value { font-size: 30px; font-weight: 800; color: var(--c-brass) !important; font-family: var(--font-mono, monospace); }
.tech-preview-box { border-radius: 16px; overflow: hidden; }
.carousel-more-link { white-space: nowrap; }
.lang-switch-btn:hover { background: rgba(212, 175, 55, .18) !important; }

/* ---------- Store order modal (light) ---------- */
#orderModal .form-feedback { margin-top: 10px; }

/* ---------- Legal / contact pages: bỏ màu cyan neon cũ ---------- */
.legal-page {
    --primary: #C58940 !important;
    --border-color: rgba(197, 137, 64, .28) !important;
    --card-bg: #1A130E !important;
}
.legal-page h2 { color: var(--c-brass-light) !important; border-bottom-color: rgba(197, 137, 64, .25) !important; }
.legal-page .container h1 { color: var(--c-ink) !important; }
.legal-page .back-link { color: var(--c-brass) !important; }
.legal-page .highlight-box { border-left-color: var(--c-brass) !important; }

/* ---------- Công tắc tính năng: giá & đặt cọc (bật trong js/site-config.js) ---------- */
/* Mặc định ẨN giá và khối cọc, kể cả khi JavaScript không chạy */
.js-price, .js-deposit { display: none !important; }
html.show-prices .js-price { display: revert !important; }
html.show-prices .js-price-pending { display: none !important; }
html.deposit-on .js-deposit { display: revert !important; }
html.deposit-on .js-deposit-off { display: none !important; }
html.deposit-on .deposit-box.js-deposit { display: block !important; }
.product-radio-card .prc-price.js-price-pending { display: none; }

.deposit-box { background: var(--c-cream-2); border: 1px dashed var(--c-brass); border-radius: 12px; padding: 14px 16px; margin: 6px 0 14px; font-size: 14px; }
.deposit-title { font-weight: 800; color: var(--c-ink) !important; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .04em; font-size: 13px; }
.deposit-row { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px dashed var(--c-line); }
.deposit-row b { color: var(--c-ink) !important; font-family: var(--font-mono, monospace); }
.deposit-bank { margin-top: 10px; line-height: 1.7; }
.deposit-bank strong { color: var(--c-ink) !important; }
.deposit-warn { margin: 10px 0 0; font-size: 12.5px; color: var(--c-warn) !important; }
.product-price.js-price-pending b { font-family: inherit; font-size: 15px; }

/* ---------- Danh sách tính năng trang Công nghệ (trước đây chữ trắng trên nền kem, không đọc được) ---------- */
.tech-checklist { list-style: none; padding: 0; margin: 16px 0 0; }
.tech-checklist li { color: var(--c-ink-2) !important; font-size: 14.5px; line-height: 1.6; padding: 7px 0; border-bottom: 1px dashed var(--c-line); opacity: 1 !important; }
.tech-checklist li:last-child { border-bottom: 0; }
.tech-checklist li strong { color: var(--c-ink) !important; }
.tech-checklist li span { color: var(--c-brass) !important; font-weight: 800; margin-right: 4px; }
.tech-preview-box div[style*="position: absolute"] { background: rgba(26, 19, 14, .88) !important; border-color: rgba(197, 137, 64, .5) !important; }
.tech-preview-box div[style*="position: absolute"] span { color: #E5A855 !important; }

/* Danh sách nằm trong thẻ nền tối (vd. "Giá Trị Cốt Lõi" ở trang Về Chúng Tôi): chữ sáng */
.feature-card .tech-checklist li { color: #E8DCCB !important; border-bottom-color: rgba(197, 137, 64, .22); }
.feature-card .tech-checklist li strong { color: #FAF7F2 !important; }
.feature-card .tech-checklist li span { color: var(--c-brass-light) !important; }
.feature-card .feature-title[style*="accent-cyan"] { color: var(--c-brass-light) !important; }
.feature-card { padding: 26px 24px !important; border-radius: 16px !important; }
.feature-card .feature-title { margin-top: 4px; }

/* ---------- Tiến độ nghiên cứu (trang Về Chúng Tôi) ---------- */
.research-progress { max-width: 1040px; margin: 0 auto; }
.rp-phases { list-style: none; padding: 0; margin: 0 0 36px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; counter-reset: none; }
.rp-phase { position: relative; background: #fff; border: 1px solid var(--c-line); border-radius: 14px; padding: 16px 14px; }
.rp-dot { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; font-weight: 800; font-size: 14px; background: var(--c-cream-2); color: #8A7A69 !important; border: 1.5px solid var(--c-line); margin-bottom: 10px; }
.rp-ph-name { font-weight: 800; color: var(--c-ink) !important; font-size: 14.5px; line-height: 1.35; }
.rp-ph-state { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; margin: 6px 0; color: #8A7A69 !important; }
.rp-ph-desc { font-size: 13px; line-height: 1.5; color: #5A4A3B !important; }
.rp-done .rp-dot { background: var(--c-ok); border-color: var(--c-ok); color: #fff !important; }
.rp-done .rp-ph-state { color: var(--c-ok) !important; }
.rp-current { border: 2px solid var(--c-brass); box-shadow: 0 8px 24px rgba(197, 137, 64, .18); }
.rp-current .rp-dot { background: var(--c-brass); border-color: var(--c-brass); color: #fff !important; }
.rp-current .rp-ph-state { color: var(--c-brass) !important; }
@media (max-width: 900px) { .rp-phases { grid-template-columns: 1fr; } .rp-phase { display: grid; grid-template-columns: 40px 1fr; column-gap: 10px; } .rp-dot { grid-row: span 3; margin: 0; } }
.rp-subtitle { font-size: 19px; color: var(--c-ink) !important; margin: 0 0 14px; }
.rp-updates { display: grid; gap: 14px; margin-bottom: 32px; }
.rp-update { background: #fff; border: 1px solid var(--c-line); border-left: 4px solid var(--c-brass); border-radius: 12px; padding: 16px 20px; }
.rp-update time { font-family: var(--font-mono, monospace); font-size: 13px; font-weight: 700; color: var(--c-brass) !important; }
.rp-update h4 { margin: 4px 0 6px; font-size: 16.5px; color: var(--c-ink) !important; }
.rp-update p { margin: 0; font-size: 14.5px; line-height: 1.65; color: var(--c-ink-2) !important; }
.rp-partners { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 28px; }
.rp-partner { display: block; background: #fff; border: 1px solid var(--c-line); border-radius: 12px; padding: 14px 16px; text-decoration: none; }
.rp-partner strong { display: block; color: var(--c-ink) !important; }
.rp-partner span { font-size: 13px; color: #5A4A3B !important; }
.rp-updated, .rp-empty { text-align: center; font-size: 13px; color: #8A7A69 !important; margin: 0; }
.spec-note a { color: var(--c-brass); font-weight: 700; text-decoration: underline; white-space: nowrap; }

.rp-partner { display: flex !important; align-items: center; gap: 14px; transition: border-color .2s, box-shadow .2s; }
a.rp-partner:hover { border-color: var(--c-brass); box-shadow: 0 6px 18px rgba(44, 29, 17, .08); }
.rp-logo { width: 52px; height: 52px; object-fit: contain; flex: none; }
.rp-pt { min-width: 0; }

/* ---------- Ô số điện thoại kèm mã quốc gia ---------- */
.phone-group { display: flex; gap: 8px; }
.cc-wrap { position: relative; flex: 0 0 112px; }
.cc-native { display: none !important; }
.cc-btn { display: flex !important; align-items: center; gap: 8px; width: 100%; cursor: pointer; text-align: left; padding: 11px 10px !important; }
.cc-btn .phone-flag { width: 22px; height: 16px; object-fit: cover; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); flex: none; }
.cc-code { flex: 1; font-weight: 700; color: var(--c-ink) !important; font-variant-numeric: tabular-nums; }
.cc-caret { font-size: 12px; color: #8A7A69 !important; }
.cc-panel { position: absolute; top: calc(100% - 6px); left: 0; z-index: 1000; width: 320px; max-width: calc(100vw - 32px); background: #fff; border: 1px solid var(--c-line); border-radius: 12px; box-shadow: 0 18px 40px rgba(44, 29, 17, .18); padding: 8px; }
.cc-search { width: 100%; padding: 10px 12px; font: inherit; font-size: 14.5px; border: 1.5px solid var(--c-brass); border-radius: 9px; outline: none; color: var(--c-ink); background: var(--c-cream); }
.cc-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 280px; overflow-y: auto; }
.cc-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--c-ink-2) !important; }
.cc-list li img { width: 22px; height: 16px; object-fit: cover; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .1); flex: none; }
.cc-list li .cc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-list li .cc-dial { color: #8A7A69 !important; font-variant-numeric: tabular-nums; }
.cc-list li:hover, .cc-list li.cc-active { background: rgba(197, 137, 64, .12); }
.cc-list li[aria-selected="true"] { font-weight: 700; }
.cc-empty { padding: 12px; text-align: center; font-size: 13.5px; color: #8A7A69 !important; }
.phone-group #orderPhone { flex: 1; min-width: 0; }

/* ---------- Hộp thông báo giữa màn hình (JarvisLead.showModal) ---------- */
.jn-overlay { position: fixed; inset: 0; z-index: 2147483000; background: rgba(26, 17, 11, .6); display: flex; align-items: center; justify-content: center; padding: 16px; animation: jnFade .2s ease; }
.jn-box { background: var(--c-cream); border: 1px solid var(--c-line); border-top: 4px solid var(--c-brass); border-radius: 18px; max-width: 520px; width: 100%; padding: 28px 26px 24px; text-align: center; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); animation: jnPop .25s cubic-bezier(.16, 1, .3, 1); }
.jn-icon { width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 50%; background: var(--c-ok); color: #fff !important; font-size: 28px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.jn-box h3 { margin: 0 0 10px; font-size: 20px; color: var(--c-ink) !important; }
.jn-box p { margin: 0 0 22px; font-size: 15px; line-height: 1.7; color: var(--c-ink-2) !important; text-align: justify; text-align-last: center; }
.jn-ok { min-width: 140px; }
@keyframes jnFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes jnPop { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
.cc-list li[hidden], .cc-panel[hidden], .cc-empty[hidden] { display: none !important; }


/* ===== Truy cap (21/11/2026): nhan an cho o nhap, lien ket bo qua toi noi dung chinh ===== */
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.skip-link { position: absolute !important; left: 12px; top: -80px; z-index: 100000; padding: 10px 16px; background: #0b1220 !important; color: #ffffff !important; border-radius: 8px; font-weight: 600; text-decoration: none !important; transition: top .15s; }
.skip-link:focus { top: 12px; outline: 3px solid #f5c542; outline-offset: 2px; }
main:focus { outline: none; }


/* ===== Tuong phan chu (21/11/2026): sua cac cho chu trung/gan mau nen. Khong doi bo cuc, chi doi mau chu. =====
   Mau chu dong-dam tren nen sang: #8C5E1E (ti le >= 4.5:1 tren nen kem/trang). Mau nen thuong hieu giu nguyen. */
/* Thanh menu tren nen kem (moi trang tru 404 co header toi) */
body:not(.page-404) .main-nav .nav-link { color: #5B6678 !important; }
body:not(.page-404) .main-nav .nav-link:hover,
body:not(.page-404) .main-nav .nav-link.active { color: #8C5E1E !important; }
/* Trang phap ly / lien he (nen kem) */
.legal-page .header-box > div:not(.badge) { color: #5B6678 !important; }
.legal-page .footer-note { color: #5B6678 !important; }
.legal-page .back-link { color: #8C5E1E !important; }
/* Tien do nghien cuu (trang Ve Chung Toi) */
.rp-updated, .rp-empty, .rp-ph-state { color: #6E5D4A !important; }
.rp-current .rp-ph-state { color: #8C5E1E !important; }
.rp-update time { color: #8C5E1E !important; }
/* Lien ket mau dong tren nen sang */
.spec-note a, .form-consent a { color: #8C5E1E !important; }
.carousel-more-link { color: #8C5E1E !important; }
.cat-chip.resale-chip { color: #8C5E1E !important; }
/* Nhan gio co nen vang: chu dam (bi !important cua theme de len) */
.timeline-time-badge[style*="D4AF37"] { color: #0F0C0A !important; }
/* Nhan Make in Vietnam tren nen xam nhat cua anh */
.global-badge { color: #0F0C0A !important; }
/* Chan trang */
.site-footer .footer-addr { color: #9A8E80 !important; }
/* Trang 404 (header + chan trang toi) */
.page-404 .brand-logo-text { color: #FAF7F2 !important; }
.page-404 .site-footer p { color: #9A8E80 !important; }
/* Ngan menu dong khong do bong len man hinh (truoc day de lai vet toi o mep trai moi trang) */
.mobile-drawer:not(.active) { box-shadow: none !important; }

/* ===== Nut nen dong: chu dam de doc ro (>= 4,5:1). Giu nguyen mau nen thuong hieu (22/11/2026) ===== */
a.btn.btn-primary, button.btn.btn-primary, .btn-story-primary, .cat-chip.active, .cat-chip:hover { color: #0F0C0A !important; }
.btn-primary i, .btn-story-primary i { color: inherit !important; }
.rp-current .rp-dot { color: #0F0C0A !important; }

/* ===== Nhan hien tren phieu dang ky (22/11/2026, Anh Phu duyet) ===== */
.field-label { display: block; font-size: 13px; font-weight: 600; color: #3F4A5A !important; margin: 0 0 5px; line-height: 1.3; }
.rp-phase:not(.rp-current):not(.rp-done) .rp-dot { color: #6E5D4A !important; }

/* Ô nhập thiếu/sai: viền đỏ + nền đỏ nhạt để khách thấy ngay (22/11) */
input.form-input[aria-invalid="true"], textarea.form-input[aria-invalid="true"],
.phone-group.is-invalid input, .phone-group.is-invalid .cc-btn {
    border-color: var(--c-err) !important; box-shadow: 0 0 0 2px rgba(200, 40, 40, .18) !important; background-color: #FFF0EE !important;
}
.form-consent.is-invalid { outline: 2px solid var(--c-err); outline-offset: 3px; border-radius: 8px; }
