/* ============================================================
   Cá nhân hoá nội thất ô tô — style dùng chung cho FE
============================================================ */
:root {
  --ink: #0d0d0f;
  --ink-2: #17171a;
  --paper: #f4f1ea;
  --gold: #c9a35c;
  --gold-soft: #e4cd9a;
  --line: rgba(244,241,234,.14);
  --text-dim: rgba(244,241,234,.62);
  --radius: 14px;
  --ease: cubic-bezier(.22,.61,.36,1);
  font-size: 16px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: "Segoe UI", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: .01em; }
p { margin: 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .5em;
  font-size: .78rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold-soft); font-weight: 600;
}
.eyebrow::before { content: ''; width: 22px; height: 1px; background: var(--gold); }

/* ---------- Progress rail ---------- */
.progress-rail {
  position: fixed; top: 0; left: 0; height: 3px; width: 100%;
  background: var(--line); z-index: 60;
}
.progress-rail__bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
  transition: width .1s linear;
}

/* ---------- Nav dots ---------- */
.section-nav {
  position: fixed; right: clamp(14px, 3vw, 34px); top: 50%; transform: translateY(-50%);
  z-index: 55; display: flex; flex-direction: column; gap: 14px;
}
.section-nav button {
  width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--gold-soft);
  background: transparent; cursor: pointer; padding: 0; position: relative;
  transition: background .25s var(--ease), transform .25s var(--ease);
}
.section-nav button.is-active { background: var(--gold); transform: scale(1.3); }
.section-nav button::after {
  content: attr(data-label);
  position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  white-space: nowrap; font-size: .72rem; letter-spacing: .04em;
  background: rgba(13,13,15,.9); border: 1px solid var(--line); padding: 4px 10px;
  border-radius: 6px; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.section-nav button:hover::after { opacity: 1; }

/* ---------- Section base ---------- */
.pv-section {
  position: relative; min-height: 100vh; display: flex; align-items: center;
  padding: clamp(64px, 10vh, 120px) clamp(20px, 6vw, 80px);
  border-top: 1px solid var(--line); overflow: hidden;
}
.pv-section__bg { position: absolute; inset: 0; z-index: 0; }
.pv-section__inner { position: relative; z-index: 2; width: 100%; max-width: 1180px; margin: 0 auto; }
.pv-section__head { max-width: 640px; margin-bottom: clamp(28px, 5vh, 56px); }
.pv-section__title { font-size: clamp(1.7rem, 3.4vw, 2.6rem); margin-top: .5em; }
.pv-section__subtitle { margin-top: .7em; color: var(--text-dim); font-size: 1.02rem; line-height: 1.55; }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ---------- Video scroll manager visuals ---------- */
[data-scroll-video] { position: absolute; inset: 0; }
.vsm-poster {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  z-index: 0; transition: opacity .6s var(--ease);
}
.vsm-video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  z-index: 1; opacity: 0; transition: opacity .8s var(--ease);
}
.vsm-video.is-hidden, .vsm-poster.is-hidden { opacity: 0; }
[data-video-slot] .vsm-video { opacity: 1; }

/* ---------- Video-pin hero — GSAP ScrollTrigger pin + scrub -----------
   Cấu trúc bám đúng #prj-pin-container của module "Flythrough" (mục 3.5
   spec): 1 container duy nhất chứa frame-start (poster) + video + scrim +
   nội dung, tất cả position:absolute/inset:0 chồng lớp. KHÔNG tự dựng
   sticky/spacer bằng tay — GSAP `pin:true` tự pin section này tại viewport
   và tự chèn khoảng đệm scroll tương ứng `scrollLength` khi khởi tạo
   (gsap-scrub.js). .pv-section mặc định display:flex (row) nên vẫn cần
   display:block ở đây để không bị flex bẻ layout khi GSAP chèn wrapper. */
.video-pin { display: block; position: relative; height: 100svh; min-height: 0; padding: 0; border: none; overflow: hidden; }
.video-pin__poster {
  position: absolute; inset: 0; z-index: 0; background-size: cover; background-position: center;
}
.video-pin__video {
  position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0;
  transition: opacity .5s var(--ease);
}
.video-pin__video.is-ready { opacity: 1; }
.video-pin__frame-end { position: absolute; inset: 0; z-index: 0; background-size: cover; background-position: center; opacity: 0; }
.video-pin__scrim {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(13,13,15,.15) 0%, rgba(13,13,15,.55) 62%, rgba(13,13,15,.94) 100%);
}
.video-pin__content {
  position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; justify-content: flex-end;
  padding: clamp(20px, 6vw, 80px); padding-bottom: clamp(48px, 9vh, 96px); pointer-events: none;
}
.video-pin__content > * { pointer-events: auto; }
.video-pin__inner { max-width: 760px; }

/* Slides tiêu đề/mô tả — fade in/out theo % cuộn, đồng bộ với video (mục
   3.5.2). Tất cả slide xếp chồng trong cùng 1 ô lưới (grid-area) để không
   ai chiếm chỗ layout của ai — GSAP chỉ đổi opacity/transform, không đổi
   display, tránh giật/nhảy chiều cao khi chuyển slide. */
.video-pin__slides { display: grid; }
.video-pin__slide {
  grid-area: 1 / 1; opacity: 0; transform: translateY(24px);
}
.video-pin__slide:first-child { opacity: 1; transform: none; } /* fallback trước khi GSAP load xong */
.video-pin__title { font-size: clamp(2.1rem, 5.6vw, 4rem); line-height: 1.08; margin-top: .4em; }
.video-pin__subtitle { margin-top: 1.1em; color: var(--text-dim); font-size: 1.08rem; max-width: 46ch; line-height: 1.6; }
.video-pin__cta { margin-top: 2em; }
.video-pin__scrolldown {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--text-dim); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  transition: opacity .3s var(--ease); pointer-events: none;
}
.video-pin__scrolldown span { width: 1px; height: 34px; background: linear-gradient(var(--gold), transparent); animation: scrollcue 1.8s infinite; }
@keyframes scrollcue { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
.video-pin__progress {
  position: absolute; right: clamp(20px, 6vw, 80px); bottom: clamp(48px, 9vh, 96px);
  z-index: 2; width: 3px; height: 120px; background: var(--line); border-radius: 2px; overflow: hidden; pointer-events: none;
}
.video-pin__progress span { display: block; width: 100%; background: linear-gradient(var(--gold-soft), var(--gold)); height: 0%; }

.btn {
  display: inline-flex; align-items: center; gap: .6em;
  padding: 14px 28px; border-radius: 999px; font-size: .92rem; font-weight: 600;
  letter-spacing: .02em; cursor: pointer; border: 1px solid transparent; transition: all .25s var(--ease);
  text-decoration: none;
}
.btn--gold { background: linear-gradient(135deg, var(--gold), #a97e3a); color: #17130a; }
.btn--gold:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn--ghost { border-color: var(--line); color: var(--paper); background: rgba(255,255,255,.03); }
.btn--ghost:hover { border-color: var(--gold-soft); }

/* ---------- Color picker sections ---------- */
.picker-layout { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
@media (max-width: 860px) { .picker-layout { grid-template-columns: 1fr; } }
.picker-preview {
  position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/3;
  background: var(--ink-2); border: 1px solid var(--line);
}
.picker-preview__img {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: 0; transition: opacity .6s var(--ease);
}
.picker-preview__img.is-active { opacity: 1; }
.picker-preview__tag {
  position: absolute; left: 16px; bottom: 16px; z-index: 2;
  background: rgba(13,13,15,.72); backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px;
  font-size: .82rem; letter-spacing: .03em;
}
.swatch-list { display: flex; flex-direction: column; gap: 12px; }
.swatch-card {
  display: flex; align-items: center; gap: 16px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: rgba(255,255,255,.02);
  transition: border-color .25s, background .25s, transform .2s;
}
.swatch-card:hover { transform: translateX(4px); }
.swatch-card.is-selected { border-color: var(--gold); background: rgba(201,163,92,.09); }
.swatch-card__dot { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(255,255,255,.5); flex: none; }
.swatch-card__label { font-weight: 600; font-size: .96rem; }
.swatch-card__check { margin-left: auto; opacity: 0; color: var(--gold); font-size: 1.1rem; transition: opacity .2s; }
.swatch-card.is-selected .swatch-card__check { opacity: 1; }

/* ---------- Scene-sequence (chất liệu ghế) ---------- */
.scene-pin { display: block; position: relative; }
.scene-pin__stage {
  position: sticky; top: 0; height: 100svh; display: flex; align-items: center;
  overflow: hidden;
}
.scene-pin__media { position: absolute; inset: 0; z-index: 0; }
.scene-pin__media img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0;
  transition: opacity .7s var(--ease), transform 8s linear;
}
.scene-pin__media img.is-active { opacity: 1; transform: scale(1.06); }
.scene-pin__scrim { position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(13,13,15,.92) 0%, rgba(13,13,15,.45) 46%, rgba(13,13,15,.05) 78%); }
.scene-pin__copy { position: relative; z-index: 2; max-width: 480px; padding: 0 clamp(20px, 6vw, 80px); }
.scene-pin__index { font-size: .8rem; color: var(--gold-soft); letter-spacing: .12em; }
.scene-pin__label { font-size: clamp(1.5rem, 3vw, 2.1rem); margin-top: .5em; }
.scene-pin__desc { margin-top: .8em; color: var(--text-dim); line-height: 1.6; }
.scene-pin__dots { display: flex; gap: 8px; margin-top: 1.6em; }
.scene-pin__dots span { width: 26px; height: 3px; background: var(--line); border-radius: 2px; transition: background .3s; }
.scene-pin__dots span.is-active { background: var(--gold); }
.scene-pin__spacer { height: 220vh; }

/* ---------- Reveal group (tiện nghi) ---------- */
.pack-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 900px) { .pack-grid { grid-template-columns: 1fr; } }
.pack-card {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
  background: rgba(255,255,255,.02); cursor: pointer; transition: border-color .25s, background .25s, transform .3s var(--ease);
}
.pack-card.is-selected { border-color: var(--gold); background: rgba(201,163,92,.08); }
.pack-card__head { display: flex; align-items: center; justify-content: space-between; }
.pack-card__title { font-size: 1.08rem; font-weight: 700; }
.pack-card__toggle {
  width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: .8rem; color: var(--gold);
}
.pack-card.is-selected .pack-card__toggle { border-color: var(--gold); background: var(--gold); color: #17130a; }
.pack-card__desc { margin-top: .8em; color: var(--text-dim); font-size: .9rem; line-height: 1.55; min-height: 4.5em; }
.pack-card__price { margin-top: 1.2em; font-size: 1.05rem; font-weight: 700; color: var(--gold-soft); }
.pack-total {
  margin-top: 28px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 18px 22px; border: 1px dashed var(--line); border-radius: 12px;
}
.pack-total__label { color: var(--text-dim); font-size: .88rem; }
.pack-total__value { font-size: 1.4rem; font-weight: 700; color: var(--gold); }

/* ---------- Summary ---------- */
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 14px; margin-top: 8px; }
.summary-item { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; background: rgba(255,255,255,.02); }
.summary-item__label { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-dim); }
.summary-item__value { margin-top: .5em; font-size: 1.05rem; font-weight: 600; }
.summary-cta { margin-top: 32px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.pv-footer {
  padding: 32px clamp(20px, 6vw, 80px); border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  color: var(--text-dim); font-size: .82rem;
}
.pv-footer a { color: var(--gold-soft); text-decoration: none; }

/* ---------- Demo banner ---------- */
.demo-banner {
  position: fixed; left: 16px; bottom: 16px; z-index: 60;
  background: rgba(13,13,15,.85); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; font-size: .78rem; color: var(--text-dim); backdrop-filter: blur(6px);
  max-width: 260px;
}
.demo-banner a { color: var(--gold-soft); font-weight: 600; }
