/* ============================================================
   WORKFLOW.AIREVIEWBDS.COM
   Dark theme - accent tím (tách biệt với edu.aireviewbds.com màu xanh)
   ============================================================ */

:root {
  --bg: #020617;
  --bg-2: #0b1120;
  --card: #0f172a;
  --card-2: #131c31;
  --border: #1e293b;
  --border-2: #2a3a52;

  --text: #e2e8f0;
  --muted: #94a3b8;
  --muted-2: #64748b;

  --accent: #8b5cf6;
  --accent-2: #6366f1;
  --accent-soft: rgba(139, 92, 246, .14);

  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, .12);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, .12);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, .12);
  --blue: #3b82f6;

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 24px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* nền gradient mờ phía trên */
body::before {
  content: '';
  position: fixed;
  inset: 0 0 auto 0;
  height: 620px;
  background:
    radial-gradient(700px 340px at 12% 0%, rgba(139, 92, 246, .16), transparent 65%),
    radial-gradient(620px 320px at 88% 6%, rgba(99, 102, 241, .13), transparent 62%);
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
input, textarea, select, button { font-family: inherit; font-size: inherit; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; position: relative; z-index: 1; }
.wrap-sm { max-width: 860px; margin: 0 auto; padding: 0 20px; position: relative; z-index: 1; }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(2, 6, 23, .82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; height: 68px;
}
.logo { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 17px; letter-spacing: -.2px; }
.logo-mark {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; font-size: 17px;
  box-shadow: 0 6px 18px rgba(139, 92, 246, .38);
}
/* Logo ảnh "Tool AI Review BĐS" - nền trắng sẵn trong file nên bỏ gradient tím */
img.logo-mark, img.auth-logo {
  display: block; background: none; object-fit: contain;
  box-shadow: 0 6px 18px rgba(37, 99, 235, .35);
}
.nav { display: flex; align-items: center; gap: 8px; }
.nav a {
  padding: 8px 14px; border-radius: 999px; color: var(--muted);
  font-size: 14px; font-weight: 500; transition: .18s;
}
.nav a:hover { color: var(--text); background: var(--card); }
.nav a.zalo { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); font-weight: 600; }
.nav a.zalo:hover { filter: brightness(1.1); }

/* ---------------- Hero ---------------- */
.hero { padding: 62px 0 40px; text-align: center; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 15px; border-radius: 999px;
  background: var(--accent-soft); border: 1px solid rgba(139, 92, 246, .32);
  color: #c4b5fd; font-size: 13px; font-weight: 600; margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(30px, 5.2vw, 50px); font-weight: 800;
  line-height: 1.18; letter-spacing: -1px; margin-bottom: 16px;
}
.hero h1 .grad {
  background: linear-gradient(120deg, var(--accent), #a78bfa 55%, var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--muted); font-size: 17px; max-width: 640px; margin: 0 auto 26px; }
.hero-stats { display: flex; justify-content: center; gap: 34px; flex-wrap: wrap; margin-top: 30px; }
.hero-stats div { text-align: center; }
.hero-stats b { display: block; font-size: 24px; font-weight: 800; color: #fff; }
.hero-stats span { font-size: 13px; color: var(--muted-2); }

/* ---------------- Section ---------------- */
.section { padding: 42px 0; }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 24px;
}
.section-head h2 {
  font-size: 25px; font-weight: 800; letter-spacing: -.4px;
  display: flex; align-items: center; gap: 12px;
}
.section-head p { color: var(--muted-2); font-size: 14px; margin-top: 4px; }
.tag-pill {
  font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .5px;
}
.tag-free { background: var(--green-soft); color: #4ade80; border: 1px solid rgba(34, 197, 94, .3); }
.tag-paid { background: var(--accent-soft); color: #c4b5fd; border: 1px solid rgba(139, 92, 246, .3); }
.tag-link { text-decoration: none; transition: .18s; }
.tag-link:hover { border-color: var(--accent); color: #ddd6fe; }

/* ---------------- Bộ lọc ---------------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 26px; }
.filters input[type=search] {
  flex: 1; min-width: 220px;
  background: var(--card); border: 1px solid var(--border); color: var(--text);
  padding: 11px 16px; border-radius: var(--r-sm); outline: none;
}
.filters input[type=search]:focus { border-color: var(--accent); }
.chip {
  padding: 9px 16px; border-radius: 999px; cursor: pointer;
  background: var(--card); border: 1px solid var(--border);
  color: var(--muted); font-size: 14px; font-weight: 500; transition: .18s;
}
.chip:hover { color: var(--text); border-color: var(--border-2); }
.chip.active { background: var(--accent-soft); border-color: var(--accent); color: #c4b5fd; }

/* ---------------- Card grid ---------------- */
/* Cột hẹp lại (4 cột thay vì 3) để khung ảnh dọc 9/16 không kéo card dài ra.
   Ảnh bìa cao bằng 16/9 chiều rộng cột, cột càng hẹp thì card càng ngắn. */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-4px); border-color: var(--border-2); box-shadow: var(--shadow); }
/* Khung 9/16 = đúng tỉ lệ poster dọc -> ảnh phủ kín, KHÔNG có viền mờ hai bên.
   Muốn card ngắn hơn thì thu hẹp cột ở .grid bên trên, đừng đổi tỉ lệ này,
   vì lệch tỉ lệ là lập tức sinh ra viền mờ. */
.card-thumb { position: relative; aspect-ratio: 9 / 16; background: var(--bg-2); overflow: hidden; }
/* object-fit: contain -> ảnh dọc hay ngang đều hiện ĐẦY ĐỦ, không cắt xén. */
.card-thumb img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; }
/* Phần trống hai bên (ảnh dọc) hoặc trên dưới (ảnh ngang) lấp bằng chính ảnh đó
   phóng to làm mờ, nhìn liền khối chứ không thành hai vệt đen. */
.thumb-blur {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center;
  filter: blur(26px) saturate(1.4) brightness(.6);
  transform: scale(1.25);
}
.card-thumb .placeholder {
  width: 100%; height: 100%; display: grid; place-items: center;
  font-size: 40px; opacity: .28;
  background: linear-gradient(135deg, var(--card-2), var(--bg-2));
}
.card-badges { position: absolute; z-index: 3; top: 11px; left: 11px; display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  backdrop-filter: blur(8px); letter-spacing: .3px;
}
.badge-free { background: rgba(34, 197, 94, .9); color: #04140a; }
.badge-sale { background: rgba(239, 68, 68, .92); color: #fff; }
.badge-hot { background: rgba(245, 158, 11, .92); color: #1a1000; }

/* --- Xem nhanh video mẫu: rê chuột vào ảnh bìa là hiện nút play --- */
.card.has-demo .card-thumb::after {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: rgba(2, 6, 23, .45); opacity: 0; transition: opacity .22s;
}
.card.has-demo:hover .card-thumb::after { opacity: 1; }
.thumb-play {
  position: absolute; top: 50%; left: 50%; z-index: 4;
  width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center; font-size: 20px; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 28px rgba(139, 92, 246, .45);
  opacity: 0; transform: translate(-50%, -50%) scale(.72);
  transition: opacity .22s, transform .22s, filter .18s;
}
.thumb-play i { margin-left: 3px; }
.card:hover .thumb-play,
.thumb-play:focus-visible { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.thumb-play:hover { filter: brightness(1.12); transform: translate(-50%, -50%) scale(1.08); }
/* máy cảm ứng không có trạng thái rê chuột -> hiện sẵn nút play */
@media (hover: none) {
  .thumb-play { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  .card.has-demo .card-thumb::after { opacity: .28; }
}

/* khung video trong modal xem nhanh */
.video-frame {
  position: relative; aspect-ratio: 16 / 9; background: #000;
  border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--border);
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* video Shorts: khung dọc 9:16, chặn chiều cao để vừa màn hình */
.video-frame.is-vertical { aspect-ratio: 9 / 16; width: min(100%, calc(80vh * 9 / 16)); margin: 0 auto; }
.modal.modal-wide.is-vertical { max-width: 440px; }

.card-body { padding: 16px 17px 17px; display: flex; flex-direction: column; flex: 1; gap: 9px; }
.card-cat { font-size: 12px; color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.card-body h3 { font-size: 16px; font-weight: 700; line-height: 1.4; }
.card-body .summary {
  color: var(--muted); font-size: 13.5px; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); margin-top: 4px;
}
.price-now { font-size: 19px; font-weight: 800; color: #fff; }
.price-now.free { color: #4ade80; }
.price-old { font-size: 13px; color: var(--muted-2); text-decoration: line-through; margin-left: 7px; }
.card-meta { font-size: 12px; color: var(--muted-2); display: flex; gap: 12px; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--r-sm); border: 1px solid transparent;
  font-weight: 600; font-size: 15px; cursor: pointer; transition: .18s; white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 8px 24px rgba(139, 92, 246, .3); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }
.btn-green { background: linear-gradient(135deg, #16a34a, var(--green)); color: #fff; }
.btn-green:hover:not(:disabled) { filter: brightness(1.1); }
.btn-ghost { background: var(--card); border-color: var(--border-2); color: var(--text); }
.btn-ghost:hover:not(:disabled) { border-color: var(--accent); color: #c4b5fd; }
.btn-danger { background: var(--red-soft); border-color: rgba(239, 68, 68, .4); color: #fca5a5; }
.btn-danger:hover:not(:disabled) { background: var(--red); color: #fff; }
.btn-block { width: 100%; }
.btn-lg { padding: 15px 30px; font-size: 16.5px; }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 8px; }

/* ---------------- Trang chi tiết ---------------- */
.breadcrumb { font-size: 13.5px; color: var(--muted-2); padding: 22px 0 6px; }
.breadcrumb a:hover { color: var(--accent); }

.detail { display: grid; grid-template-columns: 1fr 380px; gap: 34px; align-items: start; padding-bottom: 60px; }
.detail h1 { font-size: clamp(24px, 3.4vw, 34px); font-weight: 800; letter-spacing: -.6px; margin: 10px 0 14px; }
.detail-lead { color: var(--muted); font-size: 16px; margin-bottom: 24px; }
.detail-media { border-radius: var(--r); overflow: hidden; border: 1px solid var(--border); background: var(--card); margin-bottom: 26px; }
.detail-media .ratio { position: relative; aspect-ratio: 16 / 9; }
/* Video dọc (Shorts): thu cả khung viền lại cho gọn, không để 2 dải trống hai bên */
.detail-media.is-vertical { width: min(100%, 320px, calc(70vh * 9 / 16)); margin-left: auto; margin-right: auto; }
.detail-media .ratio.is-vertical { aspect-ratio: 9 / 16; width: 100%; }
.detail-media iframe, .detail-media img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
/* Khung ảnh (không phải video) hiện đủ ảnh, không cắt.
   .is-wide = có ảnh ngang riêng cho trang chi tiết -> khung 16:9 vừa khít.
   Không có thì dùng tạm ảnh dọc, khung dựng đứng và chặn chiều cao
   để poster dọc không kéo trang dài quá. */
.detail-media .ratio-img { aspect-ratio: 3 / 4; max-height: 620px; }
.detail-media .ratio-img.is-wide { aspect-ratio: 16 / 9; max-height: none; }
.detail-media .ratio-img img { z-index: 1; object-fit: contain; }

/* Tiêu đề mục trong cột nội dung, vd "Video hướng dẫn sử dụng" */
.detail-section {
  font-size: 20px; font-weight: 800; color: #fff;
  margin: 34px 0 14px; padding-left: 13px; border-left: 3px solid var(--accent);
}

.prose { color: #cbd5e1; font-size: 15.5px; }
.prose p { margin-bottom: 13px; }
.prose h3 { color: #fff; font-size: 19px; font-weight: 700; margin: 26px 0 11px; }
.prose ul { margin: 0 0 14px 20px; }
.prose li { margin-bottom: 7px; }
.prose a { color: var(--accent); text-decoration: underline; }
.prose code { background: var(--bg-2); padding: 2px 7px; border-radius: 6px; font-size: 13.5px; }

/* Thư viện ảnh mô tả thêm: để ảnh đúng tỉ lệ gốc (ảnh chụp màn hình ngang
   hay dọc đều không bị cắt), bấm vào mở ảnh gốc ở tab mới để xem cho rõ. */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 18px 0 6px; align-items: start; }
.gallery a { display: block; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--border); background: var(--bg-2); }
.gallery a:hover { border-color: var(--accent); }
.gallery img { display: block; width: 100%; height: auto; }
@media (max-width: 700px) { .gallery { grid-template-columns: 1fr; } }
.gallery a { cursor: zoom-in; }

/* Khu ảnh trang chi tiết: ảnh ngang chủ đạo + dải thumbnail nhỏ ngay dưới */
.detail-stage { margin-bottom: 26px; }
.detail-stage .detail-media { margin-bottom: 0; }
.detail-stage .detail-media a { position: absolute; inset: 0; z-index: 1; cursor: zoom-in; }
.gal-strip {
  display: flex; gap: 9px; margin-top: 10px;
  overflow-x: auto; overflow-y: hidden;
  padding-bottom: 4px; scrollbar-width: thin;
}
.gal-strip::-webkit-scrollbar { height: 6px; }
.gal-strip::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }
.gal-strip a {
  flex: 0 0 auto; width: 92px; height: 92px; display: block;
  border-radius: var(--r-sm); overflow: hidden;
  border: 1px solid var(--border); background: var(--bg-2);
  cursor: zoom-in; transition: border-color .18s, transform .18s;
}
.gal-strip a:hover { border-color: var(--accent); transform: translateY(-2px); }
.gal-strip img { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 700px) {
  .gal-strip a { width: 74px; height: 74px; }
}

/* Popup xem ảnh phóng to - dùng chung lớp .modal-overlay nên đã có sẵn
   nền mờ, bấm ra ngoài đóng và phím Escape đóng. */
.lightbox { padding: 0; }
.lightbox .lb-img {
  max-width: min(1200px, calc(100vw - 108px));
  max-height: calc(100vh - 108px);
  width: auto; height: auto; object-fit: contain;
  border-radius: var(--r-sm); box-shadow: var(--shadow);
  animation: pop .22s ease; cursor: default;
}
.lightbox .lb-btn {
  position: fixed; display: grid; place-items: center;
  background: rgba(15, 23, 42, .82); border: 1px solid var(--border-2);
  color: #e2e8f0; cursor: pointer; transition: .18s;
}
.lightbox .lb-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.lightbox .lb-close {
  top: 16px; right: 16px; width: 42px; height: 42px;
  border-radius: 999px; font-size: 26px; line-height: 1; padding-bottom: 3px;
}
.lightbox .lb-prev, .lightbox .lb-next {
  top: 50%; transform: translateY(-50%);
  width: 44px; height: 68px; border-radius: 12px; font-size: 17px;
}
.lightbox .lb-prev { left: 16px; }
.lightbox .lb-next { right: 16px; }
.lightbox .lb-count {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: rgba(15, 23, 42, .82); border: 1px solid var(--border-2);
  color: var(--muted); font-size: 13px; font-weight: 600;
  padding: 6px 14px; border-radius: 999px;
}
@media (max-width: 620px) {
  .lightbox .lb-img { max-width: calc(100vw - 24px); max-height: calc(100vh - 120px); }
  .lightbox .lb-prev, .lightbox .lb-next { width: 38px; height: 56px; }
  .lightbox .lb-prev { left: 8px; }
  .lightbox .lb-next { right: 8px; }
}

/* Khung thay chỗ video hướng dẫn khi khách chưa mua */
.locked-media {
  display: grid; place-items: center; text-align: center;
  gap: 6px; padding: 40px 22px; margin: 18px 0 6px;
  background: var(--bg-2); border: 1px dashed var(--border-2); border-radius: var(--r);
}
.locked-media .ic {
  width: 52px; height: 52px; border-radius: 999px; display: grid; place-items: center;
  font-size: 20px; color: var(--amber); background: rgba(245, 158, 11, .13);
  border: 1px solid rgba(245, 158, 11, .4); margin-bottom: 6px;
}
.locked-media .t { font-size: 16.5px; font-weight: 700; color: #fff; }
.locked-media .d { font-size: 13.5px; color: var(--muted-2); max-width: 420px; line-height: 1.65; }
.locked-media .locked-steps { list-style: none; margin: 4px 0 2px; padding: 0; text-align: left; display: grid; gap: 8px; max-width: 460px; }
.locked-media .locked-steps li { font-size: 13.5px; color: var(--text, #e5e7eb); line-height: 1.5; display: flex; gap: 8px; }
.locked-media .locked-steps li i { color: #ef4444; margin-top: 3px; }
@media (max-width: 620px) { .locked-media { padding: 30px 16px; } }

/* hộp mua hàng dính bên phải */
.buy-box {
  position: sticky; top: 90px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 24px; box-shadow: var(--shadow);
}
.buy-box .price-row { display: flex; align-items: baseline; gap: 11px; flex-wrap: wrap; margin-bottom: 6px; }
.buy-box .price-main { font-size: 36px; font-weight: 800; color: #fff; letter-spacing: -1px; }
.buy-box .price-main.free { color: #4ade80; }
.buy-box .save { font-size: 13px; color: #4ade80; font-weight: 600; margin-bottom: 18px; }
.buy-box ul { list-style: none; margin: 20px 0; display: grid; gap: 11px; }
.buy-box ul li { display: flex; gap: 10px; font-size: 14.5px; color: #cbd5e1; }
.buy-box ul li i { color: var(--green); flex: none; margin-top: 4px; }
.buy-note { font-size: 12.5px; color: var(--muted-2); text-align: center; margin-top: 13px; line-height: 1.55; }

/* ---------------- Modal ---------------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(2, 6, 23, .78); backdrop-filter: blur(7px);
  display: none; align-items: center; justify-content: center; padding: 20px;
  overflow-y: auto;
}
.modal-overlay.active { display: flex; }
.modal {
  background: #0d1424; border: 1px solid var(--border-2); border-radius: 22px;
  width: 100%; max-width: 520px; box-shadow: var(--shadow);
  max-height: calc(100vh - 40px); overflow-y: auto; animation: pop .22s ease;
}
.modal.modal-wide { max-width: 720px; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 20px 22px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: #0d1424; z-index: 2;
}
.modal-head h3 { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.modal-close {
  background: none; border: 0; color: var(--muted-2); font-size: 21px;
  cursor: pointer; line-height: 1; padding: 4px 8px; border-radius: 8px;
}
.modal-close:hover { color: var(--text); background: var(--card); }
.modal-body { padding: 22px; }

/* tóm tắt sản phẩm trong modal */
.order-summary {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 15px 17px; margin-bottom: 20px;
}
.order-summary .lbl { font-size: 12px; color: var(--muted-2); margin-bottom: 3px; }
.order-summary .name { font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.order-summary .amt { font-size: 22px; font-weight: 800; color: #c4b5fd; }

/* form */
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; color: var(--muted); margin-bottom: 7px; }
.field label .req { color: var(--red); }
.field input, .field textarea, .field select {
  width: 100%; background: var(--bg-2); border: 1px solid var(--border);
  color: var(--text); padding: 11px 14px; border-radius: var(--r-sm); outline: none; transition: .18s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); background: var(--card); }
.field textarea { resize: vertical; min-height: 92px; line-height: 1.6; }
.field .hint { font-size: 12px; color: var(--muted-2); margin-top: 5px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* --- tab Danh mục trong admin: cây cha/con sửa trực tiếp --- */
.cat-admin { display: flex; flex-direction: column; gap: 12px; }
.cat-node {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-sm); overflow: hidden;
}
.cat-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; flex-wrap: wrap; }
.cat-row-p { background: var(--card-2); border-bottom: 1px solid var(--border); }
.cat-row-c { border-top: 1px solid var(--border); }
.cat-row-c:first-child { border-top: 0; }
.cat-row-ic { width: 18px; text-align: center; color: var(--accent); font-size: 14px; }
.cat-row-c .cat-row-ic { color: var(--muted-2); font-size: 12px; }
.cat-row-name { font-weight: 600; font-size: 14.5px; }
.cat-row-c .cat-row-name { font-weight: 500; font-size: 13.5px; color: var(--muted); }
.cat-row-num {
  font-size: 11.5px; color: var(--muted-2); background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 99px; padding: 2px 9px; white-space: nowrap;
}
.cat-fb { background: var(--accent-soft); color: #c4b5fd; font-size: 11px; }
.cat-row-act { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.cat-row-act .btn[disabled] { opacity: .35; pointer-events: none; }
.cat-kids { padding: 0 14px 4px 30px; }
.cat-kids-empty { padding: 11px 14px 13px 42px; font-size: 12.5px; color: var(--muted-2); }

/* modal sửa danh mục */
.cat-icon-preview {
  width: 42px; height: 42px; flex: none; display: flex; align-items: center; justify-content: center;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--accent); font-size: 16px;
}
.cat-check { display: flex !important; align-items: center; gap: 9px; cursor: pointer; margin-bottom: 0 !important; }
.cat-check input { width: auto !important; margin: 0; accent-color: var(--accent); cursor: pointer; }
.cat-adv > summary {
  list-style: none; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted-2);
  padding: 8px 0; user-select: none;
}
.cat-adv > summary::-webkit-details-marker { display: none; }
.cat-adv > summary::before { content: '\25B8'; display: inline-block; margin-right: 7px; transition: transform .18s; }
.cat-adv[open] > summary::before { transform: rotate(90deg); }
.cat-adv > summary:hover { color: var(--text); }

@media (max-width: 640px) {
  .cat-row-act { width: 100%; margin-left: 0; }
  .cat-kids { padding-left: 16px; }
  .cat-kids-empty { padding-left: 20px; }
}

/* cây danh mục sidebar trong form admin - tick nhiều ô, 1 tool nằm nhiều danh mục */
.cat-tree {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 12px;
}
.cat-tree-g { min-width: 0; }
.cat-tree label {
  display: flex; align-items: center; gap: 8px; margin: 0 0 4px;
  font-size: 13.5px; font-weight: 500; color: var(--muted); cursor: pointer;
}
.cat-tree label:hover { color: var(--text); }
.cat-tree input[type=checkbox] { width: auto; margin: 0; padding: 0; accent-color: var(--accent); cursor: pointer; }
.cat-tree-p { font-weight: 700 !important; color: var(--text) !important; }
.cat-tree-p i { width: 16px; text-align: center; font-size: 13px; color: var(--accent); }
.cat-tree-c { padding-left: 18px; }

/* ô nhập nhiều danh mục (admin) */
.tagbox {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 7px 9px; cursor: text; transition: .18s;
}
.tagbox:focus-within { border-color: var(--accent); background: var(--card); }
.tagbox #catItems { display: contents; }
.tagbox input {
  flex: 1; min-width: 130px; width: auto;
  background: none; border: 0; padding: 4px 4px; border-radius: 0;
}
.tagbox input:focus { background: none; border: 0; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-soft); border: 1px solid rgba(139, 92, 246, .34);
  color: #c4b5fd; font-size: 13px; font-weight: 600;
  padding: 4px 6px 4px 11px; border-radius: 999px; white-space: nowrap;
}
.tag-chip button {
  background: none; border: 0; cursor: pointer; color: #c4b5fd;
  font-size: 16px; line-height: 1; padding: 0 4px; border-radius: 999px; opacity: .65;
}
.tag-chip button:hover { opacity: 1; color: #fff; background: rgba(239, 68, 68, .55); }
.tag-suggest {
  display: none; position: absolute; top: calc(100% + 5px); left: 0; right: 0; z-index: 20;
  background: var(--card); border: 1px solid var(--border-2);
  border-radius: var(--r-sm); box-shadow: var(--shadow);
  max-height: 220px; overflow-y: auto; padding: 5px;
}
.tag-suggest.open { display: block; }
.tag-opt {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 11px; border-radius: 8px; cursor: pointer;
  font-size: 14px; color: var(--muted);
}
.tag-opt i { font-size: 11px; color: var(--muted-2); }
.tag-opt:hover, .tag-opt.hi { background: var(--accent-soft); color: #c4b5fd; }
.tag-opt.hi i, .tag-opt:hover i { color: #c4b5fd; }

/* thư viện ảnh phụ của workflow (admin) */
.gal-edit {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px; margin-top: 11px;
}
.gal-empty {
  grid-column: 1 / -1; font-size: 12.5px; color: var(--muted-2);
  border: 1px dashed var(--border-2); border-radius: var(--r-sm);
  padding: 14px; text-align: center;
}
.gal-item {
  position: relative; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); overflow: hidden; cursor: grab;
}
.gal-item:active { cursor: grabbing; }
.gal-item img { display: block; width: 100%; height: 96px; object-fit: cover; }
.gal-item .gal-path {
  font-size: 10.5px; color: var(--muted-2); padding: 5px 7px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gal-tools {
  position: absolute; top: 5px; right: 5px; display: flex; gap: 4px;
  opacity: 0; transition: .18s;
}
.gal-item:hover .gal-tools { opacity: 1; }
.gal-tools button {
  width: 24px; height: 24px; display: grid; place-items: center;
  background: rgba(15, 23, 42, .86); border: 1px solid var(--border-2);
  color: #e2e8f0; border-radius: 7px; cursor: pointer; font-size: 10.5px;
}
.gal-tools button:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.gal-tools button.del:hover { background: #ef4444; border-color: #ef4444; }
.gal-tools button[disabled] { opacity: .3; cursor: default; }
.gal-tools button[disabled]:hover { background: rgba(15, 23, 42, .86); border-color: var(--border-2); color: #e2e8f0; }
@media (hover: none) { .gal-tools { opacity: 1; } }

/* QR + thông tin chuyển khoản */
.qr-area { display: grid; grid-template-columns: 200px 1fr; gap: 16px; margin-bottom: 18px; }
.qr-box {
  background: #fff; border-radius: 14px; padding: 10px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.qr-box img { width: 100%; border-radius: 8px; }
.qr-status { font-size: 12px; color: #475569; font-weight: 600; display: flex; align-items: center; gap: 7px; padding-bottom: 4px; }
.bank-rows { display: grid; gap: 9px; align-content: start; }
.bank-row {
  background: var(--card); border: 1px solid var(--border); border-radius: 11px;
  padding: 9px 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.bank-row .k { font-size: 11.5px; color: var(--muted-2); }
.bank-row .v { font-weight: 700; font-size: 14.5px; word-break: break-all; }
.bank-row .v.hl { color: #c4b5fd; }
.copy-btn {
  background: none; border: 0; color: var(--muted-2); cursor: pointer;
  padding: 6px; border-radius: 7px; flex: none;
}
.copy-btn:hover { color: var(--accent); background: var(--accent-soft); }

.memo-box {
  background: var(--accent-soft); border: 1px solid rgba(139, 92, 246, .38);
  border-radius: 13px; padding: 13px 15px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.memo-box .k { font-size: 11.5px; color: #a5b4fc; margin-bottom: 2px; }
.memo-box .v { font-size: 21px; font-weight: 800; color: #ddd6fe; letter-spacing: 1.2px; }

/* khối hướng dẫn nhắn Zalo (điểm khác biệt: xác nhận thủ công) */
.zalo-cta {
  background: var(--amber-soft); border: 1px solid rgba(245, 158, 11, .42);
  border-radius: 14px; padding: 15px 16px; margin-bottom: 16px;
}
.zalo-cta .title {
  display: flex; align-items: center; gap: 9px;
  font-weight: 700; color: #fcd34d; font-size: 14.5px; margin-bottom: 7px;
}
.zalo-cta p { font-size: 13.5px; color: #fde68a; line-height: 1.6; margin-bottom: 12px; }
.zalo-cta p b { color: #fff; }
.zalo-cta .btn { width: 100%; background: #0068ff; color: #fff; }
.zalo-cta .btn:hover { filter: brightness(1.12); }

.countdown { text-align: center; font-size: 13px; color: var(--muted-2); margin-bottom: 14px; }
.countdown b { color: var(--amber); font-variant-numeric: tabular-nums; }

/* trạng thái chờ / thành công */
.wait-state, .done-state { text-align: center; padding: 14px 0 6px; }
.wait-state .spin {
  width: 46px; height: 46px; margin: 0 auto 16px; border-radius: 50%;
  border: 3px solid var(--border-2); border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.wait-state h4 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.wait-state p { color: var(--muted); font-size: 14px; line-height: 1.65; }
.done-state .tick {
  width: 62px; height: 62px; margin: 0 auto 16px; border-radius: 50%;
  background: var(--green-soft); border: 2px solid var(--green);
  display: grid; place-items: center; font-size: 30px; color: var(--green);
  animation: pop .3s ease;
}
.done-state h4 { font-size: 20px; font-weight: 800; margin-bottom: 8px; color: #fff; }
.done-state p { color: var(--muted); font-size: 14.5px; margin-bottom: 20px; }

.alert {
  border-radius: 12px; padding: 12px 15px; font-size: 13.5px;
  display: flex; gap: 10px; align-items: flex-start; margin-bottom: 15px; line-height: 1.6;
}
.alert i { margin-top: 3px; flex: none; }
.alert-err { background: var(--red-soft); border: 1px solid rgba(239, 68, 68, .35); color: #fca5a5; }
.alert-info { background: rgba(59, 130, 246, .1); border: 1px solid rgba(59, 130, 246, .3); color: #93c5fd; }
.alert-warn { background: var(--amber-soft); border: 1px solid rgba(245, 158, 11, .35); color: #fcd34d; }
.alert-ok { background: var(--green-soft); border: 1px solid rgba(34, 197, 94, .35); color: #86efac; }

/* ---------------- Trang mở khóa ---------------- */
.unlock-hero { text-align: center; padding: 46px 0 30px; }
.unlock-hero .tick {
  width: 70px; height: 70px; margin: 0 auto 18px; border-radius: 50%;
  background: var(--green-soft); border: 2px solid var(--green);
  display: grid; place-items: center; font-size: 34px; color: var(--green);
}
.unlock-hero h1 { font-size: 27px; font-weight: 800; margin-bottom: 9px; }
.unlock-hero p { color: var(--muted); }
.unlock-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 28px; margin-bottom: 22px;
}
.unlock-card h2 { font-size: 21px; font-weight: 800; margin-bottom: 8px; }
.deliver-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 700; font-size: 17px;
  padding: 18px; border-radius: var(--r); margin: 22px 0 10px;
  box-shadow: 0 12px 30px rgba(139, 92, 246, .32); transition: .18s;
}
.deliver-btn:hover { filter: brightness(1.1); transform: translateY(-2px); }

/* Thẻ quà tặng: viền vàng để tách khỏi nút mở workflow màu tím, tránh khách
   bấm nhầm quà tặng rồi tưởng đó là sản phẩm chính */
.gift-card { border-color: rgba(245, 158, 11, .42); background: linear-gradient(180deg, var(--amber-soft), var(--card)); }
.gift-card .deliver-btn {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  box-shadow: 0 12px 30px rgba(245, 158, 11, .28);
}
.watermark {
  text-align: center; font-size: 12px; color: var(--muted-2);
  border-top: 1px dashed var(--border-2); padding-top: 14px; margin-top: 20px;
}

/* ---------------- Admin ---------------- */
.admin-login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.admin-login .box {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 34px; width: 100%; max-width: 400px; box-shadow: var(--shadow);
}
.admin-login h1 { font-size: 21px; font-weight: 800; margin-bottom: 6px; text-align: center; }
.admin-login .sub { color: var(--muted-2); font-size: 13.5px; text-align: center; margin-bottom: 24px; }

.admin-bar {
  background: var(--card); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.admin-bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 62px; max-width: 1440px; }
.tabs { display: flex; gap: 6px; }
.tab {
  padding: 9px 17px; border-radius: 10px; cursor: pointer; border: 0;
  background: none; color: var(--muted); font-weight: 600; font-size: 14.5px;
  display: flex; align-items: center; gap: 8px; transition: .18s;
}
.tab:hover { color: var(--text); background: var(--card-2); }
.tab.active { background: var(--accent-soft); color: #c4b5fd; }
.tab .count {
  background: var(--red); color: #fff; font-size: 11px; font-weight: 800;
  min-width: 19px; height: 19px; border-radius: 999px; display: grid; place-items: center; padding: 0 6px;
}
.admin-main { max-width: 1440px; margin: 0 auto; padding: 26px 20px 70px; }
.panel { display: none; }
.panel.active { display: block; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.panel-head h2 { font-size: 20px; font-weight: 800; }

/* --- thanh lọc danh sách workflow trong admin --- */
.wf-filters {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.wf-filters select,
.wf-search input {
  background: var(--card); border: 1px solid var(--border); color: var(--text);
  padding: 9px 13px; border-radius: 9px; font-size: 13.5px; font-family: inherit;
}
.wf-filters select { cursor: pointer; }
.wf-filters select:focus,
.wf-search input:focus { outline: none; border-color: var(--accent); }
.wf-search { position: relative; flex: 1; min-width: 210px; max-width: 340px; }
.wf-search i {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 12.5px; color: var(--muted-2); pointer-events: none;
}
.wf-search input { width: 100%; padding-left: 33px; }
.wf-count { font-size: 13px; color: var(--muted-2); margin-left: auto; white-space: nowrap; }

.table-wrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th {
  text-align: left; font-size: 12px; font-weight: 700; color: var(--muted-2);
  text-transform: uppercase; letter-spacing: .5px; padding: 13px 15px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
td { padding: 13px 15px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, .022); }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px; }

.status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: 999px; white-space: nowrap;
}
.st-pending { background: rgba(100, 116, 139, .18); color: #cbd5e1; }
.st-awaiting_confirm { background: var(--amber-soft); color: #fcd34d; border: 1px solid rgba(245, 158, 11, .35); }
.st-paid { background: var(--green-soft); color: #4ade80; }
.st-expired { background: rgba(100, 116, 139, .14); color: var(--muted-2); }
.st-cancelled { background: var(--red-soft); color: #fca5a5; }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
/* Ô tìm đơn hàng: bọc icon + input + nút xoá thành một khối liền */
.order-search { position: relative; display: flex; align-items: center; }
.order-search > i {
  position: absolute; left: 12px; font-size: 13px; color: var(--muted-2); pointer-events: none;
}
.order-search input {
  background: var(--card); border: 1px solid var(--border); color: var(--text);
  padding: 9px 30px 9px 33px; border-radius: 9px; width: 260px; font-size: 14px;
}
.order-search input:focus { outline: none; border-color: var(--accent); }
.order-search input::-webkit-search-cancel-button { display: none; }
.order-search button {
  position: absolute; right: 8px; background: none; border: 0; display: none;
  color: var(--muted-2); font-size: 19px; line-height: 1; cursor: pointer; padding: 0 3px;
}
.order-search button:hover { color: var(--text); }
@media (max-width: 640px) { .order-search input { width: 100%; } .order-search { flex: 1 1 100%; } }

.empty { text-align: center; padding: 56px 20px; color: var(--muted-2); }
.empty i { font-size: 40px; opacity: .35; display: block; margin-bottom: 14px; }

.setting-grid { display: grid; gap: 16px; }
.setting-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 15px 17px; }
.setting-item label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 3px; }
.setting-item .desc { font-size: 12px; color: var(--muted-2); margin-bottom: 9px; }
.setting-item input, .setting-item textarea, .setting-item select {
  width: 100%; background: var(--bg-2); border: 1px solid var(--border);
  color: var(--text); padding: 10px 13px; border-radius: 9px; outline: none;
}
.setting-item input:focus, .setting-item textarea:focus { border-color: var(--accent); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { display: none; }
.switch .track {
  width: 44px; height: 25px; border-radius: 999px; background: var(--border-2);
  position: relative; transition: .2s; flex: none;
}
.switch .track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 19px; height: 19px; border-radius: 50%; background: #fff; transition: .2s;
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(19px); }
/* Bên trong .field / .setting-item, rule "label { display: block }" có độ ưu tiên
   cao hơn .switch nên nuốt mất display:inline-flex -> nút gạt sập thành 1 chấm
   tròn đè lên chữ. Khai báo lại đúng ngữ cảnh, không cần !important. */
.field label.switch,
.setting-item label.switch {
  display: inline-flex; margin-bottom: 0;
  font-size: 14px; font-weight: 500; color: var(--text);
}

/* ---------------- Toast ---------------- */
.toast-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 300; display: grid; gap: 10px; }
.toast {
  background: var(--card); border: 1px solid var(--border-2); border-left: 3px solid var(--accent);
  border-radius: 11px; padding: 13px 18px; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow); animation: slidein .24s ease; max-width: 340px;
}
.toast.ok { border-left-color: var(--green); }
.toast.err { border-left-color: var(--red); }
@keyframes slidein { from { opacity: 0; transform: translateX(24px); } }

/* ---------------- Footer ---------------- */
.site-footer {
  border-top: 1px solid var(--border); padding: 34px 0;
  color: var(--muted-2); font-size: 13.5px; margin-top: 40px;
}
.site-footer .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a:hover { color: var(--accent); }

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .detail { grid-template-columns: 1fr; }
  .buy-box { position: static; }
}
@media (max-width: 620px) {
  .site-header .wrap { height: 60px; }
  /* trên điện thoại chỉ giữ 2 link quan trọng nhất */
  .nav a:not(.zalo):not(.nav-orders) { display: none; }
  .nav { gap: 4px; }
  .nav a { padding: 8px 11px; font-size: 13px; }
  .nav-orders i { margin-right: 2px; }
  .hero { padding: 40px 0 26px; }
  .hero-stats { gap: 22px; }
  .qr-area { grid-template-columns: 1fr; }
  .qr-box { max-width: 240px; margin: 0 auto; }
  .field-row { grid-template-columns: 1fr; }
  /* 1 cột trên điện thoại thì ảnh bìa 9/16 cao gần hết màn hình -> để 2 cột */
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card-body { padding: 12px 12px 13px; gap: 7px; }
  .card-body h3 { font-size: 14.5px; }
  .card-body .summary { font-size: 12.5px; }
  .card-cat { font-size: 11px; }
  .price-now { font-size: 16px; }
  .price-old { font-size: 12px; margin-left: 5px; }
  .card-meta { font-size: 11px; gap: 8px; }
  .detail-section { font-size: 18px; margin-top: 28px; }
  .modal-body { padding: 18px; }
  .toast-wrap { left: 16px; right: 16px; bottom: 16px; }
  .toast { max-width: none; }
}

/* ============================================================
   TÀI KHOẢN THÀNH VIÊN + AFFILIATE + FAQ
   (phần bổ sung, dùng chung bộ biến màu ở đầu file)
   ============================================================ */

/* ---------------- Menu tài khoản trên header ---------------- */
.nav a.nav-login { border: 1px solid var(--border-2); color: var(--text); }
.nav a.nav-login:hover { border-color: var(--accent); }

.user-menu { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 12px 5px 5px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer; transition: .18s;
}
.user-btn:hover { border-color: var(--border-2); }
.user-btn img, .user-ava {
  width: 28px; height: 28px; border-radius: 50%; flex: none; object-fit: cover;
}
.user-ava {
  display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.user-btn .user-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-btn i { font-size: 10px; color: var(--muted-2); transition: .2s; }
.user-menu.open .user-btn i { transform: rotate(180deg); }

.user-drop {
  display: none; position: absolute; right: 0; top: calc(100% + 9px); min-width: 250px;
  background: var(--card); border: 1px solid var(--border-2);
  border-radius: var(--r-sm); box-shadow: var(--shadow); overflow: hidden; z-index: 80;
}
.user-menu.open .user-drop { display: block; }
.user-drop-head { padding: 13px 15px; border-bottom: 1px solid var(--border); }
.user-drop-head .n { font-weight: 700; font-size: 14px; }
.user-drop-head .m { font-size: 12px; color: var(--muted-2); word-break: break-all; }
.user-drop a {
  display: flex; align-items: center; gap: 10px; padding: 11px 15px;
  font-size: 14px; color: var(--muted); border-radius: 0;
}
.user-drop a:hover { background: var(--card-2); color: var(--text); }
.user-drop a i { width: 16px; text-align: center; font-size: 13px; }
.user-drop a.danger { border-top: 1px solid var(--border); color: #fca5a5; }

/* ---------------- Trang đăng nhập / đăng ký ---------------- */
.auth-page {
  max-width: 470px; margin: 0 auto; padding: 34px 20px 70px;
  position: relative; z-index: 1;
}
.auth-back { margin-bottom: 22px; }
.auth-back a { color: var(--muted); font-size: 14.5px; display: inline-flex; align-items: center; gap: 9px; }
.auth-back a:hover { color: var(--text); }

.auth-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 34px 30px 30px; box-shadow: var(--shadow);
}
.auth-logo {
  width: 46px; height: 46px; border-radius: 13px; margin: 0 auto 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; font-size: 22px;
  box-shadow: 0 8px 22px rgba(139, 92, 246, .4);
}
.auth-card h1 { font-size: 26px; font-weight: 800; text-align: center; letter-spacing: -.5px; }
.auth-sub { text-align: center; color: var(--muted); font-size: 14.5px; margin: 7px 0 24px; }

.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 11px;
  width: 100%; padding: 12px 16px; border-radius: var(--r-sm);
  background: var(--bg-2); border: 1px solid var(--border-2);
  color: var(--text); font-size: 14.5px; font-weight: 600; transition: .18s;
}
.btn-google:hover { background: var(--card-2); border-color: var(--accent); }

.auth-or {
  display: flex; align-items: center; gap: 14px;
  margin: 20px 0; color: var(--muted-2); font-size: 11.5px; font-weight: 600; letter-spacing: 1.4px;
}
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.field label.label-row, .label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.label-link { font-size: 12.5px; color: #a78bfa; font-weight: 500; }
.label-link:hover { text-decoration: underline; }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px !important; }
.pw-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border: 0; background: none; color: var(--muted-2);
  cursor: pointer; border-radius: 8px;
}
.pw-eye:hover { color: var(--text); background: var(--card-2); }

.auth-foot { text-align: center; margin-top: 20px; color: var(--muted); font-size: 14px; }
.auth-foot a { color: #a78bfa; font-weight: 600; }
.auth-foot a:hover { text-decoration: underline; }

/* ---------------- Trang tài khoản ---------------- */
.acc-page { padding: 34px 20px 60px; }
.acc-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 22px; }
.acc-head h1 { font-size: 25px; font-weight: 800; letter-spacing: -.4px; }
.acc-head p { color: var(--muted-2); font-size: 13.5px; }
.acc-head > a { margin-left: auto; }
.acc-ava { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; flex: none; }
.acc-ava-txt {
  display: grid; place-items: center; font-size: 25px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.stat-box { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 17px 19px; }
.stat-box .k { font-size: 12.5px; color: var(--muted-2); display: flex; align-items: center; gap: 7px; }
.stat-box .v { font-size: 23px; font-weight: 800; margin-top: 5px; }
.stat-box .v.green { color: var(--green); }
.stat-box .v.purple { color: #c4b5fd; }
.stat-box .v.amber { color: var(--amber); }

.acc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.acc-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 22px;
}
.acc-card h2 {
  font-size: 17px; font-weight: 700; margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
}
.acc-card h2 i { color: #a78bfa; font-size: 15px; }
.acc-card-full { margin-top: 16px; }
.acc-note { color: var(--muted-2); font-size: 13px; margin-bottom: 14px; }
.acc-card input:disabled { opacity: .55; cursor: not-allowed; }

.order-line {
  display: flex; align-items: center; gap: 15px; flex-wrap: wrap;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.order-line:last-child { border-bottom: 0; padding-bottom: 0; }
.order-thumb {
  width: 74px; height: 52px; border-radius: 9px; overflow: hidden; flex: none;
  background: var(--bg-2); display: grid; place-items: center; font-size: 22px;
}
.order-thumb img { width: 100%; height: 100%; object-fit: cover; }
.order-info { flex: 1; min-width: 190px; }
.order-info .t { font-weight: 650; font-size: 15px; }
.order-info .m { font-size: 12.5px; color: var(--muted-2); margin-top: 3px; }
.order-act { flex: none; }

/* ---------------- Trang chương trình affiliate ---------------- */
.aff-hero { padding-bottom: 26px; }
.aff-badges {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 28px;
}
.aff-badges div {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 14px 22px; min-width: 148px;
}
.aff-badges b { display: block; font-size: 20px; font-weight: 800; color: #c4b5fd; }
.aff-badges span { font-size: 12.5px; color: var(--muted-2); }

.aff-cta { margin-top: 30px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.aff-cta > .btn { min-width: 260px; }
.aff-quick {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
  font-size: 13px; color: var(--muted-2);
}
.aff-quick b { color: #c4b5fd; font-size: 13px; word-break: break-all; }

.step-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.step-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 26px 22px; text-align: center;
}
.step-card .n {
  width: 42px; height: 42px; border-radius: 50%; margin: 0 auto 16px;
  display: grid; place-items: center; font-size: 18px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.step-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.step-card p { color: var(--muted); font-size: 14px; }

.rate-table {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); overflow: hidden;
}
.rate-row {
  display: grid; grid-template-columns: 2.2fr 1fr .7fr 1fr; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid var(--border); align-items: center; font-size: 14.5px;
}
.rate-row:last-child { border-bottom: 0; }
.rate-head { background: var(--bg-2); font-size: 12.5px; color: var(--muted-2); font-weight: 600; }
.rate-row .nm { font-weight: 600; }
.rate-row .hl { color: var(--green); font-weight: 700; }

.payout-box {
  display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(139, 92, 246, .1), rgba(34, 197, 94, .06));
  border: 1px solid rgba(139, 92, 246, .3); border-radius: var(--r-lg); padding: 28px;
}
.payout-box .ic {
  width: 52px; height: 52px; border-radius: 15px; flex: none;
  display: grid; place-items: center; font-size: 22px; color: #c4b5fd;
  background: var(--accent-soft); border: 1px solid rgba(139, 92, 246, .35);
}
.payout-box > div:last-child { flex: 1; min-width: 260px; }
.payout-box h3 { font-size: 20px; font-weight: 800; margin-bottom: 9px; }
.payout-box p { color: var(--muted); font-size: 14.5px; }
.payout-box ul { list-style: none; margin-top: 15px; display: grid; gap: 9px; }
.payout-box li { display: flex; gap: 11px; font-size: 14px; color: var(--text); }
.payout-box li i { color: var(--green); margin-top: 5px; font-size: 12px; }

/* ---------------- Câu hỏi thường gặp ---------------- */
.faq-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.faq-head .ic {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: grid; place-items: center; font-size: 17px; color: #c4b5fd;
  background: var(--accent-soft); border: 1px solid rgba(139, 92, 246, .3);
}
.faq-head h2 { font-size: 24px; font-weight: 800; letter-spacing: -.4px; }
.faq-head p { color: var(--muted-2); font-size: 13.5px; }

.faq-list { display: grid; gap: 11px; }
.faq-item {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-sm); overflow: hidden; transition: border-color .18s;
}
.faq-item[open] { border-color: var(--border-2); }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 17px 20px; cursor: pointer; font-weight: 650; font-size: 15.5px;
  list-style: none; user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: #c4b5fd; }
.faq-item summary i { font-size: 12px; color: var(--muted-2); transition: transform .2s; flex: none; }
.faq-item[open] summary i { transform: rotate(180deg); }
.faq-body {
  padding: 0 20px 18px; color: var(--muted); font-size: 14.5px; line-height: 1.75;
}
.faq-body a { color: #a78bfa; text-decoration: underline; word-break: break-all; }

/* ---------------- Affiliate Dashboard ---------------- */
.aff-dash { padding: 30px 20px 60px; }
.dash-head { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; margin-bottom: 22px; }
.dash-head h1 { font-size: 27px; font-weight: 800; letter-spacing: -.5px; }
.dash-head p { color: var(--muted-2); font-size: 13.5px; }
.dash-head > a { margin-left: auto; }
.dash-ic {
  width: 44px; height: 44px; border-radius: 13px; flex: none;
  display: grid; place-items: center; font-size: 19px; color: #c4b5fd;
  background: var(--accent-soft); border: 1px solid rgba(139, 92, 246, .32);
}
.payout-alert { align-items: flex-start; margin-bottom: 16px; }

.dash-top { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 22px; }
.dash-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px;
  background: var(--border); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden;
}
.ds { background: var(--card); padding: 19px; }
.ds .ic {
  width: 30px; height: 30px; border-radius: 9px; margin-bottom: 11px;
  display: grid; place-items: center; font-size: 13px; color: var(--muted);
  background: var(--card-2); border: 1px solid var(--border);
}
.ds .k { font-size: 12.5px; color: var(--muted-2); }
.ds .v { font-size: 22px; font-weight: 800; margin-top: 3px; }
.ds .v.green { color: var(--green); }
.ds .v.purple { color: #c4b5fd; }

.dash-payout {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 20px;
}
.dash-payout .k { font-size: 13px; color: var(--muted-2); }
.dash-payout .v { font-size: 30px; font-weight: 800; color: var(--green); margin: 3px 0 14px; }
.pay-bar { height: 7px; border-radius: 99px; background: var(--bg-2); overflow: hidden; margin-bottom: 10px; }
.pay-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--green)); }
.pay-state { font-size: 13px; color: var(--muted); }
.pay-state.ok {
  color: #86efac; background: var(--green-soft); border: 1px solid rgba(34, 197, 94, .3);
  border-radius: var(--r-sm); padding: 11px 13px; display: flex; gap: 9px; align-items: flex-start;
}
.pay-state.ok i { margin-top: 3px; }
.pay-warn {
  display: flex; gap: 9px; align-items: flex-start; margin-top: 13px;
  background: var(--amber-soft); border: 1px solid rgba(245, 158, 11, .32);
  border-radius: var(--r-sm); padding: 11px 13px; font-size: 12.5px; color: #fcd34d;
}
.pay-bank {
  margin-top: 13px; font-size: 12.5px; color: var(--muted-2);
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.pay-bank a { color: #a78bfa; text-decoration: underline; }

.dash-tabs { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 18px; }
.dt {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px;
  background: transparent; border: 1px solid var(--border); color: var(--muted);
  font-size: 14px; font-weight: 500; cursor: pointer; transition: .18s;
}
.dt:hover { color: var(--text); background: var(--card); }
.dt.active { background: var(--card); border-color: var(--border-2); color: #fff; font-weight: 600; }
.dt i { font-size: 12.5px; }

.dash-panel { display: none; }
.dash-panel.active { display: block; }

.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 16px; }
.mini-stats > div { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 16px 18px; }
.mini-stats .k { font-size: 12.5px; color: var(--muted-2); display: flex; align-items: center; gap: 7px; }
.mini-stats .v { font-size: 21px; font-weight: 800; margin-top: 4px; }
.mini-stats .v.purple { color: #c4b5fd; }
.mini-stats .v.amber { color: var(--amber); }

.chart-card, .share-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 22px; margin-bottom: 16px;
}
.chart-card h3, .share-card h3 {
  font-size: 16px; font-weight: 700; margin-bottom: 18px;
  display: flex; align-items: center; gap: 10px;
}
.chart-card h3 i, .share-card h3 i { color: #a78bfa; font-size: 14px; }

.bars { display: flex; align-items: flex-end; gap: 6px; height: 190px; }
.bcol { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; }
.bcol .stack {
  flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px;
  border-bottom: 1px solid var(--border);
}
.bcol .stack span { width: 45%; max-width: 16px; border-radius: 4px 4px 0 0; min-height: 2px; }
.b-click { background: rgba(139, 92, 246, .55); }
.b-order { background: var(--green); }
.bcol .lbl { font-size: 10.5px; color: var(--muted-2); white-space: nowrap; }
.legend { display: flex; gap: 20px; margin-top: 16px; font-size: 12.5px; color: var(--muted-2); }
.legend .dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 7px; }
.legend .dot.c { background: rgba(139, 92, 246, .55); }
.legend .dot.o { background: var(--green); }

.code-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 13px 15px; margin-bottom: 11px;
}
.code-row .k { font-size: 12px; color: var(--muted-2); min-width: 96px; }
.code-row .v { flex: 1; min-width: 180px; font-size: 13.5px; word-break: break-all; color: #c4b5fd; }
.code-row .v.big { font-size: 20px; font-weight: 800; letter-spacing: 2px; }

.share-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.sb {
  display: inline-flex; align-items: center; gap: 9px; padding: 10px 17px;
  border-radius: var(--r-sm); font-size: 14px; font-weight: 600; color: #fff;
  border: 0; cursor: pointer; transition: .18s;
}
.sb:hover { filter: brightness(1.12); }
.sb.fb { background: #1877f2; }
.sb.zl { background: #0068ff; }
.sb.tg { background: #229ed9; }
.sb.tx { background: var(--card-2); border: 1px solid var(--border-2); color: var(--text); }

.plink-list { display: grid; gap: 9px; }
.plink {
  display: flex; align-items: center; gap: 13px; flex-wrap: wrap;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 12px 14px;
}
.plink .t { font-weight: 600; font-size: 14px; flex: 1 1 210px; }
.plink .t .pz { color: var(--muted-2); font-weight: 400; font-size: 12.5px; margin-left: 8px; }
.plink .u { flex: 2 1 280px; font-size: 12px; color: var(--muted-2); word-break: break-all; }

/* ---------------- Điện thoại ---------------- */
@media (max-width: 900px) {
  .dash-top { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr; }
  .rate-row { grid-template-columns: 1.6fr 1fr 1fr; font-size: 13px; padding: 12px 14px; }
  .rate-row > div:nth-child(3) { display: none; }
}
@media (max-width: 620px) {
  /* Rule cũ ẩn mọi link trừ .zalo/.nav-orders — nhưng nút Đăng nhập là lối vào
     duy nhất của khách chưa có tài khoản nên phải cho hiện lại.
     Chọn 3 lớp để thắng độ ưu tiên của rule cũ. */
  .site-header .nav a.nav-login { display: inline-flex; align-items: center; gap: 6px; }
  /* Đã đăng nhập thì "Đơn của tôi" đã nằm trong menu tài khoản -> bỏ cho đỡ chật */
  .site-header .nav.nav-auth a.nav-orders { display: none; }
  /* Nút Zalo thu về chỉ còn icon, nhường chỗ cho 2 link chữ */
  .nav a.zalo { font-size: 0; padding: 9px 13px; }
  .nav a.zalo i { font-size: 15px; margin: 0; }

  /* Không cho chữ trên header xuống dòng; tên site co lại nhường chỗ */
  .nav a { white-space: nowrap; }
  .logo { font-size: 15px; min-width: 0; }
  .logo > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .user-btn { padding: 4px 8px 4px 4px; }
  .user-btn .user-name { display: none; }
  .user-drop { min-width: 220px; }
  .auth-card { padding: 26px 20px 24px; }
  .auth-card h1 { font-size: 23px; }
  .acc-head > a { margin-left: 0; width: 100%; justify-content: center; }
  .dash-head > a { margin-left: 0; }
  .dash-head h1 { font-size: 22px; }
  .bars { height: 150px; gap: 3px; }
  .bcol .lbl { font-size: 9px; transform: rotate(-45deg); }
  .faq-item summary { font-size: 14.5px; padding: 15px 16px; }
  .faq-body { padding: 0 16px 16px; font-size: 14px; }
  .payout-box { padding: 20px; gap: 16px; }
  .aff-badges div { min-width: 132px; padding: 12px 16px; }
}
/* Màn hình rất hẹp: bỏ hẳn chữ tên site, chỉ giữ logo — nếu không thì
   "Đơn của tôi" + "Đăng nhập" bị ép xuống dòng làm vỡ header. */
@media (max-width: 480px) {
  .logo > span:last-child { display: none; }
}

/* ---------------- Trang chính sách / điều khoản ---------------- */
.legal { padding: 40px 20px 60px; }
.legal-head { margin-bottom: 26px; padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.legal-head h1 { font-size: clamp(26px, 4vw, 34px); font-weight: 800; letter-spacing: -.6px; }
.legal-head p { color: var(--muted-2); font-size: 13.5px; margin-top: 7px; }
.legal .prose { font-size: 15px; }
.legal .prose h3 {
  font-size: 18px; font-weight: 700; color: #fff;
  margin: 30px 0 12px; padding-top: 4px;
}
.legal .prose ul { margin: 10px 0 10px 2px; }
.legal .prose li { margin-bottom: 8px; }
.legal-foot {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
  margin-top: 40px; padding-top: 26px; border-top: 1px solid var(--border);
}

/* Hàng link chính sách trong footer */
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; }
.foot-links a { color: var(--muted-2); font-size: 13px; }
.foot-links a:hover { color: #c4b5fd; text-decoration: underline; }

/* ---------------- Trạng thái "đã mua" ---------------- */
/* Huy hiệu trên ảnh bìa ngoài trang chủ */
.badge-owned {
  background: rgba(34, 197, 94, .92); color: #052e16;
  display: inline-flex; align-items: center; gap: 5px;
}
/* Thay chỗ hiện giá ở chân card: đã mua thì mời mở, không mời mua nữa */
.price-now.owned { color: var(--green); font-size: 15px; display: inline-flex; align-items: center; gap: 7px; }

/* Dải trạng thái trong hộp mua hàng ở trang chi tiết */
.owned-tag {
  display: flex; align-items: center; gap: 10px;
  background: var(--green-soft); border: 1px solid rgba(34, 197, 94, .32);
  color: #86efac; border-radius: var(--r-sm);
  padding: 12px 15px; margin-bottom: 14px;
  font-size: 14.5px; font-weight: 600;
}
.owned-tag.pending {
  background: var(--amber-soft); border-color: rgba(245, 158, 11, .32); color: #fcd34d;
}

/* ---------------- Khoe quà tặng kèm (dưới ảnh bìa trang chi tiết) ----------------
   Viền gạch đứt vàng để trông như phiếu quà tặng, tách hẳn khỏi các khối
   viền liền khác trên trang nên mắt bắt được ngay. */
.gift-teaser {
  display: flex; align-items: center; gap: 15px; flex-wrap: wrap;
  margin: 20px 0 4px; padding: 15px 18px;
  background: linear-gradient(135deg, rgba(245, 158, 11, .13), rgba(245, 158, 11, .05));
  border: 2px dashed rgba(245, 158, 11, .55);
  border-radius: var(--r);
}
.gift-teaser .ic {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-size: 19px; color: #0b1120;
  background: linear-gradient(135deg, #fbbf24, var(--amber));
  box-shadow: 0 6px 16px rgba(245, 158, 11, .35);
}
.gift-teaser .txt { flex: 1; min-width: 160px; }
.gift-teaser .t {
  font-size: 11.5px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--amber);
}
.gift-teaser .n { font-size: 16px; font-weight: 700; color: #fde68a; margin-top: 2px; }
.gift-teaser .free-tag,
.gift-teaser .got {
  flex: none; font-size: 11.5px; font-weight: 800; letter-spacing: .5px;
  padding: 6px 13px; border-radius: 999px;
  background: var(--amber); color: #451a03;
}
.gift-teaser .got { background: var(--green); color: #052e16; }

@media (max-width: 620px) {
  .gift-teaser { padding: 13px 14px; gap: 12px; }
  .gift-teaser .ic { width: 36px; height: 36px; font-size: 16px; }
  .gift-teaser .n { font-size: 14.5px; }
}

/* ============================================================
   SIDEBAR TRÁI
   Máy tính (>=1100px): cột cố định bên trái, body thụt vào 260px.
   Màn nhỏ hơn: sidebar trượt ra từ trái, mở bằng nút ba gạch.
   Nhóm xổ ra dùng thẻ <details> nên không cần JavaScript.
   ============================================================ */
.side-nav {
  position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 70;
  background: var(--bg-2); border-right: 1px solid var(--border);
  overflow-y: auto; overscroll-behavior: contain;
  padding: 0 12px 26px; display: flex; flex-direction: column; gap: 2px;
}
.side-nav::-webkit-scrollbar { width: 8px; }
.side-nav::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }

.side-brand {
  position: sticky; top: 0; z-index: 2; margin: 0 -12px 8px; padding: 15px 12px;
  background: var(--bg-2); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.side-brand a { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15px; }
.side-close {
  display: none; background: none; border: 0; color: var(--muted);
  font-size: 19px; cursor: pointer; padding: 4px 6px;
}

.side-label {
  font-size: 11px; font-weight: 700; letter-spacing: .9px; text-transform: uppercase;
  color: var(--muted-2); padding: 16px 12px 7px;
}

.side-link {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: var(--r-sm);
  color: var(--muted); font-size: 14px; font-weight: 500; transition: .16s;
}
.side-link i { width: 17px; text-align: center; font-size: 14px; }
.side-link:hover { color: var(--text); background: var(--card); }
.side-link.active { color: #c4b5fd; background: var(--accent-soft); font-weight: 600; }
/* nhóm cha không có danh mục con: là link phẳng nhưng vẫn đậm như nhóm khác */
.side-link.side-flat { font-weight: 600; }
.side-link.side-flat.active .side-count { color: #c4b5fd; border-color: var(--accent-soft); }

/* --- nhóm xổ --- */
.side-group > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: var(--r-sm);
  color: var(--muted); font-size: 14px; font-weight: 600; transition: .16s;
}
.side-group > summary::-webkit-details-marker { display: none; }
.side-group > summary:hover { color: var(--text); background: var(--card); }
.side-group[open] > summary { color: var(--text); }
.side-ic { width: 17px; text-align: center; font-size: 14px; }
.side-gname { flex: 1; min-width: 0; }
.side-count {
  font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px;
  background: var(--card-2); color: var(--muted-2); border: 1px solid var(--border);
}
.side-caret { font-size: 11px; color: var(--muted-2); transition: transform .18s; }
.side-group[open] > summary .side-caret { transform: rotate(180deg); }

.side-list { list-style: none; margin: 2px 0 6px; padding-left: 16px; border-left: 1px solid var(--border); margin-left: 20px; }
.side-list a {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border-radius: 8px;
  color: var(--muted-2); font-size: 13px; line-height: 1.4; transition: .16s;
}
.side-list a:hover { color: var(--text); background: var(--card); }
.side-list a.active { color: #c4b5fd; background: var(--accent-soft); font-weight: 600; }
.side-tt { flex: 1; min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* danh sách trong nhóm là DANH MỤC CON: icon mũi tên + số workflow */
.side-tag-ic { font-size: 10px; color: var(--muted-2); flex: none; opacity: .7; }
.side-list a:hover .side-tag-ic,
.side-list a.active .side-tag-ic { color: inherit; opacity: 1; }
.side-num {
  flex: none; font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 99px;
  background: var(--card-2); color: var(--muted-2); border: 1px solid var(--border);
}
.side-list a.active .side-num { color: #c4b5fd; border-color: var(--accent-soft); }
.side-empty { font-size: 12.5px; color: var(--muted-2); padding: 6px 12px 10px 36px; }

.side-zalo {
  margin: 20px 0 0; padding: 10px 12px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center; gap: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 14px; font-weight: 600;
}
.side-zalo:hover { filter: brightness(1.1); }

/* --- nút mở & lớp phủ (chỉ dùng ở màn nhỏ) --- */
.side-toggle {
  display: none; position: fixed; left: 14px; top: 15px; z-index: 65;
  width: 38px; height: 38px; border-radius: var(--r-sm); cursor: pointer;
  background: var(--card); border: 1px solid var(--border-2); color: var(--text); font-size: 15px;
}
.side-backdrop {
  display: none; position: fixed; inset: 0; z-index: 68;
  background: rgba(2, 6, 23, .66); backdrop-filter: blur(2px);
}

/* --- máy tính: chừa chỗ cho sidebar --- */
/* sidebar đã mang tên thương hiệu rồi, để thêm ở header nữa là thừa
   và trên điện thoại nó chen với nút ba gạch */
body.has-sidebar .site-header .logo { display: none; }
body.has-sidebar .site-header .wrap { justify-content: flex-end; }
/* Trang chủ có sidebar: khung 1200px cũ để trống 2 rìa trên màn rộng
   -> nới ra cho lưới thẻ lên 5 cột. Trang chi tiết giữ 1200px cho dễ đọc. */
body.page-home .wrap { max-width: 1560px; }

@media (min-width: 1100px) {
  body.has-sidebar { padding-left: 260px; }
}

/* --- máy tính nhỏ / máy tính bảng / điện thoại --- */
@media (max-width: 1099px) {
  body.has-sidebar .side-nav { transform: translateX(-100%); transition: transform .22s ease; }
  body.has-sidebar.side-open .side-nav { transform: none; box-shadow: var(--shadow); }
  body.has-sidebar.side-open .side-backdrop { display: block; }
  body.has-sidebar .side-toggle { display: block; }
  body.has-sidebar .side-close { display: block; }
  body.has-sidebar.side-open { overflow: hidden; }
}

/* ---------------- Nút "Khóa học" nổi bật trên header ----------------
   Dùng tông vàng cam để tách hẳn khỏi nút Zalo tím bên cạnh,
   thêm vệt sáng chạy ngang + nhãn "MỚI" cho bắt mắt. */
.nav a.nav-course {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: 6px;
  color: #1a1204; font-weight: 700;
  background: linear-gradient(135deg, #fde047, #f59e0b 55%, #f97316);
  box-shadow: 0 0 0 1px rgba(253, 224, 71, .35), 0 6px 20px rgba(245, 158, 11, .38);
  animation: course-glow 2.4s ease-in-out infinite;
}
.nav a.nav-course:hover {
  color: #1a1204; background: linear-gradient(135deg, #fef08a, #fbbf24 55%, #fb923c);
  transform: translateY(-1px);
}
.nav a.nav-course::after {
  content: ""; position: absolute; top: 0; left: -60%;
  width: 40%; height: 100%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .7), transparent);
  transform: skewX(-20deg);
  animation: course-shine 3.2s ease-in-out infinite;
}
.nav-course-new {
  font-style: normal; font-size: 9.5px; font-weight: 800; letter-spacing: .4px;
  line-height: 1; padding: 3px 5px; border-radius: 999px;
  color: #fff; background: #dc2626;
}
@keyframes course-glow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(253, 224, 71, .35), 0 6px 20px rgba(245, 158, 11, .38); }
  50%      { box-shadow: 0 0 0 1px rgba(253, 224, 71, .6),  0 6px 28px rgba(245, 158, 11, .65); }
}
@keyframes course-shine {
  0%, 60% { left: -60%; }
  100%    { left: 130%; }
}
@media (prefers-reduced-motion: reduce) {
  .nav a.nav-course, .nav a.nav-course::after { animation: none; }
  .nav a.nav-course::after { display: none; }
}

/* ---------------- Ưu đãi học viên trong hộp mua (tool trả phí) ---------------- */
.student-promo {
  margin-top: 18px; padding: 14px 15px;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, rgba(253, 224, 71, .12), rgba(249, 115, 22, .12));
  border: 1px solid rgba(251, 191, 36, .45);
}
.student-promo-title {
  display: flex; align-items: flex-start; gap: 9px;
  color: #fde68a; font-weight: 800; font-size: 13.5px; line-height: 1.45; letter-spacing: .2px;
}
.student-promo-title i { color: #fbbf24; margin-top: 2px; }
.student-promo-btn {
  margin-top: 12px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 14px; border-radius: var(--r-sm);
  color: #1a1204; font-weight: 700; font-size: 14px; text-decoration: none;
  background: linear-gradient(135deg, #fde047, #f59e0b 55%, #f97316);
  box-shadow: 0 6px 18px rgba(245, 158, 11, .3);
  transition: transform .15s, filter .15s;
}
.student-promo-btn:hover { color: #1a1204; filter: brightness(1.08); transform: translateY(-1px); }

.side-link.side-course { color: #fbbf24; font-weight: 600; }
.side-link.side-course:hover { color: #fde047; background: rgba(245, 158, 11, .12); }

/* Điện thoại: rule cũ ẩn mọi link header -> cho nút Khóa học hiện lại, thu về icon */
@media (max-width: 620px) {
  .site-header .nav a.nav-course { display: inline-flex; padding: 8px 11px; }
  .nav a.nav-course span, .nav a.nav-course .nav-course-new { display: none; }
  .nav a.nav-course i { font-size: 15px; }
}
/* Màn hẹp: thêm nút Khóa học làm logo bị bóp méo -> "Đơn của tôi" thu về icon,
   logo không cho co */
@media (max-width: 480px) {
  .logo-mark { flex-shrink: 0; }
  .nav a.nav-orders { font-size: 0; padding: 9px 12px; }
  .nav a.nav-orders i { font-size: 15px; margin: 0; }
}

/* ---------------- Nút + popup "Hướng dẫn Veo 3" ở sidebar ---------------- */
button.side-link {
  width: 100%; background: none; border: 0; font-family: inherit; text-align: left; cursor: pointer;
}
.side-link.side-guide { color: #fca5a5; font-weight: 600; }
.side-link.side-guide i { color: #ef4444; }
.side-link.side-guide:hover { color: #fecaca; background: rgba(239, 68, 68, .1); }

.veo-guide-lead { color: var(--muted); font-size: 14.5px; line-height: 1.65; margin-bottom: 16px; }
.veo-guide-lead b { color: var(--text); }
.veo-steps { margin: 18px 0 0; padding-left: 20px; display: grid; gap: 9px; font-size: 14px; color: var(--muted); line-height: 1.6; }
.veo-steps b { color: var(--text); }
.veo-steps a { color: #c4b5fd; text-decoration: underline; }
.veo-guide-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.veo-guide-actions .btn { flex: 1 1 200px; justify-content: center; }
