/* Bố cục Như charme.com.vn (S1-12): thanh hotline và liên kết nhanh, header ô tìm trái logo giữa,
   menu chữ in hoa căn giữa, dải cam kết, banner kèm hai ô quảng bá, hàng sản phẩm theo danh mục,
   chân trang có danh sách sản phẩm, nút Zalo và gọi nổi. Chỉ dùng token; màu theo phong cách. */

/* Thanh trên cùng. */
.topbar { background: var(--announce-bg, var(--brand)); color: var(--announce-ink, var(--on-brand)); font-size: .8rem; }
.topbar-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 34px; }
.topbar a { color: inherit; text-decoration: none; }
.topbar a:hover, .topbar a[aria-current="page"] { text-decoration: underline; }
.topbar-contact { margin: 0; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.topbar-links ul { display: none; gap: 20px; list-style: none; margin: 0; padding: 0; }
@media (min-width: 900px) { .topbar-links ul { display: flex; } }

/* Header: ô tìm và menu bên trái, logo giữa, tài khoản và giỏ bên phải; menu chữ in hoa căn giữa. */
.header-legacy .header-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); min-height: 72px; }
.header-legacy .header-side { display: flex; align-items: center; gap: 8px; min-width: 0; }
@media (max-width: 479px) { .header-legacy .header-side { gap: 4px; } }
.header-legacy .header-side-end { justify-content: flex-end; }
.header-legacy .header-account, .header-legacy .header-search { margin-left: 0; }
@media (min-width: 900px) { .header-legacy .header-search input { width: 240px; } }
.header-legacy .nav-desktop { border-top: 0; background: var(--nav-bg, transparent); }
.header-legacy .nav-desktop .menu { justify-content: center; column-gap: 32px; }
.header-legacy .nav-desktop .menu > li > a { padding: 11px 0; font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
/* Tuỳ chọn ở trang staff Trang chủ › Header. */
.header-legacy.header-static { position: relative; }
/* Header dính khi cuộn, bật riêng cho máy tính và điện thoại (S1-22). */
@media (max-width: 899px) { .header-legacy.static-mobile { position: relative; } }
@media (min-width: 900px) { .header-legacy.static-desktop { position: relative; } }
.topbar-links { margin-left: auto; }
.header-legacy.menu-left .nav-desktop .menu { justify-content: flex-start; }

/* Dải cam kết dưới header; trên điện thoại vuốt ngang. */
.benefits { border-bottom: 1px solid var(--line); background: var(--surface-muted); color: var(--ink-soft); font-size: .82rem; }
.benefits ul { display: flex; gap: 8px 28px; overflow-x: auto; list-style: none; margin: 0; padding: 10px 0; scrollbar-width: none; }
.benefits ul::-webkit-scrollbar { display: none; }
.benefits li { display: flex; flex: none; align-items: center; gap: 8px; white-space: nowrap; }
.benefits svg { color: var(--accent); }
@media (min-width: 900px) {
  .benefits ul { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 16px; overflow: visible; }
  .benefits li { min-width: 0; justify-content: center; white-space: normal; line-height: 1.35; }
}

/* Banner và hai ô quảng bá. */
.promo-grid { display: grid; gap: 16px; margin: 0 0 40px; }
@media (min-width: 900px) {
  .promo-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .promo-grid-banner-only { grid-template-columns: minmax(0, 1fr); }
  .promo-grid-side-only { grid-template-columns: minmax(0, 1fr); }
  .promo-grid-side-only .promo-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.hero-promo { display: grid; gap: 24px; align-items: center; margin: 0; padding: clamp(24px, 4vw, 44px); }
@media (min-width: 640px) { .hero-promo { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }
.hero-promo h1 { font-size: clamp(1.9rem, 4.2vw, 2.9rem); }
.hero-stack { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hero-stack .media:first-child { grid-row: span 2; }
.hero-stack .media { aspect-ratio: auto; min-height: 110px; }
/* Điện thoại (S1-50): khối banner và hai ô bên gọn lại, khoảng một nửa chiều cao cũ. Chữ nhỏ hơn, hai nút một hàng,
   ba ảnh sản phẩm thành một hàng ô vuông, hai ô bên đứng cạnh nhau. */
@media (max-width: 639px) {
  .promo-grid { gap: 12px; margin-bottom: 28px; }
  /* Một cột không nở theo nội dung: nhãn nút dài thì nút xuống hàng, không bị .hero cắt mất. */
  .hero-promo { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 18px 16px; }
  .hero-promo .hero-copy > .eyebrow { margin: 0 0 6px; font-size: .7rem; }
  .hero-promo h1 { margin: 0 0 6px; font-size: 1.45rem; line-height: 1.2; }
  .hero-promo .hero-copy > p:not(.eyebrow) { margin: 0; font-size: .92rem; line-height: 1.45; }
  .hero-promo .actions { flex-wrap: wrap; gap: 8px; margin-top: 12px; }
  .hero-promo .actions .btn { flex: 1 1 auto; min-height: 40px; padding: 0 10px; font-size: .88rem; text-align: center; }
  /* Ba ảnh một hàng ô vuông; ít ảnh hơn thì canh giữa. */
  .hero-stack { grid-template-columns: none; grid-template-rows: none; grid-auto-flow: column;
    grid-auto-columns: calc((100% - 16px) / 3); justify-content: center; gap: 8px; }
  .hero-stack .media:first-child { grid-row: auto; }
  .hero-stack .media { aspect-ratio: 1; min-height: 0; }
  .hero-promo .hero-brand { aspect-ratio: 16 / 9; }
  .promo-grid .promo-side { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }  /* một ô thì rộng hết */
  .promo-side .promo-box { min-height: 0; gap: 6px; padding: 14px 10px; }
  .promo-side .promo-box .eyebrow { font-size: .62rem; letter-spacing: .12em; }
  .promo-side .promo-box strong { font-size: .95rem; letter-spacing: .02em; }
  .promo-side .promo-box .btn { min-height: 32px; padding: 0 10px; font-size: .78rem; }
  .promo-side .promo-actions { gap: 6px; }
}
.hero-brand { aspect-ratio: 4 / 3; border-radius: var(--radius); }
.hero-brand img { width: 100%; height: 100%; object-fit: cover; }
.promo-side { display: grid; gap: 16px; }
/* Banner ảnh tải lên (S1-15): các ảnh chồng trong một ô lưới, ảnh đang chọn hiện rõ. */
.slideshow { position: relative; overflow: hidden; border-radius: calc(var(--radius) * 1.5); background: var(--media-bg); }
.slides { display: grid; height: 100%; }
.slide { grid-area: 1 / 1; display: block; opacity: 0; visibility: hidden; transition: opacity .6s ease, visibility .6s; }
.slide.is-active { opacity: 1; visibility: visible; }
.slide img { display: block; width: 100%; height: 100%; object-fit: cover; }
.slide-dots { position: absolute; left: 0; right: 0; bottom: 12px; display: none; justify-content: center; gap: 8px; }
.slideshow.is-ready .slide-dots { display: flex; }
.slide-dots button { width: 12px; height: 12px; padding: 0; border: 2px solid var(--on-ink); border-radius: var(--radius-pill); background: transparent; box-shadow: var(--shadow); cursor: pointer; }
.slide-dots button[aria-current="true"] { background: var(--on-ink); }
@media (prefers-reduced-motion: reduce) { .slide { transition: none; } }
@media (min-width: 640px) and (max-width: 899px) { .promo-side { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.promo-box { position: relative; display: grid; align-content: center; justify-items: center; gap: 10px; min-height: 170px; padding: 24px 20px; overflow: hidden; border-radius: var(--radius); background: var(--ink); color: var(--on-ink); text-align: center; text-decoration: none; }
a.promo-box:hover { color: var(--on-ink); box-shadow: var(--shadow); }
.promo-box > * { position: relative; }
.promo-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .3; }
.promo-box .eyebrow { margin: 0; color: inherit; opacity: .85; }
.promo-box strong { font-family: var(--font-display); font-size: clamp(1.2rem, 2.2vw, 1.45rem); line-height: 1.25; letter-spacing: .04em; text-transform: uppercase; }
.promo-box .btn { min-height: 36px; padding: 0 16px; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.promo-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

/* Khu banner kiểu mới (S1-47): trình chiếu, chia đôi, lưới, một ảnh, dải hẹp. Khung có chiều cao (hay tỉ lệ ảnh) cố
   định trước khi ảnh tải. Màu lớp phủ, màu nền ô chữ là biến trên từng banner (`--bn-shade`, `--bn-fill`). */
.bn { --bn-h: 460px; --bn-h-m: 360px; --bn-radius: calc(var(--radius) * 1.5); position: relative; margin: 0 0 40px; }
.bn-h-short { --bn-h: 340px; --bn-h-m: 250px; }
.bn-h-tall { --bn-h: min(640px, 78vh); --bn-h-m: min(500px, 72vh); }
.bn-track { display: grid; }
.bn-item { position: relative; isolation: isolate; display: grid; height: var(--bn-h-m); overflow: hidden; border-radius: var(--bn-radius); background: var(--bn-fill, #1d1a22); color: #fff; }
.bn-h-ratio .bn-item { height: auto; aspect-ratio: var(--bn-ratio-m); }
.bn-media { position: absolute; inset: 0; z-index: -2; display: block; }
.bn-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s ease; }
.bn-media img.is-broken { display: none; }
.bn-shade { position: absolute; inset: 0; z-index: -1; background: var(--bn-shade); }
.bn-y-top .bn-shade { background: linear-gradient(to bottom, var(--bn-shade) 0 30%, var(--bn-shade-0) 85%); }
.bn-y-bottom .bn-shade { background: linear-gradient(to top, var(--bn-shade) 0 30%, var(--bn-shade-0) 85%); }
.bn-copy { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; align-self: center; justify-self: start; width: 100%; max-width: 600px; padding: 28px 22px; }
.bn-y-top .bn-copy { align-self: start; }
.bn-y-bottom .bn-copy { align-self: end; }
.bn-x-center .bn-copy { justify-self: center; align-items: center; text-align: center; }
.bn-x-right .bn-copy { justify-self: end; align-items: flex-end; text-align: right; }
.bn-eyebrow { margin: 0; font-size: .74rem; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; }
.bn-title { margin: 0; max-width: 18ch; color: inherit; text-wrap: balance; font-family: var(--font-display); font-size: clamp(1.75rem, 4.2vw, 3.1rem); line-height: 1.1; }
.bn-text { margin: 0; max-width: 44ch; font-size: clamp(.95rem, 1.3vw, 1.08rem); line-height: 1.55; opacity: .92; }
.bn-btn { margin-top: 8px; }
.bn-tone-light { color: #fff; }
.bn-tone-light .bn-title, .bn-tone-light .bn-text, .bn-tone-light .bn-eyebrow { text-shadow: 0 1px 14px rgb(0 0 0 / 22%); }
.bn-tone-light .bn-btn { border-color: #fff; background: #fff; color: #1d1a22; }
.bn-tone-dark { color: #1d1a22; }
.bn-tone-dark .bn-eyebrow { color: var(--accent); }
.bn-btn:hover { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.bn-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.bn-link:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
@media (hover: hover) { .bn-item:has(.bn-link):hover .bn-media img { transform: scale(1.03); } }
@media (min-width: 900px) {
  .bn-item { height: var(--bn-h); }
  .bn-h-ratio .bn-item { height: auto; aspect-ratio: var(--bn-ratio); }
  .bn-copy { padding: 48px clamp(40px, 6vw, 88px); }
  .bn-x-left .bn-shade { background: linear-gradient(to right, var(--bn-shade) 0 38%, var(--bn-shade-0) 85%); }
  .bn-x-right .bn-shade { background: linear-gradient(to left, var(--bn-shade) 0 38%, var(--bn-shade-0) 85%); }
}

/* Tràn hết bề ngang: ra khỏi container, sát dải cam kết; chữ vẫn thẳng mép nội dung. */
.bn-bleed { margin-inline: calc(50% - 50vw); --bn-radius: 0px; }
main:has(.bn-bleed) { overflow-x: clip; }
.container > .bn-bleed:first-child { margin-top: -24px; }
@media (min-width: 900px) {
  .bn-bleed .bn-copy { max-width: none; padding-inline: max(40px, calc((100vw - var(--container)) / 2 + var(--gutter))); }
  .bn-bleed .bn-copy > * { max-width: 600px; }
}

/* Dải trượt: snap từng banner, vuốt được khi chưa có JS; mũi tên, chấm và nút dừng do storefront.js bật. */
.bn-carousel .bn-track { display: flex; overflow-x: auto; overflow-y: hidden; border-radius: var(--bn-radius); scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.bn-carousel .bn-track::-webkit-scrollbar { display: none; }
.bn-carousel .bn-item { flex: 0 0 100%; border-radius: 0; scroll-snap-align: start; scroll-snap-stop: always; }
.bn-arrow { position: absolute; top: 50%; z-index: 2; display: none; place-items: center; width: 44px; height: 44px; margin-top: -22px; padding: 0; border: 0; border-radius: 50%; background: rgb(255 255 255 / 86%); color: #1d1a22; box-shadow: var(--shadow); cursor: pointer; }
.bn-arrow:hover { background: #fff; color: var(--accent); }
.bn-prev { left: 16px; }
.bn-next { right: 16px; }
.bn-bar { position: absolute; left: 50%; bottom: 14px; z-index: 2; display: none; align-items: center; gap: 2px; padding: 2px 6px; transform: translateX(-50%); border-radius: var(--radius-pill); background: rgb(20 18 24 / 32%); }
.bn.is-ready .bn-bar { display: flex; }
.bn-dot { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer; }
.bn-dot::before { content: ""; width: 8px; height: 8px; border-radius: var(--radius-pill); background: rgb(255 255 255 / 60%); transition: width .3s ease, background .3s ease; }
.bn-dot[aria-current="true"]::before { width: 20px; background: #fff; }
.bn-pause { display: grid; place-items: center; width: 26px; height: 26px; margin-left: 4px; padding: 0; border: 0; border-radius: 50%; background: rgb(255 255 255 / 92%); color: #1d1a22; cursor: pointer; }
.bn-pause[hidden] { display: none; }
.bn-pause .bn-icon-play, .bn-pause.is-paused .bn-icon-pause { display: none; }
.bn-pause.is-paused .bn-icon-play { display: block; }
@media (min-width: 600px) { .bn.is-ready .bn-arrow { display: grid; } }

/* Chia đôi: ảnh một nửa, nửa kia là ô chữ nền màu; điện thoại ảnh trên, chữ dưới. */
.bn-split .bn-item { height: auto; grid-template-columns: minmax(0, 1fr); }
.bn-split .bn-media { position: relative; inset: auto; z-index: 0; height: var(--bn-h-m); }
.bn-split.bn-h-ratio .bn-item { aspect-ratio: auto; }
.bn-split.bn-h-ratio .bn-media { height: auto; aspect-ratio: var(--bn-ratio-m); }
.bn-split .bn-shade { display: none; }
.bn-split .bn-copy { align-self: center; justify-self: stretch; max-width: none; padding: 26px 22px 48px; }
.bn-split .bn-title { max-width: 20ch; }
.bn-split.bn-carousel .bn-bar { bottom: 10px; }
@media (max-width: 899px) { .bn-split .bn-arrow { top: calc(var(--bn-h-m) / 2); } }
@media (min-width: 900px) {
  .bn-split .bn-item { height: var(--bn-h); grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bn-split.bn-h-ratio .bn-item { height: auto; }
  .bn-split .bn-media { height: 100%; }
  .bn-split.bn-h-ratio .bn-media { aspect-ratio: var(--bn-ratio); }
  .bn-split.bn-image-right .bn-media { order: 2; }
  .bn-split .bn-no-image { grid-template-columns: minmax(0, 1fr); }
  .bn-split .bn-copy { padding: 48px clamp(32px, 5vw, 76px); }
}

/* Lưới: điện thoại ô đầu rộng, ô sau hai cột; máy tính theo cách xếp. */
.bn-mosaic .bn-track { gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bn-mosaic .bn-item { height: auto; aspect-ratio: 1; }
.bn-mosaic .bn-item:first-child { grid-column: 1 / -1; height: var(--bn-h-m); aspect-ratio: auto; }
.bn-mosaic .bn-item:nth-child(even):last-child { grid-column: 1 / -1; aspect-ratio: 2 / 1; }
.bn-mosaic .bn-copy { gap: 6px; padding: 18px; }
.bn-mosaic .bn-title { font-size: clamp(1.1rem, 1.9vw, 1.5rem); }
.bn-mosaic .bn-text { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: .92rem; }
.bn-mosaic .bn-btn { min-height: 38px; padding: 0 16px; font-size: .88rem; }
.bn-mosaic .bn-item:first-child .bn-title { font-size: clamp(1.5rem, 3.2vw, 2.5rem); }
.bn-mosaic .bn-item:first-child .bn-copy { gap: 10px; padding: 24px 22px; }
@media (max-width: 599px) {
  .bn-mosaic .bn-item:not(:first-child) :is(.bn-text, .bn-eyebrow) { display: none; }
  .bn-mosaic .bn-item:not(:first-child) .bn-copy { padding: 14px; }
  .bn-mosaic .bn-item:not(:first-child) .bn-title { font-size: 1.05rem; }
  .bn-mosaic .bn-item:not(:first-child) .bn-btn { min-height: 34px; margin-top: 4px; padding: 0 12px; font-size: .8rem; white-space: nowrap; }
}
@media (min-width: 900px) {
  .bn-mosaic .bn-track { height: var(--bn-h); gap: 16px; }
  .bn-mosaic .bn-item, .bn-mosaic .bn-item:first-child, .bn-mosaic .bn-item:nth-child(even):last-child { height: auto; grid-column: auto; aspect-ratio: auto; }
  .bn-grid-big2 .bn-track { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); grid-template-rows: repeat(2, minmax(0, 1fr)); }
  .bn-grid-big4 .bn-track { grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); }
  .bn-grid-big2 .bn-item:first-child, .bn-grid-big4 .bn-item:first-child { grid-row: 1 / 3; }
  .bn-grid-row3 .bn-track { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bn-grid-row2 .bn-track { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bn-grid-single .bn-track { grid-template-columns: minmax(0, 1fr); }
  .bn-grid-row3 .bn-item .bn-title, .bn-grid-row2 .bn-item .bn-title { font-size: clamp(1.3rem, 2.2vw, 1.9rem); }
  .bn-grid-row3 .bn-item .bn-copy, .bn-grid-row2 .bn-item .bn-copy { padding: 28px; }
}

/* Một ảnh tĩnh: chữ lớn hơn. */
.bn-hero .bn-title { font-size: clamp(2rem, 5vw, 3.6rem); }

/* Dải hẹp: chữ một bên, nút một bên; điện thoại xếp chồng. Chấm và nút dừng nằm dưới dải. */
.bn-strip { --bn-h: 150px; --bn-h-m: 132px; }
.bn-strip.bn-h-short { --bn-h: 108px; --bn-h-m: 108px; }
.bn-strip.bn-h-tall { --bn-h: 210px; --bn-h-m: 170px; }
.bn-strip .bn-item { height: auto; min-height: var(--bn-h-m); }
.bn-strip .bn-copy { gap: 4px; max-width: none; padding: 18px 20px; }
.bn-strip .bn-title { max-width: none; font-size: clamp(1.2rem, 2.2vw, 1.75rem); }
.bn-strip .bn-text { max-width: 70ch; font-size: .95rem; }
.bn-strip .bn-btn { min-height: 42px; margin-top: 6px; }
.bn-strip .bn-bar { position: static; justify-content: center; width: max-content; margin: 8px auto 0; transform: none; background: none; }
.bn-strip .bn-dot::before { background: rgb(0 0 0 / 22%); }
.bn-strip .bn-dot[aria-current="true"]::before { background: var(--ink); }
.bn-strip .bn-pause { border: 1px solid var(--line); }
.bn-strip .bn-arrow { top: calc(50% - 20px); width: 34px; height: 34px; margin-top: -17px; }
.bn-strip .bn-prev { left: 8px; }
.bn-strip .bn-next { right: 8px; }
@media (min-width: 600px) { .bn-strip.bn-carousel .bn-copy { padding-inline: 52px; } }
@media (min-width: 900px) {
  .bn-strip .bn-item { height: var(--bn-h); min-height: 0; }
  .bn-strip .bn-copy { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 36px; align-items: center; align-self: center; justify-self: stretch; padding: 16px clamp(28px, 4vw, 56px); }
  .bn-strip .bn-copy > :not(.bn-btn) { grid-column: 1; }
  .bn-strip .bn-btn { grid-column: 2; grid-row: 1 / span 3; margin: 0; }
  .bn-strip .bn-x-center .bn-copy { grid-template-columns: auto auto; justify-content: center; text-align: left; }
  .bn-strip .bn-x-right .bn-copy { grid-template-columns: auto auto; justify-content: end; }
  .bn-strip.bn-carousel .bn-copy { padding-inline: 72px; }
  .bn-strip.bn-bleed .bn-copy { padding-inline: max(40px, calc((100vw - var(--container)) / 2 + var(--gutter))); }
}
@media (prefers-reduced-motion: reduce) { .bn-media img, .bn-dot::before { transition: none; } .bn-carousel .bn-track { scroll-behavior: auto; } }

/* Hàng sản phẩm: tiêu đề gạch chân, vuốt ngang trên điện thoại, một hàng trên desktop. */
.shelf { margin: 0 0 40px; }
.shelf-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.shelf-head h2 { margin: 0 0 -1px; padding-bottom: 8px; border-bottom: 2px solid var(--accent); font-size: 1rem; letter-spacing: .04em; text-transform: uppercase; }
.shelf-head a { padding-bottom: 8px; font-size: .85rem; font-weight: 600; color: var(--accent); text-decoration: none; white-space: nowrap; }
.shelf-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 44%); gap: 12px; overflow-x: auto; list-style: none; margin: 0; padding: 2px 2px 12px; scroll-snap-type: x mandatory; }
.shelf-row > li { scroll-snap-align: start; }
@media (min-width: 640px) { .shelf-row { grid-auto-columns: minmax(0, 30%); } }
@media (min-width: 1024px) { .shelf-row { grid-auto-flow: row; grid-template-columns: repeat(6, minmax(0, 1fr)); overflow: visible; padding-bottom: 2px; } }
.shelf-body { display: grid; gap: 12px; }
@media (min-width: 1024px) {
  .shelf-body { grid-template-columns: minmax(0, 1.25fr) minmax(0, 5fr); }
  .shelf-body .shelf-row { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .shelf-body-plain { grid-template-columns: minmax(0, 1fr); }
}
.cat-banner { position: relative; display: flex; align-items: center; gap: 12px; overflow: hidden; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; }
.cat-banner .media { flex: none; width: 64px; height: 64px; aspect-ratio: auto; border-radius: var(--radius-sm); }
.cat-caption { display: grid; gap: 2px; }
.cat-caption strong { font-size: .9rem; letter-spacing: .04em; text-transform: uppercase; }
.cat-caption small { color: var(--muted); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; }
@media (min-width: 1024px) {
  .cat-banner { flex-direction: column; justify-content: flex-end; padding: 0; min-height: 100%; border: 0; }
  .cat-banner .media { position: absolute; inset: 0; width: auto; height: auto; border-radius: 0; }
  .cat-banner:hover .media img { transform: scale(1.04); }
  .cat-caption { position: relative; align-self: stretch; margin: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface); text-align: center; }
}

/* Thẻ sản phẩm: viền mảnh, nhãn giảm giá tròn, chữ căn giữa, không nút thêm vào giỏ. */
.card-legacy { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); transition: border-color .2s ease, box-shadow .2s ease; }
.card-legacy:hover { border-color: var(--accent-soft); box-shadow: var(--shadow); }
.card-legacy > a { display: flex; flex-direction: column; height: 100%; text-decoration: none; }
.card-legacy .media { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.card-legacy a:hover .media { box-shadow: none; }
.card-legacy .disc { position: absolute; top: 8px; left: 8px; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--sale); color: var(--on-sale); font-size: .76rem; font-weight: 700; }
.card-legacy .disc-muted { width: auto; height: auto; padding: 2px 8px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); color: var(--muted); }
.card-legacy .card-body { display: flex; flex: 1; flex-direction: column; align-items: center; gap: 4px; padding: 10px 10px 14px; text-align: center; }
.card-legacy .cat-name { margin: 0; color: var(--muted); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
.card-legacy .name { display: -webkit-box; margin: 0; overflow: hidden; font-size: .86rem; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.card-legacy .price { flex-direction: column-reverse; align-items: center; gap: 0; margin-top: auto; }
.card-legacy .price .now { font-weight: 700; }
.card-legacy .soldout { color: var(--muted); font-size: .75rem; }
.card-legacy .preorder { color: var(--warn); font-size: .75rem; }

/* Chân trang: danh sách sản phẩm có ảnh nhỏ, giới thiệu, dòng chính sách. */
.footer-grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.footer-legacy h2 { margin-bottom: 14px; font-family: var(--font-body); font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
.mini-list, .footer-links { display: grid; gap: 12px; list-style: none; margin: 0; padding: 0; }
.footer-links { gap: 8px; }
.mini-list a { display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: center; gap: 10px; text-decoration: none; }
.mini-list .media { aspect-ratio: 1; border-radius: var(--radius-sm); }
.mini-body { display: grid; gap: 2px; }
.mini-list .name { color: var(--ink-soft); font-size: .85rem; line-height: 1.35; }
.mini-list .price { font-size: .85rem; }
.footer-about address { display: grid; gap: 4px; font-style: normal; font-size: .88rem; color: var(--ink-soft); }
.footer-about .notice-badge { display: inline-block; margin-top: 12px; }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
.footer-legacy .footer-pages { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.footer-pages a { font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; }

/* Nút Zalo và gọi nổi; nâng lên khi thanh mua hàng ở trang sản phẩm đang hiện. */
.float-contact { position: fixed; left: 16px; bottom: 16px; z-index: 14; display: grid; justify-items: start; gap: 10px; }
.float-contact a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--radius-pill); box-shadow: var(--shadow); font-size: .85rem; font-weight: 700; text-decoration: none; }
.float-zalo, .float-messenger { border: 1px solid var(--line); background: var(--surface); color: var(--accent); }
.float-contact .float-ai { min-height: 44px; padding: 0 16px; border: 0; border-radius: var(--radius-pill); background: var(--ink); color: var(--on-ink); box-shadow: var(--shadow); font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; }
/* Nút Tư vấn AI: tròn cùng cỡ nút Gọi (48 px, 56 px khi xếp cùng bong bóng Zalo), biểu tượng lấp lánh nhẹ và chữ AI;
   vòng sáng tỏa ba lần sau khi tải trang rồi dừng; nhấc nhẹ khi rê chuột. Tên đầy đủ ở aria-label và title. */
.float-contact .float-ai { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 2px; width: 48px; min-height: 48px; padding: 0; border-radius: 50%; font-size: .78rem; letter-spacing: .02em; transition: transform .18s ease, box-shadow .18s ease; }
.float-contact .float-ai svg { flex: none; animation: ai-twinkle 2.6s ease-in-out infinite; }
.float-contact .float-ai::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); animation: ai-ring 2.2s ease-out 1s 3; pointer-events: none; }
.float-contact .float-ai:hover { transform: translateY(-2px); }
@keyframes ai-twinkle { 0%, 100% { opacity: 1; transform: scale(1) rotate(0); } 50% { opacity: .55; transform: scale(.82) rotate(20deg); } }
@keyframes ai-ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }
.float-contact.float-right { left: auto; right: 16px; justify-items: end; }
.float-call { background: var(--sale); color: var(--on-sale); }
.float-contact a:hover { color: inherit; filter: brightness(1.05); }
/* Nút Gọi chỉ còn biểu tượng tròn ở mọi khổ (số vẫn có trong aria-label và title). */
.float-call span { display: none; }
.float-contact .float-call { width: 48px; min-height: 48px; padding: 0; justify-content: center; border-radius: 50%; }
/* Bong bóng Zalo OA (iframe của SDK, 60 px khi còn là bong bóng): đổ bóng nhẹ, một quầng sáng mờ nháy chậm phía sau và
   vòng sáng tỏa ra như nút Tư vấn AI nhưng chậm hơn và lặp mãi (mỗi vòng 3,6 giây, tỏa trong 60% đầu rồi nghỉ). Chỉ áp
   khi SDK đặt cao 60 px, nên khung chat Zalo đã mở không bị ảnh hưởng. */
.zalo-chat-widget[style*="height: 60px"] { border-radius: 50%; box-shadow: 0 6px 16px rgba(0, 0, 0, .16), 0 2px 4px rgba(0, 0, 0, .08); }
.zalo-chat-widget[style*="height: 60px"]::after { content: ""; position: absolute; inset: -4px; z-index: -1; border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 104, 255, .28), rgba(0, 104, 255, 0) 70%); opacity: 0;
  animation: zalo-glow 3.2s ease-in-out 1.5s infinite; pointer-events: none; }
.zalo-chat-widget[style*="height: 60px"]::before { content: ""; position: absolute; inset: 0; border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(0, 104, 255, .5); animation: zalo-ring 3.6s ease-out 1.2s infinite; pointer-events: none; }
@keyframes zalo-ring { 0% { box-shadow: 0 0 0 0 rgba(0, 104, 255, .5); } 60%, 100% { box-shadow: 0 0 0 16px rgba(0, 104, 255, 0); } }
@keyframes zalo-glow { 0%, 100% { opacity: 0; transform: scale(.92); } 50% { opacity: 1; transform: scale(1.12); } }
@media (max-width: 899px) { .has-buy-bar .float-contact { bottom: calc(var(--buy-bar-h) + 16px + env(safe-area-inset-bottom)); } }  /* thanh mua chỉ có trên điện thoại */
/* Vị trí Phải cùng khung chat Zalo OA (S1-50): một cột bên phải, bong bóng Zalo dưới cùng, nút Gọi và Tư vấn AI ở trên.
   Bong bóng (60 px) do SDK đặt nội tuyến `right: 52px; bottom: 52px`, nên kéo về góc bằng !important, chỉ khi còn là
   bong bóng (chưa có height hay height 60px); khung chat mở thì SDK tự đặt. Cột chỉ nâng khi trang thật sự có khung
   Zalo đang hiện ở khổ đó (`:has`): trang thanh toán, trang riêng tư và khổ tắt Zalo không có khoảng trống. */
/* Ghim cả khi khung chat đã mở (SDK giữ right, bottom 52px khi đổi cỡ), để khung mở ngay chỗ khách vừa chạm; cột nút ẩn
   khi khung chat Zalo đang mở. Chỉ áp khi trình duyệt có `:has()`: trình duyệt cũ giữ bong bóng ở chỗ SDK đặt, không đè
   nút Gọi. */
@supports selector(:has(*)) {
  .zalo-chat-widget.zalo-stack[style] { right: 16px !important; bottom: 16px !important; }
  body:has(.zalo-chat-widget.zalo-stack[style*="height"]:not([style*="height: 60px"])) .float-contact { visibility: hidden; }
  @media (min-width: 900px) {
    body:has(.zalo-chat-widget.zalo-stack:not(.off-desktop)) .float-contact.float-right { right: 18px; bottom: 88px; }
  }
  @media (max-width: 899px) {
    .has-buy-bar .zalo-chat-widget.zalo-stack[style] { bottom: calc(var(--buy-bar-h) + 16px + env(safe-area-inset-bottom)) !important; }
    body:has(.zalo-chat-widget.zalo-stack:not(.off-mobile)) .float-contact.float-right { right: 18px; bottom: 88px; }
    body.has-buy-bar:has(.zalo-chat-widget.zalo-stack:not(.off-mobile)) .float-contact.float-right {
      bottom: calc(var(--buy-bar-h) + 88px + env(safe-area-inset-bottom));
    }
  }
}
/* Nút Gọi và Tư vấn AI tròn 56 px, cùng tâm với bong bóng Zalo (60 px, cách lề 16 px) khi xếp chung cột bên phải. */
@media (max-width: 899px) {
  body:has(.zalo-chat-widget.zalo-stack:not(.off-mobile)) .float-right :is(.float-call, .float-ai) { width: 56px; min-height: 56px; padding: 0;
    justify-content: center; border-radius: 50%; }
}
@media (min-width: 900px) {
  body:has(.zalo-chat-widget.zalo-stack:not(.off-desktop)) .float-right :is(.float-call, .float-ai) { width: 56px; min-height: 56px; padding: 0;
    justify-content: center; border-radius: 50%; }
}
/* Chừa chỗ ở cuối trang để nút nổi không che chữ chân trang trên điện thoại. Cột xếp trên bong bóng Zalo (S1-50) cao
   hơn và cả trên máy tính: bong bóng và nút Gọi khoảng 144 px, mỗi nút Tư vấn AI, Messenger thêm khoảng 54 px. */
@media (max-width: 899px) {
  .footer-legacy { padding-bottom: 128px; }
  body:has(.zalo-chat-widget.zalo-stack:not(.off-mobile)) .footer-legacy { padding-bottom: 168px; }
  body:has(.zalo-chat-widget.zalo-stack:not(.off-mobile)):has(.float-ai) .footer-legacy,
  body:has(.zalo-chat-widget.zalo-stack:not(.off-mobile)):has(.float-messenger) .footer-legacy { padding-bottom: 224px; }
  body:has(.zalo-chat-widget.zalo-stack:not(.off-mobile)):has(.float-ai):has(.float-messenger) .footer-legacy {
    padding-bottom: 278px; }
}
@media (min-width: 900px) {
  body:has(.zalo-chat-widget.zalo-stack:not(.off-desktop)) .footer-legacy { padding-bottom: 150px; }
  body:has(.zalo-chat-widget.zalo-stack:not(.off-desktop)):has(.float-ai) .footer-legacy,
  body:has(.zalo-chat-widget.zalo-stack:not(.off-desktop)):has(.float-messenger) .footer-legacy { padding-bottom: 205px; }
  body:has(.zalo-chat-widget.zalo-stack:not(.off-desktop)):has(.float-ai):has(.float-messenger) .footer-legacy {
    padding-bottom: 260px; }
}

/* Khung chat "Tư vấn AI" (F4) cạnh nút nổi. */
.ai-chat { position: fixed; left: 16px; bottom: 16px; z-index: 30; display: flex; flex-direction: column; width: min(380px, calc(100vw - 32px)); max-height: min(600px, calc(100vh - 32px)); overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.ai-chat[hidden] { display: none; }
/* Mở và đóng khung chat: mờ dần và trượt lên từ góc nút. */
.ai-chat { opacity: 0; transform: translateY(14px) scale(.98); transform-origin: bottom left; transition: opacity .2s ease, transform .2s ease; }
.ai-chat-right { transform-origin: bottom right; }
.ai-chat.is-open { opacity: 1; transform: none; }
/* Khung chat mở thì thay chỗ các nút nổi. */
.ai-chat-open .float-contact { display: none; }
/* Khung chat AI bên phải nằm đúng góc của bong bóng Zalo (S1-50): ẩn bong bóng khi khung AI mở, như khi hỏi cookie. */
.ai-chat-open .zalo-chat-widget { visibility: hidden !important; }
.ai-chat-right { left: auto; right: 16px; }
.ai-chat-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: var(--ink); color: var(--on-ink); }
.ai-chat-close { border: 0; background: none; color: inherit; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.ai-chat-notice { margin: 0; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--surface-muted); color: var(--muted); font-size: .75rem; line-height: 1.4; }
.ai-chat-log { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 10px; flex: 1; overflow-x: hidden; overflow-y: auto; list-style: none; margin: 0; padding: 12px 14px; }
.ai-msg { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; justify-items: start; min-width: 0; }
.ai-msg-user { justify-items: end; }
.ai-bubble { max-width: 88%; min-width: 0; margin: 0; padding: 8px 12px; border-radius: var(--radius); background: var(--surface-muted); font-size: .9rem; line-height: 1.45; overflow-wrap: anywhere; }
/* Markdown của trợ lý (dựng bằng DOM trong assistant.js): đoạn, danh sách, tiêu đề, mã, link cùng site. */
.ai-bubble > * { margin: 0; }
.ai-bubble > * + * { margin-top: 6px; }
.ai-bubble ul, .ai-bubble ol { padding-left: 18px; }
.ai-bubble li + li { margin-top: 3px; }
.ai-bubble .ai-heading { font-weight: 700; }
.ai-bubble code { padding: 0 4px; border-radius: 4px; background: var(--surface); font-size: .85em; }
.ai-bubble a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
/* Tin mới trượt nhẹ vào; dấu ba chấm khi đang trả lời. */
.ai-msg { animation: ai-msg-in .26s ease-out both; }
@keyframes ai-msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ai-msg-pending .ai-bubble { padding: 10px 12px; background: var(--surface-muted); }
.ai-typing { display: inline-flex; gap: 4px; }
.ai-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: ai-dot 1.1s ease-in-out infinite; }
.ai-typing span:nth-child(2) { animation-delay: .15s; }
.ai-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes ai-dot { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }
.ai-msg-user .ai-bubble { background: var(--accent); color: var(--accent-ink); }
.ai-msg-system .ai-bubble { background: none; padding: 0; color: var(--muted); font-size: .82rem; }
.ai-card { display: grid; gap: 6px; width: 88%; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.ai-card { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.ai-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: var(--shadow); }
.ai-card-link { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; align-items: center; text-decoration: none; }
.ai-card-link img { width: 52px; height: 52px; object-fit: cover; border-radius: var(--radius-sm); background: var(--media-bg); }
.ai-card-body { display: grid; gap: 2px; font-size: .84rem; }
.ai-card-price { font-weight: 700; }
.ai-card-price del { margin-left: 6px; font-weight: 400; color: var(--muted); }
.ai-card-buy { margin: 0; }
.ai-card-buy .btn { width: 100%; min-height: 32px; }
/* Nút gặp người thật (Zalo OA, gọi hotline) dưới câu trả lời. */
.ai-handoff { display: flex; flex-wrap: wrap; gap: 8px; width: 88%; }
.ai-handoff .btn { flex: 1 1 auto; min-height: 36px; text-decoration: none; }
.ai-handoff-zalo, .ai-handoff .ai-handoff-zalo:hover { background: #0068ff; border-color: #0068ff; color: #fff; }
.ai-handoff .ai-handoff-zalo:hover { background: #0057d6; border-color: #0057d6; }
.ai-chat-notice a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.ai-chat-form { display: flex; gap: 8px; align-items: stretch; padding: 10px 14px; border-top: 1px solid var(--line); }
/* Nút Gửi: biểu tượng máy bay giấy, cao bằng ô nhập (kéo theo khi ô cao lên), vuông tối thiểu 48 px. */
.ai-chat-form .ai-chat-send { flex: none; width: 48px; min-height: 48px; padding: 0; border-radius: var(--radius-sm); }
.ai-chat-form .ai-chat-send svg { transition: transform .18s ease; }
.ai-chat-form .ai-chat-send:hover:not(:disabled) svg { transform: translate(2px, -2px); }
.ai-chat-form .ai-chat-send:disabled { opacity: .45; cursor: default; }
.ai-chat-form textarea { flex: 1; min-width: 0; resize: none; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); color: var(--ink); font: inherit; font-size: .9rem; }
/* Màn hình cảm ứng (điện thoại dọc, xoay ngang, máy tính bảng): khung chat nằm trong vùng màn hình còn thấy, kể cả khi
   bàn phím ảo bật. assistant.js đặt --ai-top và --ai-vh theo visualViewport (lớp ai-chat-fit): đáy khung bám đáy vùng
   thấy (top tới đáy vùng rồi `translate` lên đúng chiều cao khung, không đụng `transform` của hiệu ứng mở), cao tối đa
   bằng vùng thấy. Điện thoại dọc: khung rộng hết màn hình và cao bằng vùng thấy. Trình duyệt không có visualViewport
   thì khung neo đáy, cao tối đa 100dvh. Trang phía sau không cuộn khi khung mở. Chữ trong ô nhập 16 px để Safari
   iPhone không tự phóng to trang khi chạm vào ô. */
@media (max-width: 639px) {
  .ai-chat, .ai-chat-right { left: 8px; right: 8px; bottom: 8px; width: auto; max-height: calc(100dvh - 16px); }
}
@media (max-width: 639px), (pointer: coarse) {
  .ai-chat.ai-chat-fit { top: calc(var(--ai-top, 0px) + var(--ai-vh, 100dvh) - 8px); bottom: auto; translate: 0 -100%;
    max-height: calc(var(--ai-vh, 100dvh) - 16px); }
  .ai-chat-log { overscroll-behavior: contain; }
  body.ai-chat-open { overflow: hidden; }
}
@media (max-width: 639px) { .ai-chat.ai-chat-fit { height: calc(var(--ai-vh, 100dvh) - 16px); } }
@media (max-width: 899px), (pointer: coarse) { .ai-chat-form textarea { font-size: 16px; } }
@media (prefers-reduced-motion: reduce) {
  .ai-chat, .ai-card, .float-contact .float-ai { transition: none; }
  .ai-card:hover, .float-contact .float-ai:hover { transform: none; }
  .ai-msg, .ai-typing span, .float-contact .float-ai svg, .float-contact .float-ai::after,
  .zalo-chat-widget[style*="height: 60px"]::after, .zalo-chat-widget[style*="height: 60px"]::before,
  .ai-chat-form .ai-chat-send svg { animation: none; transition: none; }
}
.topbar-links .topbar-social:first-of-type { margin-left: 4px; padding-left: 20px; border-left: 1px solid var(--line); }
