/* hichem.org giao diện "Kho hàng", bản A (anh chọn 30/10/2026). Spec: docs/specs/2026-10-30-hichem-ux-design.md.
   Nguồn duy nhất của màu web là khối :root này (ux-ui-rule mục 1). Không dùng cam (gần --brand của Phú Poly, ux-ui-rule 6.3). */
:root {
  --xanh: #1E6B2E;      /* nút Gọi, link, viền thẻ; 6.57:1 trên trắng */
  --xanh-dam: #123F1C;  /* header, chân trang; chữ trắng 11.98:1 */
  --xanh-nhat: #E8F3EA; /* nền ô ghi chú; chữ --xanh 5.77:1 */
  --tem: #F4C542;       /* tem nhãn, viền focus; chữ --chu 10.28:1, trên --xanh-dam 7.36:1 */
  --chu: #1A1F1B;       /* chữ thân 16.72:1 */
  --chu-phu: #4D574F;   /* chữ phụ 7.52:1 trên trắng, 6.69:1 trên --be-tong */
  --nen: #ffffff;
  --be-tong: #F1F2EF;   /* nền khối phụ */
  --vien: #D8DCD6;      /* viền thẻ, bảng, hover menu */
  --zalo: #0068FF;      /* nút Zalo, chữ trắng 4.75:1 */
  --chinh2: var(--xanh);      /* tên token partial menu kit */
  --nhan-sang: var(--tem);    /* tên token partial menu kit */
  --bo: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.6 var(--font); color: var(--chu); background: var(--nen); padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--xanh); }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--tem); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 21px; font-weight: 800; margin-top: 1.4em; }
h3 { font-size: 17px; font-weight: 700; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* Header: logo chữ + menu kit */
.dau { background: var(--xanh-dam); color: #ffffff; }
.dau .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 16px; padding-top: 6px; }
.logo { color: #ffffff; text-decoration: none; display: flex; flex-direction: column; justify-content: center; min-height: 48px; line-height: 1.15; }
.logo b { font-size: 20px; font-weight: 900; letter-spacing: -.01em; }
.logo b span { color: var(--tem); }
.logo small { font-size: 12px; opacity: .9; }
.dau nav.menu { gap: 0 16px; }

/* Tem nhãn, nút */
.tem { display: inline-block; background: var(--tem); color: var(--chu); font-weight: 800; font-size: 13px; padding: 3px 10px; border-radius: 4px; }
.gio { color: var(--chu-phu); font-size: 15px; margin: 0 0 14px; }
.nut-hang { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.nut { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 18px; border-radius: var(--bo); font-weight: 800; text-decoration: none; font-size: 16px; }
.nut-goi { background: var(--xanh); color: #ffffff; }
.nut-vien { border: 2px solid var(--xanh); color: var(--xanh); background: var(--nen); }

/* Trang chủ: hero A ảnh tràn 4:3 */
.hero-a img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.hero-a .wrap { padding-top: 18px; padding-bottom: 8px; }
.hero-a .tem { margin-bottom: 10px; }
.hero-a h1 { margin-top: 0; }
.khoi { padding: 28px 0; }
.khoi h2 { margin-top: 0; }
.khoi.xam { background: var(--be-tong); }

/* Thẻ sản phẩm ngang (bài học vatlieucachdien 4) */
.the-ds { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.the { display: grid; grid-template-columns: 96px 1fr; gap: 12px; height: 100%; background: var(--nen); border-radius: var(--bo); overflow: hidden; border: 1px solid var(--vien); border-top: 6px solid var(--xanh); text-decoration: none; color: var(--chu); }
.the img { width: 96px; height: 100%; min-height: 96px; object-fit: cover; }
.the div { padding: 10px 10px 10px 0; }
.the h3 { margin: 0 0 2px; color: var(--xanh-dam); }
.the p { margin: 0; font-size: 14px; color: var(--chu-phu); line-height: 1.45; }
.the .gia { color: var(--chu); font-weight: 700; }
.the.het { border-top-color: var(--chu-phu); }
.het-o { display: flex; align-items: center; justify-content: center; background: var(--be-tong); min-height: 96px; }
.kho ol { padding-left: 20px; margin: 12px 0 0; }
.kho li { margin-bottom: 8px; }
.kho-luoi > * + * { margin-top: 16px; }

/* Trang nội dung */
.noi-dung { max-width: 760px; padding-top: 20px; padding-bottom: 32px; }
.noi-dung h1 { margin-top: .2em; }
.noi-dung table { width: 100%; border-collapse: collapse; font-size: 15px; }
.noi-dung th, .noi-dung td { border: 1px solid var(--vien); padding: 8px 10px; text-align: left; vertical-align: top; }
.noi-dung th { background: var(--be-tong); }
.bang { overflow-x: auto; }
.author-byline { font-size: 14px; color: var(--chu-phu); margin: 0 0 12px; }
.cach-lam { background: var(--xanh-nhat); border-left: 4px solid var(--xanh); border-radius: 0 var(--bo) var(--bo) 0; padding: 4px 16px 8px; margin: 28px 0 0; }
.cach-lam h2 { margin-top: .8em; font-size: 18px; }
figure { margin: 18px 0; }
figure img { border-radius: var(--bo); }
figcaption { font-size: 14px; color: var(--chu-phu); margin-top: 6px; }
.faq { margin-top: 28px; }
.faq-item { border: 1px solid var(--vien); border-radius: var(--bo); margin-bottom: 8px; padding: 0 14px; }
.faq-item summary { cursor: pointer; font-weight: 700; min-height: 48px; display: flex; align-items: center; }
.faq-item p { margin: 0 0 12px; }

/* Chân trang */
.chan { background: var(--xanh-dam); color: #ffffff; padding: 24px 0; font-size: 15px; }
.chan a { color: #ffffff; }
.chan p { margin: 0 0 8px; }

/* Thanh dính đáy: Gọi, Zalo, Chỉ đường (lệch ux-ui-rule 3.1 có lý do, spec mục 5.4) */
.thanh { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 8px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: var(--nen); box-shadow: 0 -2px 12px rgba(0, 0, 0, .12); }
.thanh a { min-height: 52px; display: flex; align-items: center; justify-content: center; border-radius: var(--bo); font-weight: 800; text-decoration: none; font-size: 15px; }
.thanh .goi { background: var(--xanh); color: #ffffff; }
.thanh .zalo { background: var(--zalo); color: #ffffff; }
.thanh .duong { border: 2px solid var(--xanh); color: var(--xanh); }

@media (min-width: 900px) {
  h1 { font-size: 36px; }
  h2 { font-size: 26px; }
  .hero-a { display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; }
  .hero-a img { aspect-ratio: auto; max-height: 560px; }
  .the-ds { grid-template-columns: repeat(2, 1fr); }
  .kho-luoi { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
  .kho-luoi > * + * { margin-top: 0; }
  /* Máy tính: thanh nổi góc phải che thẻ (cờ YẾU wireframe) → chừa đáy trang, thanh gọn 360px */
  .thanh { left: auto; right: 16px; bottom: 16px; width: 360px; border-radius: 14px; }
  body { padding-bottom: 96px; }
}

/* Thẻ: link ở tên hàng (giữ chữ neo cũ), phủ cả thẻ để bấm dễ */
.the { position: relative; }
.the h3 a { color: var(--xanh-dam); text-decoration: none; }
.the h3 a::after { content: ""; position: absolute; inset: 0; }
.the p a { position: relative; z-index: 1; }
.the:has(h3 a:focus-visible) { outline: 3px solid var(--tem); outline-offset: 2px; }
.khoi h2.h2-sau { margin-top: 28px; }
.noi-dung table { display: block; overflow-x: auto; }

/* Ảnh đầu trang chủ chuyển kiểu slide (anh yêu cầu 30/10/2026; lệch ux-ui-rule 6.1, spec mục 5). Ảnh 1 = LCP, đứng yên khi tải. */
.truot { position: relative; min-width: 0; }
.truot-ray { position: relative; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.truot-ray::-webkit-scrollbar { display: none; }
.truot-o { flex: 0 0 100%; margin: 0; position: relative; scroll-snap-align: start; }
.truot-o img { border-radius: 0; }
.truot-o figcaption { position: absolute; left: 10px; top: 10px; margin: 0; background: rgba(18, 63, 28, .88); color: #ffffff; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 4px; }
.truot-dk { position: absolute; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .94); border-radius: 26px; padding: 2px; }
.truot-dk[hidden] { display: none; }
.truot-dk button { min-width: 44px; min-height: 44px; border: 0; border-radius: 22px; background: transparent; color: var(--xanh-dam); font: 800 22px/1 var(--font); cursor: pointer; }
.truot-dk button:focus-visible { outline: 3px solid var(--tem); outline-offset: 0; }
.truot-so { font-size: 13px; font-weight: 700; color: var(--xanh-dam); min-width: 28px; text-align: center; }
@media (min-width: 900px) { .truot-o img { aspect-ratio: auto; height: 560px; max-height: none; } }

/* Dải chữ chạy dưới header trang chủ (mức 3): chữ trong CSS, phần tử aria-hidden (chuyen-dong luật 5) */
.bang-chay { overflow: hidden; white-space: nowrap; background: var(--tem); color: var(--chu); font-weight: 800; font-size: 13px; letter-spacing: .04em; padding: 8px 0; }
.bang-chay::before { content: "KEO HI-BOND HICHEM  ✦  SÚNG BƠM KEO H104  ✦  DAO OLFA L5-AL  ✦  KHO HÀ NỘI  ✦  KEO HI-BOND HICHEM  ✦  SÚNG BƠM KEO H104  ✦  DAO OLFA L5-AL  ✦  KHO HÀ NỘI  ✦  "; display: inline-block; padding-left: 16px; }

/* Quy trình mua tại kho: số bằng CSS counter (không thêm chữ vào HTML), đường nối dọc */
.kho ol.buoc { list-style: none; counter-reset: b; padding: 0; position: relative; }
.buoc li { counter-increment: b; position: relative; padding-left: 52px; min-height: 40px; margin-bottom: 14px; }
.buoc li::before { content: counter(b); position: absolute; left: 0; top: -4px; width: 40px; height: 40px; border-radius: 50%; background: var(--xanh); color: #ffffff; font-weight: 800; display: flex; align-items: center; justify-content: center; z-index: 1; }
.buoc::before { content: ""; position: absolute; left: 19px; top: 20px; bottom: 34px; width: 2px; background: var(--xanh); transform-origin: top; }
.thanh a { position: relative; overflow: hidden; gap: 8px; }
.thanh svg { flex: none; }

/* Chuyển động mức 3 (anh chọn 30/10/2026; skill redesign mau/chuyen-dong.md). H1 và ảnh LCP không động. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .nut { position: relative; isolation: isolate; overflow: hidden; }
  .nut::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--xanh-dam); transform: scaleX(0); transform-origin: 0 50%; transition: transform .35s cubic-bezier(.7, 0, .2, 1); }
  .nut:hover::before { transform: scaleX(1); }
  .nut-vien:hover { color: #ffffff; border-color: var(--xanh-dam); }
  .nut::after { content: "→"; margin-left: 8px; transition: transform .3s; }
  .nut:hover::after { transform: translateX(5px); }
  .the { transition: transform .25s, box-shadow .25s; }
  .the:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(18, 63, 28, .16); }
  .the img { transition: transform .4s; }
  .the:hover img { transform: scale(1.07); }
  .hero-a .tem { animation: dong-dau .55s .25s cubic-bezier(.3, 1.6, .5, 1) both; }
  @keyframes dong-dau { from { opacity: 0; transform: scale(1.7) rotate(-10deg); } }
  @supports (animation-timeline: view()) {
    .khoi h2, .the-ds, .kho-luoi > *, .noi-dung h2 { animation: len linear both; animation-timeline: view(); animation-range: entry 0% entry 60%; }
    @keyframes len { from { opacity: .1; transform: translateY(48px); } }
    .buoc::before { animation: ve-doc linear both; animation-timeline: view(); animation-range: entry 10% cover 50%; }
    @keyframes ve-doc { from { transform: scaleY(0); } }
  }
  .bang-chay::before { animation: chay 30s linear infinite; }
  @keyframes chay { to { transform: translateX(-50%); } }
  .thanh .goi svg { animation: rung 2.6s ease-in-out infinite; transform-origin: 50% 60%; }
  @keyframes rung { 0%, 70%, 100% { transform: rotate(0); } 74% { transform: rotate(-14deg); } 78% { transform: rotate(12deg); } 82% { transform: rotate(-10deg); } 86% { transform: rotate(8deg); } 90% { transform: rotate(0); } }
  .thanh .goi::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 40%; background: rgba(255, 255, 255, .28); transform: translateX(-150%) skewX(-20deg); animation: vet 3.2s ease-in-out infinite; }
  @keyframes vet { 0%, 60% { transform: translateX(-150%) skewX(-20deg); } 100% { transform: translateX(330%) skewX(-20deg); } }
}
@media (max-width: 400px) { .thanh a { font-size: 14px; gap: 5px; } .thanh svg { width: 18px; height: 18px; } }
/* Nút tạm dừng (WCAG 2.2.2): dừng slide và dải chữ; slide tự chạy 1 vòng rồi đứng ở ảnh 1 */
.truot-dk .truot-dung .i-chay, .truot-dk .truot-dung[aria-pressed="true"] .i-dung { display: none; }
.truot-dk .truot-dung[aria-pressed="true"] .i-chay { display: inline; }
.truot-dk .truot-dung svg { vertical-align: middle; }
.truot-dk .truot-dung[hidden] { display: none; }
.dung-dong .bang-chay::before { animation-play-state: paused !important; }
@media (prefers-reduced-motion: no-preference) { .bang-chay::before { animation-iteration-count: 2; } }
