/* ===== Tờ thông tin thuốc ===== */
.bvht-tree{
  --c-blue:#0e5aa7; --c-blue-d:#0a4583; --c-tint:#eaf2fb; --c-tint2:#f5f9fd;
  --c-ink:#14273c; --c-muted:#566779; --c-line:#dde5ee; --c-mark:#ffe59a;
  color:var(--c-ink); font-size:16px; line-height:1.55; margin:0 0 40px;
  container-type:inline-size; container-name:bvht;
}
.bvht-tree *{box-sizing:border-box}
.bvht-tree button{font-family:inherit;text-transform:none;letter-spacing:0;min-height:0;margin:0;box-shadow:none}
.bvht-tree :focus-visible{outline:3px solid #f2b705;outline-offset:2px}

/* Đầu trang: tìm kiếm */
.bvht-tree .bt-hero{position:relative;overflow:hidden;background:var(--c-blue);color:#fff;border-radius:18px;padding:34px 36px 30px;margin-bottom:28px}
.bvht-tree .bt-hero::after{content:"";position:absolute;right:-40px;top:-40px;width:220px;height:220px;opacity:.09;
  background:no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M9 2h6v7h7v6h-7v7H9v-7H2V9h7z'/%3E%3C/svg%3E")}
.bvht-tree .bt-title{color:#fff;font-size:30px;line-height:1.2;font-weight:700;margin:0 0 6px}
.bvht-tree .bt-lead{color:#d9e8f8;font-size:16px;margin:0 0 20px;max-width:620px}
.bvht-tree .bt-sbox{position:relative;max-width:720px}
.bvht-tree .bt-sbox>svg{position:absolute;left:18px;top:50%;width:22px;height:22px;transform:translateY(-50%);color:var(--c-muted);pointer-events:none}
.bvht-tree input.bt-search{display:block;width:100%;height:58px;margin:0;padding:0 54px 0 52px;border:0;border-radius:12px;background:#fff;color:var(--c-ink);
  font-size:18px;box-shadow:0 6px 18px rgba(4,35,70,.25);text-transform:none}
.bvht-tree input.bt-search::placeholder{color:#8796a6}
.bvht-tree input.bt-search:focus{outline:3px solid #f2b705;outline-offset:0;box-shadow:0 6px 18px rgba(4,35,70,.25)}
.bvht-tree .bt-clear{position:absolute;right:10px;top:50%;transform:translateY(-50%);display:none;width:38px;height:38px;padding:0;border:0;border-radius:50%;
  background:var(--c-tint);color:var(--c-ink);font-size:22px;line-height:38px;cursor:pointer}
.bvht-tree.has-q .bt-clear{display:block}

/* Bố cục */
.bvht-tree .bt-body{display:grid;grid-template-columns:270px minmax(0,1fr);gap:32px;align-items:start}
.bvht-tree .bt-side{position:sticky;top:110px}
.bvht-tree .bt-side-t{font-size:15px;font-weight:700;color:var(--c-muted);margin:0 0 10px 12px}
.bvht-tree .bt-groups{display:flex;flex-direction:column;gap:2px;max-height:calc(100vh - 170px);overflow:auto;padding-right:4px}
.bvht-tree .bt-gbtn{display:flex;align-items:center;gap:10px;width:100%;padding:10px 12px;border:0;border-radius:10px;background:transparent;color:var(--c-ink);
  font-size:15px;line-height:1.35;font-weight:500;text-align:left;cursor:pointer}
.bvht-tree .bt-gbtn:hover{background:var(--c-tint2)}
.bvht-tree .bt-gbtn.on{background:var(--c-tint);color:var(--c-blue-d);font-weight:700;box-shadow:inset 3px 0 0 var(--c-blue)}
.bvht-tree .bt-gname{flex:1}
.bvht-tree .bt-gcount{flex:0 0 auto;min-width:28px;padding:1px 8px;border-radius:20px;background:#eef2f6;color:var(--c-muted);font-size:13px;font-weight:600;text-align:center}
.bvht-tree .bt-gbtn.on .bt-gcount{background:var(--c-blue);color:#fff}
/* Danh mục dạng cây */
.bvht-tree .bt-groups-tree{gap:0}
.bvht-tree .bt-nrow{display:flex;align-items:center;gap:2px;padding-left:calc(var(--d,0) * 16px)}
.bvht-tree .bt-nrow .bt-gbtn{flex:1;min-width:0}
.bvht-tree .bt-node .bt-node .bt-gbtn{font-size:14.5px;padding-top:8px;padding-bottom:8px}
.bvht-tree .bt-tog,.bvht-tree .bt-tog-sp{flex:0 0 26px;width:26px;height:26px}
.bvht-tree .bt-tog{display:flex;align-items:center;justify-content:center;padding:0;border:0;border-radius:6px;background:transparent;cursor:pointer}
.bvht-tree .bt-tog:hover{background:var(--c-tint)}
.bvht-tree .bt-tog span{width:8px;height:8px;border-right:2px solid var(--c-blue);border-bottom:2px solid var(--c-blue);transform:rotate(-45deg);transition:transform .15s}
.bvht-tree .bt-node.open>.bt-nrow .bt-tog span{transform:rotate(45deg)}
.bvht-tree .bt-kids{display:none;margin-left:12px;border-left:1px dashed var(--c-line)}
.bvht-tree .bt-node.open>.bt-kids{display:block}

.bvht-tree .bt-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:0 0 6px}
.bvht-tree .bt-status{min-height:24px;margin:0;color:var(--c-muted);font-size:15px}
.bvht-tree .bt-sort{display:flex;align-items:center;gap:8px;margin:0;color:var(--c-muted);font-size:14px;font-weight:500}
.bvht-tree select.bt-sort-sel{width:auto;height:38px;margin:0;padding:0 34px 0 12px;border:1.5px solid var(--c-line);border-radius:10px;background-color:#fff;
  color:var(--c-ink);font-size:15px;box-shadow:none}
.bvht-tree .bt-list{transition:opacity .15s}
.bvht-tree.is-loading .bt-list{opacity:.45;pointer-events:none}
.bvht-tree .bt-grp{margin:4px 0 0;color:var(--c-blue);font-size:13px;font-weight:600}
.bvht-tree .bt-capped{margin:16px 0 0;padding:12px 16px;border-radius:10px;background:var(--c-tint2);color:var(--c-muted);font-size:15px;text-align:center}
.bvht-tree.no-side .bt-body{grid-template-columns:minmax(0,1fr)}
.bvht-tree .bt-status strong{color:var(--c-ink)}

/* Nhóm và thuốc */
.bvht-tree .bt-sec{margin:0 0 26px}
.bvht-tree .bt-sec-title{display:flex;align-items:baseline;gap:10px;margin:0;padding:14px 0 10px;border-bottom:2px solid var(--c-ink);
  color:var(--c-ink);font-size:20px;line-height:1.3;font-weight:700}
.bvht-tree .bt-sec-count{margin-left:auto;font-size:14px;font-weight:500;color:var(--c-muted);white-space:nowrap}
.bvht-tree ul.bt-items{list-style:none;margin:0;padding:0}
.bvht-tree li.bt-item{display:grid;grid-template-columns:52px minmax(0,1fr) auto;gap:16px;align-items:center;margin:0;padding:16px 4px;border-bottom:1px solid var(--c-line);list-style:none}
.bvht-tree .bt-form{display:flex;align-items:center;justify-content:center;width:52px;height:52px;border-radius:14px;background:var(--c-tint);color:var(--c-blue)}
.bvht-tree .bt-form svg{width:32px;height:32px}
.bvht-tree .bt-form-cream{background:#e8f6f1;color:#0f7a5c}
.bvht-tree .bt-form-capsule{background:#f2eefb;color:#5b3fa6}
.bvht-tree .bt-form-suppo{background:#fdf1e6;color:#a4580f}
.bvht-tree .bt-form-liquid{background:#e7f5f9;color:#0d6f87}
.bvht-tree .bt-form-sachet{background:#fdf6e3;color:#9a6b00}
.bvht-tree .bt-form-hoan{background:#f5efe6;color:#7a5418}
.bvht-tree .bt-form-sui{background:#e8f3fb;color:#1d6aa8}
.bvht-tree .bt-form-spray{background:#eef0fb;color:#3d4fb0}
.bvht-tree .bt-form-drop{background:#e5f5fb;color:#0b7aa8}
.bvht-tree .bt-form-inject{background:#fdecec;color:#b4232f}
.bvht-tree .bt-form-infusion{background:#fcebf3;color:#a3265e}
.bvht-tree .bt-form-patch{background:#eff5e4;color:#557a12}
.bvht-tree h4.bt-name{margin:0;color:var(--c-ink);font-size:18px;line-height:1.3;font-weight:700;letter-spacing:.01em}
.bvht-tree .bt-hc{margin:3px 0 0;color:var(--c-ink);font-size:15px;line-height:1.45}
.bvht-tree .bt-k{color:var(--c-muted)}
.bvht-tree .bt-db{margin:2px 0 0;color:var(--c-muted);font-size:14px;line-height:1.4}
.bvht-tree mark{background:var(--c-mark);color:inherit;padding:0 1px;border-radius:2px}

.bvht-tree .bt-actions{display:flex;gap:8px}
.bvht-tree .bt-act{border:0;cursor:pointer;font-family:inherit;text-transform:none;letter-spacing:0;margin:0;min-height:0;line-height:1;display:inline-flex;align-items:center;justify-content:center;gap:6px;height:42px;padding:0 16px;border-radius:10px;
  font-size:15px;font-weight:600;text-decoration:none;white-space:nowrap;transition:background-color .15s,color .15s}
.bvht-tree .bt-act svg{width:18px;height:18px;flex:0 0 auto}
.bvht-tree .bt-view{background:var(--c-blue);color:#fff}
.bvht-tree .bt-view:hover{background:var(--c-blue-d);color:#fff}
.bvht-tree a.bt-dl{background:#fff;color:var(--c-blue);border:1.5px solid #b9cfe6}
.bvht-tree a.bt-dl:hover{background:var(--c-tint);color:var(--c-blue-d);border-color:var(--c-blue)}
.bvht-tree .bt-soon{color:var(--c-muted);font-size:14px;font-style:italic}

.bvht-tree .bt-empty{padding:36px 24px;border:1.5px dashed var(--c-line);border-radius:14px;text-align:center;color:var(--c-muted)}
.bvht-tree .bt-empty p{margin:0 0 8px}
.bvht-tree .bt-empty-t{font-size:18px;font-weight:700;color:var(--c-ink)}
.bvht-tree .bt-reset,.bvht-tree .bt-retry{margin-top:8px;height:42px;padding:0 18px;border:0;border-radius:10px;background:var(--c-blue);color:#fff;font-size:15px;font-weight:600;cursor:pointer}

/* Phân trang */
.bvht-tree .bt-pager{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:6px;margin-top:22px}
.bvht-tree .bt-pager:empty{display:none}
.bvht-tree .bt-pg{min-width:42px;height:42px;padding:0 10px;border:1.5px solid var(--c-line);border-radius:10px;background:#fff;color:var(--c-ink);font-size:16px;font-weight:600;line-height:39px;cursor:pointer}
.bvht-tree .bt-pg:hover:not([disabled]):not(.cur){border-color:var(--c-blue);color:var(--c-blue)}
.bvht-tree .bt-pg.cur{background:var(--c-blue);border-color:var(--c-blue);color:#fff;cursor:default}
.bvht-tree .bt-pg[disabled]{opacity:.35;cursor:default}
.bvht-tree .bt-pg-gap{padding:0 4px;color:var(--c-muted)}

/* Máy tính bảng & điện thoại */
/* Co giãn theo chiều rộng khung chứa (cột rộng hay hẹp đều đúng) */
@container bvht (max-width:860px){
  .bvht-tree .bt-body{grid-template-columns:minmax(0,1fr);gap:8px}
  .bvht-tree .bt-side{position:static}
  .bvht-tree .bt-side-t{display:none}
  .bvht-tree .bt-groups{flex-direction:row;max-height:none;overflow-x:auto;gap:8px;padding:2px 0 10px;scrollbar-width:thin}
  .bvht-tree .bt-gbtn{width:auto;flex:0 0 auto;white-space:nowrap;border:1.5px solid var(--c-line);background:#fff;padding:8px 12px}
  .bvht-tree .bt-gbtn.on{box-shadow:none;border-color:var(--c-blue)}
  /* Cây nhóm trên màn hẹp: giữ dạng dọc, khung cuộn */
  .bvht-tree .bt-groups.bt-groups-tree{flex-direction:column;overflow:auto;max-height:320px;padding:6px;border:1.5px solid var(--c-line);border-radius:12px;gap:0}
  .bvht-tree .bt-groups-tree .bt-gbtn{width:100%;white-space:normal;border:0;background:transparent}
  .bvht-tree .bt-groups-tree .bt-gbtn.on{background:var(--c-tint)}
}
@container bvht (max-width:580px){
  .bvht-tree .bt-hero{padding:24px 18px 22px}
  .bvht-tree .bt-title{font-size:24px}
  .bvht-tree .bt-hero::after{width:150px;height:150px;right:-50px;top:-30px}
  .bvht-tree .bt-lead{font-size:15px}
  .bvht-tree input.bt-search{height:52px;font-size:16px}
  .bvht-tree li.bt-item{grid-template-columns:44px minmax(0,1fr);gap:12px;align-items:start}
  .bvht-tree .bt-form{width:44px;height:44px;border-radius:12px}
  .bvht-tree .bt-form svg{width:28px;height:28px}
  .bvht-tree .bt-actions{grid-column:1 / -1}
  .bvht-tree .bt-act{flex:1}
  .bvht-tree .bt-sec-title{font-size:18px}
}
/* Trình duyệt cũ không hỗ trợ container query: dùng chiều rộng màn hình */
@supports not (container-type:inline-size){
  @media (max-width:900px){
    .bvht-tree .bt-body{grid-template-columns:minmax(0,1fr)}
    .bvht-tree .bt-side{position:static}
    .bvht-tree .bt-groups{flex-direction:row;max-height:none;overflow-x:auto;gap:8px}
    .bvht-tree .bt-gbtn{width:auto;flex:0 0 auto;white-space:nowrap}
  }
  @media (max-width:600px){
    .bvht-tree li.bt-item{grid-template-columns:44px minmax(0,1fr)}
    .bvht-tree .bt-actions{grid-column:1 / -1}
    .bvht-tree .bt-act{flex:1}
  }
}
@media (max-width:600px){
  .bvht-tree .bt-hero{border-radius:0;margin-left:-15px;margin-right:-15px}
}
@media (prefers-reduced-motion:reduce){.bvht-tree *{transition:none!important;scroll-behavior:auto!important}}

/* Cửa sổ xem PDF */
html.bvht-noscroll{overflow:hidden}
.bvht-modal{position:fixed;inset:0;z-index:999999;display:none;align-items:center;justify-content:center;padding:20px;background:rgba(15,25,35,.62)}
.bvht-modal.show{display:flex}
.bvht-modal *{box-sizing:border-box}
.bvht-modal .bm-box{display:flex;flex-direction:column;width:100%;max-width:1040px;height:100%;background:#fff;border-radius:12px;overflow:hidden;box-shadow:0 10px 40px rgba(0,0,0,.3)}
.bvht-modal .bm-head{display:flex;align-items:center;gap:8px;padding:10px 12px 10px 16px;border-bottom:1px solid #dde5ee;background:#f5f9fd}
.bvht-modal .bm-title{flex:1;min-width:0;font-size:17px;color:#0e5aa7;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bvht-modal .bm-pages{color:#566779;font-size:14px;white-space:nowrap}
.bvht-modal .bm-zoom{display:flex;gap:4px}
.bvht-modal .bm-btn{display:inline-flex;align-items:center;justify-content:center;gap:5px;height:38px;min-width:38px;min-height:0;margin:0;padding:0 10px;border:1.5px solid #dde5ee;border-radius:9px;
  background:#fff;color:#14273c;font-family:inherit;font-size:15px;font-weight:600;line-height:1;text-decoration:none;text-transform:none;letter-spacing:0;cursor:pointer;box-shadow:none}
.bvht-modal .bm-btn:hover{border-color:#0e5aa7;color:#0e5aa7}
.bvht-modal .bm-btn svg{width:17px;height:17px}
.bvht-modal .bm-zfit{min-width:62px;font-size:14px}
.bvht-modal .bm-close{font-size:26px;font-weight:400}
.bvht-modal .bm-dl{color:#0e5aa7}
.bvht-modal :focus-visible{outline:3px solid #f2b705;outline-offset:1px}
.bvht-modal .bm-body{flex:1;overflow:auto;background:#e4e9ef;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
.bvht-modal .bm-body{position:relative}
.bvht-modal .bm-pagesbox{display:flex;flex-direction:column;align-items:center;gap:14px;padding:12px;min-width:min-content}
.bvht-modal .bm-page{position:relative;flex:0 0 auto;display:flex;align-items:center;justify-content:center;background:#fff;box-shadow:0 1px 6px rgba(20,39,60,.18)}
.bvht-modal .bm-page canvas{display:block;width:100%;height:100%}
.bvht-modal.no-dl .bm-page{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.bvht-modal .bm-perr{color:#b32d2e;font-size:14px}
.bvht-modal .bm-msg{padding:60px 20px;text-align:center;color:#566779;font-size:16px;line-height:2}
.bvht-modal .bm-msg .bm-btn{margin-top:12px}
.bvht-modal .bm-spin{display:inline-block;width:20px;height:20px;margin-right:8px;vertical-align:-4px;border:2.5px solid #cfd8e3;border-top-color:#0e5aa7;border-radius:50%;animation:bvhtspin .8s linear infinite}
@keyframes bvhtspin{to{transform:rotate(360deg)}}
@media (max-width:600px){
  .bvht-modal{padding:0}
  .bvht-modal .bm-box{border-radius:0}
  .bvht-modal .bm-head{flex-wrap:wrap;padding:8px 8px 8px 12px}
  .bvht-modal .bm-title{flex:1 1 calc(100% - 50px);order:1}
  .bvht-modal .bm-close{order:2}
  .bvht-modal .bm-pages{order:3;flex:1}
  .bvht-modal .bm-zoom{order:4}
  .bvht-modal .bm-dl,.bvht-modal .bm-print{order:5}
  .bvht-modal .bm-dl span{display:none}
  .bvht-modal .bm-pagesbox{padding:8px;gap:8px}
}
@media (prefers-reduced-motion:reduce){.bvht-modal .bm-spin{animation-duration:2s}}
/* Khi tắt tải về: in trang (kể cả từ menu trình duyệt) chỉ ra thông báo */
@media print{
  html.bvht-noprint body *{display:none!important}
  html.bvht-noprint body::before{content:"Tài liệu này chỉ xem trên website.";display:block;padding:40px;font:16px sans-serif;text-align:center}
}

/* Ảnh hộp thuốc (ảnh đại diện) thay cho biểu tượng */
.bvht-tree .bt-form.has-thumb{background:#fff;border:1px solid var(--c-line);overflow:hidden;padding:2px}
.bvht-tree .bt-form.has-thumb img{width:100%;height:100%;object-fit:contain;display:block}

/* Nội dung soạn thảo: trong cửa sổ xem và trang riêng của thuốc */
.bvht-doc{color:#14273c;font-size:17px;line-height:1.65;overflow-wrap:break-word}
.bvht-doc p{margin:0 0 .7em}
.bvht-doc h1,.bvht-doc h2,.bvht-doc h3,.bvht-doc h4{color:#0a4583;line-height:1.3;margin:1.1em 0 .5em}
.bvht-doc ol,.bvht-doc ul{margin:.3em 0 .8em 1.4em;padding:0}
.bvht-doc li{margin:0 0 .35em}
.bvht-doc ol>li::marker{font-weight:700;color:#0a4583}
.bvht-doc img{max-width:100%;height:auto}
.bvht-doc table{border-collapse:collapse;width:100%;margin:.6em 0 1em}
.bvht-doc td,.bvht-doc th{border:1px solid #c9d4e0;padding:6px 10px;vertical-align:top}
.bvht-doc th{background:#eaf2fb}
.bvht-modal.is-html .bm-pagesbox{display:block;padding:16px}
.bvht-modal .bm-doc{max-width:820px;margin:0 auto;padding:40px 48px;background:#fff;box-shadow:0 1px 6px rgba(20,39,60,.18)}
.bvht-modal .bm-updated{max-width:820px;margin:10px auto 0;color:#566779;font-size:14px;text-align:right}
.bvht-modal .bm-pages a{color:#0e5aa7;font-weight:600}
.bvht-modal.no-dl .bm-doc{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.bvht-modal .bm-print{color:#0e5aa7}
@media (max-width:600px){
  .bvht-modal.is-html .bm-pagesbox{padding:0}
  .bvht-modal .bm-doc{padding:20px 16px;box-shadow:none}
  .bvht-modal .bm-print span{display:none}
}
/* Nút In: chỉ in nội dung đang xem */
@media print{
  html.bvht-printdoc body>*:not(.bvht-modal){display:none!important}
  html.bvht-printdoc .bvht-modal{position:static;display:block;padding:0;background:none}
  html.bvht-printdoc .bvht-modal .bm-box{display:block;height:auto;max-width:none;box-shadow:none;border-radius:0}
  html.bvht-printdoc .bvht-modal .bm-head,html.bvht-printdoc .bvht-modal .bm-updated{display:none}
  html.bvht-printdoc .bvht-modal .bm-body{overflow:visible;background:none}
  html.bvht-printdoc .bvht-modal .bm-doc{box-shadow:none;padding:0;max-width:none}
}
