/* =====================================================================
   Website điện máy — CSS thuần, mobile-first, không framework.
   Mục tiêu Core Web Vitals: không chặn render bởi font (font-display:swap),
   ảnh luôn có width/height (không CLS), không animation nặng.
   ===================================================================== */
@font-face { font-family: "BVP"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/bvp-vietnamese-400.woff2) format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "BVP"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/bvp-latin-400.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "BVP"; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/bvp-vietnamese-600.woff2) format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "BVP"; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/bvp-latin-600.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "BVP"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/bvp-vietnamese-700.woff2) format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "BVP"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/bvp-latin-700.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --primary: #1d5bd8;
  --primary-dark: #1647ab;
  --primary-soft: #eaf1fd;
  --sale: #d7263d;
  --sale-soft: #fdecef;
  --buy: #e8590c;
  --buy-dark: #c9480a;
  --ok: #128048;
  --ok-soft: #e4f5ec;
  --warn: #9a5b00;
  --warn-soft: #fff5e0;
  --star: #f5a623;
  --text: #19202d;
  --text-2: #4b5466;
  --muted: #6c7486;
  --line: #e4e7ed;
  --line-2: #d3d8e0;
  --bg: #f3f5f8;
  --panel: #fff;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 2px 8px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .18);
  --container: 1240px;
  --header-h: 60px;
  --bottomnav-h: 58px;
  --font: "BVP", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body { margin: 0; font: 15px/1.55 var(--font); color: var(--text); background: var(--bg); padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom)); }
img, video, iframe { max-width: 100%; }
img { height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: 22px; } h2 { font-size: 19px; } h3 { font-size: 16px; }
p { margin: 0 0 .8em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 12px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: #fff; padding: 8px 12px; border-radius: 6px; }
.skip:focus { left: 8px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.only-d { display: none !important; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; color: var(--text); font-weight: 600; text-decoration: none !important; line-height: 1.2; transition: background .15s, border-color .15s; }
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-buy { background: var(--buy); border-color: var(--buy); color: #fff; }
.btn-buy:hover { background: var(--buy-dark); border-color: var(--buy-dark); color: #fff; }
.btn-outline { border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-soft); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn-lg { min-height: 50px; font-size: 16px; }
.btn-block { width: 100%; }
.btn small { display: block; font-weight: 400; font-size: 12px; opacity: .9; }
.btn-stack { flex-direction: column; gap: 0; }
.link-btn { border: 0; background: none; padding: 0; color: var(--primary); font-weight: 600; }

/* ---------- Topbar / Header ---------- */
.topbar { display: none; background: #0f2a5e; color: #c9d6f2; font-size: 13px; }
.topbar-row { display: flex; align-items: center; justify-content: space-between; height: 32px; }
.topbar a, .topbar span { color: #dbe4f7; display: inline-flex; align-items: center; gap: 5px; }
.topbar .ic { width: 15px; height: 15px; }
.topbar-links { display: flex; gap: 18px; }
.header { position: sticky; top: 0; z-index: 50; background: var(--primary); color: #fff; box-shadow: 0 1px 0 rgba(0, 0, 0, .06); }
.header-row { display: flex; align-items: center; gap: 8px; min-height: var(--header-h); flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.hbtn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 40px; height: 40px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; color: inherit; text-decoration: none !important; }
.hbtn:hover { background: rgba(255, 255, 255, .12); }
.header .hbtn .ic { width: 24px; height: 24px; }
.logo { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; font-size: 18px; text-decoration: none !important; margin-right: auto; min-width: 0; }
.logo img { max-height: 44px; width: auto; background: #fff; border-radius: 10px; padding: 4px 10px; } /* logo Avin màu xanh: nền trắng để nổi trên header xanh */
.logo-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: #fff; color: var(--primary); font-size: 14px; flex: none; }
.logo-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-btn { font-weight: 600; }
.cart-count { position: absolute; top: 1px; left: 24px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ffd23f; color: #1a1a1a; font-size: 11px; line-height: 18px; text-align: center; font-weight: 700; }
.search { position: relative; order: 10; flex: 1 1 100%; display: flex; }
.search input { flex: 1; min-width: 0; height: 42px; padding: 0 44px 0 14px; border: 0; border-radius: 8px; background: #fff; color: var(--text); font-size: 15px; }
.search input::-webkit-search-cancel-button { display: none; }
.search button { position: absolute; right: 2px; top: 2px; width: 40px; height: 38px; border: 0; border-radius: 6px; background: transparent; color: var(--primary); }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60; background: #fff; color: var(--text); border-radius: var(--radius); box-shadow: var(--shadow-lg); max-height: 70vh; overflow-y: auto; }
.sg-group { padding: 6px 0; border-bottom: 1px solid var(--line); }
.sg-group:last-child { border-bottom: 0; }
.sg-title { padding: 4px 14px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.sg-item { display: flex; align-items: center; gap: 10px; padding: 7px 14px; color: var(--text); text-decoration: none !important; }
.sg-item:hover, .sg-item.sel { background: var(--primary-soft); }
.sg-item img { width: 44px; height: 44px; object-fit: contain; flex: none; border-radius: 4px; background: #fff; }
.sg-name { flex: 1; min-width: 0; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sg-name mark { background: none; color: var(--primary); font-weight: 700; }
.sg-price { font-weight: 700; color: var(--sale); white-space: nowrap; font-size: 14px; }
.sg-price s { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.sg-all { display: block; padding: 10px 14px; text-align: center; font-weight: 600; }
.hotline { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none !important; line-height: 1.2; }
.hotline small { display: block; font-size: 12px; opacity: .85; }
.hotline b { font-size: 16px; }
.mainnav { background: #fff; border-bottom: 1px solid var(--line); }
.mainnav ul { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
.mainnav a { display: block; padding: 10px 12px; color: var(--text); font-weight: 600; font-size: 14px; white-space: nowrap; text-decoration: none; }
.mainnav a:hover, .mainnav a[aria-current] { color: var(--primary); }
.nav-sale { color: var(--sale) !important; }

/* Mega menu (desktop) */
.cat-menu { position: relative; }
.cat-btn { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .14); color: #fff; font-weight: 600; }
.cat-btn:hover, .cat-menu.open .cat-btn { background: rgba(255, 255, 255, .24); }
.mega { display: none; position: absolute; left: 0; top: calc(100% + 8px); z-index: 70; width: 280px; background: #fff; color: var(--text); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.cat-menu.open .mega, .cat-menu:focus-within .mega { display: block; }
.mega-list { list-style: none; margin: 0; padding: 8px 0; }
.mega-item > a { display: flex; align-items: center; justify-content: space-between; padding: 9px 16px; color: var(--text); font-weight: 600; font-size: 14px; text-decoration: none; }
.mega-item > a .ic { width: 16px; height: 16px; color: var(--muted); }
.mega-item:hover > a { background: var(--primary-soft); color: var(--primary); }
.mega-sub { display: none; position: absolute; left: 100%; top: 0; min-height: 100%; width: 560px; padding: 16px 20px; background: #fff; border-radius: 0 var(--radius) var(--radius) 0; box-shadow: var(--shadow-lg); }
.mega-item:hover .mega-sub { display: block; }
.mega-sub-title { display: block; margin-bottom: 10px; font-weight: 700; }
.mega-sub ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 24px; }
.mega-sub li { break-inside: avoid; margin-bottom: 6px; }
.mega-sub li ul { columns: 1; margin-top: 4px; padding-left: 10px; }
.mega-sub a { color: var(--text-2); font-size: 14px; }

/* ---------- Drawer (menu mobile) ---------- */
.drawer { position: fixed; inset: 0; z-index: 90; background: rgba(15, 23, 42, .5); }
.drawer-panel { position: absolute; inset: 0 auto 0 0; width: min(86vw, 360px); background: #fff; overflow-y: auto; padding-bottom: 24px; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; }
.drawer-list { list-style: none; margin: 0 0 16px; padding: 0; }
.drawer-list > li { border-bottom: 1px solid var(--line); }
.drawer-list a { display: block; padding: 12px 16px; color: var(--text); font-weight: 600; text-decoration: none; }
.drawer-list summary { display: flex; align-items: center; justify-content: space-between; list-style: none; padding-right: 12px; cursor: pointer; }
.drawer-list summary::-webkit-details-marker { display: none; }
.drawer-list details[open] summary .ic { transform: rotate(180deg); }
.drawer-list details ul { list-style: none; margin: 0; padding: 0 0 8px 16px; }
.drawer-list details ul a { font-weight: 400; padding: 8px 16px; color: var(--text-2); }
.drawer-panel > .btn { margin: 0 16px; width: calc(100% - 32px); }

/* ---------- Bottom nav (mobile) ---------- */
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -2px 10px rgba(16, 24, 40, .06); }
.bottomnav a, .bottomnav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: none; padding: 0; color: var(--muted); font-size: 11px; text-decoration: none; }
.bottomnav [aria-current] { color: var(--primary); font-weight: 600; }
.bottomnav .ib { position: relative; }
.bottomnav .cart-count { top: -6px; left: 14px; background: var(--sale); color: #fff; }
.has-sticky-buy .bottomnav { display: none; }

/* ---------- Breadcrumb / headings ---------- */
.crumbs { display: flex; flex-wrap: nowrap; gap: 4px; align-items: center; overflow-x: auto; scrollbar-width: none; margin: 0; padding: 10px 0; list-style: none; font-size: 13px; color: var(--muted); white-space: nowrap; }
.crumbs li { display: flex; align-items: center; gap: 4px; }
.crumbs li + li::before { content: "›"; color: var(--line-2); }
.crumbs a { color: var(--text-2); }
.page-title { font-size: 21px; margin: 4px 0 12px; }
.section { margin: 16px 0; }
.panel { background: var(--panel); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sec-head h2 { margin: 0; font-size: 19px; text-transform: uppercase; letter-spacing: .01em; }
.sec-head .more { display: inline-flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.sec-head .more .ic { width: 16px; height: 16px; }
.subcats { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: -4px 0 12px; padding-bottom: 2px; }
.subcats a { flex: none; padding: 6px 12px; border: 1px solid var(--line); border-radius: 20px; background: #fff; color: var(--text-2); font-size: 13px; text-decoration: none; }
.subcats a:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- Product card ---------- */
.pgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.prow { display: grid; grid-auto-flow: column; grid-auto-columns: 46%; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
.prow > * { scroll-snap-align: start; }
.pcard { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: box-shadow .15s, border-color .15s; }
.pcard:hover { box-shadow: var(--shadow); border-color: var(--line-2); }
.pcard a { color: inherit; text-decoration: none; }
.pcard-img { position: relative; display: block; aspect-ratio: 1; background: #fff; padding: 10px; }
.pcard-img img { width: 100%; height: 100%; object-fit: contain; }
.pcard-img picture { display: contents; }
.badge-off { position: absolute; top: 8px; left: 8px; padding: 2px 7px; border-radius: 6px; background: var(--sale); color: #fff; font-size: 12px; font-weight: 700; }
.badge-oos { position: absolute; inset: auto 8px 8px; padding: 3px 8px; border-radius: 6px; background: rgba(25, 32, 45, .75); color: #fff; font-size: 12px; text-align: center; }
.pcard-body { display: flex; flex-direction: column; gap: 6px; padding: 0 10px 12px; flex: 1; }
.pcard-name { font-size: 14px; font-weight: 600; line-height: 1.4; min-height: 2.8em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-name:hover { color: var(--primary); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { padding: 1px 6px; border-radius: 4px; background: var(--bg); color: var(--text-2); font-size: 11.5px; }
.price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin-top: auto; }
.price-now { color: var(--sale); font-weight: 700; font-size: 16px; }
.price-old { color: var(--muted); font-size: 13px; text-decoration: line-through; }
.price-from { font-size: 12px; color: var(--muted); font-weight: 400; }
.pcard-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.stars { display: inline-flex; gap: 1px; color: var(--line-2); }
.stars .ic { width: 13px; height: 13px; fill: currentColor; stroke: none; }
.stars .on { color: var(--star); }
.stars-lg .ic { width: 20px; height: 20px; }

/* ---------- Home ---------- */
.hero { display: grid; gap: 8px; margin-top: 12px; }
.slider { position: relative; border-radius: var(--radius); overflow: hidden; background: #e8edf5; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; scroll-behavior: smooth; }
.slides::-webkit-scrollbar, .prow::-webkit-scrollbar, .mainnav ul::-webkit-scrollbar, .subcats::-webkit-scrollbar, .crumbs::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: start; }
.slide img { width: 100%; height: auto; aspect-ratio: 16 / 7; object-fit: cover; }
/* Không có banner phụ: slider rộng hết khung, từ 640px dùng ảnh máy tính 3:1 (1920×640); điện thoại dùng ảnh riêng 16:7 (960×420). */
@media (min-width: 640px) { .hero:not(.has-side) .slide img { aspect-ratio: 3 / 1; } }
.slider-dots { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; justify-content: center; gap: 6px; }
.slider-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .6); }
.slider-dots button.on { width: 20px; border-radius: 4px; background: #fff; }
.slider-nav { display: none; position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .85); color: var(--text); box-shadow: var(--shadow); }
.slider-nav.prev { left: 10px; } .slider-nav.next { right: 10px; }
.side-banners { display: none; }
.side-banners img { border-radius: var(--radius); width: 100%; }
.usp { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 12px 0; }
.usp div { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: var(--radius); background: #fff; font-size: 13px; line-height: 1.3; }
.usp .ic { width: 28px; height: 28px; color: var(--primary); }
.usp b { display: block; }
.catgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.catgrid a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: var(--radius); background: #fff; color: var(--text); font-size: 12.5px; font-weight: 600; text-align: center; line-height: 1.3; text-decoration: none; }
.catgrid a:hover { color: var(--primary); box-shadow: var(--shadow); }
.catgrid img, .cat-ph { width: 56px; height: 56px; object-fit: contain; }
.cat-ph { display: grid; place-items: center; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: 20px; font-weight: 700; }
.block { background: #fff; border-radius: var(--radius); padding: 14px 12px; margin: 16px 0; }
.block .pcard { border-color: var(--line); }
.block-sale { background: linear-gradient(180deg, #fff1ee 0, #fff 140px); }
.block-sale .sec-head h2 { color: var(--sale); }
.brands { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.brands a { display: grid; place-items: center; height: 64px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--text-2); font-weight: 700; text-decoration: none; }
.brands img { max-height: 44px; width: auto; object-fit: contain; }
.posts { display: grid; grid-template-columns: 1fr; gap: 12px; }
.post-card { display: flex; align-items: flex-start; gap: 12px; color: var(--text); text-decoration: none !important; background: #fff; border-radius: var(--radius); overflow: hidden; }
.post-card .thumb { display: block; flex: 0 0 120px; aspect-ratio: 16 / 10; background: var(--bg); }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card h3 { font-size: 15px; margin: 8px 8px 4px 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-card p { margin: 0 8px 8px 0; font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-card:hover h3 { color: var(--primary); }

/* ---------- Danh mục / bộ lọc ---------- */
.listing { display: grid; gap: 12px; }
.filters { display: none; }
.filters.open { display: block; position: fixed; inset: 0; z-index: 90; background: #fff; overflow-y: auto; padding: 0 0 80px; }
.filters-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 1; }
.filters-foot { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); }
.filters-foot .btn { flex: 1; }
.fgroup { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.fgroup h3 { font-size: 14px; margin-bottom: 8px; }
.fopts { display: flex; flex-wrap: wrap; gap: 6px; }
.fopt { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line-2); border-radius: 18px; background: #fff; color: var(--text-2); font-size: 13px; text-decoration: none !important; cursor: pointer; }
.fopt input { position: absolute; opacity: 0; pointer-events: none; }
.fopt:hover { border-color: var(--primary); }
.fopt.on, .fopt:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.fopt small { color: var(--muted); font-weight: 400; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.toolbar .count { color: var(--muted); font-size: 14px; margin-right: auto; }
.sorts { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; width: 100%; }
.sorts a { flex: none; padding: 6px 12px; border-radius: 18px; background: #fff; border: 1px solid var(--line); color: var(--text-2); font-size: 13px; text-decoration: none; }
.sorts a[aria-current] { border-color: var(--primary); color: var(--primary); font-weight: 600; background: var(--primary-soft); }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.active-filters a { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px 3px 10px; border-radius: 16px; background: var(--primary-soft); color: var(--primary); font-size: 13px; text-decoration: none; }
.active-filters .ic { width: 14px; height: 14px; }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); background: #fff; border-radius: var(--radius); }
.pager { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 20px 0; list-style: none; padding: 0; }
.pager a, .pager span { display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 10px; border-radius: 8px; background: #fff; border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.pager [aria-current] { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.cat-content { margin-top: 20px; }
.collapsible { position: relative; max-height: 260px; overflow: hidden; }
.collapsible::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 80px; background: linear-gradient(rgba(255, 255, 255, 0), #fff); }
.collapsible.open { max-height: none; }
.collapsible.open::after { display: none; }
.more-toggle { display: block; margin: 8px auto 0; }

/* ---------- Nội dung HTML (mô tả, bài viết) ---------- */
.prose { font-size: 15.5px; line-height: 1.7; overflow-wrap: anywhere; }
.prose h2 { font-size: 20px; margin: 1.4em 0 .6em; }
.prose h3 { font-size: 17px; margin: 1.2em 0 .5em; }
.prose img { margin: 12px auto; border-radius: 6px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px; text-align: left; vertical-align: top; }
.prose blockquote { margin: 12px 0; padding: 8px 14px; border-left: 4px solid var(--primary); background: var(--primary-soft); }
.prose iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; }

/* ---------- Trang sản phẩm ---------- */
.pd { display: grid; gap: 12px; }
.pd-main { background: #fff; border-radius: var(--radius); padding: 12px; }
.gallery { position: relative; }
.stage { position: relative; aspect-ratio: 1; background: #fff; border-radius: var(--radius-sm); overflow: hidden; }
.stage-item { position: absolute; inset: 0; display: grid; place-items: center; }
.stage-item img { width: 100%; height: 100%; object-fit: contain; }
.stage-item picture { display: contents; }
.stage-item video, .stage-item iframe { width: 100%; height: 100%; border: 0; background: #000; }
.video-poster { position: absolute; inset: 0; display: grid; place-items: center; border: 0; padding: 0; background: #000; }
.video-poster img { width: 100%; height: 100%; object-fit: contain; opacity: .9; }
.play { position: absolute; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; }
.play .ic { width: 30px; height: 30px; margin-left: 4px; }
.stage-count { position: absolute; right: 10px; bottom: 10px; padding: 2px 8px; border-radius: 12px; background: rgba(25, 32, 45, .6); color: #fff; font-size: 12px; }
.stage-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .9); box-shadow: var(--shadow); display: grid; place-items: center; z-index: 2; }
.stage-nav.prev { left: 6px; } .stage-nav.next { right: 6px; }
.thumbs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin; margin-top: 8px; padding-bottom: 4px; }
.thumb-btn { position: relative; flex: 0 0 60px; height: 60px; padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.thumb-btn img { width: 100%; height: 100%; object-fit: contain; }
.thumb-btn[aria-current="true"] { border: 2px solid var(--primary); padding: 2px; }
.thumb-btn .play { width: 26px; height: 26px; inset: 0; margin: auto; }
.thumb-btn .play .ic { width: 13px; height: 13px; margin-left: 2px; }
.pd-title { font-size: 20px; margin: 4px 0 8px; }
.pd-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.pd-meta b { color: var(--text-2); font-weight: 600; }
.pd-rating { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.pricebox { padding: 12px; border-radius: var(--radius); background: var(--sale-soft); margin: 10px 0 14px; }
.pricebox .price-now { font-size: 26px; }
.pricebox .price-old { font-size: 15px; }
.pricebox .off { padding: 1px 6px; border-radius: 4px; background: var(--sale); color: #fff; font-size: 13px; font-weight: 700; }
.pricebox .sale-end { display: block; margin-top: 4px; font-size: 13px; color: var(--sale); }
.vopts { margin-bottom: 12px; }
.vopts-label { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.vopts-label span { font-weight: 400; color: var(--muted); }
.vbtns { display: flex; flex-wrap: wrap; gap: 8px; }
.vbtn { position: relative; min-width: 72px; min-height: 40px; padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; font-size: 14px; text-align: center; line-height: 1.25; }
.vbtn small { display: block; font-size: 12px; color: var(--sale); font-weight: 600; }
.vbtn:hover { border-color: var(--primary); }
.vbtn[aria-pressed="true"] { border: 2px solid var(--primary); padding: 5px 11px; color: var(--primary); font-weight: 600; }
.vbtn.unavailable { color: var(--muted); background: var(--bg); text-decoration: line-through; }
.stock { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; font-size: 14px; font-weight: 600; }
.stock .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.stock.in_stock { color: var(--ok); } .stock.out_of_stock { color: var(--sale); } .stock.preorder, .stock.backorder { color: var(--warn); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: #fff; }
.qty button { width: 40px; height: 40px; border: 0; background: var(--bg); display: grid; place-items: center; }
.qty button:disabled { opacity: .4; }
.qty input { width: 52px; height: 40px; border: 0; text-align: center; font-weight: 600; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.qty-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font-size: 14px; }
.buy-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.buy-actions .btn-buy { grid-column: 1 / -1; }
.contact-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.policies { list-style: none; margin: 14px 0 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 10px; font-size: 14px; }
.policies li { display: flex; gap: 10px; align-items: flex-start; }
.policies .ic { color: var(--primary); margin-top: 1px; }
.pd-section { background: #fff; border-radius: var(--radius); padding: 14px 12px; margin-top: 12px; }
.pd-section > h2 { font-size: 18px; margin-bottom: 12px; }
.pd-tabs { position: sticky; top: var(--header-h); z-index: 20; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; background: #fff; border-radius: var(--radius); padding: 4px; margin-top: 12px; box-shadow: var(--shadow); }
.pd-tabs a { flex: none; padding: 8px 12px; border-radius: 6px; color: var(--text-2); font-weight: 600; font-size: 14px; text-decoration: none; }
.pd-tabs a:hover { background: var(--bg); }
.specs { width: 100%; border-collapse: collapse; font-size: 14px; }
.specs th, .specs td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.specs th { width: 42%; color: var(--text-2); font-weight: 400; background: #fafbfc; }
.specs .grp th { background: var(--bg); color: var(--text); font-weight: 700; }
.videos { display: grid; gap: 12px; }
.video-box { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden; background: #000; }
.video-box iframe, .video-box video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-title { font-size: 14px; font-weight: 600; margin-top: 6px; }
.sticky-buy { position: fixed; left: 0; right: 0; bottom: 0; z-index: 56; display: grid; grid-template-columns: 52px 52px 1fr 1fr; gap: 6px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 14px rgba(16, 24, 40, .1); }
.sticky-buy .btn { min-height: 46px; padding: 0 8px; font-size: 14px; }
.sticky-buy .ico { flex-direction: column; gap: 0; font-size: 10.5px; font-weight: 600; padding: 0; }
.sticky-buy .ico .ic { width: 20px; height: 20px; }
.toc-note { font-size: 13px; color: var(--muted); }

/* ---------- Đánh giá & hỏi đáp ---------- */
.rv-summary { display: grid; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.rv-score { display: flex; align-items: center; gap: 14px; }
.rv-score .big { font-size: 40px; font-weight: 700; line-height: 1; }
.rv-bars { display: grid; gap: 4px; font-size: 13px; }
.rv-bar { display: grid; grid-template-columns: 34px 1fr 40px; align-items: center; gap: 8px; color: var(--text-2); }
.rv-bar .track { height: 7px; border-radius: 4px; background: var(--bg); overflow: hidden; }
.rv-bar .fill { height: 100%; background: var(--star); }
.rv-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.rv-list { display: grid; }
.rv-item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.rv-item:last-child { border-bottom: 0; }
.rv-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 4px; }
.rv-head b { font-size: 14px; }
.verified { display: inline-flex; align-items: center; gap: 3px; color: var(--ok); font-size: 12px; font-weight: 600; }
.verified .ic { width: 14px; height: 14px; }
.rv-media { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.rv-media a, .rv-media button { display: block; width: 72px; height: 72px; padding: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #000; position: relative; }
.rv-media img { width: 100%; height: 100%; object-fit: cover; }
.reply { margin-top: 8px; padding: 10px 12px; border-radius: 8px; background: var(--bg); font-size: 14px; }
.reply b { color: var(--primary); }
.staff { display: inline-block; padding: 0 6px; border-radius: 4px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 600; vertical-align: 1px; }
.qa-item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.qa-children { margin: 8px 0 0 16px; padding-left: 12px; border-left: 2px solid var(--line); }
.qa-children .qa-item { padding: 8px 0; border-bottom: 0; }
.qa-meta { font-size: 12px; color: var(--muted); }
.reply-form { margin-top: 8px; }

/* ---------- Form ---------- */
.form-grid { display: grid; gap: 12px; }
.field label, .field .label { display: block; margin-bottom: 4px; font-size: 14px; font-weight: 600; }
.field .req { color: var(--sale); }
.input, .field input[type=text], .field input[type=tel], .field input[type=email], .field input[type=search], .field input[type=number], .field select, .field textarea { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; font-size: 16px; }
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--primary); outline: 0; box-shadow: 0 0 0 3px rgba(29, 91, 216, .15); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--sale); }
.field-error { display: block; margin-top: 4px; color: var(--sale); font-size: 13px; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.star-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.star-input input { position: absolute; opacity: 0; }
.star-input label { cursor: pointer; color: var(--line-2); margin: 0; }
.star-input label .ic { width: 32px; height: 32px; fill: currentColor; stroke: none; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: var(--star); }
.star-input input:focus-visible + label { outline: 2px solid var(--primary); border-radius: 4px; }
.radio-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.radio-card input { margin-top: 4px; accent-color: var(--primary); }
.radio-card small { display: block; color: var(--muted); }

/* ---------- Thông báo ---------- */
.alert { padding: 10px 14px; border-radius: 8px; margin: 10px 0; font-size: 14px; }
.alert-success { background: var(--ok-soft); color: var(--ok); }
.alert-error { background: var(--sale-soft); color: var(--sale); }
.alert-info { background: var(--primary-soft); color: var(--primary-dark); }
.alert-warning { background: var(--warn-soft); color: var(--warn); }
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--bottomnav-h) + 16px); z-index: 120; display: grid; gap: 8px; width: min(92vw, 420px); }
.toast { padding: 12px 14px; border-radius: 10px; background: #1f2937; color: #fff; box-shadow: var(--shadow-lg); font-size: 14px; display: flex; gap: 10px; align-items: center; }
.toast a { color: #ffd23f; font-weight: 600; margin-left: auto; white-space: nowrap; }
.toast-error { background: var(--sale); }

/* ---------- Giỏ hàng / Checkout / Đơn hàng ---------- */
.cart-layout { display: grid; gap: 12px; align-items: start; }
.cart-item { display: grid; grid-template-columns: 72px 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-item:last-child { border-bottom: 0; }
.cart-item img { width: 72px; height: 72px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.cart-item-name { font-weight: 600; font-size: 14px; color: var(--text); }
.cart-item-variant { font-size: 13px; color: var(--muted); }
.cart-item-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.cart-item .warn { font-size: 13px; color: var(--sale); margin-top: 4px; }
.summary { display: grid; gap: 8px; font-size: 14px; }
.summary-row { display: flex; justify-content: space-between; gap: 12px; }
.summary-row.total { padding-top: 10px; border-top: 1px dashed var(--line-2); font-size: 16px; font-weight: 700; }
.summary-row.total b { color: var(--sale); font-size: 20px; }
.coupon-form { display: flex; gap: 8px; }
.coupon-form input { flex: 1; min-width: 0; min-height: 42px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 8px; text-transform: uppercase; }
.steps { display: flex; justify-content: center; gap: 6px; margin: 12px 0; font-size: 13px; color: var(--muted); }
.steps b { color: var(--primary); }
.order-ok { text-align: center; padding: 24px 16px; }
.order-ok .ok-ic { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); }
.order-ok .ok-ic .ic { width: 34px; height: 34px; stroke-width: 2.5; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 14px 6px; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: -24px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); border: 2px solid #fff; }
.timeline li:first-child::before { background: var(--primary); }
.status { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 13px; font-weight: 600; background: var(--primary-soft); color: var(--primary); }
.status-completed { background: var(--ok-soft); color: var(--ok); }
.status-cancelled, .status-returned { background: var(--sale-soft); color: var(--sale); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.bank-box { padding: 12px; border: 1px dashed var(--primary); border-radius: var(--radius); background: var(--primary-soft); white-space: pre-line; font-size: 14px; }

/* ---------- Bài viết ---------- */
.post-layout { display: grid; gap: 16px; }
.post-header h1 { font-size: 24px; }
.post-cover { border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; }

/* ---------- Footer ---------- */
.footer { margin-top: 24px; background: #fff; border-top: 1px solid var(--line); font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; padding-top: 24px; padding-bottom: 12px; }
.footer-grid > section:first-child { grid-column: 1 / -1; }
.footer-title { font-size: 15px; text-transform: uppercase; margin-bottom: 10px; }
.footer-links, .footer-contact { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.footer-links a { color: var(--text-2); }
.footer-contact li { display: flex; gap: 8px; align-items: flex-start; color: var(--text-2); }
.footer-contact .ic { width: 18px; height: 18px; color: var(--primary); margin-top: 2px; }
.social { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 12px; }
.footer-bottom { padding-top: 12px; padding-bottom: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* ---------- Lỗi ---------- */
.error-page { text-align: center; background: #fff; border-radius: var(--radius); padding: 40px 16px; margin-top: 16px; }
.error-code { font-size: 64px; font-weight: 700; color: var(--primary); margin: 0; line-height: 1; }
.error-search { display: flex; gap: 8px; max-width: 440px; margin: 20px auto; }
.error-search input { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 8px; }
.debug { text-align: left; overflow: auto; background: #111; color: #eee; padding: 12px; border-radius: 8px; font-size: 12px; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 130; display: grid; place-items: center; background: rgba(0, 0, 0, .9); padding: 16px; }
.lightbox img, .lightbox video { max-width: 100%; max-height: 90vh; width: auto; }
.lightbox .hbtn { position: absolute; top: 10px; right: 10px; color: #fff; }

/* =====================================================================
   Tablet ≥ 640px
   ===================================================================== */
@media (min-width: 640px) {
  .container { padding: 0 16px; }
  .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .prow { grid-auto-columns: 31%; }
  .catgrid { grid-template-columns: repeat(6, 1fr); }
  .usp { grid-template-columns: repeat(4, 1fr); }
  .brands { grid-template-columns: repeat(6, 1fr); }
  .posts { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid > section:first-child { grid-column: auto; }
  .form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .form-grid .full { grid-column: 1 / -1; }
  .rv-summary { grid-template-columns: 200px 1fr; align-items: center; }
  .videos { grid-template-columns: 1fr 1fr; }
}

/* =====================================================================
   Desktop ≥ 1024px
   ===================================================================== */
@media (min-width: 1024px) {
  body { padding-bottom: 0; font-size: 15px; }
  .only-m { display: none !important; }
  .only-d { display: block !important; }
  .hotline.only-d, .cat-menu.only-d { display: flex !important; }
  .mainnav.only-d { display: block !important; }
  .topbar { display: block; }
  .bottomnav, .sticky-buy { display: none !important; }
  .header-row { flex-wrap: nowrap; gap: 16px; min-height: 68px; }
  .logo { margin-right: 0; font-size: 20px; }
  .search { order: 0; flex: 1; max-width: 560px; }
  .cart-btn { margin-left: auto; padding: 0 12px; }
  .cart-btn .only-d { display: inline !important; }
  .cart-count { left: 22px; }
  h1 { font-size: 26px; }
  .page-title { font-size: 24px; }
  .pgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .pgrid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .prow { grid-auto-flow: row; grid-template-columns: repeat(5, minmax(0, 1fr)); overflow: visible; }
  .pcard-body { padding: 0 12px 14px; }
  .price-now { font-size: 17px; }
  .hero.has-side { grid-template-columns: 1fr 300px; }
  .side-banners { display: grid; gap: 8px; align-content: start; }
  .slider-nav { display: grid; place-items: center; }
  .catgrid { grid-template-columns: repeat(8, 1fr); }
  .block { padding: 18px 16px; }
  .brands { grid-template-columns: repeat(8, 1fr); }
  .posts { grid-template-columns: repeat(4, 1fr); }
  .post-card { flex-direction: column; }
  .post-card .thumb { flex: none; }
  .post-card h3, .post-card p { margin-left: 12px; margin-right: 12px; }
  .post-card p { margin-bottom: 12px; }
  .listing { grid-template-columns: 250px 1fr; align-items: start; }
  .filters { display: block; position: sticky; top: 130px; max-height: calc(100vh - 150px); overflow-y: auto; background: #fff; border-radius: var(--radius); scrollbar-width: thin; }
  .filters-head .hbtn, .filters-foot, .filter-open { display: none !important; }
  .sorts { width: auto; }
  .pd { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; background: #fff; border-radius: var(--radius); }
  .pd-main { padding: 20px; }
  .pd-gallery { padding: 20px 0 20px 20px; }
  .gallery { position: sticky; top: 140px; }
  .pd-title { font-size: 24px; }
  .thumb-btn { flex-basis: 70px; height: 70px; }
  .pd-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
  .pd-aside { position: sticky; top: 140px; }
  .pd-section { padding: 20px; }
  .pd-tabs { top: 112px; }
  .cart-layout { grid-template-columns: 1fr 380px; }
  .cart-layout > aside { position: sticky; top: 130px; }
  .post-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
  .toasts { bottom: 24px; left: auto; right: 24px; transform: none; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .header, .topbar, .footer, .bottomnav, .sticky-buy, .pd-tabs { display: none !important; }
  body { background: #fff; padding: 0; }
}
details > summary.btn { list-style: none; display: inline-flex; } details > summary.btn::-webkit-details-marker { display: none; } details > summary { cursor: pointer; }
.qa-type{display:flex;gap:16px;border:0;padding:0;margin:0}.qa-type label{display:flex;align-items:center;gap:6px;cursor:pointer;font-weight:500}
.cart-item-variant select{margin-left:4px;padding:2px 6px;border:1px solid var(--line,#ddd);border-radius:6px;max-width:100%;font-size:13px}
/* ---------- Tài khoản khách ---------- */
.field input[type=password] { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; font-size: 16px; }
.field input[type=password]:focus { border-color: var(--primary); outline: 0; box-shadow: 0 0 0 3px rgba(29, 91, 216, .15); }
.acc-box { max-width: 440px; margin: 12px auto; }
.acc-layout { display: grid; gap: 12px; margin-top: 12px; }
@media (min-width: 900px) { .acc-layout { grid-template-columns: 240px minmax(0, 1fr); align-items: start; } }
.acc-nav { display: flex; flex-direction: column; gap: 2px; }
.acc-nav a, .acc-nav .link-btn { display: flex; align-items: center; gap: 8px; padding: 9px 8px; border-radius: 8px; color: var(--text); text-align: left; }
.acc-nav a[aria-current] { background: var(--bg); color: var(--primary); font-weight: 600; }
.acc-hello { padding: 4px 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.acc-order { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--text); }
.acc-order-r { text-align: right; white-space: nowrap; }
.acc-addr { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.acc-addr-act { display: flex; gap: 10px; align-items: start; }
.acc-inline { display: flex; gap: 8px; align-items: start; }
.addr-pick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.addr-pick .chip { cursor: pointer; border: 1px solid var(--line-2); padding: 4px 8px; font-size: 13px; }
.badge-ok { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #e7f6ec; color: #1a7f37; font-size: 12px; font-weight: 600; }
