/* ══════════════════════════════════════════════════════════════════════════
   NGUYỆT ĐÌNH - PHỄU EBOOK · CSS KHUNG CHUNG
   ──────────────────────────────────────────────────────────────────────────
   CHỈ chứa phần KHUNG lặp lại y hệt ở cả 7 trang: thanh cảnh báo, thanh tiến
   độ, màn QR, popup giữ chân, nút chính/nút từ chối, dải xem thử.
   Phần giao diện RIÊNG của từng trang vẫn nội tuyến trong chính trang đó.

   Bảng màu bám đúng DNA Nguyệt Đình: Đen Tím + Vàng Trăng.
   ══════════════════════════════════════════════════════════════════════════ */

:root {
  --void: #09080F;
  --deep: #120D24;
  --midnight: #1E1540;
  --midnight-2: #241A4D;
  --dusk: #2D2060;
  --amethyst: #6B3FA0;
  --violet: #9B59D0;
  --gold: #C9A84C;
  --gold-pale: #E8D98A;
  --cream: #F5F0E8;
  --mist: #B8B0C8;
  --mist-dim: #8B7FA8;
  --green: #4fd07a;
  --le: 22px;              /* trục lề chung - trang tự khai --le sẽ đè lên giá trị này */
}
@media (max-width: 760px) { :root { --le: 16px; } }

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; overflow-x: hidden; }

body {
  background: var(--void);
  color: var(--cream);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .nd-serif {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  margin: 0;
  text-wrap: balance;
}

a { color: var(--gold-pale); }

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* Khung chữ hẹp - trang phễu phải một cột, cuộn nhanh, không phải trang giới thiệu */
.nd-wrap {
  max-width: 560px;
  margin: 0 auto;
  /* Một trục lề duy nhất qua token --le (22px desktop / 16px mobile). Trang nào
     chưa khai --le thì rơi về 18px như cũ - không vỡ. (Luật lề Xanh-Đỏ.) */
  padding: 0 var(--le, 18px) 96px;
}

/* ── Thanh cảnh báo dính ────────────────────────────────────────────────
   Tự ẩn khi khách đã từ chối 2 lần liên tiếp (JS đặt display:none).       */
.nd-canhbao {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(201, 168, 76, .14);
  border-bottom: 1px solid rgba(201, 168, 76, .4);
  color: var(--gold-pale);
  text-align: center;
  padding: 11px 16px;
  font-size: 13.5px;
  font-weight: 500;
  backdrop-filter: blur(8px);
}
.nd-canhbao b { color: var(--cream); }

/* ── Thanh tiến độ ─────────────────────────────────────────────────────── */
.nd-tiendo { position: sticky; top: 0; z-index: 59; background: var(--void); padding: 9px 18px 7px; }
.nd-canhbao + .nd-tiendo { top: 41px; }
.nd-td-nhan { font-size: 11.5px; color: var(--mist-dim); letter-spacing: .4px; margin-bottom: 5px; }
.nd-td-rang { height: 4px; background: rgba(45, 32, 96, .7); border-radius: 3px; overflow: hidden; }
.nd-td-day {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--amethyst), var(--gold));
  transition: width .7s cubic-bezier(.22, .8, .3, 1);
}

/* ── Đồng hồ đếm ngược ─────────────────────────────────────────────────── */
.nd-dh {
  text-align: center;
  background: rgba(201, 168, 76, .07);
  border: 1px solid rgba(201, 168, 76, .28);
  border-radius: 14px;
  padding: 18px;
  margin: 22px 0;
}
.nd-dh-nhan { font-size: 12px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--mist-dim); }
.nd-dh-so {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 44px;
  font-weight: 700;
  color: var(--gold-pale);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  margin: 2px 0;
}
.nd-dh-phu { font-size: 12.5px; color: var(--mist-dim); }
.nd-dh-het { font-family: 'Cormorant Garamond', serif; font-size: 22px; color: var(--mist); }
.nd-dh-them {
  margin-top: 9px; background: transparent; border: 1px solid var(--dusk);
  color: var(--mist); border-radius: 100px; padding: 9px 18px; font-size: 13px;
  font-family: inherit; cursor: pointer;
}

/* ── Nút ───────────────────────────────────────────────────────────────── */
.nd-nut-chinh {
  display: block;
  width: 100%;
  background: linear-gradient(135deg, var(--gold), var(--gold-pale));
  color: #120D24;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  border: 0;
  border-radius: 100px;
  padding: 18px 22px;
  min-height: 56px;
  cursor: pointer;
  margin-top: 16px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.nd-nut-chinh:hover { transform: translateY(-1px); box-shadow: 0 8px 26px rgba(201, 168, 76, .28); }
.nd-nut-chinh:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }
/* Nút cứu hộ ở màn QR (PA3, Sếp chốt 14/08): ẩn 90 giây đầu. Khách trung thực
   tiền về sau 5-30 giây là tự sang trang, không bao giờ nhìn thấy nút này. */
.nd-nut-chinh.nd-an { display: none; }

/* Nút từ chối: nhẹ hơn hẳn về THỊ GIÁC nhưng vùng chạm vẫn đủ 48px, và chữ
   không nhỏ hơn 13px - giấu nút từ chối vừa là mẹo bẩn vừa hỏng khả năng tiếp cận. */
.nd-tu-choi {
  display: block;
  width: 100%;
  background: none;
  border: 0;
  color: var(--mist);
  font-family: inherit;
  font-size: 13.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 15px;
  min-height: 48px;
  cursor: pointer;
  margin-top: 6px;
}
.nd-tu-choi:hover { color: var(--cream); }

/* ── Ô nhập ────────────────────────────────────────────────────────────────
   font-size:16px là BẮT BUỘC - Safari trên iPhone tự phóng to trang khi bấm
   vào ô nhập nhỏ hơn 16px. Phễu này phần lớn khách đến từ TikTok/Facebook
   trên điện thoại, nên đây không phải chi tiết nhỏ.                        */
.nd-o {
  width: 100%;
  background: var(--deep);
  border: 1px solid var(--dusk);
  border-radius: 12px;
  color: var(--cream);
  font-family: inherit;
  font-size: 16px;
  padding: 15px 16px;
  margin-bottom: 11px;
  min-height: 52px;
}
.nd-o::placeholder { color: var(--mist-dim); }
.nd-o:focus { border-color: var(--violet); outline: none; }
.nd-loi { color: #e8776b; font-size: 13.5px; min-height: 20px; margin: 2px 0 6px; }

/* ── Màn QR ────────────────────────────────────────────────────────────── */
.nd-qr-hop {
  background: linear-gradient(160deg, var(--midnight-2), var(--midnight));
  border: 1px solid rgba(201, 168, 76, .3);
  border-radius: 18px;
  padding: 24px 20px;
  text-align: center;
  max-width: 420px;
  margin: 20px auto;
}
.nd-qr-tieu { font-family: 'Cormorant Garamond', serif; font-size: 21px; color: var(--gold-pale); line-height: 1.3; }
.nd-qr-tien {
  font-family: 'Cormorant Garamond', serif; font-size: 34px; font-weight: 700;
  color: var(--cream); margin: 4px 0 14px; font-variant-numeric: tabular-nums;
}
.nd-qr-anh {
  width: min(260px, 72vw); height: auto; background: #fff;
  padding: 10px; border-radius: 14px; display: block; margin: 0 auto 16px;
}
.nd-qr-thieu { color: var(--mist); font-size: 14px; margin: 12px 0 16px; }
.nd-qr-tt { text-align: left; background: rgba(0, 0, 0, .25); border-radius: 12px; padding: 13px 15px; margin-bottom: 12px; }
.nd-qr-d { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; padding: 4px 0; }
.nd-qr-d span { color: var(--mist-dim); }
.nd-qr-d b { color: var(--cream); font-weight: 500; text-align: right; word-break: break-all; }
.nd-qr-chep { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 0; }
.nd-chep { min-width: 92px; }
.nd-cach { text-align: left; margin-bottom: 14px; }
.nd-cach-b { padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--dusk); }
.nd-cach-b.nd-cach-cuoi { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }
.nd-cach-n { font-size: 12.5px; line-height: 1.6; color: var(--mist); margin-bottom: 9px; }
.nd-cach-n b { color: var(--cream); font-weight: 600; }
.nd-cach-so { display: inline-block; font-weight: 700; color: var(--gold-pale); margin-right: 4px; white-space: nowrap; }
.nd-cach-nut { width: 100%; min-height: 46px; }
.nd-cach-luuy { margin-top: 9px; font-size: 11.5px; line-height: 1.55; color: var(--gold-pale); opacity: .92; }
.nd-chep {
  flex: 1; background: transparent; border: 1px solid var(--dusk); color: var(--mist);
  border-radius: 100px; padding: 12px 8px; font-size: 12.5px; font-family: inherit;
  cursor: pointer; min-height: 46px;
}
.nd-chep:hover { border-color: var(--violet); color: var(--cream); }
.nd-qr-trang { font-size: 13.5px; color: var(--mist-dim); margin-bottom: 4px; min-height: 22px; }
.nd-qr-trang.nd-da-nhan { color: var(--green); font-weight: 500; }
.nd-truc-trac { display: inline-block; margin-top: 12px; font-size: 12.5px; color: var(--mist-dim); }
.nd-da-lay-p { color: var(--mist); font-size: 14px; margin: 8px 0 0; }

/* ── Popup giữ chân ────────────────────────────────────────────────────── */
.nd-ov {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(4, 3, 10, .82);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  backdrop-filter: blur(4px);
}
.nd-ov-hop {
  background: linear-gradient(160deg, var(--midnight-2), var(--deep));
  border: 1px solid var(--dusk);
  border-radius: 20px;
  padding: 26px 22px 22px;
  max-width: 460px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  position: relative;
}
.nd-ov-dong {
  position: absolute; top: 8px; right: 8px;
  width: 44px; height: 44px;
  background: none; border: 0; color: var(--mist-dim);
  font-size: 26px; line-height: 1; cursor: pointer;
}
.nd-ov-tieu { font-size: 22px; color: var(--gold-pale); line-height: 1.3; padding-right: 34px; }
.nd-ov-dan { color: var(--mist); font-size: 14px; margin: 9px 0 16px; }
.nd-chips { display: flex; flex-direction: column; gap: 8px; margin-bottom: 13px; }
.nd-chip {
  background: var(--deep); border: 1px solid var(--dusk); color: var(--mist);
  border-radius: 12px; padding: 13px 15px; font-size: 14px; font-family: inherit;
  text-align: left; cursor: pointer; min-height: 48px;
}
.nd-chip:hover { border-color: var(--violet); }
.nd-chip.on { background: rgba(201, 168, 76, .12); border-color: var(--gold); color: var(--cream); }
.nd-ov-o {
  width: 100%; background: var(--deep); border: 1px solid var(--dusk);
  border-radius: 12px; color: var(--cream); font-family: inherit; font-size: 16px;
  padding: 13px 15px; resize: vertical;
}
.nd-ov-boqua {
  display: block; width: 100%; background: none; border: 0; color: var(--mist-dim);
  font-family: inherit; font-size: 13px; padding: 14px; cursor: pointer; margin-top: 4px;
}

/* ── Dải xem thử ───────────────────────────────────────────────────────── */
.nd-demo-dai {
  position: fixed; top: 0; left: 0; z-index: 10000;
  background: var(--amethyst); color: #fff;
  font-size: 11px; letter-spacing: .8px; padding: 5px 12px;
  border-bottom-right-radius: 10px;
}
.nd-demo-nut {
  position: fixed; right: 12px; bottom: 12px; z-index: 10000;
  display: flex; flex-direction: column; gap: 7px;
}
.nd-demo-nut button {
  background: var(--midnight); border: 1px solid var(--violet); color: var(--cream);
  border-radius: 100px; padding: 12px 16px; font-size: 12.5px; font-family: inherit; cursor: pointer;
  min-height: 44px;   /* Ly nghiệm thu bằng điện thoại - nút cũng phải đủ vùng chạm */
}

/* ── Chân trang ────────────────────────────────────────────────────────── */
.nd-chan {
  text-align: center; padding: 34px 18px 26px;
  border-top: 1px solid rgba(45, 32, 96, .5);
  margin-top: 40px;
}
.nd-chan-ten { font-family: 'Cormorant Garamond', serif; color: var(--gold); font-size: 15px; letter-spacing: 2px; }
.nd-chan-p { color: var(--mist-dim); font-size: 12px; margin-top: 5px; line-height: 1.7; }

/* ── Thanh CTA dính đáy (điện thoại) ───────────────────────────────────── */
.nd-day {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
  background: linear-gradient(180deg, rgba(9, 8, 15, 0), var(--void) 32%);
  padding: 16px 18px calc(14px + env(safe-area-inset-bottom));
  display: none;
}
.nd-day.hien { display: block; }
.nd-day .nd-nut-chinh { margin-top: 0; }

@media (min-width: 780px) {
  .nd-day { display: none !important; }
}

/* ══════════════════════════════════════════════════════════════════════════
   MODULE SẢN PHẨM - value-stack kiểu Dan Henry
   Mỗi món hàng, dù nhỏ, được dựng thành một khối đủ 4 thành tố:
   thumbnail · tên hấp dẫn · mô tả chi tiết · neo giá trị.
   Dùng chung ở cả 5 trang sau phễu để đồng bộ tuyệt đối.
   ══════════════════════════════════════════════════════════════════════════ */
.pm {
  display: flex; gap: 14px; align-items: flex-start;
  background: linear-gradient(160deg, var(--midnight-2), var(--midnight));
  border: 1px solid var(--dusk); border-radius: 16px;
  padding: 15px; margin: 12px 0;
}
.pm-thumb {
  flex: 0 0 88px; width: 88px; height: 88px; border-radius: 12px; overflow: hidden;
  position: relative; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(130% 130% at 30% 18%, var(--dusk), var(--void));
  border: 1px solid rgba(201, 168, 76, .28);
}
.pm-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pm-thumb > svg { width: 40px; height: 40px; color: var(--gold-pale); opacity: .92; }
.pm-thumb::after { /* ánh trăng nhẹ ở góc, cho tile đồ vật có chiều sâu */
  content: ""; position: absolute; top: -30%; right: -30%; width: 70%; height: 70%;
  background: radial-gradient(circle, rgba(232, 217, 138, .22), transparent 70%);
  pointer-events: none;
}
.pm-thumb.co-anh::after { display: none; }
.pm-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(9, 8, 15, .32);
}
.pm-play svg { width: 30px; height: 30px; color: #fff; }
.pm-body { flex: 1; min-width: 0; }
.pm-ten {
  font-family: 'Cormorant Garamond', Georgia, serif; font-size: 20px; font-weight: 600;
  color: var(--cream); line-height: 1.24; text-wrap: balance;
}
.pm-mo { color: var(--mist); font-size: 14px; line-height: 1.62; margin: 5px 0 0; text-wrap: pretty; }
.pm-tri { display: inline-block; margin-top: 9px; font-size: 12.5px; color: var(--gold-pale); letter-spacing: .3px; }
.pm-tri s { color: var(--mist-dim); }
.pm-nhan { /* nhãn nhỏ trong module: "Nhiều người chọn nhất", "Tặng"… */
  display: inline-block; margin-top: 9px; margin-right: 6px;
  font-size: 11px; letter-spacing: .6px; text-transform: uppercase;
  color: var(--gold-pale); background: rgba(201, 168, 76, .13);
  border: 1px solid rgba(201, 168, 76, .3); border-radius: 100px; padding: 3px 10px;
}

/* Cụm module lồng trong một thẻ (vd 3 món giấy trong 1 combo) */
.pm-nhom { background: linear-gradient(160deg, var(--midnight-2), var(--midnight)); border: 1px solid var(--dusk); border-radius: 16px; padding: 15px; margin: 12px 0; }
.pm-nhom > .pm { background: rgba(9, 8, 15, .25); border-color: rgba(45, 32, 96, .55); margin: 10px 0 0; padding: 12px; }
.pm-nhom > .pm:first-of-type { margin-top: 12px; }
.pm-nhom-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.pm-nhom-h .pm-ten { font-size: 21px; }
.pm-nhom-h .g { font-family: 'Cormorant Garamond', serif; font-size: 20px; font-weight: 700; color: var(--gold-pale); white-space: nowrap; }
.pm-nhom-p { color: var(--mist); font-size: 13.5px; margin: 4px 0 0; }
.pm-nhom .pm-thumb { flex-basis: 64px; width: 64px; height: 64px; }
.pm-nhom .pm-thumb > svg { width: 30px; height: 30px; }
.pm-nhom .pm-ten { font-size: 17px; }
.pm-nhom .pm-mo { font-size: 13px; }

/* Khung video Ly thuyết minh - CHỪA SẴN, gắn video thật sau khi quay xong.
   Thay .pm-video-cho bằng <video>/<iframe> là xong, không đụng gì khác. */
.pm-video {
  border: 1px dashed rgba(201, 168, 76, .42); border-radius: 16px;
  background: rgba(201, 168, 76, .05); aspect-ratio: 16 / 9;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 7px; text-align: center; color: var(--mist-dim); margin: 4px 0 20px; padding: 16px;
}
.pm-video svg { width: 46px; height: 46px; color: var(--gold); opacity: .75; }
.pm-video b { color: var(--gold-pale); font-family: 'Cormorant Garamond', serif; font-size: 19px; font-weight: 600; }
.pm-video span { font-size: 12.5px; max-width: 34ch; line-height: 1.5; }
