/* Hàng video ngắn + khung phát (snippet video-row): trang chủ, trang sản phẩm. Mobile trước. */

.hvideo-chips { display: flex; gap: var(--space-2); overflow-x: auto; scrollbar-width: none; }
.hvideo-chips::-webkit-scrollbar { display: none; }
.hvideo-chips button {
  min-height: 36px;
  padding: 0 var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: var(--text-sm);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  cursor: pointer;
}
.hvideo-chips button .icon { width: 16px; height: 16px; flex: none; }
.hvideo-chips button[aria-pressed="true"] { border-color: var(--color-text); background: var(--color-text); color: var(--color-surface); }

.hvideo-list {
  list-style: none;
  margin: 0 calc(-1 * var(--space-4));
  padding: 0 var(--space-4);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 140px;
  gap: var(--space-2);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--space-4);
  scrollbar-width: none;
}
.hvideo-list::-webkit-scrollbar { display: none; }
.hvideo-list > li { scroll-snap-align: start; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hvideo-list > li[hidden] { display: none; }
.hvideo { color: var(--color-text); text-decoration: none; display: flex; flex-direction: column; gap: 6px; }
.hvideo:hover { color: var(--color-action-hover); }
.hvideo-cover { position: relative; aspect-ratio: 9 / 16; border-radius: var(--radius-md); overflow: hidden; background: var(--gray-700); }
.hvideo-cover img { width: 100%; height: 100%; object-fit: cover; }
.hvideo-play {
  position: absolute;
  left: 50%; top: 50%;
  width: 44px; height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: var(--radius-full);
  background: rgba(18, 21, 31, .55);
  color: #fff;
  display: grid;
  place-items: center;
}
.hvideo-play .icon { width: 22px; height: 22px; }
/* Nhãn chủ đề (trái trên) và biểu tượng nền tảng (phải trên) */
.hvideo-topic {
  position: absolute;
  top: 6px; left: 6px;
  max-width: calc(100% - 44px);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: rgba(18, 21, 31, .7);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hvideo-plat {
  position: absolute;
  top: 6px; right: 6px;
  width: 26px; height: 26px;
  border-radius: var(--radius-full);
  background: rgba(18, 21, 31, .7);
  color: #fff;
  display: grid;
  place-items: center;
}
.hvideo-plat .icon { width: 15px; height: 15px; }
.hvideo-cap { font-size: var(--text-sm); line-height: var(--leading-tight); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Sản phẩm trong video: dưới thẻ chỉ hiện giá, trong khung phát hiện đủ ảnh, tên, nút */
.hvideo-prod {
  min-height: var(--tap-min);
  margin-top: auto;
  padding: 0 var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-action);
  font-size: var(--text-sm);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.hvideo-prod:hover { border-color: var(--color-action); }
.hvideo-prod img, .hvideo-prod-name, .hvideo-prod-btn { display: none; }
.hvideo-prod-txt { min-width: 0; display: flex; flex-direction: column; }
.hvideo-prod-txt b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.hvideo-follow { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--color-text-muted); }
.hvideo-fl {
  min-height: 36px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-full);
  box-shadow: inset 0 0 0 1.5px var(--color-text);
  color: var(--color-text);
  font-weight: var(--weight-strong);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.hvideo-fl .icon { width: 16px; height: 16px; }
.hvideo-fl:hover { background: var(--color-surface-alt); color: var(--color-text); }

/* Khung phát */
.hvideo-dlg { width: min(400px, 100% - 2 * var(--space-4)); padding: 0; border: 0; border-radius: var(--radius-md); background: #000; overflow: visible; }
.hvideo-dlg::backdrop { background: rgba(0, 0, 0, .8); }
.hvideo-dlg[open] { margin-top: 64px; }
.hvideo-frame { aspect-ratio: 9 / 16; max-height: calc(100vh - 96px); }
.hvideo-dlg.has-prod .hvideo-frame { max-height: calc(100vh - 168px); }
.hvideo-frame iframe { display: block; width: 100%; height: 100%; border: 0; border-radius: var(--radius-md); }
.hvideo-x {
  position: absolute;
  top: -48px; right: 0;
  width: 44px; height: 44px;
  border: 0;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, .15);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.hvideo-foot { padding: var(--space-2); }
.hvideo-foot .hvideo-prod { min-height: 56px; border: 0; color: var(--color-text); }
.hvideo-foot .hvideo-prod img { display: block; width: 40px; height: 40px; flex: none; object-fit: contain; }
.hvideo-foot .hvideo-prod-txt { flex: 1; }
.hvideo-foot .hvideo-prod-name { display: block; font-size: var(--text-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hvideo-foot .hvideo-prod-txt b { color: var(--color-price); }
.hvideo-foot .hvideo-prod-btn {
  min-height: 36px;
  padding: 0 var(--space-2) 0 var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--color-action);
  color: #fff;
  font-weight: var(--weight-strong);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}
.hvideo-foot .hvideo-prod-btn .icon { width: 16px; height: 16px; }

/* Trang sản phẩm */
.pd-videos .hvideo-list { margin: 0; grid-auto-columns: 120px; }

@media (min-width: 40em) {
  .hvideo-list { grid-auto-columns: 22%; }
  .pd-videos .hvideo-list { grid-auto-columns: 140px; }
}
@media (min-width: 64em) {
  .pd-videos .hvideo-list { padding: 0; grid-auto-columns: calc((100% - 2 * var(--space-2)) / 3); scroll-padding: 0; }
}

.hvideo-none { margin: var(--space-4) 0; color: var(--color-text-muted); font-size: var(--text-sm); text-align: center; }

/* ---------- Trang blog video (snippet video-blog): lưới nhiều hàng ---------- */
.vblog-body { padding: 0 var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }
.vblog-follow { margin-top: var(--space-3); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.vblog-follow > * { flex: none; }
.vblog .blog-head p { max-width: 60ch; }
.hvideo-list.is-grid {
  margin: 0;
  padding: 0;
  grid-auto-flow: row;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4) var(--space-2);
  overflow: visible;
  scroll-snap-type: none;
}
.hvideo-list.is-grid > li { gap: var(--space-2); }
.hvideo-list.is-grid .hvideo-cap { min-height: calc(2em * var(--leading-tight)); }

/* ---------- Trang bài video (snippet video-post) ---------- */
.vpost { padding-bottom: var(--space-7); }
.vpost-grid { padding: 0 var(--space-4); display: flex; flex-direction: column; gap: var(--space-4); }
.vpost-media { width: 100%; max-width: 400px; align-self: center; }
.vpost-player, .vpost-frame { position: relative; display: block; aspect-ratio: 9 / 16; max-height: 60vh; margin: 0 auto; border-radius: var(--radius-md); overflow: hidden; background: var(--gray-900); }
.vpost-player img { width: 100%; height: 100%; object-fit: cover; }
.vpost-player .hvideo-play { width: 64px; height: 64px; margin: -32px 0 0 -32px; }
.vpost-player .hvideo-play .icon { width: 30px; height: 30px; }
.vpost-player .hvideo-plat { top: var(--space-2); right: var(--space-2); width: 32px; height: 32px; }
.vpost-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.vpost-info { min-width: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.vpost-topic { align-self: flex-start; padding: 2px var(--space-2); border-radius: var(--radius-sm); background: var(--color-surface-sunken); font-size: var(--text-xs); font-weight: var(--weight-strong); }
.vpost-info h1 { margin: 0; font-size: var(--text-xl); line-height: var(--leading-tight); }
.vpost-meta { margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); }
.vpost-prods { margin-top: var(--space-2); }
.vpost-prods h2, .vpost-more-hd h2 { margin: 0 0 var(--space-2); font-size: var(--text-base); }
.vpost-plist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.vpost-more { margin-top: var(--space-6); padding: 0 var(--space-4); }
.vpost-more-hd { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); }
.vpost-more-hd a { font-size: var(--text-sm); font-weight: var(--weight-strong); text-decoration: none; display: inline-flex; align-items: center; }
.vpost-more-hd a .icon { width: 16px; height: 16px; }

@media (min-width: 40em) {
  .hvideo-list.is-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .vpost-plist { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 64em) {
  .vpost { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--page-gutter) var(--space-7); }
  .vblog-body, .vpost-grid, .vpost-more { padding: 0; }
  .vblog .blog-head { display: grid; grid-template-columns: 1fr auto; align-items: end; column-gap: var(--space-6); row-gap: 4px; }
  .vblog .blog-head h1 { grid-column: 1; }
  .vblog .blog-head p { grid-column: 1; }
  .vblog-follow { grid-column: 2; grid-row: 1 / span 2; margin: 0; justify-content: flex-end; }
  .vblog-body { gap: var(--space-4); }
  .hvideo-list.is-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .vpost-grid { flex-direction: row; align-items: flex-start; gap: var(--space-6); }
  .vpost-media { flex: 0 0 380px; align-self: flex-start; }
  .vpost-player, .vpost-frame { max-height: 80vh; }
  .vpost-info { flex: 1; padding-top: var(--space-2); }
  .vpost-info h1 { font-size: var(--text-2xl); }
  .vpost-more .hvideo-list { grid-auto-columns: calc((100% - 5 * var(--space-2)) / 6); margin: 0; padding: 0; }
}
.vpost-all { margin-top: var(--space-3); width: 100%; }
@media (min-width: 40em) { .vpost-all { width: auto; } }