/* Nền chung của storefront, bố cục Cổ điển và token của phong cách Hồng Charme (mặc định).
   Bố cục khác ở css/layouts/, phong cách khác ở css/styles/ (S1-11): phong cách chỉ đặt lại
   token và màu; bố cục chỉ dùng token, không mã màu cứng, để mọi tổ hợp đều đọc được.
   Màu Charme lấy từ logo (#eb008b); chữ và nút dùng tông đậm hơn để đủ tương phản AA. */

:root {
  --bg: #fcfafb;
  --surface: #ffffff;
  --surface-muted: #f7eff3;
  --ink: #1f1b16;
  --ink-soft: #4a433b;
  --muted: #7a7065;
  --line: #ecdfe6;
  --brand: #eb008b;
  --accent: #c2007a;
  --accent-soft: rgb(194 0 122 / 35%);
  --tint: #fbe4f1;
  --tint-soft: #fdf2f8;
  --accent-ink: #ffffff;
  --on-ink: #ffffff;
  --header-bg: rgb(252 250 251 / 92%);
  --sale: #b3261e;
  --ok: #2f6b3f;
  --warn: #8a6100;
  --font-body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-pill: 999px;
  --shadow: 0 1px 2px rgb(31 27 22 / 6%), 0 8px 24px rgb(31 27 22 / 6%);
  --shadow-soft: 0 2px 10px rgb(194 0 122 / 8%);
  --on-brand: #ffffff;
  --on-sale: #ffffff;
  --hero-bg: radial-gradient(120% 140% at 85% 10%, var(--tint) 0%, var(--tint-soft) 45%, var(--surface) 100%);
  --media-bg: linear-gradient(135deg, var(--tint-soft), var(--tint));
  --footer-bg: var(--surface);
  --container: 1200px;
  --gutter: 16px;
}

@media (min-width: 768px) {
  :root { --gutter: 24px; }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration-color: var(--accent-soft); text-underline-offset: 3px; }
a:hover { color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; letter-spacing: .01em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); }
h3 { font-size: 1.25rem; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--on-ink); padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Dải thông báo trên cùng (mọi giao diện) */

.announce { background: var(--announce-bg, var(--brand)); color: var(--announce-ink, var(--on-brand)); font-size: .84rem; font-weight: 600; }
.announce .container { display: flex; justify-content: center; flex-wrap: wrap; gap: 2px 24px; padding-top: 7px; padding-bottom: 7px; text-align: center; }
@media (max-width: 479px) { .announce-phone { display: none; } }
.announce a { color: inherit; text-decoration: none; }
.announce a:hover { color: inherit; text-decoration: underline; }

/* Header */

/* Không dùng backdrop-filter: nó biến header thành khung chứa của phần tử fixed, làm menu điện thoại bị cắt. */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--header-bg); color: var(--ink); border-bottom: 1px solid var(--line); }
.header-bar { display: flex; align-items: center; gap: 12px; min-height: 64px; }
@media (min-width: 900px) { .header-bar { gap: 24px; } }
.brand { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; text-decoration: none; color: var(--ink); white-space: nowrap; }
.brand:hover { color: var(--ink); }
/* Logo cao (biểu tượng lớn, chữ nhỏ ở đáy): dưới ~56px chữ CHARME khó đọc. */
.brand-logo { display: block; height: 56px; width: auto; padding: 4px 0; box-sizing: content-box; }
@media (min-width: 900px) { .brand-logo { height: 68px; } }
.site-footer .brand-logo { height: 72px; }
.header-search { display: none; margin-left: auto; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); padding: 0 4px 0 14px; }
.header-search:focus-within { border-color: var(--ink); }
.header-search input { width: 200px; border: 0; background: none; font: inherit; font-size: .95rem; padding: 8px 0; outline: none; }
.header-search button { display: inline-flex; padding: 8px; border: 0; background: none; color: var(--ink); cursor: pointer; }
/* Nút tìm trên điện thoại (S1-46): mở ô tìm của header thành một hàng ngay dưới header; máy tính đã có ô tìm. */
.search-toggle { display: inline-flex; align-items: center; padding: 8px 6px; color: var(--ink); }
.search-toggle:hover { color: var(--accent); }
.search-toggle .icon-close, .search-toggle[aria-expanded="true"] .icon-search { display: none; }
.search-toggle[aria-expanded="true"] .icon-close { display: block; }
@media (max-width: 899px) {
  .site-header.search-open { padding-bottom: 56px; }
  .site-header.search-open .header-search { display: flex; position: absolute; left: var(--gutter); right: var(--gutter); bottom: 10px; height: 44px; margin: 0; }
  /* Chữ 16 px để iPhone không phóng to trang khi chạm vào ô. */
  .site-header.search-open .header-search input { flex: 1; width: auto; min-width: 0; font-size: 1rem; }
}
.header-link { display: none; text-decoration: none; font-size: .95rem; color: var(--ink-soft); padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--radius-pill); white-space: nowrap; }
.header-link:hover, .header-link[aria-current="page"] { border-color: var(--ink); color: var(--ink); }

/* Menu chính: hàng riêng dưới header; mục có mục con mở danh sách khi rê chuột hoặc focus. */
.nav-desktop { display: none; border-top: 1px solid var(--line); }
.nav-desktop .menu { display: flex; flex-wrap: wrap; column-gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav-desktop .menu-item { position: relative; }
.nav-desktop a { flex: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; text-decoration: none; padding: 12px 0; font-size: .95rem; color: var(--ink-soft); box-shadow: inset 0 -2px 0 transparent; }
.nav-desktop a:hover, .nav-desktop a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.nav-desktop .caret { opacity: .6; transition: transform .2s ease; }
.nav-desktop .has-children:hover .caret, .nav-desktop .has-children:focus-within .caret { transform: rotate(180deg); }
.nav-desktop .submenu { position: absolute; top: 100%; left: -16px; z-index: 30; display: none; min-width: 240px; margin: 0; padding: 8px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.nav-desktop .has-children:hover > .submenu, .nav-desktop .has-children:focus-within > .submenu { display: block; }
.nav-desktop .submenu a { display: block; padding: 9px 12px; border-radius: var(--radius-sm); box-shadow: none; background: none; color: var(--ink-soft); font-size: .92rem; text-transform: none; letter-spacing: 0; font-weight: 400; }
.nav-desktop .submenu a:hover, .nav-desktop .submenu a[aria-current="page"] { background: var(--surface-muted); color: var(--ink); box-shadow: none; }

.header-account { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 8px 6px; text-decoration: none; color: var(--ink); font-size: .95rem; white-space: nowrap; }
.header-account .label { display: none; }
.header-account:hover, .header-account[aria-current="page"] { color: var(--accent); }
.header-cart { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; text-decoration: none; color: var(--ink); font-size: .95rem; white-space: nowrap; }
.header-cart .label { display: none; }
.header-cart .count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--ink); color: var(--on-ink); font-size: .75rem; font-weight: 700; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.header-cart:hover .count, .header-cart[aria-current="page"] .count { background: var(--accent); }

/* Menu điện thoại: trượt từ cạnh trái, ngay dưới header để nút Menu vẫn bấm được để đóng. */
.nav-mobile { margin-left: 0; }
.nav-mobile > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: .95rem; }
.nav-mobile > summary::-webkit-details-marker { display: none; }
.nav-mobile > summary .bars { width: 18px; height: 12px; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); position: relative; }
.nav-mobile > summary .bars::after { content: ""; position: absolute; left: 0; right: 0; top: 3px; border-top: 2px solid var(--ink); }
.nav-mobile[open] > summary .bars { border-color: transparent; }
.nav-mobile[open] > summary .bars::after { top: 3px; transform: rotate(45deg); }
.nav-mobile[open] > summary .bars::before { content: ""; position: absolute; left: 0; right: 0; top: 3px; border-top: 2px solid var(--ink); transform: rotate(-45deg); }
.nav-mobile[open]::after { content: ""; position: fixed; inset: var(--drawer-top, var(--header-h, 64px)) 0 0 0; z-index: 25; background: rgb(20 16 22 / 45%); }
.nav-mobile[open] > .drawer { position: fixed; top: var(--drawer-top, var(--header-h, 64px)); left: 0; bottom: 0; z-index: 26; width: min(88vw, 360px); overflow-y: auto; background: var(--surface); box-shadow: var(--shadow); padding: 12px var(--gutter) 24px; animation: drawer-in .2s ease-out; }
@keyframes drawer-in { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer a { display: block; padding: 12px 4px; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 600; }
.drawer a.sub { padding-left: 20px; font-weight: 400; color: var(--ink-soft); font-size: .95rem; }
.drawer .search-form { margin: 4px 0 12px; }
.drawer-extra { margin-top: 16px; }
.drawer-extra a { font-weight: 400; color: var(--ink-soft); font-size: .95rem; }
html.menu-open { overflow: hidden; }
/* Điện thoại hẹp (S1-46): Menu, nút tìm, logo, tài khoản và giỏ vừa một hàng từ 320 px. Dưới 375 px nút Menu chỉ
   còn biểu tượng; chữ "Menu" vẫn là tên của nút cho trình đọc màn hình. */
@media (max-width: 479px) {
  .header-bar { column-gap: 6px; }
  .nav-mobile > summary { gap: 6px; padding: 8px; }
  .header-cart { padding: 8px 6px; }
}
@media (max-width: 374px) {
  .nav-mobile > summary { min-height: 42px; padding: 8px 9px; }
  .nav-mobile-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .header-account { padding: 8px 4px; }
  .header-cart { gap: 4px; }
}

.search-form { display: flex; gap: 8px; max-width: 560px; margin-top: 16px; }
.search-form input { flex: 1; min-width: 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; background: var(--surface); }
.search-form input:focus { border-color: var(--ink); outline: none; }
/* Trang danh sách có sidebar (S1-25): từ 1024 px hai cột; dưới đó sidebar là ngăn kéo (JS) hoặc nằm trên lưới. */
.listing-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; margin-bottom: 48px; }
.listing-main { min-width: 0; }
.listing-sidebar { display: grid; gap: 4px; align-content: start; }
.side-block { margin: 0; padding: 16px 0; border: 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; }
.side-block:first-of-type { padding-top: 0; }
.side-title { margin: 0 0 4px; padding: 0; font-size: .82rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
.side-filters .side-block label { display: flex; align-items: center; gap: 8px; font-size: .95rem; cursor: pointer; }
.side-filters input[type=radio], .side-filters input[type=checkbox] { accent-color: var(--accent, var(--ink)); width: 16px; height: 16px; }
.side-filters .n, .side-cats .n { margin-left: auto; color: var(--muted); font-size: .8rem; }
.side-options { display: grid; gap: 8px; max-height: 236px; overflow-y: auto; padding-right: 4px; }
.side-cats ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.side-cats ul ul { display: none; margin: 2px 0 4px 12px; padding-left: 10px; border-left: 1px solid var(--line); }
.side-cats li.is-open > ul { display: grid; }
.side-cats a { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius-sm); color: var(--ink-soft); text-decoration: none; font-size: .95rem; }
.side-cats a:hover { background: var(--surface-2, rgb(0 0 0 / 4%)); color: var(--ink); }
.side-cats a[aria-current="page"] { color: var(--accent, var(--ink)); font-weight: 700; background: var(--surface-2, rgb(0 0 0 / 4%)); }
.side-actions { display: flex; align-items: center; gap: 16px; padding: 16px 0 0; }
.drawer-head, .drawer-scrim { display: none; }
.filter-toggle { gap: 8px; }
.filter-toggle .badge, .list-toolbar .badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--accent); color: var(--accent-ink); font-size: .75rem; }
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; list-style: none; padding: 0; margin: -8px 0 20px; }
.chip-active { border-color: var(--ink); color: var(--ink); }
.chip-active span { font-size: 1.05rem; line-height: 1; }
.active-filters .clear-all { font-size: .9rem; }
@media (max-width: 1023px) {
  /* Có JS: sidebar thành ngăn kéo bên trái, mở bằng nút "Bộ lọc". */
  .listing-sidebar.has-drawer { position: fixed; z-index: 60; inset: 0 auto 0 0; width: min(340px, 88vw); padding: 0 18px 24px; overflow-y: auto; background: var(--surface, #fff); box-shadow: 0 0 40px rgb(0 0 0 / 18%); transform: translateX(-105%); transition: transform .2s ease; visibility: hidden; }
  .listing-sidebar.has-drawer.is-open { transform: none; visibility: visible; }
  .listing-sidebar.has-drawer .drawer-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 1; margin: 0 -18px 8px; padding: 14px 18px; background: inherit; border-bottom: 1px solid var(--line); }
  .drawer-close { width: 36px; height: 36px; border: 0; background: transparent; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--ink); }
  .drawer-scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 55; background: rgb(0 0 0 / 40%); }
  .listing-sidebar.has-drawer .side-actions { position: sticky; bottom: -24px; margin: 0 -18px; padding: 14px 18px; background: inherit; border-top: 1px solid var(--line); }
  body.drawer-open { overflow: hidden; }
  /* Thanh công cụ: nút Bộ lọc và sắp xếp cùng một hàng, số sản phẩm xuống dưới. */
  .list-toolbar { gap: 10px; }
  .list-toolbar .count { order: 3; flex-basis: 100%; }
  .list-toolbar .sort-form label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .list-toolbar .sort-form select { min-height: 44px; }
  .filter-toggle { min-height: 44px; }
}
@media (min-width: 1024px) {
  .listing-layout { grid-template-columns: 260px minmax(0, 1fr); gap: 40px; }
  .listing-sidebar { position: sticky; top: calc(var(--header-h, 0px) + 16px); max-height: calc(100vh - var(--header-h, 0px) - 32px); overflow-y: auto; padding-right: 8px; }
  .filter-toggle, .chips-mobile { display: none !important; }
  .listing-main .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1400px) { .listing-main .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.list-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.list-toolbar .count { margin: 0; color: var(--muted); font-size: .9rem; }
.sort-form { display: flex; align-items: center; gap: 8px; font-size: .95rem; }
.sort-form select { padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; background: var(--surface); }

@media (min-width: 900px) {
  .nav-desktop, .header-link { display: block; }
  .header-search { display: flex; }
  .nav-mobile, .search-toggle { display: none; }
  .header-account { margin-left: 0; }
  .header-account .label, .header-cart .label { display: inline; }
}

/* Main */

main { min-height: 60vh; padding: 24px 0 56px; }

.breadcrumb { font-size: .875rem; color: var(--muted); margin-bottom: 16px; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: 6px; color: var(--line); }
.breadcrumb a { text-decoration: none; }

.page-head { margin-bottom: 24px; }
.page-head .lede { color: var(--ink-soft); max-width: 70ch; }
.page-head .hint { color: var(--ink-soft); max-width: 70ch; margin: 8px 0 0; font-size: .9rem; }
.page-head .count { color: var(--muted); font-size: .9rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 24px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); text-decoration: none; font-size: .9rem; color: var(--ink-soft); }
a.chip:hover { border-color: var(--accent); color: var(--accent); }
a.chip[aria-current] { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.chip .n { color: var(--muted); font-size: .8rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px; border-radius: var(--radius-sm); border: 1px solid var(--ink); background: var(--ink); color: var(--on-ink); font: inherit; font-weight: 600; letter-spacing: .02em; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-outline { background: transparent; color: var(--ink); }
.btn-small { min-height: 38px; padding: 0 14px; font-size: .88rem; }
.btn[disabled] { background: var(--surface-muted); border-color: var(--line); color: var(--muted); cursor: not-allowed; }

/* Product media and placeholder */

.media { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius); background: var(--media-bg); }
.media img { width: 100%; height: 100%; object-fit: cover; }
.media .placeholder { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-size: clamp(.85rem, 2.4vw, 1.15rem); font-weight: 600; text-transform: uppercase; letter-spacing: .32em; color: var(--accent-soft); }
.gallery .media .placeholder { font-size: clamp(1.2rem, 3vw, 1.8rem); }
.media img + .placeholder { display: none; }
.media img.is-broken { display: none; }
.media img.is-broken + .placeholder { display: grid; }

/* Khối cam kết (trang chủ, trang sản phẩm) */

.highlights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; list-style: none; margin: -16px 0 48px; padding: 0; }
@media (min-width: 900px) { .highlights { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); } }
.highlights li { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: .9rem; line-height: 1.4; color: var(--ink-soft); }
.highlights svg { flex: none; color: var(--accent); }

/* Product grid and card */

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; list-style: none; padding: 0; margin: 0; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 24px; } }

.card { position: relative; }
.card a { text-decoration: none; display: block; }
.card .media { transition: box-shadow .2s ease; }
.card a:hover .media { box-shadow: var(--shadow); }
.card a:hover .name { color: var(--accent); }
.card .flags { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; z-index: 1; }
.card .brand-name { margin: 12px 0 2px; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.card .name { margin: 0 0 6px; font-size: .98rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.8em; }
.card { display: flex; flex-direction: column; }
.card > a { flex: 1; }
/* Ảnh thứ hai hiện khi rê chuột (chỉ thiết bị có chuột). */
.media img.alt { position: absolute; inset: 0; opacity: 0; transition: opacity .3s ease; }
@media (hover: hover) { .card a:hover .media.has-alt img.alt { opacity: 1; } }
.card-action { margin-top: 10px; }
.card-btn { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; font-size: .88rem; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.card-btn:hover { border-color: var(--ink); background: var(--ink); color: var(--on-ink); }

.badge { display: inline-block; padding: 2px 8px; border-radius: var(--radius-pill); font-size: .75rem; font-weight: 600; letter-spacing: .02em; background: var(--surface); color: var(--ink-soft); border: 1px solid var(--line); }
.badge-sale { background: var(--sale); border-color: var(--sale); color: var(--on-sale); }
.badge-muted { background: var(--surface-muted); }

.price { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-variant-numeric: tabular-nums; }
.price .now { font-weight: 700; color: var(--ink); }
.price .now.on-sale { color: var(--sale); }
.price del { color: var(--muted); font-size: .9em; }
.price-lg { font-size: 1.5rem; }

.stock { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; }
.stock::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.stock-instock { color: var(--ok); }
.stock-onbackorder { color: var(--warn); }
.stock-outofstock { color: var(--muted); }

/* Pagination */

.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 40px; list-style: none; padding: 0; }
.pagination a, .pagination span { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); text-decoration: none; }
.pagination [aria-current="page"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.pagination .gap { border: 0; background: none; }

/* Home */

.hero { position: relative; overflow: hidden; border-radius: calc(var(--radius) * 1.5); background: var(--hero-bg); border: 1px solid var(--line); padding: clamp(32px, 7vw, 80px) clamp(20px, 6vw, 72px); margin-bottom: 48px; }
.hero .eyebrow { font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); margin: 0 0 12px; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); max-width: 16ch; }
.hero p { color: var(--ink-soft); max-width: 52ch; margin: 0 0 24px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; }

.section { margin-bottom: 56px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-head h2 { margin: 0; }
.section-head a { font-size: .95rem; white-space: nowrap; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; list-style: none; padding: 0; margin: 0; }
.tile { display: flex; flex-direction: column; justify-content: flex-end; min-height: 140px; padding: 20px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(160deg, var(--surface) 0%, var(--surface-muted) 100%); text-decoration: none; }
.tile:hover { border-color: var(--accent); }
.tiles-image .tile { position: relative; min-height: 0; padding: 0; overflow: hidden; justify-content: flex-start; background: var(--surface); }
.tiles-image .tile-media { display: block; aspect-ratio: 4 / 3; border-radius: 0; }
.tiles-image .tile-media .placeholder { font-size: .8rem; letter-spacing: .2em; padding: 0 16px; text-align: center; }
.tiles-image .tile-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.tiles-image .tile:hover .tile-media img { transform: scale(1.04); }
.tiles-image .title, .tiles-image .meta { padding: 0 16px; }
.tiles-image .title { margin-top: 14px; }
.tiles-image .meta { padding-bottom: 16px; }

/* Hero Hồng Charme: chữ bên trái, ba ảnh sản phẩm bên phải. */
.hero-classic { display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) { .hero-classic { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); } }
.hero-media { display: grid; grid-template-columns: 1.3fr 1fr; grid-template-rows: 1fr 1fr; gap: 12px; }
.hero-media .media { border-radius: var(--radius); box-shadow: var(--shadow); }
.hero-media .media:first-child { grid-row: span 2; aspect-ratio: 3 / 4; }
@media (max-width: 899px) { .hero-media { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: none; } .hero-media .media:first-child { grid-row: auto; aspect-ratio: 1; } }
.tile .title { font-family: var(--font-display); font-size: 1.45rem; font-weight: 600; line-height: 1.2; }
.tile .meta { color: var(--muted); font-size: .875rem; margin-top: 4px; }

/* Product page */

/* minmax(0, 1fr): dải thumbnail dài không được kéo rộng cột (và cả trang) trên điện thoại. */
.product { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; margin-bottom: 56px; }
@media (min-width: 900px) { .product { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: start; } }

.gallery .thumbs { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; }
.gallery .thumbs button { flex: 0 0 72px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: none; cursor: pointer; overflow: hidden; }
.gallery .thumbs button[aria-current="true"] { border-color: var(--ink); }
.gallery .thumbs img { aspect-ratio: 1; object-fit: cover; width: 100%; }

@media (min-width: 900px) { .product-info { position: sticky; top: calc(var(--header-h, 152px) + 16px); } }
.product-info .brand-name { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); text-decoration: none; }
.product-info h1 { margin: 6px 0 12px; }
.product-info .summary { color: var(--ink-soft); margin: 16px 0; }
.product-info .price-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 8px 0 16px; }

.notice { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface-muted); border: 1px solid var(--line); margin: 16px 0; }
.notice strong { display: block; }

.variants { border: 0; padding: 0; margin: 16px 0; }
.variants legend { font-size: .9rem; color: var(--muted); margin-bottom: 8px; padding: 0; }
.variants .options { display: flex; flex-wrap: wrap; gap: 8px; }
.variants input { position: absolute; opacity: 0; pointer-events: none; }
.variants label { display: inline-flex; flex-direction: column; gap: 2px; min-width: 88px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; font-size: .95rem; }
.variants label small { color: var(--muted); font-size: .8rem; }
.variants input:checked + label { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.variants input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }

.buy { display: grid; gap: 8px; margin: 20px 0; }
.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.stepper button { width: 40px; border: 0; background: none; font: inherit; font-size: 1.2rem; color: var(--ink); cursor: pointer; }
.stepper button:hover { color: var(--accent); }
.stepper .qty input { width: 48px; border: 0; text-align: center; -moz-appearance: textfield; }
.stepper .qty input::-webkit-inner-spin-button, .stepper .qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
/* Thanh mua cố định ở đáy màn hình điện thoại. */
.buy-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: flex; align-items: center; gap: 12px; padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgb(0 0 0 / 8%); }
.buy-bar[hidden] { display: none; }
.buy-bar-info { display: grid; min-width: 0; flex: 1; font-size: .85rem; }
.buy-bar-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-soft); }
.buy-bar .btn { min-height: 44px; }
@media (min-width: 900px) { .buy-bar { display: none !important; } }
/* Thanh mua dính đáy chỉ có dưới 900px; máy tính không chừa chỗ (trước đây chân trang trang sản phẩm bị hở 96px). */
@media (max-width: 899px) { body.has-buy-bar .site-footer { padding-bottom: 96px; } }
.buy-row { display: flex; gap: 12px; }
.buy-row .btn { flex: 1; }
.qty input { width: 76px; min-height: 48px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font: inherit; text-align: center; font-variant-numeric: tabular-nums; }
.qty input:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 1px var(--ink); }
.buy .hint { font-size: .875rem; color: var(--muted); margin: 0; }

/* Dưới nút "Thêm vào giỏ" (S1-17): hồ sơ mùi hương, dòng giao hàng, tư vấn. */
.profile { margin: 20px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); }
.profile-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.profile-head h2 { margin: 0; font-size: 1.05rem; }
.profile-head a { font-size: .85rem; color: var(--ink-soft); }
.profile-rows { display: grid; grid-template-columns: minmax(92px, max-content) minmax(0, 1fr); gap: 7px 16px; margin: 0; font-size: .95rem; }
.profile-rows dt { color: var(--muted); }
.profile-rows dd { margin: 0; }
.profile-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.profile-stats li { display: grid; gap: 2px; align-content: start; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-muted); }
.profile-stats small { color: var(--muted); font-size: .78rem; }
.profile-stats strong { font-size: .9rem; font-weight: 600; line-height: 1.35; }
.profile-fit { margin: 12px 0 0; font-size: .92rem; color: var(--ink-soft); }
.profile-fit span { color: var(--muted); margin-right: 6px; }
.buy-notes { display: flex; gap: 12px; align-items: flex-start; margin: 18px 0 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.buy-notes svg { flex: none; margin-top: 1px; color: var(--accent); }
.buy-notes p { display: grid; gap: 2px; margin: 0; }
.ship-note { font-weight: 600; font-size: .95rem; }
.trust-line { color: var(--muted); font-size: .85rem; line-height: 1.45; }
.consult { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 14px 0 0; }
.consult p { margin: 0; font-size: .92rem; color: var(--ink-soft); }
.consult-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.consult-actions [hidden] { display: none; }
/* Tư vấn và Zalo (S1-26): hai khối "hoà" vào một lưới (display: contents) để dòng chữ cùng hàng và hàng nút căn
   giữa theo nhau; khối Zalo là cột phải, nội dung canh trái trong cột. Cột thông tin hẹp thì xếp dọc. */
.consult-row { container-type: inline-size; margin: 14px 0 0; }
.consult-grid { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "ask" "ask-actions" "zalo" "zalo-button";
  align-items: center; justify-items: start; gap: 8px 24px; }
.consult-grid .consult, .consult-grid .zalo-offer { display: contents; }
.consult-grid .consult > p { grid-area: ask; }
.consult-grid .consult-actions { grid-area: ask-actions; }
.consult-grid .zalo-offer > p { grid-area: zalo; margin: 8px 0 0; }
.consult-grid .zalo-offer .btn-zalo { grid-area: zalo-button; }
@container (min-width: 470px) {
  .consult-grid { grid-template-columns: auto auto; justify-content: space-between;
    grid-template-areas: "ask zalo" "ask-actions zalo-button"; }
  .consult-grid .zalo-offer > p { margin: 0; }
}
.zalo-offer p { font-size: .92rem; color: var(--ink-soft); }

/* Mô tả và thông số nằm dưới phần mua, rộng hết trang, để cột mua không dài theo dữ liệu. */
.product-more { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; padding-top: 40px; margin-bottom: 56px; border-top: 1px solid var(--line); }
@media (min-width: 900px) { .product-more { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 64px; align-items: start; } }
.product-more > :only-child { grid-column: 1 / -1; }
.product-more h2 { font-size: 1.6rem; margin: 0 0 16px; }
.product-description .prose { color: var(--ink-soft); }
.product-specs .details { margin-top: 24px; }

.details { border-top: 1px solid var(--line); }
.details > details { border-bottom: 1px solid var(--line); }
.details summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 18px 0; font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; }
.details summary::-webkit-details-marker { display: none; }
.details summary::after { content: "+"; font-family: var(--font-body); font-size: 1.4rem; color: var(--muted); }
.details details[open] summary::after { content: "−"; }
.details .body { padding: 0 0 20px; color: var(--ink-soft); }
.details .body > :first-child { margin-top: 0; }

.spec { width: 100%; border-collapse: collapse; font-size: .95rem; }
.spec th, .spec td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); }
.spec th { width: 34%; color: var(--muted); font-weight: 500; }
.spec tr:last-child th, .spec tr:last-child td { border-bottom: 0; }

.prose { max-width: 72ch; }
.prose img { height: auto; border-radius: var(--radius-sm); }
.content-page { max-width: 760px; margin: 0 auto 56px; }
.content-page .prose { color: var(--ink-soft); line-height: 1.7; }
.content-page .prose h2 { color: var(--ink); font-size: 1.4rem; margin-top: 1.6em; }
.faq-item + .faq-item { margin-top: 28px; padding-top: 4px; border-top: 1px solid var(--line); }
.faq-page .faq-item h2 { margin-top: 1em; }
.faq-links { font-size: .95rem; }
.contact-section { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--line); }
.contact-form { display: grid; gap: 16px; max-width: 640px; }
.contact-form .btn { justify-self: start; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Footer */

.site-footer { border-top: 1px solid var(--line); background: var(--footer-bg); color: var(--ink); padding: 48px 0 32px; font-size: .95rem; }
.site-footer .cols { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.site-footer h2 { font-size: 1.15rem; margin-bottom: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a { text-decoration: none; color: var(--ink-soft); }
.site-footer a:hover { color: var(--accent); }
.site-footer .legal { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.site-footer .cols { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
@media (min-width: 1024px) { .site-footer .cols { grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); } }
.footer-about .muted { max-width: 34ch; }
.footer-contact a { color: var(--ink); font-weight: 600; }
.pay-methods { display: flex; gap: 6px; }
.pay-methods span { padding: 3px 10px; border: 1px solid var(--line); border-radius: var(--radius-pill); font-size: .75rem; font-weight: 700; letter-spacing: .04em; color: var(--ink-soft); background: var(--surface); }
.store-info { display: grid; gap: 4px; margin-top: 32px; font-style: normal; font-size: .85rem; color: var(--muted); }
.store-info strong { color: var(--ink-soft); }
.store-info a { text-decoration: underline; }
.store-info .notice-badge { display: inline-block; width: max-content; margin-top: 8px; }
.store-info .notice-badge img { display: block; width: 160px; height: auto; }

/* Empty and error pages */

.empty { text-align: center; padding: 64px 16px; color: var(--ink-soft); }
.empty h1 { margin-bottom: 12px; }
.empty .actions { margin-top: 24px; display: flex; justify-content: center; }

.eyebrow { font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); margin: 0 0 8px; }
.muted { color: var(--muted); }
.site-footer .brand { display: inline-block; margin: 0 0 8px; }
.gallery .thumbs button { aspect-ratio: 1; background: var(--media-bg); }
.gallery .thumbs img.is-broken { display: none; }

/* Thông báo */

.messages { display: grid; gap: 8px; margin-bottom: 20px; }
.message { margin: 0; padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); border-left: 4px solid var(--ok); }
.message-warning { border-left-color: var(--warn); }
.message-error { border-left-color: var(--sale); }
.message-link { margin-left: 8px; font-weight: 600; color: var(--accent); white-space: nowrap; }

/* Giỏ hàng và checkout */

.btn-block { width: 100%; }
.link-button { padding: 0; border: 0; background: none; font: inherit; font-size: .875rem; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-button:hover { color: var(--sale); }

.cart-layout, .checkout-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: start; margin-bottom: 56px; }
@media (min-width: 900px) {
  .cart-layout, .checkout-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: 48px; }
  .summary-box { position: sticky; top: calc(var(--header-h, 152px) + 16px); }
}

.line-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.cart-line { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; grid-template-areas: "thumb main main" "thumb qty total"; gap: 8px 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 640px) {
  .cart-line { grid-template-columns: 88px minmax(0, 1fr) auto 120px; grid-template-areas: "thumb main qty total"; }
}
.cart-line .thumb { grid-area: thumb; border-radius: var(--radius-sm); }
.cart-line .thumb .placeholder { font-size: .55rem; letter-spacing: .2em; }
.line-main { grid-area: main; display: grid; gap: 2px; }
.line-name { text-decoration: none; font-weight: 600; line-height: 1.4; }
.line-unit { font-size: .9rem; }
.line-qty { grid-area: qty; display: flex; align-items: center; gap: 12px; }
.line-qty .qty input { min-height: 40px; width: 64px; }
.line-total { grid-area: total; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.cart-actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 20px; }

.summary-box { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.summary-box h2 { font-size: 1.5rem; margin-bottom: 16px; }
.summary-box .hint { margin: 12px 0 0; font-size: .875rem; color: var(--muted); text-align: center; }
/* Dòng đồng ý ngay trên nút Đặt hàng và Tạo tài khoản (S1-44); trong .auth-card khoảng cách theo gap của lưới. */
.legal-note { margin: 0; font-size: .85rem; line-height: 1.5; color: var(--muted); text-align: center; }
.legal-note a { text-decoration-color: currentColor; }
.summary-box .legal-note { margin: 0 0 12px; }
.ship-progress { margin: 0 0 16px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--tint-soft); font-size: .9rem; }
.ship-progress p { margin: 0 0 8px; }
.ship-progress .bar { height: 6px; border-radius: var(--radius-pill); background: var(--line); overflow: hidden; }
.ship-progress .bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.summary-lines { list-style: none; margin: 0 0 8px; padding: 0; }
.summary-lines li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .95rem; }
.summary-lines .amount { white-space: nowrap; font-variant-numeric: tabular-nums; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 10px 0; margin: 12px 0 20px; font-variant-numeric: tabular-nums; }
.totals dt { color: var(--ink-soft); padding-right: 16px; }
.totals dd { margin: 0; text-align: right; }
.totals .grand { padding-top: 12px; border-top: 1px solid var(--line); font-size: 1.15rem; font-weight: 700; color: var(--ink); }

.checkout-fields h2 { font-size: 1.5rem; }
.checkout-account { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 20px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow-wrap: anywhere; }
.checkout-account p { margin: 0; flex: 1 1 260px; }
.checkout-account .checkout-account-note { flex-basis: 100%; padding-top: 10px; border-top: 1px dashed var(--line); font-size: .85rem; color: var(--muted); }
.field-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 640px) { .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.field { display: grid; gap: 6px; align-content: start; }
.field-wide { grid-column: 1 / -1; }
.field label { font-size: .9rem; font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; }
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 1px var(--ink); }
.field .help { color: var(--muted); font-size: .8rem; }
.field .error { color: var(--sale); font-size: .85rem; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--sale); }

/* Ô chọn tỉnh, thành có tìm (S1-46, storefront.js); tắt JS thì là select thường. */
.province-picker { position: relative; scroll-margin-top: calc(var(--header-h, 64px) + 40px); }
.province-button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.province-button::after { content: ""; flex: none; width: 8px; height: 8px; margin-right: 4px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.province-button[aria-expanded=true]::after { transform: translateY(2px) rotate(-135deg); }
.province-button.is-placeholder { color: var(--muted); }
.province-button:focus-visible, .province-button[aria-expanded=true] { border-color: var(--ink); outline: none; box-shadow: 0 0 0 1px var(--ink); }
.field.has-error .province-button { border-color: var(--sale); }
.province-popup { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 15; min-width: min(22rem, calc(100vw - 2 * var(--gutter))); display: flex; flex-direction: column; max-height: min(28rem, var(--room, 28rem)); overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow); }
.province-popup[hidden] { display: none; }
.field .province-popup .province-search { flex: none; width: auto; margin: 8px; border-color: var(--line); }
.field .province-popup .province-search:focus { border-color: var(--ink); }
.province-list { position: relative; flex: 1 1 auto; min-height: 0; margin: 0; padding: 0 0 4px; overflow-y: auto; overscroll-behavior: contain; list-style: none; }
.province-list:not(.is-filtered) .is-pinned + .province-option:not(.is-pinned) { border-top: 1px solid var(--line); }
.province-option { display: grid; align-content: center; min-height: 44px; padding: 8px 12px; line-height: 1.35; cursor: pointer; }
.province-option[hidden] { display: none; }
.province-option small { color: var(--muted); font-size: .8rem; }
.province-option[aria-selected=true] { color: var(--accent); font-weight: 600; }
.province-option.is-active { background: var(--tint-soft); box-shadow: inset 3px 0 0 var(--accent); }
@media (hover: hover) { .province-option:hover { background: var(--surface-muted); } }
.province-status { margin: 0; padding: 8px 12px 12px; color: var(--ink-soft); font-size: .9rem; }
.province-foot { flex: none; padding: 4px 12px 10px; border-top: 1px solid var(--line); background: var(--surface-muted); }
.province-all { display: block; width: 100%; min-height: 44px; padding: 8px 0 4px; border: 0; background: none; color: var(--ink); font: inherit; font-size: .9rem; line-height: 1.4; text-align: left; cursor: pointer; }
.province-all strong { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-soft); text-underline-offset: 3px; }
.province-note { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.4; }
/* Màn hình thấp, thường là khi bàn phím điện thoại đang mở (storefront.js thêm is-compact): ô bật ra đè lên nút và
   lên sát header, chân chỉ còn dòng "Xem cả ... tỉnh, thành", để danh sách vẫn thấy khoảng ba tỉnh. */
.province-picker.is-compact { scroll-margin-top: calc(var(--header-h, 64px) + 8px); }
.province-picker.is-compact .province-popup { top: 0; }
.field .province-picker.is-compact .province-search { margin: 6px 8px; }
.province-picker.is-compact .province-foot { padding: 0 12px; }
.province-picker.is-compact .province-all { padding: 4px 0; }
.province-picker.is-compact .province-all > span, .province-picker.is-compact .province-note { display: none; }
.form-errors { color: var(--sale); margin-bottom: 16px; }

.payment-methods { border: 0; padding: 0; margin: 0 0 20px; }
.payment-methods legend { font-weight: 600; font-size: .9rem; margin-bottom: 8px; padding: 0; }
.payment-methods { display: grid; gap: 8px; }
.payment-option { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.payment-option:has(input:checked) { border-color: var(--ink); }
.payment-option input { margin-top: 5px; accent-color: var(--ink); }
.payment-option span { display: grid; gap: 2px; }
.payment-option small { color: var(--muted); }
.payment-option.is-paused { cursor: not-allowed; opacity: .6; }
.paused-tag { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--line); color: var(--ink-soft); font-size: .72rem; font-style: normal; font-weight: 600; }

.order-received { max-width: 880px; margin: 0 auto 56px; }
.order-overview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0 0 32px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); }
@media (min-width: 640px) { .order-overview { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
.order-overview div { padding: 16px; background: var(--surface); }
.order-overview dt { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.order-overview dd { margin: 4px 0 0; font-weight: 700; }
.order-detail { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; margin-bottom: 32px; }
@media (min-width: 768px) { .order-detail { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 48px; } }
.order-detail h2 { font-size: 1.4rem; }
.order-detail address { font-style: normal; line-height: 1.8; }

.transfer-box { margin: 0 0 32px; padding: 24px; border: 1px solid var(--accent-soft); border-radius: var(--radius); background: var(--tint-soft); }
.transfer-box h2 { font-size: 1.4rem; }
.transfer-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: center; }
@media (min-width: 640px) { .transfer-grid { grid-template-columns: auto minmax(0, 1fr); gap: 32px; } }
.transfer-qr { margin: 0; justify-self: center; text-align: center; }
.transfer-qr svg { display: block; width: 220px; height: auto; max-width: 100%; background: #fff; border-radius: var(--radius-sm); }
.transfer-qr figcaption { margin-top: 8px; font-size: .85rem; color: var(--muted); }
.transfer-details { display: grid; gap: 10px; margin: 0; }
.transfer-details div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; }
.transfer-details dt { color: var(--muted); }
.transfer-details dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.transfer-box .hint { margin: 16px 0 0; font-size: .875rem; color: var(--ink-soft); }

.track-form { display: grid; gap: 16px; max-width: 640px; margin-bottom: 40px; }
.track-form .btn { justify-self: start; }
.track-result { margin-bottom: 56px; }
.track-result > h2 { font-size: 1.6rem; }

/* Tài khoản khách */

.auth-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; margin-bottom: 56px; }
@media (min-width: 900px) { .auth-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 32px; align-items: start; } }
.auth-card { display: grid; gap: 16px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.auth-card h2 { font-size: 1.5rem; margin: 0; }
.auth-card .hint { margin: 0; font-size: .9rem; text-align: center; }
@media (min-width: 900px) { .auth-single { grid-template-columns: minmax(0, 520px); } }

.account-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; margin-bottom: 56px; }
@media (min-width: 900px) { .account-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 48px; align-items: start; } }
.account-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.account-nav a, .account-nav .link-button { padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); text-decoration: none; font-size: .95rem; color: var(--ink-soft); }
.account-nav a[aria-current="page"] { border-color: var(--ink); color: var(--ink); }
.account-nav form { display: contents; }
@media (min-width: 900px) {
  .account-nav { flex-direction: column; gap: 0; border-top: 1px solid var(--line); }
  .account-nav a, .account-nav .link-button { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; padding: 12px 0; text-align: left; }
  .account-nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
}
.account-main h2 { font-size: 1.4rem; }
.account-section { margin-bottom: 32px; }
.account-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 640px) { .account-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.account-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.account-card address { font-style: normal; margin-bottom: 12px; }
.account-form { display: grid; gap: 16px; margin-bottom: 40px; max-width: 640px; }
.account-form .btn { justify-self: start; }
.account-form h2 { margin: 0; }

.orders-table { width: 100%; border-collapse: collapse; font-size: .95rem; font-variant-numeric: tabular-nums; }
.orders-table th, .orders-table td { text-align: left; padding: 12px 8px 12px 0; border-bottom: 1px solid var(--line); }
.orders-table thead th { color: var(--muted); font-weight: 500; font-size: .85rem; }
.orders-table td:last-child { text-align: right; padding-right: 0; white-space: nowrap; }
.status { display: inline-block; padding: 2px 10px; border-radius: var(--radius-pill); font-size: .8rem; background: var(--surface-muted); white-space: nowrap; }
.status-completed { background: #e3f1e6; color: var(--ok); }
.status-cancelled, .status-failed, .status-refunded { color: var(--muted); }

/* Ẩn theo thiết bị (S1-22): điện thoại là màn hình hẹp hơn 900 px, cùng ngưỡng chuyển sang menu ngăn kéo. */
@media (max-width: 899px) { .off-mobile { display: none !important; } }
@media (min-width: 900px) { .off-desktop { display: none !important; } }

/* Zalo OA (S1-26). Khung chat do SDK của Zalo dựng; class off-mobile, off-desktop ẩn theo thiết bị như nút nổi. */
/* Nút Quan tâm (S1-46) là link zalo.me tới OA, màu xanh của Zalo; `.btn.` để thắng `.btn` của phong cách tải sau. */
.btn.btn-zalo { border-color: #0068ff; background: #0068ff; color: #fff; }
.btn.btn-zalo:hover { border-color: #0050c8; background: #0050c8; color: #fff; }
.btn-zalo svg { flex: none; }
.footer-zalo { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 14px; font-size: .9rem; }
.zalo-section { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--line); }
.zalo-section .btn-zalo { display: flex; width: fit-content; margin-bottom: 20px; }  /* thẻ OA (SDK đặt inline-block) xuống dòng dưới */
.zalo-section .zalo-follow-button { max-width: 100%; overflow: hidden; }
.order-zalo { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 24px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.order-zalo p { margin: 0; flex: 1 1 240px; }
.order-email-note { margin: 0 0 24px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow-wrap: anywhere; }

/* Bài viết (S1-31) */
.post-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px 24px; list-style: none; padding: 0; margin: 0 0 32px; }
@media (min-width: 640px) { .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.post-card a { display: flex; flex-direction: column; gap: 8px; color: inherit; text-decoration: none; }
.post-card img, .post-card-blank { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface-soft, #f4f1f3); }
.post-card time { font-size: .8rem; color: var(--muted); }
.post-card strong { font-size: 1.05rem; line-height: 1.35; }
.post-card a:hover strong { color: var(--accent); }
.post-card p { margin: 6px 0 0; font-size: .9rem; color: var(--ink-soft); }
/* Điểm tin ở trang chủ (S1-46): điện thoại là dải trượt ngang thấy hai thẻ, JS tự đẩy từng thẻ; từ 640px là lưới ba bài. */
@media (max-width: 639px) {
  .legacy-news .post-grid { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
  .legacy-news .post-grid::-webkit-scrollbar { display: none; }
  .legacy-news .post-card { flex: 0 0 calc((100% - 12px) / 2); min-width: 0; scroll-snap-align: start; }
  .legacy-news .post-card a { gap: 6px; }
  .legacy-news .post-card strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; font-size: .92rem; }
}
@media (min-width: 640px) { .legacy-news .post-grid > li:nth-child(n+4) { display: none; } }
.post-meta { margin: -8px 0 20px; font-size: .9rem; color: var(--muted); }
.post-meta a { color: inherit; }
.post-cover { display: block; width: 100%; height: auto; margin: 0 0 24px; border-radius: var(--radius-sm); }
.post .prose figure { margin: 20px 0; }
.post .prose figcaption { font-size: .85rem; color: var(--muted); text-align: center; }
.post-others { margin-bottom: 48px; }

/* Hộp hỏi đồng ý cookie (S1-32) */
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60; max-width: 560px; margin: 0 auto; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: 0 8px 28px rgba(0, 0, 0, .18); }
.consent[hidden] { display: none; }
/* Nút liên hệ nổi và khung chat Zalo nằm cùng góc màn hình: ẩn tới khi khách chọn. */
.consent-open .float-contact, .consent-open .zalo-chat-widget { visibility: hidden !important; }  /* SDK Zalo đặt style nội tuyến */
.consent p { margin: 0 0 12px; font-size: .92rem; }
.consent-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.link-button { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }

/* Đánh giá sản phẩm (S1-33) */
.stars { display: inline-block; font-size: 1rem; line-height: 1; letter-spacing: 1px; color: transparent; background: linear-gradient(90deg, #f2a900 var(--fill), #d9d3d6 var(--fill)); -webkit-background-clip: text; background-clip: text; }
.rating-badge { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); }
.rating-badge a { color: inherit; }
.card .rating-badge { margin: 2px 0 4px; font-size: .78rem; }
.card .rating-badge .stars { font-size: .85rem; }
.product-rating { margin: -4px 0 12px; }
.reviews { margin: 48px 0; max-width: 860px; }
.review-summary { display: flex; flex-wrap: wrap; gap: 24px 40px; align-items: center; margin-bottom: 24px; }
.review-score { display: flex; flex-direction: column; gap: 4px; }
.review-score strong { font-size: 2.4rem; line-height: 1; }
.review-score .stars { font-size: 1.25rem; }
.review-score span:last-child { font-size: .85rem; color: var(--muted); }
.review-bars { list-style: none; margin: 0; padding: 0; min-width: 240px; flex: 1; max-width: 420px; }
.review-bars li { display: grid; grid-template-columns: 36px 1fr 36px; gap: 8px; align-items: center; font-size: .85rem; color: var(--muted); }
.review-bars .bar { height: 8px; border-radius: 4px; background: #eee8ea; overflow: hidden; }
.review-bars .bar span { display: block; height: 100%; background: #f2a900; }
.review-bars .n { text-align: right; }
.review-list { list-style: none; margin: 0 0 16px; padding: 0; }
.review-list > li { padding: 16px 0; border-top: 1px solid var(--line); }
.review-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: .9rem; }
.review-head time { color: var(--muted); font-size: .8rem; }
.tag-verified { font-size: .75rem; color: #1f7a4d; background: #e7f5ee; border-radius: 999px; padding: 2px 8px; }
.review-list p { margin: 8px 0 0; }
.review-reply { margin: 10px 0 0 16px; padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--surface-soft, #f7f4f5); font-size: .9rem; }
.review-reply p { margin: 4px 0 0; }
.review-form { margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px; }
.review-form summary { cursor: pointer; font-weight: 600; }
.review-form form { margin-top: 12px; }
.star-input { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0 0 12px; }
.star-input legend { width: 100%; margin-bottom: 6px; font-weight: 600; font-size: .9rem; }
.star-input label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: .9rem; }
.star-input label:has(input:checked) { border-color: #f2a900; background: #fff7e0; }

/* Mã giảm giá ở giỏ hàng (S1-34) */
.coupon-box { margin: 0 0 16px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.coupon-box h3 { margin: 0 0 8px; font-size: .95rem; }
.coupon-enter { display: flex; gap: 8px; margin-bottom: 10px; }
.coupon-enter input { flex: 1; min-width: 0; text-transform: uppercase; }
.coupon-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.coupon { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 10px; border: 1px dashed var(--line); border-radius: var(--radius-sm); }
.coupon.is-on { border: 1px solid var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.coupon.is-off { opacity: .6; }
.coupon-text { display: grid; gap: 2px; font-size: .85rem; }
.coupon-text small { color: var(--muted); }
.totals .discount { color: var(--accent); }

/* Vận chuyển ở trang đơn (S1-35) */
.order-shipments { grid-column: 1 / -1; }
.order-shipments .shipment { padding: 12px 0; border-top: 1px solid var(--line); }
.order-shipments p { margin: 0 0 6px; }
.shipment-status { font-weight: 600; color: var(--accent); }
.shipment-timeline { list-style: none; margin: 8px 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.shipment-timeline li { position: relative; display: flex; gap: 10px; padding: 0 0 8px; font-size: .9rem; }
.shipment-timeline li::before { content: ""; position: absolute; left: -20px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.shipment-timeline li:first-child::before { background: var(--accent); }
.shipment-timeline time { color: var(--muted); white-space: nowrap; }

/* Link đánh giá của đơn (S1-33) */
.order-review-item { padding: 16px 0; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.order-review-product { display: flex; gap: 12px; align-items: center; }
.order-review-product img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); }
.order-review-item textarea { width: 100%; }
.order-reviews .field { margin: 16px 0; display: grid; gap: 6px; max-width: 360px; }
.order-review-done { list-style: none; padding: 0; display: grid; gap: 8px; }
