/* Nền chung cho 5 layout demo GuCigar: màu, chữ, nút, thẻ sản phẩm, bộ lọc, khung đọc */
:root {
  --bg: #17120f;
  --bg-2: #201915;
  --bg-3: #2a211b;
  --wood: #3a2618;
  --cream: #efe6d6;
  --muted: #a99c8e;
  --dim: #7a6e63;
  --line: rgba(239, 230, 214, 0.1);
  --line-2: rgba(239, 230, 214, 0.18);
  --gold: #c9a66b;
  --gold-hi: #e8cf98;
  --gold-lo: #9c7a3f;
  --gold-grad: linear-gradient(180deg, #f1d891 0%, #d4aa52 55%, #a9792a 100%);
  --brown: #6e3a1a;
  --serif: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --sans: 'Be Vietnam Pro', system-ui, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --wrap: 1180px;
  --pad: clamp(18px, 4.5vw, 40px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--cream);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: 0.005em; }
p { margin: 0; }
[hidden] { display: none !important; }
html[data-lock] body { overflow: hidden; }

.wrap { width: 100%; max-width: calc(var(--wrap) + var(--pad) * 2); margin: 0 auto; padding: 0 var(--pad); }
.eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); }
.muted { color: var(--muted); }
.gold-text { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.serif-i { font-family: var(--serif); font-style: italic; }

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border-radius: 999px;
  background: var(--gold-grad); color: #1a120c;
  font-weight: 600; font-size: 15px; letter-spacing: 0.02em;
  box-shadow: 0 10px 30px rgba(201, 166, 107, 0.18);
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 14px 36px rgba(201, 166, 107, 0.28); }
.btn svg { width: 18px; height: 18px; }
.btn-line {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--cream); font-size: 14.5px;
  transition: border-color 0.2s, background 0.2s;
}
.btn-line:hover { border-color: var(--gold); background: rgba(201, 166, 107, 0.06); }
.btn-block { width: 100%; }
.micro { font-size: 13px; color: var(--muted); line-height: 1.55; }
.micro b { color: var(--cream); font-weight: 500; }

/* ---------- Logo ---------- */
.logo img { height: 34px; width: auto; }

/* ---------- Thẻ sản phẩm ---------- */
.pcard { display: flex; flex-direction: column; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; transition: border-color 0.25s, transform 0.25s var(--ease); }
.pcard:hover { border-color: var(--line-2); transform: translateY(-2px); }
.pcard .ph { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: #0f0c0a; }
.pcard .ph img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.pcard:hover .ph img { transform: scale(1.04); }
.pcard .badge { position: absolute; left: 12px; top: 12px; padding: 5px 10px; border-radius: 999px; background: rgba(23, 18, 15, 0.78); backdrop-filter: blur(6px); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-hi); }
.pcard .match { position: absolute; left: 12px; bottom: 12px; right: 12px; padding: 6px 10px; border-radius: 8px; background: rgba(201, 166, 107, 0.92); color: #1a120c; font-size: 12px; font-weight: 600; }
.pcard .bd { display: grid; gap: 8px; padding: 16px 16px 18px; }
.pcard h3 { font-size: 21px; line-height: 1.2; }
.pcard .hook { font-family: var(--serif); font-style: italic; font-size: 16.5px; color: var(--muted); line-height: 1.35; }
.pcard .meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12.5px; color: var(--dim); }
.pcard .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.price { font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--gold-hi); letter-spacing: 0.02em; }
.price small { font-family: var(--sans); font-size: 11.5px; color: var(--dim); font-weight: 400; margin-left: 4px; }
.more { font-size: 13px; color: var(--gold); display: inline-flex; align-items: center; gap: 4px; }

.dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--bg-3); border: 1px solid var(--line-2); }
.dots i.on { background: var(--gold); border-color: var(--gold); }

/* ---------- Bộ lọc chọn theo gu ---------- */
.quiz { display: grid; gap: 18px; }
.quiz .qh { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.quiz .qt { font-size: 14px; font-weight: 600; color: var(--cream); }
.quiz .qn { font-size: 12px; color: var(--dim); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip { display: grid; gap: 1px; text-align: left; padding: 9px 14px; border-radius: 12px; border: 1px solid var(--line-2); font-size: 14px; transition: all 0.2s; }
.chip span { font-size: 11.5px; color: var(--dim); }
.chip:hover { border-color: var(--gold); }
.chip[aria-pressed='true'] { background: var(--gold); border-color: var(--gold); color: #1a120c; }
.chip[aria-pressed='true'] span { color: #3b2a16; }
.quiz-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }
.quiz-foot b { color: var(--gold-hi); }
.reset { font-size: 13px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

.tabs { display: flex; gap: 6px; padding: 4px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs button { padding: 9px 18px; border-radius: 999px; font-size: 14px; color: var(--muted); white-space: nowrap; transition: all 0.2s; }
.tabs button[aria-selected='true'] { background: var(--cream); color: #1a120c; font-weight: 600; }

.empty-match { padding: 22px; border: 1px dashed var(--line-2); border-radius: 14px; color: var(--muted); font-size: 14.5px; }
.empty-match a { color: var(--gold); text-decoration: underline; }

/* ---------- Bảng trượt (chi tiết sản phẩm, đọc bài) ---------- */
.sheet { position: fixed; inset: 0; z-index: 80; visibility: hidden; }
.sheet.open { visibility: visible; }
.sheet .scrim { position: absolute; inset: 0; background: rgba(8, 6, 5, 0.62); opacity: 0; transition: opacity 0.35s var(--ease); }
.sheet.open .scrim { opacity: 1; }
.sheet .panel {
  position: absolute; right: 0; top: 0; bottom: 0; width: min(560px, 100%);
  background: var(--bg-2); border-left: 1px solid var(--line);
  transform: translateX(100%); transition: transform 0.45s var(--ease);
  display: flex; flex-direction: column;
}
.sheet.open .panel { transform: none; }
.sheet .bar { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.sheet .x { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); }
.sheet .scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet .foot { padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg-2); display: grid; gap: 8px; }
@media (max-width: 640px) {
  .sheet .panel { top: auto; height: 92vh; width: 100%; border-left: 0; border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; transform: translateY(100%); }
}

/* Chi tiết sản phẩm: não trái (thông số) + não phải (trải nghiệm) */
.pd-gallery { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 16px 18px 0; scrollbar-width: none; }
.pd-gallery img { flex: 0 0 78%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 12px; scroll-snap-align: start; }
.pd-body { padding: 18px 18px 26px; display: grid; gap: 18px; }
.pd-body h2 { font-size: 30px; }
.spec { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.spec div { display: grid; grid-template-columns: 26px 92px 1fr; gap: 8px; align-items: baseline; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.spec div:last-child { border-bottom: 0; }
.spec .k { color: var(--dim); font-size: 12.5px; }
.spec .ic { color: var(--gold); }
.story p { font-family: var(--serif); font-size: 20px; line-height: 1.5; color: var(--cream); }
.story p + p { margin-top: 12px; }
.story p:first-child::first-letter { color: var(--gold); }
.lr { display: grid; gap: 10px; }
.lr .lab { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); }

/* Khung đọc bài */
.read { padding: 26px 22px 30px; max-width: 640px; }
.read h2 { font-size: 32px; margin: 8px 0 6px; }
.read .rm { font-size: 13px; color: var(--dim); margin-bottom: 22px; }
.read p { font-size: 17.5px; line-height: 1.8; color: #e5dccb; }
.read p + p { margin-top: 16px; }
.read .teaser { padding: 14px 16px; margin-top: 20px; border-radius: 10px; background: var(--bg-3); color: var(--muted); font-size: 14px; }
.read-cta { margin-top: 30px; padding: 20px; border-radius: 14px; border: 1px solid rgba(201, 166, 107, 0.35); background: linear-gradient(180deg, rgba(201, 166, 107, 0.08), transparent); display: grid; gap: 12px; }
.read-cta p { font-family: var(--serif); font-size: 19px; line-height: 1.4; color: var(--cream); }

/* ---------- Thông báo, thanh dưới ---------- */
.toast { position: fixed; left: 50%; bottom: 90px; z-index: 99; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px; background: #0e0b09; border: 1px solid rgba(201, 166, 107, 0.4); font-size: 14px; transition: all 0.3s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: rgba(23, 18, 15, 0.92); backdrop-filter: blur(12px); border-top: 1px solid var(--line); display: none; gap: 10px; align-items: center; }
.dock .btn { min-height: 46px; flex: 1; font-size: 14px; }
.dock .q { width: 46px; height: 46px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); }
@media (max-width: 860px) { .dock { display: flex; } body.has-dock { padding-bottom: 76px; } }

/* QR cho máy tính */
.qr { display: none; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-2); }
.qr img { width: 84px; height: 84px; border-radius: 8px; }
.qr p { font-size: 13px; color: var(--muted); line-height: 1.5; }
.qr b { color: var(--cream); font-weight: 600; }
@media (min-width: 861px) { .qr { display: flex; } }

/* Hiện dần khi cuộn */
@media (prefers-reduced-motion: no-preference) {
  .js .rv { opacity: 0; transform: translateY(16px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
  .js .rv.in { opacity: 1; transform: none; }
}
