/* Trang khách Tiệm trang sức Vibe — giao diện F, thẻ sản phẩm kiểu A.
   Màu do token quyết định (admin đổi được qua #look). Mọi hiệu ứng tắt khi máy bật "giảm chuyển động". */

/* ---------- Token ---------- */
:root {
  --bg: #FFF6F8; --surface: #FFFFFF; --surface2: #FDEBEF; --ink: #3B1730; --muted: #76566A; --line: #F3D6DE;
  --accent: #C92A62; --accent-ink: #FFFFFF; --accent-soft: #FFE3EC;
  --good: #137A62; --good-soft: #E3F4EE; --warn: #9A4D06; --warn-soft: #FCEEDC; --bad: #B4232A;
  --scrim: rgba(28, 12, 22, .5); --photo: #FFFFFF;
  --font-display: "Baloo 2", "Be Vietnam Pro", system-ui, sans-serif; --font-body: "Be Vietnam Pro", system-ui, sans-serif;
  --r-sm: 10px; --r: 14px; --r-lg: 20px;
  --shadow-1: 0 1px 2px rgba(59, 23, 48, .06), 0 2px 8px rgba(59, 23, 48, .05);
  --shadow-2: 0 6px 18px rgba(59, 23, 48, .12), 0 2px 6px rgba(59, 23, 48, .06);
  --ease-out: cubic-bezier(.22, 1, .36, 1); --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --hdr-h: 68px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark; --bg: #1C1018; --surface: #26161F; --surface2: #321C29; --ink: #FBE9F0; --muted: #C9A3B5; --line: #45283A; --accent: #FF6F9C; --accent-ink: #2A0716; --accent-soft: #4A1F33; --good: #5FD3B5; --good-soft: #163A31; --warn: #F2A65A; --warn-soft: #3D2A14; --bad: #F2797A; --scrim: rgba(0,0,0,.62); --shadow-1: 0 1px 2px rgba(0,0,0,.3); --shadow-2: 0 8px 24px rgba(0,0,0,.4); }
}
:root[data-theme="dark"] { color-scheme: dark; --bg: #1C1018; --surface: #26161F; --surface2: #321C29; --ink: #FBE9F0; --muted: #C9A3B5; --line: #45283A; --accent: #FF6F9C; --accent-ink: #2A0716; --accent-soft: #4A1F33; --good: #5FD3B5; --good-soft: #163A31; --warn: #F2A65A; --warn-soft: #3D2A14; --bad: #F2797A; --scrim: rgba(0,0,0,.62); --shadow-1: 0 1px 2px rgba(0,0,0,.3); --shadow-2: 0 8px 24px rgba(0,0,0,.4); }

/* ---------- Nền tảng ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--hdr-h) + 12px); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.55; overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
body.locked { overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.15; text-wrap: balance; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
img { display: block; max-width: 100%; }
svg { flex: 0 0 auto; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.wrap { max-width: 1280px; margin: 0 auto; padding-inline: 16px; }
@media (min-width: 900px) { .wrap { padding-inline: 24px; } }
.loading { padding: 80px 16px; text-align: center; color: var(--muted); }

/* ---------- Nút ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--r); border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 15px; text-decoration: none; transition: transform .12s var(--ease-out), filter .15s, background-color .2s, color .2s, border-color .2s; }
.btn svg { width: 18px; height: 18px; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); filter: none; }
.btn.block { width: 100%; }
.btn.is-off { opacity: .6; cursor: default; }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); position: relative; transition: transform .12s var(--ease-out); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 20px; height: 20px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; font-size: 13px; min-height: 36px; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface2); color: var(--muted); white-space: nowrap; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.acc { background: var(--accent-soft); color: var(--accent); }

/* ---------- Đầu trang ---------- */
.hdr { background: var(--accent); color: var(--accent-ink); position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.hdr .wrap { display: flex; align-items: center; gap: 10px 14px; min-height: var(--hdr-h); flex-wrap: wrap; padding-block: 10px; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 20px; white-space: nowrap; color: inherit; text-decoration: none; min-width: 0; }
.logo img { width: 40px; height: 40px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--accent-ink) 55%, transparent); }
.logo span { overflow: hidden; text-overflow: ellipsis; }
.search { flex: 1 1 100%; position: relative; min-width: 0; order: 3; }
@media (min-width: 760px) { .search { flex: 1 1 320px; order: 0; max-width: 560px; } }
.search input { width: 100%; min-height: 44px; border: 0; background: var(--surface); color: var(--ink); border-radius: var(--r); padding: 0 14px 0 42px; font-size: 16px; box-shadow: inset 0 0 0 1px transparent; transition: box-shadow .2s; }
.search input:focus { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-ink) 55%, transparent); }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.hdr-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.hdr .icon-btn { background: transparent; border-color: color-mix(in srgb, var(--accent-ink) 40%, transparent); color: var(--accent-ink); }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; padding: 0 14px; min-height: 44px; border-radius: var(--r); border: 1px solid color-mix(in srgb, var(--accent-ink) 40%, transparent); background: transparent; color: var(--accent-ink); }
.chip-btn svg { width: 18px; height: 18px; }
@media (max-width: 420px) { .chip-btn span { display: none; } .chip-btn { padding: 0; width: 44px; justify-content: center; } }
.badge-count { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--accent-ink); color: var(--accent); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.cart-btn.bump .badge-count, .cart-btn.bump svg { animation: bump .45s var(--ease-spring); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }

.main { padding-block: 4px 140px; min-height: 60vh; }

/* ---------- Banner ---------- */
.banners { position: relative; margin-block: 16px 4px; border-radius: var(--r-lg); overflow: hidden; }
.bn-track { display: grid; }
.bn { grid-area: 1 / 1; opacity: 0; visibility: hidden; transition: opacity .6s var(--ease-out), visibility .6s; }
.bn.on { opacity: 1; visibility: visible; }
.bn-art { min-height: 184px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; gap: 12px; padding: 24px 26px 30px; background: var(--ink); color: var(--bg); border-radius: var(--r-lg); }
.bn-art h2 { font-family: var(--font-display); font-size: clamp(24px, 4vw, 40px); margin: 0 0 8px; }
.bn-art p { margin: 0 0 16px; opacity: .85; font-size: 15px; max-width: 40ch; }
.bn-art .cta { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 14px 0 18px; border-radius: 999px; border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 700; transition: transform .12s; }
.bn-art .cta:active { transform: scale(.97); }
.bn-art .cta svg { width: 18px; height: 18px; }
.bn-art .imgs { display: flex; justify-content: center; }
.bn-art .imgs img { width: clamp(72px, 13vw, 128px); aspect-ratio: 1; object-fit: contain; background: #fff; border-radius: 50%; border: 4px solid color-mix(in srgb, currentColor 25%, transparent); margin-left: -16px; }
.bn-art .imgs img:first-child { margin-left: 0; }
.ladder-art { display: flex; align-items: flex-end; gap: 8px; justify-content: center; }
.ladder-art div { width: 72px; height: var(--h); border-radius: 12px 12px 0 0; background: color-mix(in srgb, currentColor 16%, transparent); display: grid; align-content: end; justify-items: center; padding: 8px 4px; font-size: 12px; font-weight: 700; text-align: center; transform-origin: bottom; animation: grow .8s var(--ease-out) both; }
.ladder-art div:nth-child(2) { animation-delay: .1s; } .ladder-art div:nth-child(3) { animation-delay: .2s; background: color-mix(in srgb, var(--accent) 55%, transparent); }
.ladder-art b { font-size: 17px; }
@keyframes grow { from { transform: scaleY(.2); opacity: 0; } }
@media (max-width: 560px) { .bn-art { grid-template-columns: minmax(0, 1fr); } .ladder-art div { width: 60px; } }
.bn-img { display: block; width: 100%; aspect-ratio: 3 / 1; border-radius: var(--r-lg); border: 0; padding: 0; background: var(--surface2) center / cover no-repeat; }
@media (max-width: 560px) { .bn-img { aspect-ratio: 16 / 9; } }
.bn-dots { position: absolute; left: 0; right: 0; bottom: 4px; display: flex; justify-content: center; }
.bn-dots button { width: 28px; height: 28px; border: 0; background: none; display: grid; place-items: center; padding: 0; }
.bn-dots button::before { content: ""; width: 8px; height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--bg) 50%, transparent); transition: width .3s var(--ease-out), background-color .3s; }
.bn-dots button[aria-current="true"]::before { background: var(--bg); width: 20px; }
.mid-poster { grid-column: 1 / -1; margin: 4px 0; }

/* ---------- Danh mục ---------- */
.stories { display: flex; gap: 14px; overflow-x: auto; padding-block: 18px 10px; scrollbar-width: none; scroll-snap-type: x proximity; }
.stories::-webkit-scrollbar { display: none; }
.story { flex: 0 0 auto; width: 80px; display: grid; justify-items: center; gap: 6px; background: none; border: 0; padding: 0; font-size: 12px; font-weight: 600; text-align: center; line-height: 1.25; scroll-snap-align: start; }
.story .ring { width: 70px; height: 70px; border-radius: 50%; padding: 3px; background: var(--line); transition: background-color .25s, transform .2s var(--ease-out); }
.story:hover .ring { transform: translateY(-2px); }
.story:active .ring { transform: scale(.95); }
.story[aria-current="true"] .ring { background: conic-gradient(from 200deg, var(--accent), color-mix(in srgb, var(--accent) 45%, #FFC7D8), var(--accent)); }
.story[aria-current="true"] { color: var(--accent); }
.story .ring img, .story .ring > span { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--photo); border: 3px solid var(--bg); display: grid; place-items: center; color: var(--accent); font-family: var(--font-display); font-size: 20px; }
.story .ring > span svg { width: 26px; height: 26px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 13px; margin: 4px 0 8px; color: var(--muted); }
.crumbs button { background: none; border: 0; padding: 4px 2px; color: var(--muted); min-height: 36px; }
.crumbs button:hover { color: var(--accent); text-decoration: underline; }
.crumbs [aria-current="page"] { color: var(--ink); font-weight: 600; }
.subrow { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 6px; align-items: center; scrollbar-width: none; }
.subrow::-webkit-scrollbar { display: none; }
.subrow .lvl { flex: 0 0 auto; font-size: 12px; color: var(--muted); font-weight: 600; }
.chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 0 14px; font-size: 14px; white-space: nowrap; min-height: 40px; transition: background-color .2s, color .2s, border-color .2s; }
.chip .n { font-size: 12px; color: var(--muted); }
.chip[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip[aria-current="true"] .n { color: inherit; opacity: .8; }
.col-head { margin: 6px 0 14px; }
.col-head h1 { font-family: var(--font-display); font-size: clamp(26px, 4vw, 36px); margin: 0 0 4px; }
.col-head p { margin: 0; color: var(--muted); max-width: 60ch; }

/* ---------- Bộ sưu tập (dải ngang) ---------- */
.shelf { margin-block: 18px 6px; }
.shelf-h { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 10px; }
.shelf-h h2 { font-family: var(--font-display); font-size: 22px; margin: 0; }
.shelf-h p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.see-all { display: inline-flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 600; color: var(--accent); text-decoration: none; white-space: nowrap; min-height: 44px; }
.see-all svg { width: 16px; height: 16px; transition: transform .2s var(--ease-out); }
.see-all:hover svg { transform: translateX(3px); }
.shelf-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(168px, 44%); gap: 12px; overflow-x: auto; padding: 2px 2px 10px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
@media (min-width: 700px) { .shelf-row { grid-auto-columns: 200px; } }
.shelf-row .card { scroll-snap-align: start; }

/* ---------- Lọc màu ---------- */
.colorbox { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; margin-block: 14px 16px; display: grid; gap: 10px; min-width: 0; }
.colorbox .hd { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.colorbox h2 { font-family: var(--font-display); font-size: 20px; margin: 0; }
.ai-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 4px 10px; }
.ai-tag svg { width: 14px; height: 14px; }
.swatches { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.swatches::-webkit-scrollbar { display: none; }
.sw { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 5px 14px 5px 5px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 14px; transition: background-color .2s, border-color .2s, color .2s; }
.sw .dot { width: 32px; height: 32px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--ink) 15%, transparent); box-shadow: inset 0 -6px 10px rgba(0,0,0,.14), inset 0 6px 8px rgba(255,255,255,.55); transition: transform .2s var(--ease-spring); }
.sw .dot.rainbow { background: conic-gradient(#F09BBE, #E2B341, #3FAE6A, #3E7FD6, #A9D8F2, #F09BBE); }
.sw:hover .dot { transform: scale(1.08); }
.sw .n { color: var(--muted); font-weight: 500; font-size: 12px; }
.sw[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.promo { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; background: var(--accent-soft); border-radius: var(--r-lg); padding: 16px 18px; margin-block: 4px 18px; }
.promo h2 { font-family: var(--font-display); font-size: 21px; margin: 0 0 2px; }
.promo p { margin: 0; color: var(--muted); font-size: 14px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar p { margin: 0; }
.toolbar select { min-height: 44px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 0 12px; font-size: 15px; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r-lg); display: grid; justify-items: center; gap: 10px; }
.empty p { margin: 0; }

/* ---------- Thẻ sản phẩm (kiểu A) ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; } }
@media (min-width: 1200px) { .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.card { position: relative; display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1); transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out), border-color .25s; }
@media (hover: hover) { .card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); } .card:hover .ph { transform: scale(1.05); } }
.card .open { display: flex; flex-direction: column; flex: 1; color: inherit; text-decoration: none; }
.ph-wrap { position: relative; display: block; aspect-ratio: 1; background: var(--photo); overflow: hidden; }
.ph-wrap::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--surface2) 80%, transparent) 50%, transparent 70%) var(--surface2); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.ph { position: relative; width: 100%; height: 100%; object-fit: contain; padding: 6%; opacity: 0; transition: opacity .35s var(--ease-out), transform .4s var(--ease-out); }
.ph.ok { opacity: 1; }
.ph-wrap:has(.ph.ok)::before { display: none; }
.noimg { position: relative; height: 100%; display: grid; place-content: center; justify-items: center; gap: 6px; background: var(--surface2); color: var(--muted); font-size: 12px; font-weight: 600; text-align: center; padding: 10px; }
.noimg svg { width: 26px; height: 26px; color: var(--accent); opacity: .7; }
.ph-wrap:has(.noimg)::before { display: none; }
@keyframes shimmer { to { background-position: -200% 0; } }
.stock { position: absolute; left: 8px; top: 8px; display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: var(--shadow-1); }
.stock::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.stock.ok { color: var(--good); }
.stock.out { color: var(--warn); }
.mau { position: absolute; right: 9px; top: 9px; width: 20px; height: 20px; border-radius: 50%; background: var(--c); border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.12), inset 0 -3px 5px rgba(0,0,0,.15); }
.card .body { display: grid; gap: 4px; padding: 10px 12px 4px; flex: 1; align-content: start; }
.card .nm { font-weight: 600; font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; overflow-wrap: anywhere; }
.card .price { font-size: 13px; }
.card .price b { font-family: var(--font-display); font-size: 18px; color: var(--accent); }
@media (max-width: 380px) { .card .moq { display: none; } }
.card .act { padding: 8px 10px 10px; }
.card .act .btn { width: 100%; min-height: 42px; font-size: 13px; padding: 0 10px; gap: 6px; border-radius: var(--r-sm); }
.card .act .btn small { font-weight: 500; opacity: .85; }
.card .add.has { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); }
.card .add span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card.out .ph { opacity: .5; filter: grayscale(.4); }
/* Hiện dần khi cuộn tới */
.card:not(.in) { opacity: 0; transform: translateY(14px) scale(.98); }
.card.in { animation: rise .5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms); }
.shelf-row .card.in, .grid .card.in { animation-name: rise; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.more { display: flex; justify-content: center; margin-top: 22px; }
.fly { position: fixed; z-index: 90; object-fit: contain; background: #fff; pointer-events: none; box-shadow: var(--shadow-2); }

/* ---------- Nút nổi, thanh giỏ, điều hướng dưới ---------- */
.social-float { position: fixed; right: 14px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); z-index: 29; display: grid; gap: 10px; transition: bottom .3s var(--ease-out); }
#float.has-bar .social-float { bottom: calc(156px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 900px) { .social-float { bottom: 24px; } #float.has-bar .social-float { bottom: 100px; } }
.soc { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; border: 0; color: #fff; text-decoration: none; font-weight: 800; font-size: 12px; font-family: var(--font-body); box-shadow: 0 6px 16px rgba(0,0,0,.18); position: relative; }
.soc svg { width: 24px; height: 24px; }
.soc.fb { background: #1877F2; } .soc.zl { background: #0068FF; } .soc.ph { background: #12A150; } .soc.ms { background: #7A5AF8; } .soc.em { background: #6B7280; }
.soc.sm { width: 40px; height: 40px; box-shadow: none; font-size: 11px; }
.soc.sm svg { width: 20px; height: 20px; }
.social-float.anim .soc { opacity: 0; transform: scale(.4); animation: socPop .35s var(--ease-spring) forwards, socWiggle 3.2s ease-in-out 1s infinite; }
.social-float.anim .soc:nth-child(2) { animation-delay: .06s, 1.15s; } .social-float.anim .soc:nth-child(3) { animation-delay: .12s, 1.3s; } .social-float.anim .soc:nth-child(4) { animation-delay: .18s, 1.45s; } .social-float.anim .soc:nth-child(5) { animation-delay: .24s, 1.6s; }
.social-float.anim.seen .soc { opacity: 1; transform: none; animation: socWiggle 3.2s ease-in-out 1s infinite; }
.social-float .soc { transition: transform .15s, box-shadow .15s; }
.social-float .soc:hover { animation-play-state: paused; transform: scale(1.12) translateX(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.28); }
.social-float .soc::after { content: attr(aria-label); position: absolute; right: 58px; top: 50%; transform: translateY(-50%) translateX(6px); background: rgba(20,20,24,.92); color: #fff; font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 8px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; }
.social-float .soc:hover::after, .social-float .soc:focus-visible::after { opacity: 1; transform: translateY(-50%) translateX(0); }
@media (hover: none) { .social-float .soc::after { display: none; } }
@keyframes socPop { to { opacity: 1; transform: scale(1); } }
@keyframes socWiggle { 0%, 92%, 100% { transform: rotate(0); } 93% { transform: rotate(-8deg); } 94% { transform: rotate(7deg); } 95% { transform: rotate(-6deg); } 96% { transform: rotate(5deg); } 97% { transform: rotate(-3deg); } 98% { transform: rotate(0); } }
.cartbar { position: fixed; left: 12px; right: 12px; bottom: calc(72px + env(safe-area-inset-bottom, 0px)); z-index: 30; max-width: 560px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--ink); color: var(--bg); border-radius: var(--r-lg); padding: 10px 10px 10px 16px; box-shadow: var(--shadow-2); animation: barIn .35s var(--ease-out); }
.cartbar > span { display: grid; font-size: 14px; } .cartbar > span span { opacity: .8; font-size: 13px; }
.cartbar .btn { background: var(--bg); color: var(--ink); border-color: var(--bg); min-height: 44px; padding: 0 12px 0 16px; gap: 2px; }
@keyframes barIn { from { transform: translateY(20px); opacity: 0; } }
@media (min-width: 900px) { .cartbar { bottom: 20px; } }
.bnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line); display: flex; justify-content: space-around; padding: 4px 8px calc(4px + env(safe-area-inset-bottom, 0px)); }
.bnav button { background: none; border: 0; display: grid; justify-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); min-width: 64px; min-height: 52px; padding-top: 4px; transition: color .2s; }
.bnav button[aria-current="true"] { color: var(--accent); }
.bnav svg { width: 22px; height: 22px; }
@media (min-width: 900px) { .bnav { display: none; } }
.toast { position: fixed; left: 50%; top: calc(var(--hdr-h) + 10px + env(safe-area-inset-top, 0px)); transform: translate(-50%, -12px); z-index: 95; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: var(--r); box-shadow: var(--shadow-2); font-size: 14px; width: max-content; max-width: calc(100% - 32px); text-align: center; opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s var(--ease-out); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Ngăn kéo (chi tiết / giỏ / form) ---------- */
.scrim { position: fixed; inset: 0; z-index: 60; background: var(--scrim); display: flex; align-items: flex-end; justify-content: center; animation: fadeIn .2s ease-out; }
.scrim.leave { animation: fadeOut .16s ease-in forwards; }
.drawer { width: min(600px, 100%); max-height: 92dvh; background: var(--bg); overflow-y: auto; overscroll-behavior: contain; display: grid; grid-template-rows: auto 1fr auto; border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: var(--shadow-2); }
.drawer.enter { animation: sheetIn .32s var(--ease-out); }
.drawer.leave { animation: sheetOut .16s ease-in forwards; }
@media (min-width: 900px) { .scrim { align-items: center; } .drawer { border-radius: var(--r-lg); max-height: 88dvh; } }
@keyframes fadeIn { from { opacity: 0; } } @keyframes fadeOut { to { opacity: 0; } }
@keyframes sheetIn { from { transform: translateY(40px); opacity: .4; } }
@keyframes sheetOut { to { transform: translateY(30px); opacity: 0; } }
.dh { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px 10px 18px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 2; }
.dh h2 { margin: 0; font-size: 18px; font-family: var(--font-display); font-weight: 700; flex: 1; }
.db { padding: 16px 18px; display: grid; gap: 16px; align-content: start; min-width: 0; margin: 0; }
.df { padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--surface); display: grid; gap: 10px; position: sticky; bottom: 0; z-index: 2; }
.gallery { display: grid; gap: 8px; }
.main-img { aspect-ratio: 1; max-height: 400px; width: 100%; margin: 0 auto; background: var(--photo); border-radius: var(--r-lg); border: 1px solid var(--line); overflow: hidden; }
.main-img img { width: 100%; height: 100%; object-fit: contain; animation: fadeIn .3s; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; }
.thumbs button { flex: 0 0 auto; width: 60px; height: 60px; padding: 0; border: 2px solid var(--line); border-radius: var(--r-sm); background: var(--photo); overflow: hidden; }
.thumbs button[aria-pressed="true"] { border-color: var(--accent); }
.thumbs img { width: 100%; height: 100%; object-fit: contain; }
.pd-title { font-family: var(--font-display); font-size: 26px; font-weight: 700; margin: 4px 0 8px; overflow-wrap: anywhere; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; }
.detect { font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detect i { width: 18px; height: 18px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent); }
.ladder { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--surface); border-radius: var(--r); overflow: hidden; }
.ladder th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.ladder td { padding: 10px 12px; border-bottom: 1px solid var(--line); transition: background-color .25s, color .25s; }
.ladder tr:last-child td { border-bottom: 0; }
.ladder td:last-child, .ladder th:last-child { text-align: right; }
.ladder tr.on td { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.nudge { font-size: 14px; padding: 10px 12px; border-radius: var(--r); background: var(--good-soft); color: var(--good); }
.nudge.warn { background: var(--warn-soft); color: var(--warn); }
.nudge.bad { background: color-mix(in srgb, var(--bad) 10%, transparent); color: var(--bad); }
.desc { white-space: pre-line; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.skel-line { height: 12px; border-radius: 6px; background: linear-gradient(100deg, var(--surface2) 30%, var(--line) 50%, var(--surface2) 70%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.skel-line.short { width: 60%; }
.share { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.share .copy { min-height: 40px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 0 14px; font-size: 13px; }
.buyrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.sum { font-size: 13px; text-align: right; display: grid; color: var(--muted); }
.sum b { font-size: 21px; color: var(--ink); font-family: var(--font-display); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.stepper button { width: 44px; height: 44px; border: 0; background: none; font-size: 20px; border-radius: var(--r); transition: background-color .15s; }
.stepper button:active { background: var(--surface2); }
.stepper input { width: 64px; height: 44px; border: 0; text-align: center; background: transparent; font-variant-numeric: tabular-nums; font-size: 16px; }
.cline { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.cline img, .cline .noimg { width: 68px; height: 68px; object-fit: contain; background: var(--photo); border-radius: var(--r-sm); border: 1px solid var(--line); }
.cline .top { display: flex; justify-content: space-between; gap: 8px; }
.cline .ctrl { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.cline .nudge { margin-top: 8px; font-size: 13px; }
.want { display: grid; gap: 4px; margin-top: 8px; font-size: 13px; }
.want input { width: 160px; min-height: 44px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 0 12px; font-size: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; }
.field .req { color: var(--bad); }
.field input, .field textarea { width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font-size: 16px; transition: border-color .2s, box-shadow .2s; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field textarea { min-height: 84px; resize: vertical; }
.field .err { color: var(--bad); font-size: 13px; }
.field [aria-invalid="true"] { border-color: var(--bad); }
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.success { text-align: center; display: grid; gap: 6px; justify-items: center; padding-top: 6px; }
.success .tick { width: 64px; height: 64px; border-radius: 50%; background: var(--good); color: #fff; display: grid; place-items: center; animation: pop .5s var(--ease-spring); }
.success .tick svg { width: 34px; height: 34px; stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .45s .2s ease-out forwards; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.success .code { font-family: var(--font-display); font-size: 30px; font-weight: 700; color: var(--accent); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 12px; padding-bottom: 16px; position: relative; counter-increment: s; }
.steps li::before { content: counter(s); grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--surface2); color: var(--muted); }
.steps li.done::before { content: "✓"; background: var(--good); color: #fff; }
.steps li.now::before { background: var(--accent); color: var(--accent-ink); }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 2px; background: var(--line); }
.steps b { display: block; } .steps span { font-size: 13px; color: var(--muted); }

/* ---------- Trang phụ ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; display: grid; gap: 12px; }
.panel h1, .panel h2 { margin: 0; font-family: var(--font-display); font-size: 26px; }
.panel h3 { margin: 0; font-size: 16px; }
.panel p { margin: 0; }
.doc { max-width: 760px; margin: 20px auto 0; display: grid; gap: 16px; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl .r { text-align: right; }
.foot { border-top: 1px solid var(--line); padding-block: 28px 160px; font-size: 14px; color: var(--muted); background: var(--surface); }
.foot .wrap { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: start; }
.foot .wrap > div { display: grid; gap: 2px; }
.foot b { color: var(--ink); }
.foot-social { display: flex !important; gap: 10px; align-items: center; }
@media (min-width: 900px) { .foot { padding-bottom: 40px; } }

/* ---------- Giảm chuyển động ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .card:not(.in) { opacity: 1; transform: none; }
  .ph { opacity: 1; }
}
.card.seen { animation: none; }

/* Nút liên hệ: điện thoại gom thành 1 nút, bấm mới bung ra; máy tính hiện sẵn cả cột */
.soc-list { display: grid; gap: 10px; }
.soc.toggle { display: none; background: var(--accent); color: var(--accent-ink); }
@media (max-width: 899px) {
  .soc.toggle { display: grid; }
  .social-float .soc-list { position: absolute; bottom: 58px; right: 0; opacity: 0; transform: translateY(10px) scale(.9); transform-origin: bottom right; pointer-events: none; transition: opacity .2s, transform .25s var(--ease-spring); }
  .social-float.open .soc-list { opacity: 1; transform: none; pointer-events: auto; }
  .social-float.anim .soc-list .soc { animation: none; opacity: 1; transform: none; }
  .social-float.anim .soc.toggle { animation: socPop .35s var(--ease-spring) forwards, socWiggle 3.2s ease-in-out 1s infinite; }
  .social-float.anim.seen .soc.toggle { animation: socWiggle 3.2s ease-in-out 1s infinite; opacity: 1; transform: none; }
  .social-float.open .soc.toggle { animation: none; }
}
.bnav button > span { display: block; }
.cartbar { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 900px) { .cartbar { bottom: 20px; } }

/* ---------- Tài khoản đại lý ---------- */
.seg-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface2); border-radius: var(--r); }
.seg-tabs button { min-height: 44px; border: 0; border-radius: var(--r-sm); background: transparent; font-weight: 600; color: var(--muted); transition: background-color .2s, color .2s, box-shadow .2s; }
.seg-tabs button[aria-selected="true"] { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-1); }
.acc-form { display: grid; gap: 14px; }
.acc-form p { margin: 0; }
.acc-links { display: flex; justify-content: space-between; gap: 10px; }
.otp { font-size: 26px !important; letter-spacing: 10px; text-align: center; font-variant-numeric: tabular-nums; }
.acc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.acc-top h1 { margin: 2px 0; font-family: var(--font-display); font-size: 26px; }
.orders { display: grid; gap: 12px; }
.order { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 6px; background: var(--bg); }
.order p { margin: 0; }
.order-h, .order-f { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.order-h > div { display: grid; }
.order-f b { font-family: var(--font-display); font-size: 18px; color: var(--accent); }
.center { text-align: center; }
.zalo-hint { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 8px 8px 8px 14px; border-radius: var(--r); background: color-mix(in srgb, #0068FF 10%, var(--surface)); color: var(--ink); font-size: 13px; border: 1px solid color-mix(in srgb, #0068FF 25%, transparent); }
.zalo-hint span { flex: 1; }
.zalo-hint .icon-btn { width: 36px; height: 36px; border: 0; background: transparent; }

/* ---------- Chọn địa chỉ (tỉnh/thành → phường/xã) ---------- */
.addr { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.addr legend { font-size: 14px; font-weight: 600; padding: 0; margin-bottom: 8px; }
@media (max-width: 520px) { .addr { grid-template-columns: 1fr; } }
.field select { width: 100%; min-height: 48px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font-size: 16px; }
.field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input:disabled { background: var(--surface2); color: var(--muted); }
.combo { position: relative; }
.combo-list { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% - 2px); max-height: 240px; overflow-y: auto; margin: 4px 0 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-2); }
.combo-list li { padding: 10px 12px; border-radius: var(--r-sm); cursor: pointer; font-size: 15px; }
.combo-list li:hover, .combo-list li[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
.combo-list li.none { color: var(--muted); cursor: default; }
.order-act { display: flex; gap: 8px; flex-wrap: wrap; }
.order-act .btn { min-height: 40px; font-size: 13px; padding: 0 12px; }
.order-sync { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.order-sync .btn { min-height: 40px; font-size: 13px; }
.pill.bad { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.debt { display: flex; gap: 12px; flex-wrap: wrap; }
.debt > div { flex: 1 1 160px; background: var(--accent-soft); border-radius: var(--r); padding: 12px 14px; display: grid; }
.debt b { font-family: var(--font-display); font-size: 24px; color: var(--accent); }

/* ---------- Trang thông tin ---------- */
.prose h1 { font-family: var(--font-display); font-size: 28px; margin: 0 0 4px; }
.prose h2 { font-family: var(--font-display); font-size: 20px; margin: 14px 0 0; }
.prose p, .prose ul { margin: 0; line-height: 1.7; }
.prose ul { padding-left: 20px; display: grid; gap: 4px; }
.foot-links { display: flex !important; flex-wrap: wrap; gap: 6px 16px; }
.foot-links a { color: var(--muted); text-decoration: underline; }

.order .ship { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font-size: 14px; }
.order .ship .btn { min-height: 36px; font-size: 13px; padding: 0 12px; }

/* Ô chống máy (Turnstile): chỉ hiện khi cần khách bấm xác minh */
.cm-host { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1000; display: none; background: var(--surface, #fff); padding: 8px; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.18); }
.cm-host.show { display: block; }
