/* ==========================================================================
   Bán Nhàn — trang HƯỚNG DẪN SỬ DỤNG (landingpage/huong-dan/)
   Nạp SAU style.css: dùng lại token màu, nút, nav, chân trang của landing page;
   file này chỉ thêm phần riêng của trung tâm hướng dẫn và trang bài viết.
   Bố cục bài viết học theo trang hướng dẫn của KiotViet: cây mục lục bên trái ·
   bài ở giữa · "Trong bài này" bên phải.
   ========================================================================== */

.guide-page { --nav-h: 74px; }
/* Bài viết có 3 cột nên khung rộng hơn landing (1160px); nav + breadcrumb rộng theo cho thẳng mép. */
.guide-page .nav .wrap, .gbar .wrap, .gdoc { max-width: 1400px; }
.guide-page .nav { background: rgba(255, 255, 255, .96); }
.nav__links a[aria-current="page"] { color: var(--brand); font-weight: 600; }

/* --- màu nhấn theo chủ đề (icon trong cây mục lục) --- */
.tone-brand { background: var(--tint-brand); color: var(--brand); }
.tone-sun { background: var(--tint-sun); color: #B97B06; }
.tone-mint { background: var(--tint-mint); color: var(--mint); }
.tone-sky { background: var(--tint-sky); color: var(--sky); }

/* ==========================================================================
   Ô tìm kiếm (dùng ở trang chủ hướng dẫn + đầu cây mục lục)
   ========================================================================== */

.gsearch { position: relative; width: 100%; }
.gsearch > svg {
    position: absolute; left: 16px; top: 50%; translate: 0 -50%;
    width: 20px; height: 20px; color: var(--muted); pointer-events: none;
}
.gsearch input {
    width: 100%;
    padding: 13px 16px 13px 46px;
    border: 2px solid var(--line-strong);
    border-radius: var(--r-pill);
    background: var(--white);
    color: var(--ink);
    font: inherit;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.gsearch input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--tint-brand); }
.gsearch--hero { max-width: 640px; margin-top: 8px; }
.gsearch--hero input { padding-block: 17px; font-size: 1.0625rem; box-shadow: var(--shadow); }
.gsearch--side input { padding-block: 9px; font-size: .9375rem; }
.gsearch--side > svg { width: 17px; height: 17px; left: 14px; }

.gsearch__list {
    position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 8px);
    margin: 0; padding: 6px; list-style: none;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-lg);
    max-height: min(420px, 60vh);
    overflow-y: auto;
    text-align: left;
}
.gsearch__list a {
    display: block; padding: 10px 12px; border-radius: 10px;
    text-decoration: none; line-height: 1.45;
}
.gsearch__list a:hover, .gsearch__list a.is-active { background: var(--paper-2); }
.gsearch__list b { display: block; font-weight: 600; }
.gsearch__list small { color: var(--muted); font-size: .8125rem; }
.gsearch__list mark { background: var(--tint-sun); color: inherit; border-radius: 3px; padding: 0 2px; }
.gsearch__empty { padding: 12px; color: var(--muted); font-size: .9375rem; }

/* ==========================================================================
   Trang chủ hướng dẫn
   ========================================================================== */

.ghero {
    padding-block: clamp(46px, 7vw, 86px) clamp(40px, 6vw, 70px);
    background:
        radial-gradient(900px 340px at 85% -10%, var(--tint-sky), transparent 70%),
        radial-gradient(700px 300px at 5% 110%, var(--tint-sun), transparent 70%),
        var(--paper);
}
.ghero__in { display: grid; gap: 16px; justify-items: center; text-align: center; }
.ghero h1 .hl { color: var(--brand); }
.ghero .lead { text-align: center; }
.ghero__popular {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px;
    margin-top: 6px; max-width: 760px; font-size: .9375rem;
}
.ghero__popular span { color: var(--muted); padding: 5px 2px; }
.ghero__popular a {
    padding: 5px 13px; border-radius: var(--r-pill);
    background: var(--white); border: 1px solid var(--line-strong);
    text-decoration: none; transition: border-color .15s ease, color .15s ease;
}
.ghero__popular a:hover { border-color: var(--brand); color: var(--brand-deep); }

.gquick-wrap { padding-block: clamp(44px, 6vw, 72px); }
.gquick {
    list-style: none; margin: 34px 0 0; padding: 0;
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px;
    counter-reset: q;
}
.gquick__item {
    position: relative; height: 100%;
    display: grid; justify-items: center; gap: 10px;
    padding: 26px 14px 22px; text-align: center; text-decoration: none;
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
a.gquick__item:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.gquick__item svg { width: 34px; height: 34px; color: var(--brand); }
.gquick__item b { font-family: var(--font-display); font-weight: 600; font-size: 1.0625rem; line-height: 1.3; }
.gquick__n {
    position: absolute; top: -13px; left: 50%; translate: -50% 0;
    width: 28px; height: 28px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--brand); color: #fff; font-weight: 700; font-size: .875rem;
    box-shadow: 0 0 0 4px var(--white);
}
@media (max-width: 900px) { .gquick { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 26px; } }

.gcats {
    margin-top: 36px;
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px;
}
.gcat {
    padding: 24px 24px 20px;
    background: var(--white); border: 1px solid var(--line); border-radius: var(--r);
    box-shadow: var(--shadow-sm);
    scroll-margin-top: calc(var(--nav-h) + 20px);
}
.gcat__head { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; }
.gcat__icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; }
.gcat__icon svg { width: 26px; height: 26px; }
.gcat h3 { font-size: 1.2rem; }
.gcat__head p { margin-top: 4px; color: var(--muted); font-size: .9063rem; line-height: 1.55; }
.gcat ul { list-style: none; margin: 16px 0 0; padding: 14px 0 0; border-top: 1px dashed var(--line-strong); display: grid; gap: 4px; }
.gcat li a {
    display: flex; gap: 8px; align-items: baseline;
    padding: 5px 0; text-decoration: none; font-size: .9688rem; line-height: 1.45;
}
.gcat li a::before { content: "›"; color: var(--brand); font-weight: 700; }
.gcat li a:hover { color: var(--brand-deep); text-decoration: underline; text-underline-offset: 3px; }
.gcat li.is-soon { padding: 5px 0 5px 14px; color: var(--muted); font-size: .9688rem; }
.gcat li.is-soon small { margin-left: 4px; padding: 1px 8px; border-radius: var(--r-pill); background: var(--paper-2); font-size: .75rem; }
@media (max-width: 1000px) { .gcats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .gcats { grid-template-columns: 1fr; } }

/* ==========================================================================
   Trang bài viết — thanh breadcrumb + bố cục 3 cột
   ========================================================================== */

.gbar { background: var(--white); border-bottom: 1px solid var(--line); }
.gbar__in { display: flex; align-items: center; gap: 14px; min-height: 48px; }
.crumbs {
    display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px;
    margin: 0; padding: 10px 0; list-style: none;
    font-size: .875rem; color: var(--muted);
}
.crumbs li + li::before { content: "›"; margin-right: 8px; color: var(--line-strong); font-weight: 700; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--brand); }
.crumbs [aria-current] { color: var(--ink); font-weight: 500; }

.gbar__menu {
    display: none; align-items: center; gap: 6px; flex: none;
    padding: 7px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-pill);
    background: var(--white); color: var(--ink); font: 600 .875rem var(--font-body); cursor: pointer;
}
.gbar__menu svg { width: 18px; height: 18px; }

.gdoc {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr) 220px;
    gap: 44px;
    align-items: start;
    padding-block: 34px 70px;
}

/* --- cây mục lục trái --- */
.gside {
    position: sticky; top: calc(var(--nav-h) + 18px);
    max-height: calc(100vh - var(--nav-h) - 36px);
    overflow-y: auto;
    padding-right: 6px;
    scrollbar-width: thin;
}
.gside__head { margin-bottom: 12px; }
.gside__home {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font-display); font-weight: 700; font-size: 1.125rem; text-decoration: none;
}
.gside__home svg { width: 22px; height: 22px; color: var(--brand); }
.gside__tree { margin-top: 16px; display: grid; gap: 2px; }
.gside__cat summary {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 8px; border-radius: 10px;
    font-weight: 600; font-size: .9375rem; line-height: 1.35;
    cursor: pointer; list-style: none; user-select: none;
}
.gside__cat summary::-webkit-details-marker { display: none; }
.gside__cat summary:hover { background: var(--paper-2); }
.gside__icon { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; }
.gside__icon svg { width: 16px; height: 16px; }
.gside__chev { width: 15px; height: 15px; margin-left: auto; color: var(--muted); transition: rotate .15s ease; }
.gside__cat[open] .gside__chev { rotate: 90deg; }
.gside__cat ul { list-style: none; margin: 2px 0 8px 22px; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.gside__cat li a {
    display: block; padding: 6px 10px; margin-left: -16px; padding-left: 14px;
    border-left: 2px solid transparent;
    font-size: .9063rem; line-height: 1.4; color: var(--muted); text-decoration: none;
}
.gside__cat li a:hover { color: var(--ink); }
.gside__cat li a[aria-current="page"] { color: var(--brand-deep); font-weight: 600; border-left-color: var(--brand); background: linear-gradient(90deg, var(--tint-brand), transparent); }

/* --- mục lục phải "Trong bài này" --- */
.gtoc { position: sticky; top: calc(var(--nav-h) + 18px); font-size: .875rem; }
.gtoc__title { font-weight: 700; font-family: var(--font-display); font-size: 1rem; margin-bottom: 8px; }
.gtoc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); display: grid; }
.gtoc a {
    display: block; padding: 5px 0 5px 14px; margin-left: -2px;
    border-left: 2px solid transparent;
    color: var(--muted); text-decoration: none; line-height: 1.45;
}
.gtoc a:hover { color: var(--ink); }
.gtoc a.is-active { color: var(--brand-deep); border-left-color: var(--brand); font-weight: 600; }

/* ==========================================================================
   Nội dung bài
   ========================================================================== */

.garticle__head { display: grid; gap: 14px; justify-items: start; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.garticle__head .chip { text-decoration: none; }
.garticle__head h1 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); }
.garticle__meta { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .875rem; }
.garticle__meta svg { width: 16px; height: 16px; }

.prose { padding-top: 10px; max-width: 800px; }
.prose > * + * { margin-top: 16px; }
.prose h2 {
    margin-top: 46px; padding-top: 4px;
    font-size: clamp(1.4rem, 2.4vw, 1.75rem);
    scroll-margin-top: calc(var(--nav-h) + 20px);
}
.prose h3 { margin-top: 30px; font-size: 1.2rem; }
.prose h2 + *, .prose h3 + * { margin-top: 12px; }
.prose p, .prose li { color: #3E3230; }
.prose a { color: var(--brand-deep); text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 6px; }
.prose strong { color: var(--ink); }

/* Tên nút / mục menu trong phần mềm: <span class="ui">Thêm hàng hóa</span> */
.prose .ui {
    display: inline-block; padding: 0 8px; margin: 0 1px;
    border: 1px solid var(--line-strong); border-radius: 6px;
    background: var(--white); color: var(--ink);
    font-weight: 600; font-size: .92em; line-height: 1.6;
    box-shadow: 0 1px 0 var(--line-strong);
    white-space: nowrap;
}
.prose kbd {
    display: inline-block; padding: 0 7px; min-width: 1.6em; text-align: center;
    border: 1px solid var(--line-strong); border-bottom-width: 3px; border-radius: 6px;
    background: var(--white); font: 600 .85em/1.6 var(--font-body);
}
/* Số trong ảnh (khung đỏ) được nhắc lại trong câu: <span class="num">1</span> */
.prose .num {
    display: inline-grid; place-items: center;
    width: 1.5em; height: 1.5em; border-radius: 50%;
    background: #E11D48; color: #fff; font-weight: 700; font-size: .8em; vertical-align: .1em;
}

/* Danh sách bước: <ol class="buoc"> (KHÔNG dùng tên .steps — trùng khối "Cách hoạt động" của style.css)<li>…</li></ol> */
.prose ol.buoc { list-style: none; padding: 0; counter-reset: step; display: grid; gap: 14px; }
.prose ol.buoc > li {
    position: relative; margin: 0;
    padding: 14px 18px 14px 58px;
    background: var(--white); border: 1px solid var(--line); border-radius: var(--r-sm);
    counter-increment: step;
}
.prose ol.buoc > li::before {
    content: counter(step);
    position: absolute; left: 16px; top: 14px;
    width: 28px; height: 28px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--brand); color: #fff; font-weight: 700; font-size: .875rem; line-height: 1;
}
.prose ol.buoc > li > figure { margin-top: 12px; }

/* Ảnh chụp màn hình */
.prose figure { margin: 22px 0 0; }
.prose figure img {
    display: block; width: 100%; height: auto;
    border: 1px solid var(--line-strong); border-radius: 12px;
    box-shadow: var(--shadow);
    background: var(--white);
    cursor: zoom-in;
}
.prose figure.shot--small img { width: auto; max-width: min(100%, 560px); }
.prose figcaption { margin-top: 10px; color: var(--muted); font-size: .875rem; text-align: center; line-height: 1.5; }

/* Hộp ghi chú: <div class="note tip|warn|info"><p class="note__title">…</p><p>…</p></div> */
.prose .note {
    position: relative;
    padding: 16px 18px 16px 54px;
    border-radius: var(--r-sm);
    background: var(--tint-sky); border: 1px solid #CFE0F2;
}
.prose .note::before {
    content: ""; position: absolute; left: 18px; top: 17px; width: 22px; height: 22px;
    background: currentColor;
    color: var(--sky);
    -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat;
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5.5'/%3E%3Ccircle cx='12' cy='7.6' r='.6' fill='black'/%3E%3C/svg%3E");
}
.prose .note > * + * { margin-top: 6px; }
.prose .note p, .prose .note li { color: var(--ink); font-size: .9688rem; }
.prose .note__title { font-weight: 700; }
.prose .note.tip { background: var(--tint-mint); border-color: #C3E9DA; }
.prose .note.tip::before {
    color: var(--mint);
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6M10 21h4'/%3E%3Cpath d='M12 3a6 6 0 0 0-3.6 10.8c.7.6 1.1 1.4 1.1 2.2h5c0-.8.4-1.6 1.1-2.2A6 6 0 0 0 12 3z'/%3E%3C/svg%3E");
}
.prose .note.warn { background: var(--tint-sun); border-color: #F6DFA9; }
.prose .note.warn::before {
    color: #C77A00;
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.5 2.8 19.5h18.4z'/%3E%3Cpath d='M12 10v4.2'/%3E%3Ccircle cx='12' cy='16.9' r='.6' fill='black'/%3E%3C/svg%3E");
}

/* Bảng giải thích (vd ý nghĩa từng cột) */
.prose table { width: 100%; border-collapse: collapse; font-size: .9375rem; background: var(--white); border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); }
.prose th, .prose td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose th { background: var(--paper-2); font-weight: 600; }
.prose tr:last-child td { border-bottom: 0; }
.prose .table-wrap { overflow-x: auto; }

/* Hỏi đáp trong bài: <details class="faq"><summary>…</summary><p>…</p></details> */
.prose details.faq { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--white); padding: 0 18px; }
.prose details.faq + details.faq { margin-top: 10px; }
.prose details.faq summary { padding: 14px 0; font-weight: 600; cursor: pointer; }
.prose details.faq[open] summary { border-bottom: 1px dashed var(--line); margin-bottom: 12px; }
.prose details.faq > :last-child { padding-bottom: 14px; }

/* --- bài trước / sau --- */
.gpager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 54px; max-width: 800px; }
.gpager a {
    display: grid; gap: 4px; padding: 16px 20px;
    border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--white);
    text-decoration: none; transition: border-color .15s ease, transform .15s ease;
}
.gpager a:hover { border-color: var(--brand); transform: translateY(-2px); }
.gpager small { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .8125rem; }
.gpager small svg { width: 15px; height: 15px; }
.gpager b { font-family: var(--font-display); font-weight: 600; font-size: 1.0625rem; line-height: 1.3; }
.gpager__next { text-align: right; justify-items: end; }

.grelated { margin-top: 44px; max-width: 800px; }
.grelated h2 { font-size: 1.3rem; }
.grelated ul { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grelated a {
    display: grid; gap: 3px; height: 100%; padding: 14px 16px;
    border-radius: var(--r-sm); background: var(--paper-2); text-decoration: none;
    transition: background-color .15s ease;
}
.grelated a:hover { background: var(--tint-brand); }
.grelated b { font-weight: 600; line-height: 1.35; }
.grelated span { color: var(--muted); font-size: .875rem; line-height: 1.5; }

.ghelp {
    display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
    margin-top: 44px; max-width: 800px; padding: 22px 24px;
    border-radius: var(--r); background: var(--tint-brand);
}
.ghelp h3 { font-size: 1.2rem; }
.ghelp p { margin-top: 4px; color: var(--muted); font-size: .9375rem; max-width: 50ch; }
.ghelp--wide { max-width: none; margin-top: 0; padding: 30px 34px; }
.ghelp__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* --- ảnh phóng to khi bấm --- */
.zoom {
    position: fixed; inset: 0; z-index: 200;
    display: grid; place-items: center; padding: 3vmin;
    background: rgba(28, 18, 15, .86); cursor: zoom-out;
}
.zoom[hidden] { display: none; }
.zoom img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); background: #fff; }
.zoom__close {
    position: absolute; top: 14px; right: 18px;
    width: 44px; height: 44px; border: 0; border-radius: 50%;
    background: rgba(255, 255, 255, .16); color: #fff; font-size: 28px; line-height: 1; cursor: pointer;
}

/* ==========================================================================
   Co giãn
   ========================================================================== */

@media (max-width: 1200px) {
    .gdoc { grid-template-columns: 250px minmax(0, 1fr); gap: 36px; }
    .gtoc { display: none; }
}

@media (max-width: 900px) {
    .gdoc { grid-template-columns: minmax(0, 1fr); padding-top: 22px; }
    .gbar__menu { display: inline-flex; }
    .crumbs li:not(:last-child):not(:nth-last-child(2)) { display: none; }
    .gside {
        position: fixed; z-index: 90; top: 0; bottom: 0; left: 0;
        width: min(330px, 88vw); max-height: none;
        padding: 20px 18px 30px;
        background: var(--white); box-shadow: var(--shadow-lg);
        translate: -105% 0; transition: translate .22s ease;
    }
    .gside.is-open { translate: 0 0; }
    .gside-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(28, 18, 15, .4); }
    .gpager, .grelated ul { grid-template-columns: 1fr; }
    .gpager__next { text-align: left; justify-items: start; }
}

@media (max-width: 520px) {
    .prose ol.buoc > li { padding: 12px 14px 12px 50px; }
    .prose ol.buoc > li::before { left: 12px; top: 12px; }
    .prose .note { padding-left: 48px; }
    .prose .note::before { left: 15px; }
}

@media (prefers-reduced-motion: reduce) {
    .gside, .gside__chev, .gquick__item, .gpager a { transition: none; }
}
