/* 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; }
.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; }

/* 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; }
.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); }
@media (max-width: 639px) { .float-call span { display: none; } .float-call { padding: 0 13px; } }
@media (max-width: 899px) { .has-buy-bar .float-contact { bottom: 88px; } }  /* thanh mua chỉ có trên điện thoại */
/* Chừa chỗ ở cuối trang để nút nổi không che chữ chân trang trên điện thoại. */
@media (max-width: 899px) { .footer-legacy { padding-bottom: 128px; } }

/* 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; }
/* Khung chat mở thì thay chỗ các nút nổi. */
.ai-chat-open .float-contact { display: none; }
.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; align-content: start; gap: 10px; flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 12px 14px; }
.ai-msg { display: grid; gap: 6px; justify-items: start; }
.ai-msg-user { justify-items: end; }
.ai-bubble { max-width: 88%; margin: 0; padding: 8px 12px; border-radius: var(--radius); background: var(--surface-muted); font-size: .9rem; line-height: 1.45; }
.ai-msg-user .ai-bubble { background: var(--accent); color: var(--accent-ink); }
.ai-msg-system .ai-bubble, .ai-msg-pending .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-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; }
.ai-chat-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 14px; border-top: 1px solid var(--line); }
.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; }
@media (max-width: 639px) { .ai-chat, .ai-chat-right { left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 80vh; } }
.topbar-links .topbar-social:first-of-type { margin-left: 4px; padding-left: 20px; border-left: 1px solid var(--line); }
