:root {
  --nen: #f4f8f5;
  --the: #ffffff;
  --chu: #12312f;
  --chu-phu: #4d6663;
  --vien: #d7e3dd;
  --dam: #0d4644;
  --dam-2: #0a3634;
  --la: #a4e04a;
  --la-nhat: #e8f6d2;
  --nuoc-nhat: #dff1f1;
  --mua: #d43c1c;
  --mua-dam: #b5300f;
  --dau-de: 'Phudu', 'Be Vietnam Pro', sans-serif;
  --chu-than: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--nen);
  color: var(--chu);
  font: 400 15px/1.5 var(--chu-than);
}
h1, h2, h3, p { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #1a8f8a; outline-offset: 2px; }

.khung { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.an { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Đầu trang */
.dau { background: var(--dam); color: #fff; }
.dau-trong { display: flex; align-items: center; gap: 12px; padding-top: 12px; padding-bottom: 14px; }
.dau img { width: 72px; height: 72px; flex: none; }
.dau h1 { font: 700 26px/1.15 var(--dau-de); }
.dau p { color: #cfe5e0; font-size: 14px; margin-top: 3px; }

/* Theo video */
.video { padding-top: 16px; padding-bottom: 4px; }
.video h2 { font: 600 17px/1.3 var(--dau-de); margin-bottom: 8px; }
.video-hang {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(216px, 1fr);
  gap: 8px;
  overflow-x: auto;
  margin: 0 -16px;
  padding: 0 16px 8px;
  scrollbar-width: none;
}
.video-hang::-webkit-scrollbar, .muc-hang::-webkit-scrollbar { display: none; }
.nut-video {
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: left;
  background: var(--the);
  border: 1px solid var(--vien);
  border-radius: 10px;
  padding: 9px 12px;
  min-height: 60px;
}
.nut-video b {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  line-height: 1;
  border-radius: 8px;
  background: var(--nuoc-nhat);
  color: var(--dam);
  font: 700 17px/1 var(--dau-de);
}
.nut-video span { font-size: 13.5px; font-weight: 500; line-height: 1.3; }
.nut-video small { display: block; color: var(--chu-phu); font-size: 12px; font-weight: 400; }
.nut-video[aria-pressed="true"] { background: var(--dam); border-color: var(--dam); color: #fff; }
.nut-video[aria-pressed="true"] small { color: #cfe5e0; }
.nut-video[aria-pressed="true"] b { background: var(--la); color: var(--dam-2); }

/* Thanh dính: tìm + hạng mục */
.dinh {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--nen);
  padding: 8px 0 0;
  border-bottom: 1px solid transparent;
}
.dinh.dang-dinh { border-bottom-color: var(--vien); box-shadow: 0 4px 12px rgb(13 70 68 / .07); }
.tim {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--the);
  border: 2px solid var(--dam);
  border-radius: 10px;
}
.tim > svg { width: 20px; height: 20px; margin-left: 12px; flex: none; }
.tim svg { fill: none; stroke: var(--dam); stroke-width: 2; stroke-linecap: round; }
.tim input {
  flex: 1;
  min-width: 0;
  height: 46px;
  border: 0;
  outline: 0;
  background: none;
  padding: 0 8px 0 10px;
  font-size: 16px; /* 16px để iPhone không tự phóng to khi gõ */
}
.tim input::placeholder { color: #6a817e; }
.tim input::-webkit-search-cancel-button { display: none; }
.tim:focus-within { box-shadow: 0 0 0 3px rgb(26 143 138 / .28); }
.tim button { width: 44px; height: 44px; border: 0; background: none; display: grid; place-items: center; }
.tim button[hidden] { display: none; }
.tim button svg { width: 18px; height: 18px; }

.muc-hang {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: 0 -16px;
  padding: 8px 16px;
  scrollbar-width: none;
}
.chip {
  flex: none;
  min-height: 38px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--vien);
  background: var(--the);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--dam); border-color: var(--dam); color: #fff; }

/* Nội dung */
.noi-dung { padding-top: 6px; padding-bottom: 32px; min-height: 50vh; }
.dem { color: var(--chu-phu); font-size: 13.5px; min-height: 20px; }
.dem b { color: var(--chu); font-weight: 600; }
.dem button {
  border: 0;
  background: none;
  padding: 4px 2px;
  color: var(--dam);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.nhom { padding-top: 16px; scroll-margin-top: 120px; }
.nhom-dau { display: flex; align-items: center; gap: 8px; }
.nhom h2 { font: 700 21px/1.2 var(--dau-de); }
.nhom-so { color: var(--chu-phu); font-size: 13px; }
.nhom-loi { color: var(--chu-phu); font-size: 14px; margin-top: 3px; max-width: 64ch; }
.luoi { display: grid; gap: 8px; margin-top: 10px; }

.sp {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
  background: var(--the);
  border: 1px solid var(--vien);
  border-radius: 10px;
  padding: 10px;
}
.anh-sp {
  width: 76px;
  height: 76px;
  border-radius: 8px;
  background: var(--nuoc-nhat);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.anh-sp img { width: 100%; height: 100%; object-fit: cover; }
.anh-sp svg { width: 38px; height: 38px; fill: none; stroke: var(--dam); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sp-than { min-width: 0; display: flex; flex-direction: column; }
.sp h3 { font-size: 15px; font-weight: 600; line-height: 1.3; }
.sp-mota { font-size: 13.5px; line-height: 1.4; color: var(--chu-phu); margin-top: 2px; }
.sp-tap { font-size: 12px; color: #3f6b12; margin-top: 3px; font-weight: 500; }
.nut-mua {
  align-self: flex-start;
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: var(--mua);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.sp-than > :nth-last-child(2) { margin-bottom: 8px; }
.nut-mua:hover { background: var(--mua-dam); }

.rong {
  text-align: center;
  padding: 40px 16px;
  background: var(--the);
  border: 1px dashed var(--vien);
  border-radius: 10px;
  margin-top: 12px;
}
.rong h2 { font: 700 19px/1.3 var(--dau-de); overflow-wrap: anywhere; }
.rong p { color: var(--chu-phu); margin-top: 6px; }

/* Chân trang */
.chan { background: var(--dam-2); color: #cfe5e0; font-size: 13px; padding: 20px 0 24px; }
.chan p + p { margin-top: 8px; }
.theo-doi a { color: #fff; font-weight: 600; margin-left: 10px; display: inline-block; padding: 4px 0; }

.thong-bao {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 10;
  max-width: 420px;
  margin: 0 auto;
  background: var(--dam-2);
  color: #fff;
  font-size: 14px;
  text-align: center;
  border-radius: 10px;
  padding: 11px 14px;
  box-shadow: 0 6px 20px rgb(0 0 0 / .25);
}

@media (min-width: 720px) {
  .dau img { width: 84px; height: 84px; }
  .dau h1 { font-size: 32px; }
  .video-hang { margin: 0; padding: 0 0 8px; grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); }
  .muc-hang { margin: 0; padding: 8px 0; flex-wrap: wrap; }
  .luoi { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .sp { grid-template-columns: 96px 1fr; }
  .anh-sp { width: 96px; height: 96px; }
}
@media (min-width: 1000px) {
  .luoi { grid-template-columns: repeat(3, 1fr); }
}
