:root {
  --navy: #283593;
  --navy-d: #1d2775;
  --red: #d32f2f;
  --red-d: #b71c1c;
  --bg: #eceefa;
  --card: #fff;
  --line: #e1e4f2;
  --tint: #e8eaf8;
  --text: #1b1f3b;
  --muted: #6b7089;
  --green: #1b8a3f;
  --nav-h: 62px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}
body.no-scroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin: 0; }
.ic { width: 22px; height: 22px; flex: none; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
#topbar { position: sticky; top: 0; z-index: 30; background: var(--navy); color: #fff; }
.top-in { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 12px 14px; min-height: 56px; }
#page-title { font-size: 22px; font-weight: 800; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 12px; padding: 4px 4px 4px 12px; }
.top-search .ic { width: 18px; height: 18px; color: #6b7089; }
.top-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font-size: 13.5px; padding: 6px 0; text-overflow: ellipsis; }
.top-search input::placeholder { color: #7b7f99; }
.top-search button { width: 36px; height: 36px; flex: none; border: 0; border-radius: 9px; background: var(--red); color: #fff; display: grid; place-items: center; }
.top-search button .ic { color: #fff; }
.top-search { display: none; }
body[data-bar="search"] .top-search { display: flex; }
body[data-bar="search"] #page-title { display: none; }
.brand { display: none; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; }
.brand-name { color: #fff; font-weight: 800; letter-spacing: .5px; }
.brand-jsc { color: #f23c26; font-weight: 900; font-size: 22px; margin-left: -2px; }
/* Tên thương hiệu dạng CHỮ (không dùng ảnh logo trong giao diện).
   Điện thoại: hiện #page-title; Máy tính: ẩn #page-title, hiện .brand —
   xem khối @media (min-width: 1024px) bên dưới. Ảnh logo chỉ dùng làm icon ứng dụng. */
.top-nav { display: none; }
.hotline { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 6px; background: var(--red); color: #fff; font-weight: 700; white-space: nowrap; padding: 8px 16px; min-height: 42px; border: 1.5px solid transparent; border-radius: 10px; }
.hotline:hover { background: var(--red-d); }
.hotline .ic { width: 20px; height: 20px; color: #fff; flex: none; }
.hotline .hl-txt { display: none; flex-direction: row; align-items: center; gap: 6px; line-height: 1.15; }
.hotline small { font-size: 15px; font-weight: 800; color: #fff; line-height: 1.2; }
.hotline b { font-size: 15px; font-weight: 800; line-height: 1.2; }
body[data-bar="search"] .hotline { display: none; }
.top-actions { display: flex; gap: 6px; }
.icon-btn { position: relative; background: none; border: 0; color: #fff; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; }
.icon-btn:hover { background: rgba(255, 255, 255, .14); }
.badge { position: absolute; top: 2px; right: 0; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; display: grid; place-items: center; border: 1.5px solid var(--navy); }

/* ---------- bottom nav ---------- */
#bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line);
  display: flex; justify-content: center; padding-bottom: env(safe-area-inset-bottom);
}
#bottom-nav a {
  flex: 1; max-width: 160px; height: var(--nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 600; color: #5b6086; position: relative;
}
#bottom-nav a { color: #3b4170; }
#bottom-nav a .ic { color: var(--navy); }
#bottom-nav a.on, #bottom-nav a.on .ic { color: var(--red); }
#bottom-nav .badge { top: 6px; right: calc(50% - 22px); border-color: #fff; }

/* ---------- layout ---------- */
#view { max-width: 1180px; margin: 0 auto; padding: 14px; min-height: 60vh; }
.narrow { max-width: 720px; margin: 0 auto; }
.card { background: var(--card); border-radius: 14px; padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(30, 40, 120, .06); }
.card h2, .sec-title { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.bold { font-weight: 700; }
.red { color: var(--red); }
.green { color: var(--green); }
.navy { color: var(--navy); }
.mt { margin-top: 12px; }
.mb { margin-bottom: 12px; }
.gap { display: grid; gap: 10px; }

/* ---------- buttons / forms ---------- */
.btn { border: 1.5px solid transparent; border-radius: 10px; padding: 10px 16px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; text-align: center; }
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-d); }
.btn.red { background: var(--red); color: #fff; }
.btn.red:hover { background: var(--red-d); }
.btn.ghost { background: #fff; color: var(--navy); border-color: var(--navy); }
.btn.light { background: #fff; color: var(--navy); }
.btn.block { width: 100%; }
.btn.sm { padding: 6px 12px; min-height: 34px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.field { display: grid; gap: 4px; margin-bottom: 12px; }
.field label { font-weight: 600; font-size: 13px; }
.field input, .field textarea, .field select, .input {
  width: 100%; border: 1px solid #ccd0e6; border-radius: 10px; padding: 10px 12px; background: #fff; min-height: 42px;
}
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus, .input:focus { outline: 2px solid #9fa8da; border-color: var(--navy); }
.form-err { background: #fdecea; color: var(--red-d); border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; font-size: 13px; }
.form-err:empty { display: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- states ---------- */
.state { display: grid; justify-items: center; gap: 10px; padding: 40px 14px; text-align: center; color: var(--muted); }
.state-ic { width: 56px; height: 56px; border-radius: 50%; background: var(--tint); color: var(--navy); display: grid; place-items: center; }
.state-ic .ic { width: 28px; height: 28px; }
.state.err p { color: var(--red-d); }
.spin { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--tint); border-top-color: var(--navy); animation: sp .8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px); transform: translate(-50%, 20px); background: #1b1f3b; color: #fff; padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none; transition: .25s; z-index: 100; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { background: var(--red-d); }
#toast.ok { background: var(--green); }

/* ---------- home: hero video (responsive: phone 4:3, tablet 16:9, desktop 21:9) ---------- */
.hero.hero-vid { display: block; }
.hero-vid .hero-body { padding: 0; width: 100%; aspect-ratio: 4 / 3; min-height: 0; max-height: 70vh; }
@media (min-width: 640px) { .hero-vid .hero-body { aspect-ratio: 16 / 9; padding: 0; } }
@media (min-width: 1024px) { .hero-vid .hero-body { aspect-ratio: 21 / 9; max-height: 520px; padding: 0; } }
.vid-zoom { position: absolute; right: 12px; bottom: 12px; z-index: 3; border: 1px solid rgba(255, 255, 255, .6); background: rgba(15, 22, 80, .65); color: #fff; font: inherit; font-size: 13px; font-weight: 700; padding: 8px 14px; border-radius: 999px; cursor: pointer; backdrop-filter: blur(4px); }
.vid-zoom:hover { background: rgba(15, 22, 80, .85); }
.vid-modal { position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, .92); display: flex; align-items: center; justify-content: center; padding: 56px 8px 16px; }
.vid-full { max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; background: #000; }
.vid-close { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .18); color: #fff; font-size: 20px; cursor: pointer; }
.vid-close:hover { background: rgba(255, 255, 255, .32); }
/* ---------- home: hero slider (full-bleed on phone) ---------- */
.hero { position: relative; margin: -14px -14px 0; overflow: hidden; background: var(--navy); color: #fff; }
.hero-media { position: relative; overflow: hidden; background: #e9ecf5; aspect-ratio: 16 / 11; }
.hero-panels { position: absolute; top: 0; bottom: 0; left: 0; width: 900%; display: flex; background: #fff; animation: heroSlide 32s ease-in-out infinite; }
.hero-slide { flex: 0 0 calc(100% / 9); background-size: cover; background-position: center; position: relative; }
.hero-tag { position: absolute; z-index: 3; left: 12px; bottom: 12px; background: rgba(15, 22, 80, .78); color: #fff; font-size: 12px; font-weight: 700; padding: 7px 12px; border-radius: 8px; }
@keyframes heroSlide { 0.00% { left: 0; } 10.50% { left: 0; } 12.50% { left: -100%; } 23.00% { left: -100%; } 25.00% { left: -200%; } 35.50% { left: -200%; } 37.50% { left: -300%; } 48.00% { left: -300%; } 50.00% { left: -400%; } 60.50% { left: -400%; } 62.50% { left: -500%; } 73.00% { left: -500%; } 75.00% { left: -600%; } 85.50% { left: -600%; } 87.50% { left: -700%; } 98.00% { left: -700%; } 100% { left: -800%; } }
@media (prefers-reduced-motion: reduce) { .hero-panels { animation: none; } }
.hero-body { position: relative; z-index: 2; display: grid; gap: 14px; padding: 22px 18px 24px; overflow: hidden; isolation: isolate; background: var(--navy); }
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(18, 26, 96, .32), rgba(18, 26, 96, .48)); }
.hero-body h2, .hero-body p { text-shadow: 0 1px 6px rgba(0, 0, 0, .55); }
.hero-pill { justify-self: start; border: 1px solid rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .1); border-radius: 999px; padding: 5px 13px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.hero h2 { font-size: 28px; line-height: 1.15; font-weight: 800; color: #fff; margin: 0; }
.hero h2 span { color: #ffd54a; }
.hero p { color: #fff; opacity: .92; font-size: 15px; line-height: 1.6; }
.hero-cta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hero-cta .btn { min-height: 48px; border-radius: 12px; font-size: 14.5px; padding: 8px 6px; white-space: nowrap; }
.btn.outline-w { background: transparent; color: #fff; border-color: #fff; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hero-stat { background: var(--tint); border-radius: 12px; padding: 10px 11px; }
.hero-stat b { display: block; font-size: 14px; line-height: 1.2; color: var(--navy); }
.hero-stat span { font-size: 12px; color: #4a5080; }
.quick-box { display: grid; gap: 12px; margin: 14px 0 0; padding: 16px; border-radius: 16px; box-shadow: 0 2px 14px rgba(20, 30, 90, .12); }
.intro { margin: 16px 0 20px; padding: 22px 18px; border-radius: 16px; border-left: 5px solid var(--red); box-shadow: 0 2px 14px rgba(20, 30, 90, .1); }
.intro-img { display: block; width: 100%; height: auto; aspect-ratio: 1485 / 1059; object-fit: cover; image-rendering: -webkit-optimize-contrast; border-radius: 12px; margin: 0 0 16px; box-shadow: 0 2px 10px rgba(20, 30, 90, .15); }
.intro .kick { font-size: 13px; letter-spacing: .12em; color: var(--red); font-weight: 800; margin-bottom: 10px; }
.intro h2 { font-size: 24px; line-height: 1.25; font-weight: 800; margin: 0 0 14px; color: #12163a; }
.intro p { color: #2b2f4d; font-size: 15px; line-height: 1.7; }
.intro p + p { margin-top: 12px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 2px 10px; }
.sec-head h2 { font-size: 15px; font-weight: 700; margin: 0; }
.sec-head a { color: var(--muted); font-size: 13px; }

/* ---------- home: khối giới thiệu dài dưới danh sách sản phẩm ---------- */
.about { margin: 18px 0 6px; padding: 20px 18px 22px; background: var(--card); border-radius: 16px; box-shadow: 0 2px 14px rgba(20, 30, 90, .08); }
.about > h2 { font-size: 18px; line-height: 1.35; font-weight: 800; color: #12163a; margin: 0 0 12px; }
.about h3 { font-size: 14px; line-height: 1.45; font-weight: 800; color: var(--navy); margin: 22px 0 9px; padding-top: 16px; border-top: 1px solid var(--line); }
.about p { color: #2b2f4d; font-size: 14.5px; line-height: 1.72; }
.about p + p { margin-top: 10px; }
.about b { color: #12163a; font-weight: 700; }
.about ul { margin: 10px 0 0; padding-left: 20px; }
.about li { color: #2b2f4d; font-size: 14.5px; line-height: 1.65; margin-bottom: 7px; }
.about li::marker { color: var(--red); }
.about-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.about-cta .btn { flex: 1 1 140px; min-height: 46px; }
.about-meta { margin-top: 14px; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
@media (min-width: 768px) { .about { padding: 26px 24px 28px; } .about > h2 { font-size: 20px; } }
@media (min-width: 1024px) {
  .about { padding: 32px 40px 34px; }
  .about > h2 { font-size: 22px; }
  .about p, .about li { font-size: 15px; }
  .about-cta .btn { flex: 0 0 auto; padding-left: 24px; padding-right: 24px; }
}

/* ---------- shop ---------- */
/* ---------- ảnh khuyến mãi ở đầu Kho hàng ---------- */
/* Ảnh băng ngang TRÀN HẾT bề ngang màn hình (giống .hero ở Trang chủ) để không còn hở một
   viền sáng bao quanh ảnh như khi nó nằm trong thẻ bo góc. Cao theo đúng tỉ lệ ảnh gốc
   (2172×724) nên ảnh không bị méo. Màn hình máy tính rộng mới trả lại dạng thẻ bo góc cho cân
   với lưới sản phẩm bên dưới. */
.ss-promo { margin: -14px -14px 14px; border-radius: 0; overflow: hidden;
  background: #0a1f66; }
.ss-promo img { display: block; width: 100%; height: auto; }
@media (min-width: 640px) { .ss-promo { margin: -18px -18px 16px; } }
@media (min-width: 1024px) {
  .ss-promo { margin: 0 0 16px; border-radius: 16px; box-shadow: 0 2px 12px rgba(20, 30, 90, .16); }
}
.chips { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 8px; scrollbar-width: thin; }
.chip { flex: none; border: 1px solid #cfd2e8; background: #fff; color: #232a5c; border-radius: 999px; padding: 9px 16px; font-weight: 600; font-size: 13.5px; }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.grid-products { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pcard { background: #fff; border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 1px 2px rgba(30, 40, 120, .06); transition: transform .15s; }
.pcard:hover { transform: translateY(-2px); }
/* Ảnh bìa thẻ sản phẩm: khung VUÔNG + hiện TRỌN ảnh (contain) — ảnh chụp dọc của điện thoại
   không còn bị cắt mất phần trên/dưới (giá, tên sản phẩm in sẵn trong ảnh vẫn đọc được). */
.pcard .pimg { aspect-ratio: 1 / 1; background: #f4f6fb; overflow: hidden; display: grid; place-items: center; position: relative; }
/* Nhãn nằm ở góc PHẢI trên: ảnh sản phẩm của shop thường in bảng giá ở góc trái trên,
   để nhãn bên trái sẽ che mất chữ đó. */
.pbadge { position: absolute; top: 8px; right: 8px; z-index: 1; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 8px; color: #fff; background: var(--navy); box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.pbadge.hot { background: var(--red); }
.pbadge.buy { background: var(--green); }
.pbadge.contact { background: var(--navy); }
/* Nhãn KHUYẾN MÃI — dải băng đỏ vắt qua góc TRÊN-TRÁI ảnh sản phẩm, đúng mẫu tem "SALE":
   nền đỏ, chữ TRẮNG in hoa nghiêng 45° chạy dọc mép băng, bóng đổ dưới mép cho cảm giác băng
   dán nổi trên ảnh. Quản trị nhập chữ ở mục Kho hàng; đây CHỈ LÀ NHÃN HIỂN THỊ, không đổi giá bán.
   --rb = cạnh ô vuông ở góc; mọi thứ (chữ, bóng) co giãn theo nó nên đổi một số là đổi cả nhãn. */
.psale { --rb: 64px; position: absolute; top: 0; left: 0; z-index: 3; width: var(--rb); height: var(--rb);
  overflow: hidden; pointer-events: none; }
@media (min-width: 768px) { .psale { --rb: 76px; } }
@media (min-width: 1024px) { .psale { --rb: 86px; } }
/* Bóng của băng: cùng hình tam giác nhưng lệch xuống-phải, chỉ hở ra ở mép chéo. */
.psale::before { content: ""; position: absolute; inset: 0; transform: translate(7%, 9%);
  background: linear-gradient(100deg, #2b0b0b 0%, #7a1616 55%, #431010 100%);
  clip-path: polygon(0 0, 100% 0, 0 100%); }
/* Thân băng: tam giác đỏ phủ kín góc ảnh. */
.psale::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, #ff3a3a 0%, #e60d0d 34%, #cc0000 64%, #9d0000 100%);
  clip-path: polygon(0 0, 100% 0, 0 100%); }
/* Chữ chạy dọc theo đường chéo của băng (xoay -45° như mẫu). */
.psale b { position: absolute; left: 36%; top: 36%; z-index: 1; transform: translate(-50%, -50%) rotate(-45deg);
  max-width: calc(var(--rb) * .8); font-size: calc(var(--rb) * .19); font-weight: 900; line-height: 1.1;
  letter-spacing: .04em; text-transform: uppercase; color: #fff; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0, 0, 0, .45); }
/* Chữ dài (quản trị nhập trên 8 ký tự): thu nhỏ để vẫn đọc trọn trong băng, không bị cắt "…". */
.psale.s2 b { font-size: calc(var(--rb) * .135); letter-spacing: .02em; max-width: calc(var(--rb) * .92); }
/* Trang chi tiết sản phẩm: ảnh lớn nên băng to hơn, bo góc trên-trái theo khung ảnh. */
.gallery .psale { --rb: 116px; border-radius: 14px 0 0 0; }
@media (min-width: 768px) { .gallery .psale { --rb: 150px; } }
@media (min-width: 1024px) { .gallery .psale { --rb: 168px; } }
.pcard .pimg img { width: 100%; height: 100%; object-fit: contain; display: block; }
/* Sản phẩm đã có ẢNH BÌA riêng (quản trị cắt đúng tỉ lệ): hiện trọn khung, không cắt thêm.
   Khung giữ đúng tỉ lệ ảnh bìa qua aspect-ratio đặt inline theo cover_w / cover_h. */
.pcard .pimg.is-cover img { object-fit: cover; }
.pcard .pimg .ic { width: 46px; height: 46px; color: var(--navy); stroke-width: 1.6; }
.pcard .pbody { padding: 10px; display: grid; gap: 6px; flex: 1; align-content: start; }
.pname { font-weight: 500; font-size: 13.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 34px; }
.price { font-weight: 800; color: var(--red); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 8px; background: #e1e4f7; color: var(--navy); }
.tag.pink { background: #fde3e5; color: var(--red); }
.tag.ok { background: #dff3e6; color: var(--green); }
.tag.out { background: #eee; color: #777; }
/* Nhãn khuyến mãi trong danh sách kho hàng của quản trị — cùng tông với dải băng trên ảnh. */
.tag.sale { background: #c1121f; color: #fff; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.stars .star { color: #cfd3e6; }
.stars .star.on { color: #f5a623; }

/* ---------- product detail ---------- */
.pd { display: grid; gap: 14px; }
.gallery { position: relative; }
.slider { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: 14px; background: var(--tint); scrollbar-width: none; }
.slider::-webkit-scrollbar { display: none; }
/* Ảnh bìa ở trang sản phẩm: khung vuông trên điện thoại, hiện trọn ảnh (contain). */
.slider .slide { flex: none; width: 100%; scroll-snap-align: center; aspect-ratio: 1 / 1; background: #fff; }
.slider .slide img { width: 100%; height: 100%; object-fit: contain; display: block; cursor: zoom-in; }
.slider-count { position: absolute; right: 10px; bottom: 10px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; padding: 3px 9px; border-radius: 999px; }
.slide-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .85); color: var(--navy); display: none; place-items: center; }
.slide-nav.prev { left: 8px; } .slide-nav.next { right: 8px; }
.slide-nav .ic { width: 18px; height: 18px; }
.thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; }
.thumbs button { flex: none; width: 62px; height: 48px; border-radius: 8px; overflow: hidden; border: 2px solid transparent; padding: 0; background: #fff; }
.thumbs button.on { border-color: var(--red); }
.thumbs img { width: 100%; height: 100%; object-fit: contain; }
.pd-price { font-size: 24px; font-weight: 800; color: var(--red); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.stat { background: var(--bg); border-radius: 10px; padding: 8px; text-align: center; }
.stat b { display: block; font-size: 16px; color: var(--navy); }
.stat span { font-size: 11px; color: var(--muted); }
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table td { padding: 8px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec-table td:first-child { color: var(--muted); width: 42%; }
.qty { display: inline-flex; align-items: center; border: 1px solid #ccd0e6; border-radius: 10px; overflow: hidden; background: #fff; }
.qty button { width: 36px; height: 38px; border: 0; background: var(--bg); font-size: 18px; font-weight: 700; }
.qty input { width: 48px; text-align: center; border: 0; height: 38px; outline: 0; }
.review { padding: 10px 0; border-bottom: 1px solid var(--line); }
.review:last-child { border-bottom: 0; }
.review .rv-x { border: 0; background: none; color: var(--red); padding: 0; display: inline-grid; place-items: center; cursor: pointer; }
.review .rv-x .ic { width: 16px; height: 16px; }
/* ---------- admin: đánh giá khách hàng ---------- */
.rev-manage { display: flex; gap: 10px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rev-manage:last-of-type { border-bottom: 0; }
.rev-manage .rm-img { flex: none; width: 48px; height: 48px; border-radius: 8px; overflow: hidden; background: var(--tint); display: grid; place-items: center; color: var(--navy); }
.rev-manage .rm-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rev-manage .rm-img.ph .ic { width: 20px; height: 20px; }
.rev-manage .btn.red { flex: none; }
.rev-manage .btn.red .ic { width: 15px; height: 15px; }
.starpick { display: flex; gap: 4px; }
.starpick button { background: none; border: 0; font-size: 28px; color: #cfd3e6; padding: 0 2px; }
.starpick button.on { color: #f5a623; }
.actions-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- account ---------- */
.acc-head { background: var(--navy); color: #fff; margin: -14px -14px 14px; padding: 10px 16px 20px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.avatar { width: 54px; height: 54px; border-radius: 50%; background: #e8eaf8; color: var(--navy); display: grid; place-items: center; font-weight: 800; font-size: 22px; flex: none; }
.acc-head .info { flex: 1; min-width: 140px; line-height: 1.4; }
.acc-head .info b { font-size: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.card-head h2 { margin: 0; }
.card-head a { color: var(--muted); font-size: 13px; }
.icon-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.icon-grid.three { grid-template-columns: repeat(3, 1fr); }
.icon-grid a, .icon-grid button { background: none; border: 0; display: grid; justify-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 6px 0; position: relative; }
.icon-grid .ib { width: 44px; height: 44px; border-radius: 50%; background: var(--tint); color: var(--navy); display: grid; place-items: center; }
.icon-grid.plain .ib { background: none; }
.icon-grid.plain .ic { width: 24px; height: 24px; }
.icon-grid .badge { right: calc(50% - 26px); top: 0; border-color: #fff; }
.link-row { display: flex; align-items: center; gap: 12px; padding: 14px 4px; border-top: 1px solid var(--line); width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; font-weight: 500; font-size: 15px; }
.link-row:first-of-type { border-top: 0; }
.link-row .ic { color: var(--navy); }
.link-row .chev { margin-left: auto; color: #9aa; width: 18px; }

/* ---------- orders / cart ---------- */
.status { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.st-pending { background: #fff4d6; color: #8a5a00; }
.st-confirmed { background: var(--tint); color: var(--navy); }
.st-shipping { background: #e0f2ff; color: #045a8d; }
.st-delivered { background: #e6f5ec; color: var(--green); }
.st-cancelled { background: #eee; color: #777; }
.line { display: flex; gap: 10px; padding: 8px 0; align-items: center; }
.line img, .line .noimg { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--tint); flex: none; }
.order-total { text-align: right; font-weight: 700; padding-top: 8px; border-top: 1px dashed var(--line); }
.order-card.sel { outline: 2px solid var(--navy); }
.sticky-bar { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 8px); background: #fff; border-radius: 14px; padding: 12px; display: flex; align-items: center; gap: 12px; box-shadow: 0 4px 18px rgba(30, 40, 120, .18); }

/* ---------- chat ---------- */
.chat { display: flex; flex-direction: column; background: #fff; border-radius: 16px; overflow: hidden; height: calc(100vh - 56px - var(--nav-h) - 40px); min-height: 420px; box-shadow: 0 1px 2px rgba(30, 40, 120, .06); }
.chat-head { background: var(--navy); color: #fff; padding: 12px 14px; display: flex; gap: 10px; align-items: center; }
.chat-head .avatar { width: 38px; height: 38px; font-size: 15px; }
.chat-body { flex: 1; overflow-y: auto; background: var(--bg); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 78%; padding: 9px 12px; border-radius: 14px; background: #fff; align-self: flex-start; white-space: pre-wrap; word-break: break-word; box-shadow: 0 1px 1px rgba(0, 0, 0, .05); position: relative; }
.msg.me { background: var(--navy); color: #fff; align-self: flex-end; }
.msg time { display: block; font-size: 10px; opacity: .65; margin-top: 3px; }
.chat-foot { padding: 8px; border-top: 1px solid var(--line); background: #fff; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.quick button { background: var(--tint); color: var(--navy); border: 1px solid #c5cae9; border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 600; }
.chat-form { display: flex; gap: 8px; }
.chat-form input { flex: 1; border: 1px solid #ccd0e6; border-radius: 999px; padding: 10px 14px; min-width: 0; }
.chat-form button { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--navy); color: #fff; display: grid; place-items: center; flex: none; }
.chat-item { display: flex; gap: 12px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--line); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; }
.chat-item:last-child { border-bottom: 0; }
.dot { background: var(--red); color: #fff; border-radius: 9px; min-width: 18px; height: 18px; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }

/* ---------- tệp phân loại khách + xóa tin nhắn (quản trị) ---------- */
.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-n { font-size: 11.5px; font-weight: 700; opacity: .65; margin-left: 5px; }
.chat-open { flex: 1; min-width: 0; display: flex; gap: 12px; align-items: center; background: none; border: 0; padding: 0; text-align: left; color: var(--text); font: inherit; }
.chat-item .tag .ic { width: 13px; height: 13px; vertical-align: -2px; }
.chat-hint .ic { width: 15px; height: 15px; vertical-align: -3px; color: var(--navy); }
.file-btn { flex: none; width: 38px; height: 38px; border-radius: 50%; border: 1px solid #cfd2e8; background: #fff; color: #6b7089; display: grid; place-items: center; }
.file-btn .ic { width: 19px; height: 19px; }
.file-btn.on { background: var(--tint); border-color: var(--navy); color: var(--navy); }
.chat-tool { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; background: #f3f4fb; border-bottom: 1px solid var(--line); }
.chat-tool .btn.sm { min-height: 30px; padding: 4px 10px; font-size: 12.5px; gap: 5px; }
.chat-tool .btn.sm .ic { width: 16px; height: 16px; }
.msg.has-del { padding-right: 26px; }
.msg-del { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .13); color: inherit; font-size: 14px; line-height: 1; display: grid; place-items: center; opacity: .6; }
.msg-del:hover, .msg-del:focus-visible { opacity: 1; background: rgba(0, 0, 0, .28); }
.msg.me .msg-del { background: rgba(255, 255, 255, .28); }
.pick { display: block; width: 100%; text-align: left; padding: 12px 14px; border: 1px solid #d7daea; border-radius: 10px; background: #fff; color: var(--text); font: inherit; font-weight: 600; margin-bottom: 8px; }
.pick.on { border-color: var(--navy); background: var(--tint); color: var(--navy); }

/* ---------- contact ---------- */
.contact-hero { background: var(--navy); color: #fff; border-radius: 16px; padding: 18px; margin-bottom: 14px; }
.contact-hero h2 { color: #fff; font-size: 22px; font-weight: 800; margin: 0; }
.contact-hero p { color: #d3d8ff; margin-top: 6px; font-size: 14px; }
.crow .btn { border-radius: 999px; padding: 8px 18px; min-height: 38px; font-size: 14px; }
.qf .field label { font-weight: 400; color: var(--muted); }
.qf .field input, .qf .field textarea { border-radius: 12px; min-height: 46px; }
.qf .field textarea { min-height: 84px; }
.btn.white { background: #fff; color: var(--text); border-color: var(--line); }
.crow { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.crow:last-child { border-bottom: 0; }
.crow .ib { width: 40px; height: 40px; border-radius: 50%; background: var(--tint); color: var(--navy); display: grid; place-items: center; flex: none; }

/* ---------- admin ---------- */
.admin-menu { display: grid; gap: 12px; }
.admin-tile { background: #fff; border-radius: 14px; padding: 16px; display: flex; gap: 14px; align-items: center; box-shadow: 0 1px 2px rgba(30, 40, 120, .06); position: relative; }
.admin-tile .ib { width: 48px; height: 48px; border-radius: 12px; background: var(--tint); color: var(--navy); display: grid; place-items: center; flex: none; }
.admin-tile .badge { position: static; border-color: #fff; margin-left: auto; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; padding-bottom: 4px; }
.tabs button { flex: none; border: 1px solid #c5cae9; background: #fff; border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 13px; color: var(--navy); }
.tabs button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
.kpi { background: #fff; border-radius: 12px; padding: 12px; }
.kpi b { display: block; font-size: 20px; color: var(--navy); }
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.tbl th { color: var(--muted); font-size: 12px; }
table.tbl .r { text-align: right; }
.img-list { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.img-item { position: relative; width: 74px; height: 74px; border-radius: 8px; overflow: hidden; background: #fff; border: 1px solid var(--line); }
.img-item img { width: 100%; height: 100%; object-fit: contain; }
.img-item button { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .65); color: #fff; font-size: 12px; line-height: 1; padding: 0; }

/* ---------- ảnh bìa sản phẩm (quản trị tự cắt) ---------- */
/* Khung xem trước ảnh bìa: giữ đúng tỉ lệ ảnh đã cắt nên không cắt thêm lần nữa. */
.cover-edit { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cover-edit .cover-prev { width: 96px; height: auto; max-height: 120px; border-radius: 10px; border: 1px solid var(--line); background: #fff; object-fit: contain; display: block; }
.cover-edit .cover-note { flex: 1; min-width: 140px; }
/* Hộp thoại cắt ảnh: khung cắt cố định chiều cao, ảnh bên trong do JS đặt vị trí/kích thước. */
.crop-stage { width: 100%; height: 300px; background: #eef0f8; border-radius: 12px; display: grid; place-items: center; overflow: hidden; touch-action: none; }
.crop-frame { position: relative; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px rgba(20, 30, 90, .12); cursor: grab; touch-action: none; }
.crop-frame.drag { cursor: grabbing; }
.crop-frame img { position: absolute; left: 0; top: 0; max-width: none; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.crop-grid { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .9); background-image: linear-gradient(to right, rgba(255, 255, 255, .45) 1px, transparent 1px), linear-gradient(to bottom, rgba(255, 255, 255, .45) 1px, transparent 1px); background-size: 33.334% 33.334%; }
@media (min-width: 768px) { .crop-stage { height: 360px; } }
/* Nhóm nút chọn tỉ lệ cần xuống dòng được (6 lựa chọn, màn hình hẹp không đủ một hàng). */
.seg.wrap { display: flex; flex-wrap: wrap; border-radius: 14px; }
.seg.wrap button { flex: 1 1 auto; justify-content: center; }
.radio-row { display: flex; gap: 8px; }
.radio-row label { flex: 1; border: 1.5px solid #ccd0e6; border-radius: 10px; padding: 10px; display: flex; gap: 8px; align-items: center; font-weight: 600; cursor: pointer; }
.radio-row input { width: auto; min-height: 0; }
.radio-row label.on { border-color: var(--navy); background: var(--tint); }
.hint { background: #fff8e1; border-radius: 8px; padding: 6px 10px; font-size: 12px; color: #7a5b00; margin-bottom: 10px; }
kbd { background: #fff; border: 1px solid #bbb; border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-size: 11px; }

/* ---------- modal ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(15, 20, 60, .55); z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 18px; }
.modal h3 { font-size: 17px; margin-bottom: 12px; }
.modal-msg { margin-bottom: 16px; font-size: 15px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- tablet ---------- */
@media (min-width: 640px) {
  #view { padding: 18px; }
  .grid-products { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .hero { margin: -18px -18px 0; }
  .hero-media { aspect-ratio: 16 / 8; }
  .hero h2 { font-size: 36px; }
  .hero-body { padding: 30px 32px 32px; }
  .intro { margin: 20px 0 22px; padding: 26px 28px; }
  .acc-head { margin: 0 0 14px; border-radius: 16px; padding: 18px; }
  .narrow.acc { max-width: 720px; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .modal-wrap { align-items: center; }
  .modal { border-radius: 18px; }
  .admin-menu { grid-template-columns: repeat(3, 1fr); }
  .admin-tile { flex-direction: column; text-align: center; padding: 22px 14px; }
  .admin-tile .badge { position: absolute; top: 10px; right: 10px; }
  .slide-nav { display: grid; }
  .slider .slide { aspect-ratio: 4 / 3; }
}

/* ---------- desktop ---------- */
@media (min-width: 1024px) {
  body { padding-bottom: 0; }
  #bottom-nav { display: none; }
  .brand { display: flex; }
  #page-title { display: none; }
  .top-nav { display: flex; gap: 4px; flex: 1; margin-left: 18px; }
  .hotline .hl-txt { display: flex; }
  body[data-bar="search"] .hotline { display: flex; }
  .top-nav a { padding: 8px 14px; border-radius: 8px; font-weight: 600; color: #dfe3ff; }
  .top-nav a:hover { background: rgba(255, 255, 255, .12); }
  .top-nav a.on { background: #fff; color: var(--navy); }
  .top-in { padding: 8px 18px; }
  .top-search { flex: 0 1 380px; margin-left: auto; }
  .top-actions { margin-left: auto; }
  body[data-bar="search"] .top-actions { margin-left: 0; }
  #view { padding: 24px 18px; }
  .hero { margin: 0; border-radius: 20px; display: grid; grid-template-columns: 1.25fr 1fr; align-items: stretch; }
  .hero-media { aspect-ratio: auto; min-height: 440px; }
  .hero h2 { font-size: 36px; }
  .hero p { font-size: 16px; }
  .hero-body { padding: 40px 38px; align-content: center; }
  .hero-tag { bottom: 20px; left: 20px; font-size: 14px; padding: 10px 16px; }
  .intro { margin: 24px 0 26px; padding: 30px 34px; }
  .grid-products { grid-template-columns: repeat(4, 1fr); }
  .pd { grid-template-columns: 1.1fr 1fr; gap: 28px; align-items: start; }
  .pd .full { grid-column: 1 / -1; }
  #toast { bottom: 24px; }
  .chat { height: calc(100vh - 130px); }
  .grid-products.related { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1023px) {
  body[data-bar="none"] #topbar { display: none; }
}

@media print {
  #topbar, #bottom-nav, #toast { display: none !important; }
}

.grid-orders { display: grid; gap: 12px; }
@media (min-width: 900px) { .grid-orders { grid-template-columns: 1fr 1fr; } }
.order-card { cursor: default; }
[data-o] { cursor: pointer; }

/* ---------- addresses ---------- */
.addr { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; background: #fff; }
.addr[data-pick] { cursor: pointer; }
.addr.sel { border-color: var(--navy); background: var(--tint); }
.tag-def { font-size: 11px; font-weight: 800; color: var(--red); border: 1px solid var(--red); border-radius: 6px; padding: 1px 7px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 12px; }
.check input { width: 18px; height: 18px; }
.card > .addr { margin-bottom: 0; }
.field select { background: #fff; }

/* ---------- extra ---------- */
.info-row { display: flex; align-items: flex-start; gap: 14px; padding: 9px 0; }
.info-row > .ic { color: var(--navy); margin-top: 2px; }
.card h2.navy { font-size: 17px; font-weight: 800; margin-bottom: 14px; }
.pcard { border-radius: 16px; }
.pcard .pbody { padding: 11px 12px 14px; }
.rec-title { display: flex; align-items: center; justify-content: space-between; margin: 18px 2px 10px; }
.rec-title h2 { font-size: 15px; font-weight: 700; }
.rec-title a { color: var(--muted); font-size: 13px; }
.acc-link { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }

/* ---------- product detail: buy bar replaces the bottom tabs ---------- */
.buy-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fff; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  max-width: 1180px; margin: 0 auto; box-shadow: 0 -4px 16px rgba(20, 25, 70, .08);
}
/* sản phẩm có đặt cọc: 3 nút — "Mua ngay" xuống hàng dưới cho dễ bấm trên điện thoại */
.buy-bar.three #buy { grid-column: 1 / -1; }
@media (min-width: 640px) {
  .buy-bar.three { grid-template-columns: 1fr 1fr 1fr; }
  .buy-bar.three #buy { grid-column: auto; }
}
/* ---------- hình thức đặt cọc 30% ---------- */
.dep-note { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; font-size: 12.5px; font-weight: 600; color: var(--green); }
.dep-note .ic { width: 16px; height: 16px; flex: none; }
.dep-box { margin-top: 10px; padding: 10px 12px; border: 1px dashed #b9dcbf; border-radius: 10px; background: #f2fbf4; display: grid; gap: 6px; }
.dep-box[hidden] { display: none; }
.dep-tag { display: inline-block; margin-top: 4px; font-size: 11px; font-weight: 700; color: var(--green); background: #e6f6ec; border-radius: 6px; padding: 2px 7px; }

/* ---------- chọn kích thước / màu sắc ở trang sản phẩm ---------- */
.opt-block { margin: 10px 0 0; }
.opt-title { font-size: 12.5px; font-weight: 700; color: #5a5f80; margin-bottom: 6px; }
.opt-block .chips { margin-bottom: 2px; flex-wrap: wrap; overflow-x: visible; }
.opt-block .chip { padding: 7px 14px; }
.opt-block .chip-n { font-weight: 700; opacity: .8; margin-left: 6px; }

/* ---------- trang thanh toán đặt cọc ---------- */
.pay-status { display: flex; gap: 10px; align-items: flex-start; border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; font-size: 13.5px; }
.pay-status .ic { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.pay-status b { display: block; font-size: 14px; margin-bottom: 2px; }
.pay-status.warn { background: #fff8e1; color: #7a5b00; }
.pay-status.info { background: #e8f2ff; color: #14447a; }
.pay-status.ok { background: #e9f8ef; color: #1b6b3a; }
.pay-status.err { background: #fdecea; color: var(--red-d); }
.pay-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.pay-row:last-of-type { border-bottom: 0; }
.pay-row b { text-align: right; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .3px; }
.center { text-align: center; }
.qr-wrap { text-align: center; margin: 4px 0 12px; }
.qr-wrap img { width: 100%; max-width: 260px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.bill-pick { display: flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px dashed #c5cae9; border-radius: 12px; padding: 18px 12px; color: var(--navy); font-weight: 700; cursor: pointer; background: #fafbff; width: 100%; font-family: inherit; font-size: 14px; }
.bill-pick:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.bill-pick .ic { width: 20px; height: 20px; }
.bill-prev { margin-top: 10px; }
.bill-prev img { width: 100%; max-width: 260px; border-radius: 10px; border: 1px solid var(--line); display: block; }
.proof-btn { border: 1px solid var(--line); border-radius: 8px; padding: 0; overflow: hidden; background: #fff; flex: none; }
.proof-btn img { width: 54px; height: 54px; object-fit: cover; display: block; }
body.pd-mode #bottom-nav { display: none; }
body.pd-mode { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
body.pd-mode #toast { bottom: 90px; }
@media (min-width: 1024px) {
  body.pd-mode { padding-bottom: 84px; }
  .buy-bar { left: 50%; right: auto; width: 100%; transform: translateX(-50%); border-radius: 14px 14px 0 0; }
}

/* ---------- cart: the order bar replaces the bottom tabs ---------- */
body.cart-mode #bottom-nav { display: none; }
body.cart-mode { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
body.cart-mode #toast { bottom: 100px; }
body.cart-mode .sticky-bar {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 1180px; z-index: 40;
  border-radius: 14px 14px 0 0; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 16px rgba(20, 25, 70, .12);
}
@media (min-width: 1024px) {
  body.cart-mode { padding-bottom: 96px; }
}

.pcard .pbody .ic { width: 13px; height: 13px; color: var(--red); }

/* ---------- notifications ---------- */
.ib-sm { width: 34px; height: 34px; border-radius: 50%; background: var(--tint); color: var(--navy); display: grid; place-items: center; flex: none; }
.notif { display: block; }
.notif.unread { border-left: 4px solid var(--navy); background: #f6f7ff; }

/* ---------- buy sheet (Mua ngay) ---------- */
.buy-sheet .bs-top { display: flex; gap: 14px; align-items: flex-end; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.bs-img { position: relative; width: 120px; height: 120px; flex: none; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 0; overflow: hidden; cursor: zoom-in; }
.bs-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.bs-zoom { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; display: grid; place-items: center; font-size: 15px; }
.bs-info { min-width: 0; display: grid; gap: 6px; }
.bs-name { font-weight: 600; font-size: 14px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bs-qty { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; }
.bs-total { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--tint); }
.bs-total > span { font-size: 13px; color: var(--muted); }
.bs-total i { font-style: normal; white-space: nowrap; }
.bs-total b { font-size: 20px; font-weight: 800; color: var(--red); white-space: nowrap; }
.buy-sheet .btn.block { width: 100%; margin-top: 6px; }


/* ---------- văn bản pháp lý (chính sách bảo mật, điều khoản, hồ sơ cửa hàng) ---------- */
.legal { max-width: 760px; }
.legal-head { padding: 4px 2px 14px; }
.legal-head h1 { font-size: 22px; font-weight: 800; color: #12163a; line-height: 1.25; }
.legal-head p { margin-top: 6px; }
.legal-intro { margin-top: 10px; color: #2b2f4d; font-size: 14px; line-height: 1.65; }
.legal-sec { padding: 16px; }
.legal-sec h2 { font-size: 15.5px; font-weight: 800; color: var(--navy); margin-bottom: 10px; line-height: 1.35; }
.legal-sec p { font-size: 14px; line-height: 1.7; color: #2b2f4d; }
.legal-sec p + p { margin-top: 10px; }
.legal-sec ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 7px; }
.legal-sec li { font-size: 14px; line-height: 1.65; color: #2b2f4d; }
.legal-sec a { color: var(--navy); font-weight: 700; text-decoration: underline; }
.legal-sec .legal-info { list-style: none; padding-left: 0; gap: 8px; }
.legal-sec .legal-info li { font-size: 13.5px; }
.legal-sec code { background: #eef0fa; border-radius: 5px; padding: 1px 5px; font-size: 12.5px; word-break: break-all; }
.legal-foot { text-align: center; }
.legal-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; font-size: 13px; }
.legal-check { align-items: flex-start; font-weight: 500; font-size: 12.5px; line-height: 1.55; margin: 2px 0 14px; }
.legal-check input { margin-top: 2px; flex: none; }
.legal-check a { text-decoration: underline; }
.auth-legal { text-align: center; margin-top: 14px; line-height: 1.55; }
.copy-box { background: #f5f6fc; border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; color: #2b2f4d; max-height: 320px; overflow: auto; font-family: inherit; margin-bottom: 10px; }
.mono-break { word-break: break-word; }
@media (min-width: 768px) {
  .legal-head h1 { font-size: 26px; }
  .legal-sec { padding: 20px; }
  .legal-sec h2 { font-size: 16.5px; }
}

/* ---------- trang Tải ứng dụng (#/download) ---------- */
.dl .legal-head h1 { font-size: 22px; }
.dl-steps { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 9px; }
.dl-steps li { font-size: 13.5px; line-height: 1.65; color: #2b2f4d; }
.dl-steps code, .dl .card p code { background: #eef0fa; border-radius: 5px; padding: 1px 5px; font-size: 12.5px; word-break: break-all; }
.dl-sub { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.dl-sub b { font-size: 14px; color: var(--navy); }
.dl .btn .ic { width: 18px; height: 18px; }
.dl .row { display: flex; flex-wrap: wrap; }
.dl .row .btn { flex: 1 1 160px; }
.dl .copy-box { margin-bottom: 0; }
.dl .card > p + p { margin-top: 10px; }
.dl .legal-head p { color: var(--muted); }

/* 2 thẻ chọn cửa hàng ứng dụng */
.dl-store { display: grid; gap: 10px; }
.dl-store-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; text-decoration: none; color: inherit; }
.dl-store-card:active { transform: scale(.99); }
.dl-store-card:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.dl-store-card > .ic { width: 26px; height: 26px; flex: none; color: var(--navy); }
.dl-store-card .st { display: grid; gap: 2px; min-width: 0; }
.dl-store-card .st-t { font-size: 15px; font-weight: 800; color: var(--navy); line-height: 1.3; }
.dl-store-card .st-s { font-size: 12.5px; color: var(--muted); }
.dl-store-card .chev { margin-left: auto; width: 18px; color: #9aa; flex: none; }
.dl-store-card.off { background: #f6f7fb; border-style: dashed; }
.dl-store-card.off > .ic, .dl-store-card.off .st-t { color: #98a0b3; }
.dl-store-badge { order: 2; margin-left: auto; font-size: 11.5px; font-weight: 700; color: #7a8296; background: #eceefa; border-radius: 999px; padding: 4px 9px; flex: none; }
@media (min-width: 768px) {
  .dl-store { grid-template-columns: 1fr 1fr; }
}

/* ---------- xem ảnh / bill phóng to (quản trị) ---------- */
.imgzoom { position: fixed; inset: 0; z-index: 90; background: #0b0f1a; display: flex; flex-direction: column; }
.iz-bar { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; color: #fff; }
.iz-title { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iz-tools { display: flex; gap: 8px; flex: none; }
.iz-btn { width: 40px; height: 40px; border-radius: 11px; border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .08); color: #fff; display: inline-flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; }
.iz-btn:active { transform: scale(.94); }
.iz-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.iz-btn .ic { width: 20px; height: 20px; }
.iz-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; touch-action: none; cursor: zoom-in; }
.iz-stage.zoomed { cursor: grab; }
.iz-stage.dragging { cursor: grabbing; }
.iz-img { max-width: 100%; max-height: 100%; transform-origin: center center; will-change: transform; user-select: none; -webkit-user-drag: none; }
.iz-foot { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); color: #fff; }
.iz-zoom { min-width: 66px; padding: 9px 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .08); color: #fff; font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; text-align: center; cursor: pointer; }
/* mũi tên đổi ảnh + số thứ tự ảnh trong khung xem toàn màn hình */
.iz-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .22); background: rgba(15, 20, 35, .55); color: #fff; display: grid; place-items: center; padding: 0; cursor: pointer; backdrop-filter: blur(4px); }
.iz-nav:active { transform: translateY(-50%) scale(.94); }
.iz-nav.prev { left: 8px; } .iz-nav.next { right: 8px; }
.iz-nav .ic { width: 20px; height: 20px; }
.iz-count { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); background: rgba(15, 20, 35, .6); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; font-variant-numeric: tabular-nums; pointer-events: none; }
.iz-ctrls { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.iz-one { padding: 9px 13px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .08); color: #fff; font: inherit; font-size: 13px; font-weight: 800; letter-spacing: .3px; cursor: pointer; }
.iz-one.on { background: #fff; color: #0b0f1a; border-color: #fff; }
.iz-one.hide { display: none; }
.iz-hint { font-size: 11.5px; color: rgba(255, 255, 255, .68); text-align: center; line-height: 1.4; }
.iz-thumbs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; max-width: 100%; scrollbar-width: none; }
.iz-thumbs::-webkit-scrollbar { display: none; }
.iz-thumbs button { flex: none; width: 54px; height: 42px; border-radius: 8px; overflow: hidden; border: 2px solid transparent; background: rgba(255, 255, 255, .1); padding: 0; cursor: pointer; }
.iz-thumbs button.on { border-color: #fff; }
.iz-thumbs img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* --- Mã giảm giá: ô nhập ở trang đặt hàng + danh sách trong quản trị --- */
.coupon-box { margin-top: 10px; padding: 10px 12px; border: 1px dashed #b9c0e8; border-radius: 10px; background: #f7f8ff; }
.coupon-box .row { gap: 8px; }
.coupon-box .input { flex: 1; min-width: 0; }
.coupon-box .btn { flex: none; }
.coupon-box[hidden], #cp-row[hidden], #cp-on[hidden], #disc-row[hidden] { display: none; }
.coupon-item { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
.coupon-item:last-child { border-bottom: 0; }
.cp-code { font-size: 16px; letter-spacing: 1px; color: var(--navy); }
#f-max-wrap[hidden] { display: none; }

/* --- Trả hàng / hoàn tiền (khối trong đơn đã giao + biểu mẫu gửi yêu cầu) --- */
.ret-box { margin-top: 10px; padding: 10px 12px; border: 1px dashed #b9c0e8; border-radius: 10px; background: #f7f8ff; }
.ret-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ret-head b { font-size: 13.5px; }
.ret-imgs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.ret-imgs .proof-btn img { width: 64px; height: 64px; }
.ret-thumb { position: relative; }
.ret-thumb img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; background: #fff; }
.ret-thumb button { position: absolute; top: -6px; right: -6px; width: 21px; height: 21px; border: 0; border-radius: 50%; background: var(--red); color: #fff; font-size: 14px; line-height: 1; display: grid; place-items: center; cursor: pointer; }
.ret-reasons { display: grid; gap: 6px; }
.ret-r { display: flex; align-items: center; gap: 9px; border: 1.5px solid #ccd0e6; border-radius: 10px; padding: 9px 11px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.ret-r input { width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0; border: 0; background: transparent; accent-color: var(--navy); flex: none; }
.ret-r.on { border-color: var(--navy); background: var(--tint); }
.ret-reason { margin-top: 6px; }
.ret-card-imgs { display: flex; gap: 8px; flex-wrap: wrap; }
@media (min-width: 768px) {
  .ret-imgs .proof-btn img, .ret-thumb img { width: 76px; height: 76px; }
}

/* --- Cảnh báo: backend (/api) không chạy → mọi thay đổi sẽ KHÔNG được lưu --- */
.backend-alert {
  position: sticky; top: 0; z-index: 60;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  background: var(--red); color: #fff; padding: 8px 12px;
  font-size: 13px; line-height: 1.35;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
.backend-alert b { font-size: 13px; }
.backend-alert a {
  margin-left: auto; flex: none; background: #fff; color: var(--red-d);
  font-weight: 700; padding: 4px 11px; border-radius: 999px; white-space: nowrap;
}

/* --- Bộ lọc (kho hàng + quản trị): thẻ lọc có đầu mục, chip danh mục kèm số lượng,
       nhánh con thụt cấp, sắp xếp dạng phân đoạn --- */
.filter-bar {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 12px 30px -22px rgba(29, 39, 117, .65), 0 1px 2px rgba(27, 31, 59, .05);
  margin-bottom: 14px; overflow: hidden;
}
.filter-head {
  display: flex; align-items: center; gap: 9px; padding: 10px 13px;
  background: linear-gradient(180deg, #f5f7ff, #fff); border-bottom: 1px solid var(--line);
}
.filter-head .fh-ic {
  width: 30px; height: 30px; flex: none; border-radius: 10px; display: grid; place-items: center;
  background: var(--tint); color: var(--navy);
}
.filter-head .fh-ic .ic { width: 17px; height: 17px; }
.filter-head .fh-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.filter-head .fh-txt b { font-size: 13.5px; color: var(--navy); line-height: 1.25; }
.filter-head .fh-sub {
  font-size: 11.5px; color: var(--muted); line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.filter-clear {
  display: none; flex: none; align-items: center; gap: 2px;
  border: 1px solid #f2cbcb; background: #fff6f6; color: var(--red-d);
  border-radius: 999px; padding: 5px 10px 5px 7px; font-size: 11.5px; font-weight: 700;
}
.filter-clear .ic { width: 13px; height: 13px; }
.filter-clear.on { display: inline-flex; }
/* Nút tắt/ẩn bộ lọc: thu gọn phần thân, giữ nguyên lựa chọn đang áp dụng (tóm tắt vẫn hiện trên đầu). */
.filter-toggle {
  display: inline-flex; flex: none; align-items: center; gap: 3px;
  border: 1px solid var(--line); background: #fff; color: var(--navy);
  border-radius: 999px; padding: 5px 10px 5px 8px; font-size: 11.5px; font-weight: 700;
  transition: background .14s, border-color .14s, color .14s;
}
.filter-toggle:hover { background: var(--tint); border-color: #b8c0e6; }
.filter-toggle:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.filter-toggle .ic { width: 13px; height: 13px; flex: none; transition: transform .18s ease; }
.filter-toggle .ft-txt { white-space: nowrap; }
/* Chưa ẩn: mũi tên chỉ lên (bấm để thu gọn). Đã ẩn: mũi tên chỉ xuống (bấm để mở ra). */
.filter-bar:not(.collapsed) .filter-toggle .ic { transform: rotate(-90deg); }
.filter-bar.collapsed .filter-toggle .ic { transform: rotate(90deg); }
.filter-bar.collapsed .filter-toggle { color: #5b6086; }
.filter-bar.collapsed .filter-head { border-bottom: 0; }
.filter-bar.collapsed .filter-body { display: none; }
.filter-body { display: grid; gap: 13px; padding: 12px 13px 13px; }
.fgroup { min-width: 0; }
.fgroup-label {
  display: flex; align-items: center; gap: 5px; margin-bottom: 7px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: #8b90ab;
}
.fgroup-label .ic { width: 13px; height: 13px; flex: none; }
.fgroup-sub { margin-top: 10px; padding-left: 10px; border-left: 2px solid var(--tint); }
.filter-bar .chips {
  display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none;
  margin: 0; padding-bottom: 1px;
}
.filter-bar .chips::-webkit-scrollbar { display: none; }
.filter-bar .chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid #dfe3f3; background: #fbfbff; color: #3b4170;
  border-radius: 999px; padding: 7px 12px; font-size: 12.5px; font-weight: 700;
  transition: background .14s, border-color .14s, color .14s, box-shadow .14s;
}
.filter-bar .chip:hover { border-color: #b8c0e6; background: #fff; color: var(--navy); }
.filter-bar .chip.on {
  background: linear-gradient(180deg, #3546bd, var(--navy-d));
  border-color: var(--navy-d); color: #fff;
  box-shadow: 0 6px 14px -9px rgba(29, 39, 117, .95), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.filter-bar .chip .chip-n {
  font-size: 10.5px; font-weight: 800; line-height: 1; padding: 3px 5px; min-width: 18px;
  border-radius: 999px; background: var(--tint); color: var(--navy); text-align: center;
}
.filter-bar .chip.on .chip-n { background: rgba(255, 255, 255, .22); color: #fff; }
.seg {
  display: inline-flex; gap: 2px; padding: 3px; background: #f0f2fb;
  border: 1px solid var(--line); border-radius: 999px;
}
.seg button {
  border: 0; background: none; border-radius: 999px; padding: 6px 12px;
  font-size: 12.5px; font-weight: 700; color: #5b6086; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px;
  transition: background .14s, color .14s, box-shadow .14s;
}
.seg button .ic { width: 13px; height: 13px; }
.seg button.on { background: #fff; color: var(--navy); box-shadow: 0 1px 4px rgba(27, 31, 59, .18); }
.result-bar { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 10px; }
.result-bar .rcount { font-size: 13.5px; font-weight: 700; color: var(--navy); }
.result-bar .rcount b { font-size: 15.5px; font-weight: 800; color: var(--red); }
.result-active {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700;
  color: var(--navy); background: var(--tint); border-radius: 999px; padding: 3px 9px;
}
.result-sort {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700;
  color: var(--muted); background: #fff; border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 9px;
}
.result-sort .ic { width: 12px; height: 12px; color: var(--navy); }
@media (max-width: 359px) {
  .seg button { padding: 6px 9px; font-size: 12px; }
  .filter-bar .chip { padding: 6px 10px; font-size: 12px; }
  /* Máy rất hẹp: nút ẩn/hiện lọc chỉ còn mũi tên cho khỏi chật (vẫn có aria-label). */
  .filter-toggle { padding: 5px 7px; }
  .filter-toggle .ft-txt { display: none; }
}
@media (min-width: 768px) {
  /* Màn hình rộng: danh mục hiện hết trên vài dòng, phần sắp xếp nằm bên phải cho gọn. */
  .filter-bar .chips { flex-wrap: wrap; overflow-x: visible; }
  .filter-body { grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 18px; }
  .fgrow-sort { min-width: 200px; }
}

/* ---------- cài app (PWA): dòng nhắc góc phải dưới + trang Tải ứng dụng ---------- */
.install-dock {
  position: fixed; z-index: 45; right: 10px;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 10px);
  display: flex; align-items: center; justify-content: flex-end;
  max-width: calc(100vw - 20px);
  pointer-events: none; /* chỉ phần tử con nhận bấm, không chặn trang phía sau */
}
.install-dock > * { pointer-events: auto; }
.install-dock.is-gone { display: none; }

.install-dock .dock-card {
  display: none; align-items: center; gap: 10px;
  padding: 9px 10px 9px 11px; border-radius: 14px;
  background: #fff; border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(20, 30, 90, .2);
  animation: dock-in .26s ease-out;
}
.install-dock:not(.is-off) .dock-card { display: flex; }
@keyframes dock-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.install-dock .dock-ic {
  flex: none; width: 32px; height: 32px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--tint); color: var(--navy);
}
.install-dock .dock-ic .ic { width: 18px; height: 18px; }
.install-dock .dock-txt { display: grid; gap: 1px; min-width: 0; max-width: 152px; }
.install-dock .dock-txt b { font-size: 13px; color: var(--navy); line-height: 1.25; white-space: nowrap; }
.install-dock .dock-sub { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.install-dock .dock-go { flex: none; padding: 8px 13px; font-size: 13px; white-space: nowrap; }

/* công tắc tắt / bật của khách */
.install-dock .dock-sw {
  flex: none; width: 38px; height: 22px; border-radius: 999px; border: 0;
  background: #d5d9ea; padding: 2px; cursor: pointer; transition: background .18s;
}
.install-dock .dock-sw[aria-checked="true"] { background: var(--green); }
.install-dock .dock-sw .knob {
  display: block; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .28); transition: transform .18s;
}
.install-dock .dock-sw[aria-checked="true"] .knob { transform: translateX(16px); }

/* khách đã tắt: chỉ còn nút tròn nhỏ, bấm để bật lại */
.install-dock .dock-pill {
  display: none; align-items: center; gap: 6px;
  padding: 8px 13px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--navy); font-size: 12.5px; font-weight: 600;
  box-shadow: 0 6px 18px rgba(20, 30, 90, .16); cursor: pointer;
}
.install-dock .dock-pill .ic { width: 16px; height: 16px; }
.install-dock.is-off .dock-pill { display: flex; }

/* chừa chỗ để dòng nhắc không đè nút "Đặt hàng"/"Mua ngay" ở đáy trang */
body.has-install-dock { padding-bottom: calc(var(--nav-h) + 66px + env(safe-area-inset-bottom)); }
body.has-install-dock .sticky-bar { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 74px); }

@media (min-width: 900px) {
  /* Máy tính: ghim gọn ở góc phải dưới, không đè nội dung. */
  .install-dock { right: 18px; bottom: 18px; }
  body.has-install-dock { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
  body.has-install-dock .sticky-bar { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 8px); }
}
@media (max-width: 380px) {
  /* Máy rất hẹp: bỏ dòng phụ cho gọn, giữ đúng 1 dòng "Cài đặt ứng dụng". */
  .install-dock .dock-sub { display: none; }
  .install-dock .dock-txt { max-width: 104px; }
}

.dl-main h2 { font-size: 16px; }
.dl-main .btn .ic { width: 18px; height: 18px; }
.dl-main .btn + .btn { margin-top: 8px; }
.dl-diag { border-top: 1px solid var(--line); padding-top: 10px; }
.dl-diag > summary {
  cursor: pointer; font-size: 13px; font-weight: 600; color: #4a5080;
  list-style: none; display: flex; align-items: center; gap: 6px;
}
.dl-diag > summary::-webkit-details-marker { display: none; }
.dl-diag > summary::before { content: 'ⓘ'; color: var(--navy); font-size: 14px; }
.dl-diag-row {
  display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
  font-size: 12.5px; padding: 7px 0; border-bottom: 1px dashed #e9ebf5;
}
.dl-diag-row:last-child { border-bottom: 0; }
.dl-diag-row span { color: var(--muted); }
.dl-diag-row b { text-align: right; color: #2b2f4d; font-weight: 600; }
.dl-diag-row b.green { color: var(--green); }
.dl-diag-row b.red { color: var(--red); }

/* ---------- tiến độ giao hàng (vận đơn Giao Hàng Nhanh) ---------- */
.track-box { border: 1px solid var(--line); background: #fbfbff; border-radius: 12px; padding: 12px; }
.tsteps { list-style: none; margin: 8px 0 0; padding: 0; }
.tstep { display: flex; align-items: flex-start; gap: 10px; position: relative; padding-bottom: 16px; }
.tstep:last-child { padding-bottom: 0; }
.tstep::before {
  content: ''; position: absolute; left: 5px; top: 14px; bottom: 0; width: 2px; background: var(--line);
}
.tstep:last-child::before { display: none; }
.tstep.done::before { background: #b9e3c7; }
.tstep .tdot {
  flex: none; width: 12px; height: 12px; border-radius: 50%; margin-top: 3px;
  border: 2px solid #cfd3e6; background: #fff; z-index: 1;
}
.tstep.done .tdot { border-color: var(--green); background: var(--green); }
.tstep.cur .tdot { border-color: var(--navy); background: var(--navy); box-shadow: 0 0 0 4px rgba(40, 53, 147, .14); }
.tstep .tlbl { font-size: 13px; color: var(--muted); line-height: 1.35; }
.tstep.done .tlbl { color: var(--text); }
.tstep.cur .tlbl { color: var(--navy); font-weight: 700; }
.tlogs { list-style: none; margin: 4px 0 0; padding: 0; }
.tlogs li {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 5px 0; border-top: 1px dashed var(--line);
}
.tlogs li:first-child { border-top: 0; }
