/* Area B: trang chủ (.home-* .hero* .band* .tiles* .trust* .guide*). Dùng token và primitive của shop.css, không định nghĩa lại. */

/* Chữ đặt trên ảnh giữ màu cố định theo tông ảnh (ảnh không đổi màu ở chế độ tối). */
.hero[data-tone="light"], .band[data-tone="light"] { --hero-fg: var(--brand); --hero-fg-2: var(--brand-2); }
.hero[data-tone="dark"], .band[data-tone="dark"] { --hero-fg: #FFFFFF; --hero-fg-2: rgba(255, 255, 255, .88); }

.home-sec { margin-top: var(--sp-40); }
@media (min-width: 768px) { .home-sec { margin-top: var(--sp-56); } }
@media (min-width: 1024px) { .home-sec { margin-top: var(--sp-72); } }
@media (min-width: 1440px) { .home-sec { margin-top: var(--sp-96); } }

.home-h2 {
  margin: 0;
  font-size: var(--t-h2);
  line-height: 1.2;
  letter-spacing: -.01em;
  color: var(--ink);
}

/* ------------------------------------------------------------------ */
/* Ảnh <picture> dùng chung cho hero, banner, dải màu                  */
/* ------------------------------------------------------------------ */
.hero-pic { display: block; width: 100%; height: 100%; }
.hero-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--pos-m, 50% 50%);
  background: var(--lining);
}
@media (min-width: 768px) { .hero-img { object-position: var(--pos-t, var(--pos-d, 50% 50%)); } }
@media (min-width: 1024px) { .hero-img { object-position: var(--pos-d, 50% 50%); } }

/* ------------------------------------------------------------------ */
/* Hero                                                                */
/* ------------------------------------------------------------------ */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--lining);
  color: var(--hero-fg);
  isolation: isolate;
}
.hero-media { aspect-ratio: 4 / 5; width: 100%; max-height: var(--hero-max-m, none); }
@media (min-width: 768px) { .hero-media { aspect-ratio: 16 / 9; } }
@media (min-width: 1024px) { .hero-media { aspect-ratio: auto; height: min(42.86vw, 78svh); } }
.hero-img--product { object-position: 50% 35%; }

.hero-scrim { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
@media (min-width: 768px) {
  .hero[data-tone="light"] .hero-scrim { background: var(--scrim-light); opacity: .5; }
}
.hero[data-tone="dark"] .hero-scrim { background: linear-gradient(180deg, rgba(var(--deep-rgb), .12) 0, rgba(var(--deep-rgb), .3) 40%, rgba(var(--deep-rgb), .78) 100%); }
@media (min-width: 768px) {
  .hero[data-tone="dark"] .hero-scrim {
    background: linear-gradient(90deg, rgba(var(--deep-rgb), .66) 0, rgba(var(--deep-rgb), 0) 62%), var(--scrim-dark);
  }
}

.hero-wrap {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: var(--sp-20);
  pointer-events: none;
}
.hero-copy { pointer-events: auto; max-width: 34ch; }
.hero[data-tone="dark"] .hero-wrap { justify-content: flex-end; padding-bottom: calc(40px + var(--sp-24)); }
@media (min-width: 768px) {
  .hero-wrap, .hero[data-tone="dark"] .hero-wrap { justify-content: center; padding: 0 var(--gutter) 48px; }
  .hero-copy { max-width: min(50%, 480px); }
}
@media (min-width: 1024px) {
  /* Khối chữ ở 42% chiều cao (phần dưới bị thẻ size đè 64px). */
  .hero-wrap, .hero[data-tone="dark"] .hero-wrap { justify-content: flex-start; padding: 0 var(--gutter); }
  .hero-copy { position: absolute; top: 42%; transform: translateY(-50%); max-width: 480px; }
}
@media (min-width: 1440px) { .hero-copy { max-width: 520px; } }
/* 1600–1920: chữ H1 to hơn (56px) nên khối chữ rộng theo, tiêu đề giữ đúng 2 dòng như ở 1024–1440. */
@media (min-width: 1600px) { .hero-copy { max-width: 640px; } }

/* Nền chờ của ảnh lớn theo tông ảnh, cố định ở cả chế độ tối: chữ đặt trên ảnh (mực trên ảnh sáng, trắng trên ảnh đêm)
   vẫn đọc được trong lúc ảnh chưa tải xong trên 4G, hoặc nếu ảnh lỗi. */
.hero[data-tone="light"], .hero[data-tone="light"] .hero-img,
.band[data-tone="light"], .band[data-tone="light"] .band-media, .band--color .band-media { background-color: #E7E4DE; }
.hero[data-tone="dark"], .hero[data-tone="dark"] .hero-img,
.band[data-tone="dark"], .band[data-tone="dark"] .band-media { background-color: var(--brand-night); }

.hero-h1 {
  margin: 0;
  font-size: var(--t-hero);
  line-height: 1.12;
  letter-spacing: -.01em;
  color: var(--hero-fg);
  text-wrap: balance;
}
.hero-sub {
  margin: var(--sp-8) 0 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--hero-fg-2);
  font-weight: 500;
}
.hero-sub-d { display: none; }
@media (min-width: 1024px) {
  .hero-sub { margin-top: var(--sp-12); font-size: 17px; }
  .hero-sub-d { display: inline; }
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-8);
  min-height: 44px;
  margin-top: var(--sp-4);
  font-size: var(--t-ui);
  font-weight: 600;
  color: var(--hero-fg);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 5px;
}
.hero-cta-ico { transition: transform var(--d-fast) var(--ease); }
.hero-cta:hover .hero-cta-ico { transform: translateX(3px); }
@media (min-width: 1024px) {
  .hero-cta {
    margin-top: var(--sp-24);
    min-height: 48px;
    padding: 0 var(--sp-24);
    border-radius: var(--r-sm);
    background: var(--hero-fg);
    color: #FFFFFF;
    text-decoration: none;
    transition: background var(--d-fast) var(--ease);
  }
  .hero[data-tone="light"] .hero-cta:hover { background: var(--brand-hover); }
  .hero[data-tone="dark"] .hero-cta { color: var(--brand); }
}
.hero-cta:focus-visible { outline: 2px solid var(--hero-fg); outline-offset: 3px; }

.hero-cap, .band-cap {
  position: absolute;
  right: var(--gutter);
  z-index: 2;
  pointer-events: none;
}
.hero-cap { bottom: calc(40px + var(--sp-8)); }
/* Máy tính bảng trở lên: góc phải dưới ảnh là toà nhà tối, đặt chú thích sang góc trái (nền sân sáng).
   Màn rộng hơn khung 1320: chú thích thẳng mép trái của khung chữ (cùng mép với H1), không dạt ra mép màn hình. */
@media (min-width: 768px) {
  .hero-cap { bottom: calc(48px + var(--sp-8)); right: auto; left: max(var(--gutter), calc((100% - var(--maxw)) / 2)); }
}
@media (min-width: 1024px) { .hero-cap { bottom: calc(64px + var(--sp-8)); } }
.hero-cap > .ai-cap, .band-cap > .ai-cap { position: static; white-space: nowrap; }

/* ------------------------------------------------------------------ */
/* Thẻ chọn size đè lên đáy ảnh (thẻ do F dựng, B lo vị trí)           */
/* ------------------------------------------------------------------ */
.home-size { position: relative; z-index: 3; margin-top: -40px; }
@media (min-width: 768px) { .home-size { margin-top: -48px; } }
@media (min-width: 1024px) { .home-size { margin-top: -64px; } }
.home-size-in { min-height: 1px; }

/* ------------------------------------------------------------------ */
/* Ô danh mục                                                          */
/* ------------------------------------------------------------------ */
.tiles-head { margin-bottom: var(--sp-16); }
.tiles-intro { display: none; margin: var(--sp-8) 0 0; color: var(--muted); font-size: var(--t-body); max-width: 32ch; }
.tiles-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-12);
}
/* 3 danh mục trở lên trên điện thoại (hoặc hơn 3 ở mọi cỡ): hàng cuộn ngang có điểm dừng, thấy 2,3 ô. */
.tiles--rail .tiles-list {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 2 * var(--sp-12)) / 2.3);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  margin-inline: calc(-1 * var(--gutter));
  padding-inline: var(--gutter);
  scroll-padding-inline: var(--gutter);
}
@media (max-width: 767px) {
  .tiles--many .tiles-list {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 2 * var(--sp-12)) / 2.3);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: var(--gutter);
    scroll-padding-inline: var(--gutter);
  }
}
.tiles-list::-webkit-scrollbar { display: none; }
.tiles-item { scroll-snap-align: start; min-width: 0; }
.tiles-link { display: grid; gap: 2px; color: var(--ink); text-decoration: none; border-radius: var(--r-md); }
.tiles-media {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--lining);
  margin-bottom: var(--sp-8);
}
.tiles-media picture { display: block; width: 100%; height: 100%; }
/* Viền mảnh: ảnh có mảng sáng sát mép (cửa sổ) không hoà vào nền trắng làm góc bo như bị cắt. */
.tiles-media::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 12%, transparent);
}
.tiles-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms var(--ease), opacity 200ms var(--ease);
}
.tiles-img--product { object-position: 50% 35%; }
.tiles-img--empty { background: var(--lining); }
.tiles-name { font-size: 16px; font-weight: 600; line-height: 1.3; }
.tiles-count { font-size: var(--t-small); color: var(--muted); }
@media (hover: hover) and (pointer: fine) {
  .tiles-link:hover .tiles-img { transform: scale(1.03); }
  .tiles-link:hover .tiles-name { text-decoration: underline; text-underline-offset: 3px; }
}
@media (min-width: 768px) {
  /* Máy tính bảng: các ô chia đều bề ngang (2 danh mục thì mỗi ô một nửa), không để trống nửa phải. */
  .tiles:not(.tiles--rail) .tiles-list { grid-template-columns: repeat(min(var(--tiles-n), 3), minmax(0, 1fr)); gap: var(--sp-16); }
  .tiles--rail .tiles-list { grid-auto-columns: calc((100% - 3 * var(--sp-16)) / 3.5); gap: var(--sp-16); }
}
@media (min-width: 1024px) {
  .tiles-wrap { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--sp-24); align-items: start; }
  .tiles-head { grid-column: span 4; margin: 0; padding-top: var(--sp-8); }
  .tiles-intro { display: block; }
  .tiles-list { grid-column: span 8; justify-content: end; }
  .tiles:not(.tiles--rail) .tiles-list { grid-template-columns: repeat(min(var(--tiles-n), 3), minmax(0, 360px)); gap: var(--sp-24); }
  .tiles--rail .tiles-list { margin-inline: 0; padding-inline: 0; grid-auto-columns: calc((100% - 4 * var(--sp-16)) / 5); }
}

/* ------------------------------------------------------------------ */
/* Dải hàng ngang theo danh mục (rail.js)                              */
/* ------------------------------------------------------------------ */
.hrails { --rail-gap: 12px; }
.hrails-list { display: grid; gap: var(--sp-40); }
.hrails-applied { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: var(--sp-20); }
.hrails-applied[hidden] { display: none; }
.hrails-applied__l { font-size: var(--t-small); font-weight: 600; color: var(--muted); margin-right: 2px; }
.hrails-empty { display: grid; justify-items: start; gap: var(--sp-16); max-width: 600px; }
.hrails-empty[hidden] { display: none; }
.hrails-empty__t { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.4; }
.hrails-empty__btns { display: flex; flex-wrap: wrap; gap: 8px; }
.hrails-empty__chat { display: grid; gap: 8px; width: 100%; }
.hrails-empty__chat-h { margin: 0; font-size: 15px; font-weight: 600; }

.hrail-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 4px var(--sp-16);
  margin-bottom: var(--sp-12);
}
.hrail-titles { min-width: 0; display: grid; gap: 2px; }
.hrail-title { margin: 0; font-size: var(--t-h2); line-height: 1.2; letter-spacing: -.01em; }
.hrail-count { margin: 0; font-size: var(--t-small); color: var(--muted); }
.hrail-tools { display: flex; align-items: center; gap: var(--sp-8); flex: none; }
.hrail-all {
  display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 0 0 4px;
  color: var(--ink); font-size: var(--t-ui); font-weight: 600; text-decoration: underline;
  text-decoration-thickness: 1.5px; text-underline-offset: 5px; white-space: nowrap;
}
.hrail-all svg { transition: transform var(--d-fast) var(--ease); }
.hrail-arrows { display: none; gap: var(--sp-8); }
.hrail-arrow {
  display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 1px solid var(--stone); border-radius: var(--r-sm); background: var(--paper); color: var(--ink);
  transition: background-color var(--d-fast) var(--ease), color var(--d-fast) var(--ease), border-color var(--d-fast) var(--ease), opacity var(--d-fast) var(--ease);
}
.hrail-arrow[aria-disabled="true"] { opacity: .35; cursor: default; }
.hrail-arrow:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.hrail.is-static .hrail-arrows { display: none !important; }

/* Băng thẻ (ul.: thắng ul[class] { padding: 0 } của shop.css): vuốt ngang có điểm dừng. Điện thoại, máy tính bảng: tràn ra mép màn hình, thẻ kế ló ra (2,2 / 3,2 thẻ).
   padding-block chừa chỗ cho vòng tiêu điểm của link thẻ (băng cuộn cắt phần tràn). */
ul.hrail-track {
  list-style: none;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% + var(--gutter) - 2 * var(--rail-gap)) / 2.2);
  column-gap: var(--rail-gap);
  margin: -6px calc(-1 * var(--gutter)) 0;
  padding: 6px var(--gutter) 8px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.hrail-track::-webkit-scrollbar { display: none; }
.hrail-item { min-width: 0; scroll-snap-align: start; display: flex; }
.hrail-item > .card { flex: 1 1 auto; }

/* Ô cuối "Xem tất cả N mẫu": cùng khung 4:5 với ảnh thẻ. */
.hrail-more { display: block; width: 100%; color: var(--ink); text-decoration: none; border-radius: var(--r-sm); }
/* Nền xanh than như vải áo, mép trên là vạch thước dây (cúc đồng: chỉ dùng cho hình, đúng chữ ký của shop). */
.hrail-more__box {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end; gap: var(--sp-8);
  aspect-ratio: 4 / 5; padding: var(--sp-16); border-radius: var(--r-sm);
  background: var(--ink); color: var(--on-ink);
  transition: background-color var(--d-fast) var(--ease);
}
.hrail-more__tape {
  position: absolute; left: 0; right: 0; top: 0; height: 18px; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, var(--brass) 0 1.5px, transparent 1.5px 50px) 0 0 / 100% 14px no-repeat,
    repeating-linear-gradient(90deg, var(--brass) 0 1px, transparent 1px 10px) 0 0 / 100% 7px no-repeat;
  opacity: .9;
}
.hrail-more__n { font-size: clamp(28px, 2vw + 20px, 44px); line-height: 1.05; font-weight: 700; font-stretch: 87.5%; overflow-wrap: anywhere; }
.hrail-more__n.display { font-size: clamp(24px, 1.4vw + 18px, 36px); font-stretch: 108%; }
.hrail-more__t { font-size: var(--t-ui); font-weight: 600; line-height: 1.35; opacity: .92; }
.hrail-more__ico {
  display: inline-grid; place-items: center; width: 44px; height: 44px; margin-top: var(--sp-4);
  border-radius: var(--r-round); background: var(--paper); color: var(--ink);
  transition: transform var(--d-fast) var(--ease);
}
.hrail-more:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

@media (hover: hover) and (pointer: fine) {
  .hrail-all:hover svg { transform: translateX(3px); }
  .hrail-arrow:not([aria-disabled="true"]):hover { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
  .hrail-more:hover .hrail-more__box { background: var(--ink-hover); }
  .hrail-more:hover .hrail-more__ico { transform: translateX(4px); }
  .hrail-arrows { display: inline-flex; }
}
@media (min-width: 768px) {
  .hrails { --rail-gap: 16px; }
  .hrails-list { gap: var(--sp-56); }
  .hrail-head { margin-bottom: var(--sp-16); }
  ul.hrail-track { grid-auto-columns: calc((100% + var(--gutter) - 3 * var(--rail-gap)) / 3.2); }
}
/* Màn rộng cảm ứng (iPad ngang 1180, iPad Pro 1366): vẫn tràn ra mép màn hình, thẻ thứ tư ló ra (3,6 thẻ)
   để khách biết dải còn vuốt được; hiện thêm nút ‹ › cỡ 44px cho ngón tay. */
@media (min-width: 1180px) {
  .hrails { --rail-gap: 20px; }
  ul.hrail-track { grid-auto-columns: calc((100% + var(--gutter) - 3 * var(--rail-gap)) / 3.6); }
  .hrail-arrows { display: inline-flex; }
  .hrail-arrow { width: 44px; height: 44px; }
}
/* Máy tính (chuột): đúng 4 thẻ trong khung trang (thẳng mép với các phần khác), nút ‹ › để lật. */
@media (min-width: 1180px) and (hover: hover) and (pointer: fine) {
  .hrails { --rail-gap: 24px; }
  ul.hrail-track {
    grid-auto-columns: calc((100% - 3 * var(--rail-gap)) / 4);
    margin: -6px -6px 0;
    padding: 6px 6px 8px;
    scroll-padding-inline: 6px;
  }
  .hrail-arrow { width: 40px; height: 40px; }
}
@media (min-width: 1024px) { .hrails-list { gap: var(--sp-72); } }

/* ------------------------------------------------------------------ */
/* "Xem tất cả" (link tới trang danh mục)                              */
/* ------------------------------------------------------------------ */
.home-all-in { display: grid; gap: var(--sp-16); }
.home-all-sub { margin: var(--sp-8) 0 0; font-size: var(--t-body); line-height: 1.55; color: var(--muted); max-width: 52ch; }
.home-all-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-8); }
.home-all-a {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center;
  column-gap: var(--sp-12); min-height: 64px; padding: var(--sp-12) var(--sp-16); border-radius: var(--r-md);
  border: 1px solid var(--stone); color: var(--ink); text-decoration: none;
  transition: border-color var(--d-fast) var(--ease), background-color var(--d-fast) var(--ease);
}
.home-all-name { font-size: 17px; font-weight: 600; line-height: 1.3; }
.home-all-n { grid-row: 2; font-size: var(--t-small); color: var(--muted); }
.home-all-ico { grid-row: 1 / span 2; grid-column: 2; display: inline-flex; transition: transform var(--d-fast) var(--ease); }
.home-all-a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) {
  .home-all-a:hover { border-color: var(--ink); }
  .home-all-a:hover .home-all-ico { transform: translateX(4px); }
}
@media (min-width: 768px) {
  .home-all-list { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--sp-12); }
}
@media (min-width: 1024px) {
  .home-all-in { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; gap: var(--sp-32); }
  .home-all-a { min-height: 76px; padding: var(--sp-16) var(--sp-20); }
}

/* ------------------------------------------------------------------ */
/* Lưới "Vest đang có" (chỉ trang /live)                               */
/* ------------------------------------------------------------------ */
.home-grid { scroll-margin-top: var(--hdr-offset, 0px); }

/* ------------------------------------------------------------------ */
/* Phần cuối trang chủ: trình duyệt bỏ qua dựng/vẽ khi còn xa màn hình (content-visibility), nhớ cỡ thật sau lần vẽ đầu.  */
/* Khung giữ chỗ gần đúng cỡ thật để thanh cuộn không nhảy nhiều.                                                     */
/* ------------------------------------------------------------------ */
.home > .trust, .home > .band--b3, .home > .home-live, .home > .guide { content-visibility: auto; }
.home > .trust { contain-intrinsic-size: auto 560px; }
.home > .band--b3 { contain-intrinsic-size: auto 488px; }
.home > .home-live { contain-intrinsic-size: auto 320px; }
.home > .guide { contain-intrinsic-size: auto 260px; }
@media (min-width: 768px) {
  .home > .trust { contain-intrinsic-size: auto 360px; }
  .home > .band--b3 { contain-intrinsic-size: auto 432px; }
  .home > .home-live { contain-intrinsic-size: auto 200px; }
}
@media (min-width: 1024px) {
  .home > .trust { contain-intrinsic-size: auto 300px; }
  .home > .band--b3 { contain-intrinsic-size: auto 600px; }
}

/* ------------------------------------------------------------------ */
/* Hiện dần khi cuộn tới (home.js armReveal): chỉ khu nằm dưới màn đầu */
/* ------------------------------------------------------------------ */
@media (prefers-reduced-motion: no-preference) {
  .home .rv { opacity: 0; transform: translateY(16px); transition: opacity 240ms var(--ease), transform 240ms var(--ease); }
  .home .rv.is-in, .home .rv:focus-within { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------------ */
/* Banner giữa các phần + dải màu                                      */
/* ------------------------------------------------------------------ */
.band {
  position: relative;
  overflow: hidden;
  background: var(--lining);
  color: var(--hero-fg);
  isolation: isolate;
}
.band--color { color: var(--ink); background: transparent; }
.band-media { position: relative; width: 100%; aspect-ratio: 4 / 5; overflow: hidden; background: var(--lining); }
@media (min-width: 768px) { .band-media { aspect-ratio: 16 / 9; } }
@media (min-width: 1024px) { .band-media { aspect-ratio: auto; height: min(42.86vw, 70svh); } }
.band-media .hero-img { transition: transform 600ms var(--ease), opacity 200ms var(--ease); }
/* Ảnh banner, ô danh mục (tải lười, dưới màn đầu): hiện dần khi tải xong, khung giữ sẵn tỉ lệ nên không nhảy bố cục.
   Ảnh đầu trang (LCP) không mờ dần. */
.band-media .hero-img:not(.is-loaded), .tiles-img:not(.is-loaded):not(.tiles-img--empty) { opacity: 0; }
@media (hover: hover) and (pointer: fine) {
  .band:hover .band-media .hero-img { transform: scale(1.03); }
}
.band--noimg .band-media .hero-pic { visibility: hidden; }

.band-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: var(--scrim-o, 0);
  background: linear-gradient(180deg, rgba(255, 255, 255, .88) 0, rgba(255, 255, 255, .62) 30%, rgba(255, 255, 255, 0) 54%);
}
@media (min-width: 768px) { .band-scrim { background: var(--scrim-light); } }
.band--color .band-scrim { display: none; }

.band-wrap {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: var(--sp-24);
  pointer-events: none;
}
.band-copy { pointer-events: auto; max-width: 34ch; }
.band--color .band-copy { max-width: min(72%, 30ch); }
@media (min-width: 768px) {
  .band-wrap { justify-content: center; padding-top: 0; padding-bottom: 0; }
  .band-copy { max-width: min(46%, 460px); }
  .band--color .band-copy { max-width: min(40%, 420px); }
  /* Dải màu: chữ luôn ở phần tường trống phía trên giá treo (giữa khung là áo). */
  .band--color .band-wrap { justify-content: flex-start; padding-top: var(--sp-32); }
}
@media (min-width: 1024px) {
  .band--color .band-wrap { justify-content: flex-start; padding-top: clamp(32px, 6vw, 96px); }
}
/* Máy tính bảng (768–1023): ảnh 16:9 hẹp nên chữ dễ chạy vào thanh treo đồng, móc áo (dải màu) và giá áo tối (banner 3).
   Khối chữ hẹp lại ở mảng tường trống phía trên trái; banner 3 thêm lớp phủ sáng. */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .band--color .band-copy { max-width: 29%; }
  .band--color .band-wrap { padding-top: var(--sp-24); }
  .band--b3 .band-copy { max-width: 38%; }
  .band--b3 .band-scrim { opacity: .85; }
}
/* 1024–1279: cột đồng của giá treo ở ~37% bề ngang ảnh, khối chữ dải màu dừng trước đó. */
@media (min-width: 1024px) and (max-width: 1279.98px) {
  .band--color .band-copy { max-width: calc(37vw - var(--gutter) - 24px); }
}

.band-eyebrow {
  margin: 0 0 var(--sp-8);
  font-size: var(--t-small);
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--hero-fg-2);
}
.band-title {
  margin: 0;
  font-size: clamp(22px, 1.4vw + 16px, 44px);
  line-height: 1.15;
  letter-spacing: -.01em;
  color: var(--hero-fg);
  text-wrap: balance;
}
.band--color .band-title { color: var(--brand); }
.band-body {
  margin: var(--sp-8) 0 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--hero-fg-2);
  max-width: 36ch;
}
.band--color .band-body { color: var(--brand-2); }
@media (min-width: 1024px) {
  .band-body { font-size: 16px; margin-top: var(--sp-12); }
}
.band-cta {
  position: static;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-8);
  min-height: 44px;
  margin-top: var(--sp-8);
  font-size: var(--t-ui);
  font-weight: 600;
  color: var(--hero-fg);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 5px;
}
button.band-cta { padding: 0; border: 0; background: none; font-family: inherit; cursor: pointer; text-align: left; }
.band-cta svg { transition: transform var(--d-fast) var(--ease); }
/* Cả banner bấm được (link phủ toàn khung), chữ vẫn là một link duy nhất cho bàn phím và trình đọc màn hình. */
.band-cta::after { content: ""; position: absolute; inset: 0; z-index: 2; }
.band-wrap { pointer-events: none; }
.band:hover .band-cta svg { transform: translateX(3px); }
.band-cta:focus-visible { outline: 2px solid var(--hero-fg); outline-offset: 3px; }
.band-cap { bottom: var(--sp-12); }

/* Chip màu thật dưới ảnh (điện thoại, máy tính bảng) hoặc đè góc trái dưới ảnh (máy tính). */
.band-chips-wrap { position: relative; z-index: 3; padding-top: var(--sp-16); }
.band-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-8);
}
.band-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-8);
  min-height: 44px;
  padding: 0 var(--sp-12) 0 var(--sp-8);
  border: 1px solid var(--stone);
  border-radius: var(--r-xs);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: var(--t-ui);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--d-fast) var(--ease), color var(--d-fast) var(--ease), border-color var(--d-fast) var(--ease);
}
.band-chip .swatch { flex: none; }
.band-chip-n {
  font-family: "Archivo", "Be Vietnam Pro", system-ui, sans-serif;
  font-stretch: 87.5%;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: var(--t-small);
  color: var(--muted);
}
.band-chip[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.band-chip[aria-pressed="true"] .band-chip-n { color: inherit; opacity: .8; }
@media (hover: hover) and (pointer: fine) { .band-chip:hover { border-color: var(--ink); } }
@media (min-width: 1024px) {
  .band-chips-wrap {
    position: absolute;
    left: 0;
    right: 0;
    margin-inline: auto;
    max-width: var(--maxw);
    top: calc(min(42.86vw, 70svh) - 44px - clamp(24px, 3vw, 48px));
    padding-top: 0;
  }
  .band--color .band-chip { border-color: transparent; box-shadow: var(--sh-2); }
}

/* Ô ảnh chèn trong lưới (khi có từ 8 mẫu). */
.band--tile { height: 100%; border-radius: var(--r-sm); }
.band--tile .band-media { aspect-ratio: 4 / 5; height: 100%; }
@media (min-width: 768px) { .band--tile .band-media { aspect-ratio: auto; min-height: 100%; } }
.band--tile .band-copy {
  position: absolute;
  inset: 0 auto auto 0;
  z-index: 2;
  padding: var(--sp-16);
  max-width: 100%;
}
.band--tile .band-title { font-size: clamp(20px, 1vw + 14px, 30px); }
.band--tile .band-cap { right: var(--sp-12); }

/* ------------------------------------------------------------------ */
/* Khối yên tâm                                                        */
/* ------------------------------------------------------------------ */
.trust-list {
  list-style: none;
  margin: var(--sp-20) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-8);
}
.trust-list > li { min-width: 0; display: flex; }
.trust-list > li:last-child { grid-column: span 2; }
.trust-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-4);
  width: 100%;
  min-height: 44px;
  padding: var(--sp-16);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: var(--lining);
  color: var(--ink);
  font: inherit;
  text-align: left;
}
button.trust-item { cursor: pointer; transition: border-color var(--d-fast) var(--ease); }
@media (hover: hover) and (pointer: fine) { button.trust-item:hover { border-color: var(--stone); } }
.trust-ico { display: inline-flex; color: var(--ink); margin-bottom: var(--sp-4); }
.trust-t { font-size: var(--t-ui); font-weight: 600; line-height: 1.35; }
.trust-sub { font-size: var(--t-small); line-height: 1.45; color: var(--muted); }
.trust-note { margin: var(--sp-12) 0 0; font-size: var(--t-small); line-height: 1.45; color: var(--muted); }
@media (min-width: 768px) {
  .trust-list { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--sp-12); }
  .trust-list > li, .trust-list > li:last-child { grid-column: span 2; }
  .trust-list > li:nth-child(n + 4) { grid-column: span 3; }
}
@media (min-width: 1024px) {
  .trust-list { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: var(--sp-24); }
  .trust-list > li, .trust-list > li:last-child, .trust-list > li:nth-child(n + 4) { grid-column: auto; }
  .trust-item { padding: var(--sp-20); }
}

/* ------------------------------------------------------------------ */
/* Khối live                                                           */
/* ------------------------------------------------------------------ */
.home-live-in {
  display: grid;
  gap: var(--sp-20);
  padding-block: var(--sp-24);
  border-top: 1px solid var(--stone);
  border-bottom: 1px solid var(--stone);
}
.home-live-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-8);
  margin: 0 0 var(--sp-8);
  font-size: var(--t-small);
  font-weight: 600;
  color: var(--muted);
}
.home-live.is-on .home-live-tag { color: var(--alert); }
.home-live-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: var(--r-round);
  background: var(--alert);
  flex: none;
}
.home-live-on .home-live-dot { background: currentColor; }
.home-live-body { margin: var(--sp-8) 0 0; font-size: var(--t-body); line-height: 1.55; color: var(--muted); max-width: 60ch; }
.home-live-btns { display: grid; gap: var(--sp-8); }
.home-live-btns > a { width: 100%; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-8); }
@media (min-width: 768px) {
  .home-live-in { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--sp-32); padding-block: var(--sp-32); }
  .home-live-btns { min-width: 240px; }
}

/* ------------------------------------------------------------------ */
/* Đánh giá / link fanpage                                             */
/* ------------------------------------------------------------------ */
.home-rv:not(.has-rv) { margin-top: var(--sp-16); }
.home-rv:not(.has-rv) .wrap { display: flex; justify-content: center; }
.home-rv-fb {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-8);
  min-height: 44px;
  font-size: var(--t-ui);
  font-weight: 500;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.home-rv-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--sp-8) var(--sp-16); }
.home-rv-list {
  list-style: none;
  margin: var(--sp-16) calc(-1 * var(--gutter)) 0;
  padding: 0 var(--gutter);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 88%;
  gap: var(--sp-12);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
}
.home-rv-list::-webkit-scrollbar { display: none; }
.home-rv-card {
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
  padding: var(--sp-16);
  border-radius: var(--r-md);
  background: var(--lining);
  min-width: 0;
}
.home-rv-top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4) var(--sp-12); font-size: var(--t-small); color: var(--muted); }
.home-rv-stars { display: inline-flex; gap: 1px; color: var(--ink); }
.home-rv-name { font-weight: 600; color: var(--ink); }
.home-rv-text { margin: 0; font-size: var(--t-body); line-height: 1.55; color: var(--ink); }
.home-rv-p { margin-top: auto; font-size: var(--t-small); font-weight: 600; color: var(--ink); min-height: 44px; display: inline-flex; align-items: center; }
@media (min-width: 768px) { .home-rv-list { grid-auto-columns: calc((100% - var(--sp-12)) / 2); } }
@media (min-width: 1024px) {
  .home-rv-list { margin-inline: 0; padding-inline: 0; grid-auto-columns: calc((100% - 2 * var(--sp-16)) / 3); gap: var(--sp-16); }
}

/* ------------------------------------------------------------------ */
/* Cách chọn size vest                                                 */
/* ------------------------------------------------------------------ */
.guide { margin-bottom: var(--sp-56); }
.guide-in > * { max-width: 68ch; }
.guide-body {
  margin-top: var(--sp-12);
  font-size: var(--t-body);
  line-height: 1.55;
  color: var(--ink);
  max-height: calc(3 * 1.55em);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent);
  mask-image: linear-gradient(180deg, #000 55%, transparent);
}
.guide-body p { margin: 0 0 var(--sp-12); }
.guide-body p:last-child { margin-bottom: 0; }
.guide.is-open .guide-body { max-height: none; -webkit-mask-image: none; mask-image: none; }
.guide-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4) var(--sp-24); margin-top: var(--sp-8); }
.guide-more, .guide-reco {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-4);
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: var(--t-ui);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.guide-reco { font-weight: 500; color: var(--muted); }
.guide-more svg { transition: transform var(--d-fast) var(--ease); }
.guide.is-open .guide-more svg { transform: rotate(180deg); }

/* ------------------------------------------------------------------ */
/* Trang /live: chỉ giữ lưới hàng                                      */
/* ------------------------------------------------------------------ */
/* Chỉ khi đang live thật (hoặc đang chờ dữ liệu live). Không có buổi live (live.js đặt html.is-live-idle): trang chủ đầy đủ
   hiện dưới lời báo "Hiện chưa có buổi live" + nút mở fanpage. */
html.is-live:not(.is-live-idle) .home .hero,
html.is-live:not(.is-live-idle) .home .home-size,
html.is-live:not(.is-live-idle) .home .tiles,
html.is-live:not(.is-live-idle) .home .band,
html.is-live:not(.is-live-idle) .home .trust,
html.is-live:not(.is-live-idle) .home .home-live,
html.is-live:not(.is-live-idle) .home .home-rv,
html.is-live:not(.is-live-idle) .home .hrails,
html.is-live:not(.is-live-idle) .home .home-all,
html.is-live:not(.is-live-idle) .home .guide { display: none !important; }
/* Không có buổi live: trang chủ đầy đủ (dải theo danh mục + "Xem tất cả"), không lặp lại bằng lưới hàng. */
html.is-live.is-live-idle .home .home-grid { display: none; }
html.is-live:not(.is-live-idle) .home .home-grid { margin-top: var(--sp-16); }
.lv-idle { flex-wrap: wrap; }
.lv-idle-txt { flex: 1 1 220px; }
.lv-idle-fb { flex: none; min-height: 44px; gap: 6px; }
@media (max-width: 767.98px) { .lv-idle-fb { flex: 1 1 100%; } }

@media (prefers-reduced-motion: reduce) {
  .band-media .hero-img, .tiles-img, .hero-cta-ico, .band-cta svg, .guide-more svg, .hrail-arrow, .hrail-more__ico, .hrail-all svg, .home-all-ico { transition: none !important; }
  .band:hover .band-media .hero-img, .tiles-link:hover .tiles-img { transform: none !important; }
}

/* ------------------------------------------------------------------ */
/* Nội dung trang chủ riêng của shop (Tuan Hub, settings.storefront)   */
/* home.js mountSf; index.html / máy chủ đặt html[data-sf], [data-sf-usp] trước lần vẽ đầu (không chớp nội dung vest). */
/* ------------------------------------------------------------------ */
/* Không có dòng cam kết (cả thông báo): ẩn dải, đầu trang lên sát mép trên. */
html[data-sf-usp="0"] { --usp-h: 0px; }
html[data-sf-usp="0"] #usp { display: none; }
html.sf-wait #usp-in { visibility: hidden; }
/* Dòng chủ shop tự viết: dài quá khung thì cắt "…", không tràn ngang. */
html[data-sf] .usp-item { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; line-height: var(--usp-h); }
@media (min-width: 1024px) { html[data-sf] .usp:not(.has-notice) .usp-item { max-width: 40ch; } }

/* Khung chờ khi trang chủ gọn (chưa có ảnh đầu trang): cùng cao với khối chữ thật. */
html[data-sf="text"] .boot-hero { aspect-ratio: auto; max-height: none; height: 188px; }
@media (min-width: 768px) { html[data-sf="text"] .boot-hero { height: 232px; } }
@media (min-width: 1024px) { html[data-sf="text"] .boot-hero { height: 304px; } }

/* Ảnh đầu trang của shop: chữ trắng trên lớp phủ tối (data-tone="dark"). Nút hiện cả trên điện thoại (link chủ shop đặt). */
@media (max-width: 767.98px) { .hero--sf .hero-cta { display: inline-flex; } }
.hero--plain { background: var(--lining); }

/* Trang chủ gọn: tên shop (hoặc tiêu đề) + khẩu hiệu trên nền vải lót, thẻ chọn size đè mép dưới như bản có ảnh. */
.hero--text { --hero-fg: var(--ink); --hero-fg-2: var(--muted); background: var(--lining); }
.hero--text .hero-wrap { position: relative; inset: auto; display: block; min-height: 188px; padding-top: var(--sp-32); padding-bottom: calc(40px + var(--sp-32)); }
.hero--text .hero-copy { position: static; transform: none; max-width: 40ch; }
.hero--text .hero-h1 { font-size: clamp(26px, 1.6vw + 20px, 44px); overflow-wrap: anywhere; }
.hero--text .hero-sub { overflow-wrap: anywhere; }
@media (min-width: 768px) {
  .hero--text .hero-wrap { min-height: 232px; padding: var(--sp-40) var(--gutter) calc(48px + var(--sp-40)); }
  .hero--text .hero-copy { max-width: min(70%, 640px); }
}
@media (min-width: 1024px) {
  .hero--text .hero-wrap { min-height: 304px; padding-top: var(--sp-56); padding-bottom: calc(64px + var(--sp-56)); }
  .hero--text .hero-cta { color: var(--on-ink); }
  .hero--text .hero-cta:hover { background: var(--ink-hover); }
}

/* Banner của shop: ảnh đúng tỉ lệ đã tải lên (máy tính / điện thoại riêng), không cắt chữ trên ảnh, không nhảy bố cục. */
.sf-ban-pic { display: block; aspect-ratio: var(--ar-m, 16 / 9); border-radius: var(--r-md); overflow: hidden; background: var(--lining); }
@media (min-width: 768px) { .sf-ban-pic { aspect-ratio: var(--ar-d, 21 / 9); } }
.sf-ban-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sf-ban-a { display: block; border-radius: var(--r-md); }
.sf-ban-a:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
@media (hover: hover) {
  .sf-ban-a .sf-ban-img { transition: transform 600ms var(--ease); }
  .sf-ban-a:hover .sf-ban-img { transform: scale(1.02); }
}

/* Giới thiệu cuối trang */
.sf-about { margin-bottom: var(--sp-56); }
.sf-about-in > * { max-width: 68ch; }
.sf-about .home-h2 { margin-bottom: var(--sp-16); }
.sf-about p { margin: 0 0 var(--sp-12); font-size: var(--t-body); line-height: var(--lh-body); color: var(--ink); overflow-wrap: anywhere; }
.home--sf > :last-child:not(.sf-about) { margin-bottom: var(--sp-56); }

html.is-live:not(.is-live-idle) .home .sf-ban,
html.is-live:not(.is-live-idle) .home .sf-about { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  .sf-ban-a .sf-ban-img { transition: none !important; }
  .sf-ban-a:hover .sf-ban-img { transform: none !important; }
}
