/**
 * san_pham.css – giao diện DÙNG CHUNG cho mọi trang sản phẩm / bài viết kỹ thuật.
 * Dùng cùng css/style.css (header, footer, nút, màu) và js/san_pham.js.
 * Mọi class đều bắt đầu bằng "sp-" để không đụng style của trang chủ.
 *
 * Nguyên tắc trình bày (để các trang đồng nhất):
 *  - Chỉ có 1 kiểu hộp nhấn mạnh: .sp-note (viền trái). Tóm tắt đầu bài: .sp-key.
 *  - Bảng luôn có <caption> "Bảng n. ..."; hình luôn có <figcaption> "Hình n. ...".
 *  - Công dụng / mục kỹ thuật dùng danh sách định nghĩa <dl class="sp-dl"> (Cơ chế / Thông số / Lưu ý).
 *  - Mục lục chỉ cần h2: <div data-sp-toc data-levels="2"></div>
 */

/* ---------- Thanh tiến trình đọc ---------- */
.sp-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--green, #1F8A5B); z-index: 3000; }

/* ---------- Breadcrumb ---------- */
.sp-breadcrumb { background: var(--bg, #F5F7FA); border-bottom: 1px solid var(--border, #E5EAF0); padding: 12px 0; font-size: 13.5px; color: var(--muted, #5B6573); }
.sp-breadcrumb a { color: var(--blue, #145DA0); font-weight: 600; }
.sp-breadcrumb i { font-size: 10px; margin: 0 6px; }
.sp-breadcrumb span { color: var(--text, #17202A); }

/* ---------- Đầu bài ---------- */
.sp-head { padding: 34px 0 6px; }
.sp-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.sp-tags a, .sp-tags span { font-size: 12px; font-weight: 700; color: var(--green, #1F8A5B); background: #e7f5ee; padding: 4px 12px; border-radius: 999px; }
.sp-head h1 { font-size: 32px; line-height: 1.25; color: var(--navy, #0B1F33); max-width: 860px; margin-bottom: 12px; }
.sp-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; color: var(--muted, #5B6573); }
.sp-meta i { color: var(--blue, #145DA0); margin-right: 5px; }

/* ---------- Bố cục 2 cột ---------- */
.sp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; align-items: start; padding: 18px 0 70px; }
.sp-article { min-width: 0; font-size: 16.5px; line-height: 1.75; color: #28333f; }
.sp-article > * + * { margin-top: 16px; }
.sp-article p, .sp-article li, .sp-article dd { text-wrap: pretty; }
.sp-lead { font-size: 18px; line-height: 1.7; color: #1d2a37; }

.sp-article h2 { font-size: 26px; line-height: 1.3; color: var(--navy, #0B1F33); margin-top: 52px; padding-top: 22px; border-top: 3px solid var(--navy, #0B1F33); scroll-margin-top: 90px; }
.sp-article h3 { font-size: 19px; line-height: 1.4; color: var(--blue-dark, #0B4F71); margin-top: 30px; scroll-margin-top: 90px; }
.sp-article h2 + h3 { margin-top: 18px; }
.sp-article a:not(.btn-primary):not(.btn-outline):not(.btn-call):not(.btn-zalo) { color: var(--blue, #145DA0); text-decoration: underline; text-underline-offset: 3px; }
.sp-article strong { color: var(--navy, #0B1F33); }
.sp-article sub, .sp-article sup { font-size: .75em; line-height: 0; }

/* Danh sách */
.sp-list { display: grid; gap: 8px; padding-left: 0; list-style: none; }
.sp-list li { position: relative; padding-left: 22px; }
.sp-list li::before { content: ""; position: absolute; left: 4px; top: .75em; width: 7px; height: 7px; border-radius: 50%; background: var(--blue, #145DA0); }
.sp-ol { counter-reset: n; display: grid; gap: 10px; list-style: none; padding: 0; }
.sp-ol li { counter-increment: n; position: relative; padding-left: 38px; }
.sp-ol li::before { content: counter(n); position: absolute; left: 0; top: 2px; width: 26px; height: 26px; border-radius: 50%; background: var(--navy, #0B1F33); color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center; }

/* ---------- Tóm tắt đầu bài ---------- */
.sp-key { background: var(--bg, #F5F7FA); border: 1px solid var(--border, #E5EAF0); border-radius: 10px; padding: 16px 20px; }
.sp-key > strong { display: block; font-size: 13px; letter-spacing: .6px; text-transform: uppercase; color: var(--green, #1F8A5B); margin-bottom: 6px; }
.sp-key .sp-list { font-size: 15.5px; line-height: 1.6; gap: 6px; }

/* ---------- Mục lục (chỉ h2) ---------- */
.sp-toc { border: 1px solid var(--border, #E5EAF0); border-radius: 10px; padding: 16px 20px; }
.sp-toc-head { display: flex; justify-content: space-between; align-items: center; }
.sp-toc-head strong { font-size: 16px; color: var(--navy, #0B1F33); }
.sp-toc-toggle { background: #fff; border: 1px solid var(--border, #E5EAF0); border-radius: 6px; padding: 3px 12px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--blue, #145DA0); }
.sp-toc-list { margin-top: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 28px; font-size: 15px; line-height: 1.5; list-style: none; padding: 0; counter-reset: none; }
.sp-toc-list[hidden] { display: none; }
.sp-toc-list ol { list-style: none; padding-left: 16px; margin-top: 2px; font-size: 14px; }
.sp-toc-list a { color: var(--text, #17202A); text-decoration: none !important; display: block; padding: 4px 0; border-bottom: 1px dashed var(--border, #E5EAF0); }
.sp-toc-list a:hover, .sp-toc-list a.active { color: var(--blue, #145DA0); font-weight: 600; }

/* ---------- Hình ---------- */
.sp-fig { border: 1px solid var(--border, #E5EAF0); border-radius: 10px; padding: 16px; background: #fff; }
.sp-fig svg { display: block; width: 100%; height: auto; }
.sp-fig figcaption, .sp-article caption { font-size: 14px; line-height: 1.5; color: var(--muted, #5B6573); }
.sp-fig figcaption { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border, #E5EAF0); }
.sp-fig figcaption b, .sp-article caption b { color: var(--navy, #0B1F33); }

/* Sơ đồ quy trình (HTML, tự xuống dòng trên điện thoại) */
.sp-flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; list-style: none; padding: 0; counter-reset: f; }
.sp-flow li { counter-increment: f; position: relative; background: var(--bg, #F5F7FA); border: 1px solid var(--border, #E5EAF0); border-radius: 8px; padding: 12px 12px 12px; font-size: 14px; line-height: 1.5; }
.sp-flow li::before { content: "Bước " counter(f); display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--green, #1F8A5B); margin-bottom: 2px; }
.sp-flow li b { display: block; color: var(--navy, #0B1F33); font-size: 15px; }
.sp-flow li:not(:last-child)::after { content: "\2192"; position: absolute; right: -9px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; border-radius: 50%; background: var(--navy, #0B1F33); color: #fff; font-size: 10px; display: grid; place-items: center; z-index: 1; }

/* Công thức / ví dụ tính */
.sp-calc { background: #fafbfc; border: 1px solid var(--border, #E5EAF0); border-left: 4px solid var(--blue, #145DA0); border-radius: 8px; padding: 14px 18px; font-size: 15.5px; }
.sp-calc > strong:first-child { display: block; margin-bottom: 6px; }
.sp-formula { font-family: "Cambria Math", "Times New Roman", serif; font-size: 18px; text-align: center; padding: 6px 0; color: var(--navy, #0B1F33); }
.sp-calc ol { display: grid; gap: 4px; padding-left: 20px; }
.sp-calc li { line-height: 1.6; }

/* ---------- Bảng ---------- */
.sp-table-wrap { overflow-x: auto; border: 1px solid var(--border, #E5EAF0); border-radius: 8px; }
.sp-article table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; min-width: 560px; }
.sp-article caption { text-align: left; padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--border, #E5EAF0); caption-side: top; }
.sp-article th, .sp-article td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border, #E5EAF0); vertical-align: top; }
.sp-article thead th { background: var(--navy, #0B1F33); color: #fff; font-weight: 600; font-size: 13.5px; }
.sp-article tbody th { font-weight: 600; color: var(--navy, #0B1F33); }
.sp-article tbody tr:nth-child(even) { background: #fafbfc; }
.sp-article tbody tr:last-child > * { border-bottom: 0; }
.sp-article td.num, .sp-article th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sp-table-note { font-size: 13.5px; line-height: 1.6; color: var(--muted, #5B6573); }

/* ---------- Hộp lưu ý (chỉ một kiểu) ---------- */
.sp-note { border-left: 4px solid var(--blue, #145DA0); background: #eef5fb; padding: 12px 18px; border-radius: 0 8px 8px 0; font-size: 15.5px; line-height: 1.65; }
.sp-note.is-warn { border-color: #d89a1c; background: #fff7e6; }
.sp-note strong:first-child { margin-right: 4px; }

/* ---------- Danh sách định nghĩa: Cơ chế / Thông số / Lưu ý ---------- */
.sp-dl { display: grid; grid-template-columns: 120px 1fr; gap: 8px 18px; font-size: 15.5px; line-height: 1.65; padding: 12px 0 4px; border-top: 1px solid var(--border, #E5EAF0); }
.sp-dl dt { font-size: 12.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted, #5B6573); padding-top: 3px; }
.sp-dl dd { margin: 0; }

/* ---------- FAQ ---------- */
.sp-faq details { border-bottom: 1px solid var(--border, #E5EAF0); }
.sp-faq details:first-child { border-top: 1px solid var(--border, #E5EAF0); }
.sp-faq summary { padding: 14px 4px; font-weight: 700; color: var(--navy, #0B1F33); cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.sp-faq summary::-webkit-details-marker { display: none; }
.sp-faq summary::after { content: "+"; font-size: 20px; line-height: 1; color: var(--blue, #145DA0); font-weight: 400; }
.sp-faq details[open] summary::after { content: "\2212"; }
.sp-faq details > div { padding: 0 4px 16px; }

/* ---------- CTA trong bài ---------- */
.sp-cta { background: var(--navy, #0B1F33); color: #fff; border-radius: 12px; padding: 24px 26px; }
.sp-cta h3, .sp-cta p, .sp-cta strong { color: #fff; margin-top: 0; }
.sp-cta p { color: #cfd8e3; margin: 6px 0 16px; }
.sp-cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Liên hệ, liên kết, chia sẻ ---------- */
.sp-contact { display: grid; gap: 8px; list-style: none; padding: 0; font-size: 15.5px; }
.sp-contact li { display: flex; gap: 12px; }
.sp-contact i { color: var(--green, #1F8A5B); width: 18px; margin-top: 6px; text-align: center; }
.sp-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 20px; }
.sp-links a { display: block; padding: 10px 14px; border: 1px solid var(--border, #E5EAF0); border-radius: 8px; font-weight: 600; text-decoration: none !important; }
.sp-links a:hover { border-color: var(--blue, #145DA0); background: var(--bg, #F5F7FA); }
.sp-share { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--border, #E5EAF0); font-size: 14px; }
.sp-share a, .sp-share button { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--bg, #F5F7FA); color: var(--navy, #0B1F33); border: 0; cursor: pointer; text-decoration: none !important; font-size: 15px; }
.sp-share a:hover, .sp-share button:hover { background: var(--blue, #145DA0); color: #fff !important; }

/* ---------- Thanh bên ---------- */
.sp-side { position: sticky; top: 90px; display: grid; gap: 20px; }
.sp-side-card { border: 1px solid var(--border, #E5EAF0); border-radius: 12px; padding: 20px; background: #fff; }
.sp-side-card h4 { font-size: 16px; color: var(--navy, #0B1F33); margin-bottom: 12px; }
.sp-side-cta { background: var(--navy, #0B1F33); color: #fff; border: 0; }
.sp-side-cta h4 { color: #fff; }
.sp-side-cta p { font-size: 14px; color: #cfd8e3; margin-bottom: 12px; }
.sp-side-cta .btn-primary, .sp-side-cta .btn-call, .sp-side-cta .btn-zalo { width: 100%; justify-content: center; margin-top: 8px; }
.sp-side-products { display: grid; gap: 12px; }
.sp-side-products a { display: flex; gap: 12px; align-items: center; text-decoration: none !important; color: var(--text, #17202A); font-weight: 600; font-size: 14.5px; line-height: 1.4; }
.sp-side-products a:hover { color: var(--blue, #145DA0); }
.sp-side-products img { width: 60px; height: 60px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: var(--bg, #F5F7FA); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .sp-layout { grid-template-columns: 1fr; gap: 30px; }
  .sp-side { position: static; }
  .sp-head h1 { font-size: 27px; }
  .sp-flow { grid-template-columns: 1fr 1fr; }
  .sp-flow li:nth-child(2)::after { display: none; }
}
@media (max-width: 600px) {
  .sp-article { font-size: 16px; }
  .sp-article h2 { font-size: 22px; margin-top: 40px; }
  .sp-toc-list { grid-template-columns: 1fr; }
  .sp-dl { grid-template-columns: 1fr; gap: 2px; }
  .sp-dl dd { margin-bottom: 8px; }
  .sp-links { grid-template-columns: 1fr; }
  .sp-flow { grid-template-columns: 1fr; }
  .sp-flow li::after { display: none; }
  .sp-cta { padding: 20px; }
  .sp-fig { padding: 10px; }
}
