/* ============================================================================
   thumuatphcm.vn — Aesthetic upgrade layer
   ----------------------------------------------------------------------------
   Enqueued via functions.php with `deps: [flatsome-main, flatsome-style]` so
   WordPress prints this AFTER Flatsome's own stylesheets, on every page.

   Scope after phase 01 + phase 02: token (§1), typography (§2), contrast (§3),
   the service-row card + generic button override (§4/§5 — theme-owned only,
   NOT plugin components), rhythm (§6), and .tm-* classes for templates (§7).
   Plugin shortcode components (.tmtphcm-trust, .tmtphcm-process, etc.) style
   themselves at source in wp-content/plugins/thumuatphcm-custom/assets/css/ —
   this layer must never target those classes again: 9/11 of them enqueue in
   the footer and would always win a cascade fight against anything printed
   in <head>, so a layer rule targeting them is dead weight at best.
   ========================================================================== */

/* ─── 0. Self-hosted Be Vietnam Pro (400/500/600/700) ────────────────────── */
/* Two subset files per weight: "vietnamese" (diacritics) + "latin" (base
   ASCII) — both are required for correctly mixed Vietnamese text; browsers
   auto-pick the right file per glyph via unicode-range. No latin-ext (not
   needed for Vietnamese). font-display: swap avoids invisible text on 3G. */
@font-face {
    font-family: 'Be Vietnam Pro';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('./fonts/be-vietnam-pro-400-vietnamese.woff2') format('woff2');
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
    font-family: 'Be Vietnam Pro';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('./fonts/be-vietnam-pro-400-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Be Vietnam Pro';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('./fonts/be-vietnam-pro-500-vietnamese.woff2') format('woff2');
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
    font-family: 'Be Vietnam Pro';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('./fonts/be-vietnam-pro-500-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Be Vietnam Pro';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('./fonts/be-vietnam-pro-600-vietnamese.woff2') format('woff2');
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
    font-family: 'Be Vietnam Pro';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('./fonts/be-vietnam-pro-600-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Be Vietnam Pro';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('./fonts/be-vietnam-pro-700-vietnamese.woff2') format('woff2');
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
    font-family: 'Be Vietnam Pro';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('./fonts/be-vietnam-pro-700-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ─── 1. Tokens ──────────────────────────────────────────────────────────── */
:root {
    /* Brand — 3 màu duy nhất */
    --tm-red:        #c0392b;   /* hành động chính: form, CTA, giá  */
    --tm-red-dark:   #a5301f;
    --tm-red-soft:   #fdf2f0;
    --tm-blue:       #0068ff;   /* Zalo / chat                      */
    --tm-green:      #15803d;   /* gọi điện / trạng thái thành công  */
    --tm-gold:       #d99100;   /* CHỈ dùng cho ngôi sao đánh giá    */

    /* Neutral ramp */
    --tm-ink:        #14181f;
    --tm-body:       #3d4450;
    --tm-muted:      #5b6472;   /* 5.7:1 trên trắng — đạt AA        */
    --tm-border:     #e4e7ec;
    --tm-border-str: #d3d8e0;
    --tm-surface:    #f6f7f9;
    --tm-bg:         #ffffff;

    /* Card standard */
    --tm-r:          12px;
    --tm-r-sm:       8px;
    --tm-card-sh:    0 1px 2px rgba(16,24,40,.05);
    --tm-card-sh-hv: 0 6px 18px rgba(16,24,40,.10);
    --tm-card-pad:   20px;

    /* Type scale */
    --tm-f:          'Be Vietnam Pro', -apple-system, 'Segoe UI', system-ui, sans-serif;
    --tm-t-hero:     clamp(26px, 4.2vw, 38px);
    --tm-t-h2:       clamp(21px, 2.6vw, 28px);
    --tm-t-h3:       clamp(17px, 1.6vw, 19px);
    --tm-t-body:     16px;
    --tm-t-sm:       14px;
    --tm-t-xs:       12.5px;

    /* Section rhythm */
    --tm-sec-y:      clamp(36px, 5vw, 64px);
    --tm-wrap:       1100px;
}

/* ─── 2. Typography ──────────────────────────────────────────────────────── */
body,
.tmtphcm-trust, .tmtphcm-process, .tmtphcm-trust-boxes,
.tmtphcm-price-hl, .tmtphcm-reviews, .tmtphcm-cta-strip {
    font-family: var(--tm-f);
    color: var(--tm-body);
    font-size: var(--tm-t-body);
    line-height: 1.6;
    text-wrap: pretty;
}

h1, .section h1 {
    font-family: var(--tm-f);
    font-size: var(--tm-t-hero);
    font-weight: 700;
    line-height: 1.22;
    letter-spacing: -.015em;
    color: var(--tm-ink);
}
h2, .section h2 {
    font-family: var(--tm-f);
    font-size: var(--tm-t-h2);
    font-weight: 700;
    line-height: 1.28;
    letter-spacing: -.01em;
    color: var(--tm-ink);
    margin-bottom: .5em;
}
h3, h4, h5 {
    font-family: var(--tm-f);
    font-size: var(--tm-t-h3);
    font-weight: 600;
    line-height: 1.35;
    color: var(--tm-ink);
}

/* ─── 3. Contrast — kéo mọi chữ phụ lên AA ───────────────────────────────── */
.tmtphcm-trust__label,
.tmtphcm-process__desc,
.tmtphcm-trust-boxes__desc,
.tmtphcm-reviews__location,
.tmtphcm-post-meta,
.tmtphcm-toc-sidebar a,
.tmtphcm-quote__hint,
.tmtphcm-quote__note,
.tmtphcm-lead-form__hint {
    color: var(--tm-muted);
}
.tmtphcm-reviews__text,
.tmtphcm-price-hl__name { color: var(--tm-body); }

/* ─── 4. Card standard (theme-owned only — plugin components self-style) ─── */
/* Service row cards (trang chủ, functions.php markup) — chuẩn card + giữ
   khoảng cách gốc (margin/padding vốn nằm trong tmtphcm_homepage_mobile_css()
   trước đây, nay dọn về đây cùng phần card standard). */
.row.tmtphcm-services-row > .col {
    background: var(--tm-bg);
    border: 1px solid var(--tm-border);
    border-radius: var(--tm-r);
    box-shadow: var(--tm-card-sh);
    margin: 20px 8px;
    padding: var(--tm-card-pad);
    transition: box-shadow .18s ease, transform .18s ease;
}
.row.tmtphcm-services-row > .col:hover {
    box-shadow: var(--tm-card-sh-hv);
    transform: translateY(-1px);
}

/* ─── 5. Buttons & CTA (generic Flatsome override only) ──────────────────── */
.button.primary, a.button.primary {
    background: var(--tm-red);
    border-color: var(--tm-red);
    color: #fff;
    border-radius: var(--tm-r-sm);
    font-family: var(--tm-f);
    font-weight: 600;
    letter-spacing: 0;
}
.button.primary:hover, a.button.primary:hover {
    background: var(--tm-red-dark);
    border-color: var(--tm-red-dark);
}

/* ─── 6. Section rhythm & width ──────────────────────────────────────────── */
.section + .section { border-top: 0; }

/* ============================================================================
   7. PAGE TEMPLATES
   ----------------------------------------------------------------------------
   Các template trong flatsome-child đang style inline 100% → CSS ngoài không
   ghi đè được. Bộ class dưới đây là bản thay thế; xem HANDOFF.md mục 3 để
   biết inline style nào đổi thành class nào, theo từng file.
   ========================================================================== */

/* Wrapper trang */
.tm-page {
    max-width: 900px;
    margin: 0 auto;
    padding: clamp(24px, 4vw, 40px) 16px 64px;
}
.tm-page--wide   { max-width: 1060px; }
.tm-page--narrow { max-width: 760px; }

.tm-page > h1 { margin-bottom: 10px; }

/* Đoạn mở đầu */
.tm-lede {
    font-size: clamp(16px, 1.6vw, 18px);
    line-height: 1.75;
    color: var(--tm-body);
    max-width: 68ch;
    margin-bottom: clamp(28px, 4vw, 44px);
}

/* Section spacing trong trang */
.tm-sec { margin-bottom: clamp(32px, 4.5vw, 52px); }
.tm-sec > h2:first-child,
.tm-panel > h2:first-child { margin-top: 0; }

/* Panel nền nhạt */
.tm-panel {
    background: var(--tm-surface);
    border: 1px solid var(--tm-border);
    border-radius: var(--tm-r);
    padding: clamp(20px, 3vw, 30px) clamp(18px, 3vw, 28px);
}
.tm-panel--center { text-align: center; }

/* Grid */
.tm-grid       { display: grid; gap: 16px; }
.tm-grid--auto { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.tm-grid--2    { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.tm-grid--3    { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.tm-grid--center { text-align: center; }
/* Ép đúng 2 cột ở ≤580px cho lưới số liệu — auto-fit của .tm-grid--3 có thể
   xuống 1 cột trước khi chạm breakpoint này, tuỳ độ rộng nội dung thật. */
@media (max-width: 580px) {
    .tm-grid--stat { grid-template-columns: repeat(2, 1fr); }
}

/* Card — dùng chung chuẩn ở mục 4 */
.tm-card {
    background: var(--tm-bg);
    border: 1px solid var(--tm-border);
    border-radius: var(--tm-r);
    box-shadow: var(--tm-card-sh);
    padding: var(--tm-card-pad);
    text-decoration: none;
    color: inherit;
    display: block;
    transition: box-shadow .18s ease, transform .18s ease;
}
.tm-card:hover {
    box-shadow: var(--tm-card-sh-hv);
    transform: translateY(-1px);
    border-color: var(--tm-border-str);
}
.tm-card__title { font-weight: 600; color: var(--tm-ink); display: block; }
.tm-card--row   { display: flex; gap: 18px; align-items: flex-start; }

/* Badge số quy trình (page-dich-vu) — không dùng .tmtphcm-process__badge của
   plugin: file CSS đó không nạp trên trang này, và badge đó định vị absolute
   nhắm vào một ancestor không tồn tại ở markup này. */
.tm-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--tm-red);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    margin: 0 auto 10px;
}
.tm-card__icon  {
    flex: 0 0 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--tm-red-soft);
    color: var(--tm-red);
    font-size: 20px;
}
.tm-card__media { margin-bottom: 10px; text-align: center; }
.tm-card__media img { max-height: 64px; width: auto; }

/* Giá */
.tm-price {
    color: var(--tm-red);
    font-weight: 700;
    margin-top: 6px;
    font-variant-numeric: tabular-nums;
}
.tm-price--empty { color: var(--tm-muted); font-weight: 500; }

/* Chú thích nhỏ — thay cho #888 / #999 */
.tm-note {
    font-size: var(--tm-t-xs);
    color: var(--tm-muted);
    line-height: 1.55;
    margin-top: 8px;
}

/* Số liệu (trang Giới thiệu) */
.tm-stat {
    background: var(--tm-bg);
    border: 1px solid var(--tm-border);
    border-radius: var(--tm-r);
    box-shadow: var(--tm-card-sh);
    padding: 24px 14px;
    text-align: center;
}
.tm-stat__num {
    font-size: clamp(26px, 3.2vw, 34px);
    font-weight: 700;
    color: var(--tm-red);
    line-height: 1.1;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}
.tm-stat__label { font-size: var(--tm-t-sm); color: var(--tm-muted); margin-top: 6px; }

/* Bảng giá theo tình trạng máy (single-phone_model) */
.tm-table-wrap { overflow-x: auto; }
.tm-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--tm-border);
    border-radius: var(--tm-r);
    font-size: var(--tm-t-sm);
}
.tm-table th {
    background: var(--tm-surface);
    color: var(--tm-ink);
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--tm-border);
}
.tm-table td { padding: 12px 16px; border-bottom: 1px solid var(--tm-border); }
.tm-table tr:last-child td { border-bottom: 0; }
.tm-table td:last-child:not([colspan]),
.tm-table th:last-child {
    text-align: right;
    font-weight: 700;
    color: var(--tm-red);
    font-variant-numeric: tabular-nums;
}

/* Danh sách thông tin — thay <table> ở page-lien-he */
.tm-def { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin: 0; }
.tm-def dt {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--tm-ink);
    white-space: nowrap;
}
.tm-def dt i { color: var(--tm-red); width: 1em; text-align: center; }
.tm-def dd { margin: 0; color: var(--tm-body); }

/* Giữ màu thương hiệu Zalo cho link nằm trong danh sách .tm-def (mặc định
   dd a sẽ đỏ theo link toàn site, làm mất phân biệt với link gọi/email) */
.tm-link--zalo { color: var(--tm-blue); }
.tm-link--zalo:hover { color: #0057d6; }

/* Chip lọc (archive-phone_model) */
.tm-chip {
    display: inline-flex;
    align-items: center;
    padding: 7px 16px;
    border-radius: 999px;
    border: 1px solid var(--tm-border-str);
    background: var(--tm-bg);
    color: var(--tm-body);
    font-size: var(--tm-t-sm);
    font-weight: 500;
    text-decoration: none;
    transition: border-color .15s, background .15s, color .15s;
}
.tm-chip:hover      { border-color: var(--tm-red); color: var(--tm-red); }
.tm-chip.is-active  { background: var(--tm-red); border-color: var(--tm-red); color: #fff; }
.tm-chip--sm        { padding: 4px 12px; font-size: var(--tm-t-xs); }
.tm-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

/* Nút */
.tm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 26px;
    border-radius: var(--tm-r-sm);
    font-family: var(--tm-f);
    font-weight: 600;
    font-size: var(--tm-t-body);
    text-decoration: none;
    border: 1.5px solid transparent;
    transition: background .15s, border-color .15s;
}
.tm-btn--primary { background: var(--tm-red); color: #fff; }
.tm-btn--primary:hover { background: var(--tm-red-dark); color: #fff; }
.tm-btn--zalo    { background: var(--tm-blue); color: #fff; }
.tm-btn--zalo:hover { background: #0057d6; color: #fff; }
.tm-btn--ghost   { background: transparent; color: var(--tm-red); border-color: var(--tm-border-str); }
.tm-btn--ghost:hover { border-color: var(--tm-red); }
.tm-btns { display: flex; flex-wrap: wrap; gap: 12px; }
.tm-btns--center { justify-content: center; }

/* Panel CTA đỏ — dùng ở page-dich-vu, single-phone_model */
.tm-cta {
    background: var(--tm-red);
    color: #fff;
    border-radius: var(--tm-r);
    padding: clamp(24px, 3.5vw, 36px) clamp(20px, 3vw, 28px);
    text-align: center;
}
.tm-cta h2   { color: #fff; margin-top: 0; }
.tm-cta p    { color: #fff; margin-bottom: 20px; }
.tm-cta .tm-btns { justify-content: center; }
.tm-cta .tm-btn--primary { background: #fff; color: var(--tm-red); }
.tm-cta .tm-btn--primary:hover { background: #f7eae8; color: var(--tm-red-dark); }
.tm-cta .tm-btn--ghost   { color: #fff; border-color: rgba(255,255,255,.7); }
.tm-cta .tm-btn--ghost:hover { background: rgba(255,255,255,.14); }
.tm-cta__note { font-size: var(--tm-t-xs); color: #fff; opacity: .88; margin: 14px 0 0; }

/* Danh sách link nội bộ nhiều cột */
.tm-linklist {
    columns: 3;
    column-gap: 28px;
    padding-left: 20px;
    margin: 0;
    font-size: var(--tm-t-sm);
}
.tm-linklist--2 { columns: 2; }
.tm-linklist li { break-inside: avoid; margin-bottom: 5px; }
.tm-linklist a  { color: var(--tm-body); text-decoration: none; }
.tm-linklist a:hover { color: var(--tm-red); text-decoration: underline; }

/* FAQ */
.tm-faq {
    border: 1px solid var(--tm-border);
    border-radius: var(--tm-r-sm);
    padding: 14px 18px;
    margin-bottom: 8px;
    background: var(--tm-bg);
}
.tm-faq > summary {
    font-weight: 600;
    color: var(--tm-ink);
    cursor: pointer;
    list-style: none;
}
.tm-faq > summary::-webkit-details-marker { display: none; }
.tm-faq[open] > summary { color: var(--tm-red); }
.tm-faq p { margin: 10px 0 0; color: var(--tm-body); line-height: 1.65; }

/* Post navigation (blog single) — cặp với .tmtphcm-post-nav ở style.css */
.tm-navpost--next { text-align: right; }

/* Ảnh đại diện bài blog (single.php) */
.tm-figure { margin: 0 0 28px; }
.tm-figure__img { width: 100%; height: auto; border-radius: var(--tm-r-sm); }

/* Section có viền phân cách (khác .tm-sec mặc định) */
.tm-sec--divided {
    padding-top: clamp(24px, 3.5vw, 36px);
    border-top: 1px solid var(--tm-border);
}

/* Link mặc định toàn site */
a        { color: var(--tm-red); text-decoration: none; }
.tm-page a:not(.tm-btn):not(.tm-card):not(.tm-chip):hover,
.entry-content a:hover { text-decoration: underline; }
a:hover  { color: var(--tm-red-dark); }

/* ─── 8. Mobile ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    :root { --tm-card-pad: 16px; }
    .row.tmtphcm-services-row > .col { margin: 10px 0; }

    .tm-linklist, .tm-linklist--2 { columns: 1; }
    .tm-card--row { flex-direction: column; gap: 12px; }
    .tm-btns .tm-btn { width: 100%; }
    .tm-def { grid-template-columns: 1fr; gap: 2px 0; }
    .tm-def dd { margin-bottom: 12px; }
    .tm-table { font-size: var(--tm-t-xs); }
    .tm-table th, .tm-table td { padding: 10px 12px; }
}
