/* Film engine — phim nền toàn màn hình + chữ từng cảnh + catalog bấm được. */

.is-film .ss-header {
  background: transparent;
  box-shadow: none;
  transition: color 0.5s var(--ease);
}
.is-film .ss-header.is-scrolled { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
.is-film .ss-header[data-ink="light"] { color: #fff; }
/* Menu nằm trong viên kính mờ (như Pivoine / Nival) */
.is-film .ss-nav, .is-film .ss-header-end {
  padding: 6px 6px 6px 22px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 62%, transparent);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 8px 30px rgba(0, 0, 0, 0.06);
}
.is-film .ss-nav { padding: 10px 24px; margin-left: auto; margin-right: auto; }
.is-film .ss-header-end { margin-left: 0; gap: 14px; }
.is-film .ss-header[data-ink="light"] :is(.ss-nav, .ss-header-end) { background: rgba(20, 20, 24, 0.32); }
.ss-bag { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; cursor: pointer; font-size: 14px; padding: 6px 4px; }
.ss-bag b { min-width: 22px; height: 22px; border-radius: 11px; display: grid; place-items: center; font-size: 11px; background: currentColor; }
.ss-bag b span { color: var(--bg); }
.ss-bag.bump b { animation: fm-bump 0.5s var(--ease); }
@keyframes fm-bump { 40% { transform: scale(1.35); } }

.is-film main > :not(.fm), .is-film .ss-footer { position: relative; z-index: 3; background: var(--bg); }
.is-film .ss-footer { background: var(--ink); }

.fm { position: relative; }
.fm-stage { position: fixed; inset: 0; z-index: 0; background: var(--bg); overflow: hidden; }
.fm-canvas, .fm-poster { position: absolute; inset: 0; width: 100%; height: 100%; }
.fm-poster { object-fit: cover; object-position: 50% 50%; transition: opacity 0.6s; }
.fm-poster.is-gone { opacity: 0; }
.fm-load { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 75; transition: opacity 0.6s; }
.fm-load i { display: block; height: 100%; background: var(--accent, var(--ink)); transform: scaleX(0); transform-origin: left; transition: transform 0.3s; }
.fm-load.is-done { opacity: 0; }

.fm-journey { position: relative; z-index: 2; }
.fm-scene {
  position: relative;
  min-height: calc(var(--vh) * 100 * var(--len, 1));
  padding: calc(var(--header-h) + 6vh) var(--gutter) 10vh;
  display: flex;
  align-items: center;
  color: var(--ink);
}
.fm-scene[data-ink="light"] { color: #fff; text-shadow: 0 1px 24px rgba(0, 0, 0, 0.25); }
.fm-scene[data-ink="light"] .fm-body { color: rgba(255, 255, 255, 0.86); }
.fm-scene--right { justify-content: flex-end; }
.fm-scene--center { justify-content: center; text-align: center; }
.fm-scene--center .fm-actions { justify-content: center; }
.fm-scene--top { align-items: flex-start; }
.fm-scene--bottom { align-items: flex-end; }
.fm-copy { max-width: 31rem; }
.fm-scene--center .fm-copy { max-width: 46rem; }
.fm-kicker { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 600; margin: 0 0 18px; }
.fm-title { font-size: clamp(42px, 5.4vw, 96px); line-height: 0.98; margin: 0 0 22px; text-transform: var(--fm-title-case, none); letter-spacing: var(--fm-title-tracking, -0.015em); }
.fm-title em, .fm-title i { font-style: italic; }
.fm-body { font-size: 16px; line-height: 1.6; color: var(--muted); max-width: 24rem; margin: 0 0 28px; }
.fm-scene--center .fm-body { margin-left: auto; margin-right: auto; }
.fm-list { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 16px; max-width: 24rem; counter-reset: fm; }
.fm-list li { display: grid; grid-template-columns: 28px 1fr; gap: 2px 10px; padding-top: 14px; border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent); counter-increment: fm; }
.fm-list li::before { content: counter(fm, lower-roman); grid-row: span 2; font-family: var(--font-display); font-style: italic; opacity: 0.7; }
.fm-list b { font-family: var(--font-display); font-weight: 500; font-size: 20px; }
.fm-list span { font-size: 14px; opacity: 0.8; }
.fm-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.fm-scene .ss-btn { min-height: 48px; padding: 0 26px; font-size: 14px; }
.fm-scene .ss-btn-ico { width: auto; height: auto; background: none; color: inherit; }
.fm-scene .ss-btn--ghost { box-shadow: none; padding: 0 4px; text-decoration: underline; text-underline-offset: 6px; }
.fm-hint { position: absolute; left: var(--gutter); bottom: 28px; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; display: flex; align-items: center; gap: 12px; }
.fm-hint i { width: 1px; height: 26px; background: currentColor; animation: ss-hint 1.8s ease-in-out infinite; transform-origin: top; }
@keyframes ss-hint { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ---------- Catalog: ảnh cảnh + điểm bấm ---------- */
.fm-catalog { position: relative; z-index: 2; height: calc(var(--vh) * 100); overflow: hidden; color: var(--ink); }
.fm-catalog[data-ink="light"] { color: #fff; }
.fm-still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fm-hotspots { position: absolute; inset: 0; }
.fm-spot {
  position: absolute;
  translate: -50% 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  white-space: nowrap;
}
.fm-spot-name { font-size: clamp(18px, 1.6vw, 26px); text-transform: none; text-shadow: 0 1px 18px rgba(0, 0, 0, 0.35); }
.fm-spot-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 6px 0 16px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.82);
  color: #1d1a17;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.fm-spot-btn span { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #1d1a17; color: #fff; transition: transform 0.4s var(--ease); }
.fm-spot-btn span svg { width: 13px; height: 13px; }
.fm-spot-btn:hover span { transform: rotate(-45deg); }
.fm-catalog-copy { position: absolute; left: var(--gutter); bottom: 6vh; }
.fm-catalog-copy h2 { font-size: clamp(36px, 4vw, 72px); margin: 0; text-transform: none; }

.fm-detail { position: fixed; inset: 0; z-index: 58; background: #000; }
.fm-detail[hidden] { display: none; }
.fm-approach, .fm-detail-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fm-back {
  position: absolute;
  left: var(--gutter);
  top: calc(var(--header-h) + 8px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px 0 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: #1d1a17;
  font-size: 13px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
}
.fm-back svg { width: 16px; height: 16px; }
.fm-card {
  position: absolute;
  right: var(--gutter);
  bottom: 5vh;
  width: min(380px, calc(100% - 2 * var(--gutter)));
  padding: 24px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.84);
  color: #1d1a17;
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  opacity: 0;
}
.fm-card-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.fm-card h3 { font-size: 30px; margin: 0; text-transform: none; }
.fm-card-price { font-size: 18px; }
.fm-card-desc { margin: 10px 0 18px; font-size: 14px; color: #555; line-height: 1.5; }
.fm-card-size { font-size: 13px; color: #555; }
.fm-card .ss-btn { --b: #1d1a17; --c: #fff; padding: 0 22px; }
html.fm-locked { overflow: hidden; }

@media (max-width: 767px) {
  .is-film .ss-nav { display: none; }
  .is-film .ss-header-end { padding: 4px 4px 4px 14px; }
  .fm-scene { padding: calc(var(--header-h) + 20px) var(--gutter) 12vh; }
  .fm-scene--m-top { align-items: flex-start; }
  .fm-scene--m-bottom { align-items: flex-end; }
  .fm-scene--m-center { align-items: center; }
  .fm-scene--right, .fm-scene--center { justify-content: flex-start; text-align: left; }
  .fm-scene--center .fm-actions { justify-content: flex-start; }
  .fm-scene--center .fm-body { margin-left: 0; }
  .fm-title { font-size: clamp(38px, 11vw, 54px); }
  .fm-body { font-size: 15px; }
  .fm-spot-name { font-size: 20px; }
  .fm-card { left: var(--gutter); right: var(--gutter); width: auto; bottom: max(16px, env(safe-area-inset-bottom)); padding: 20px; }
  .fm-card h3 { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .fm-hint i { animation: none; }
}

/* Nút trên cảnh phim tối: viên trắng */
.fm-scene[data-ink="light"] .ss-btn { --b: #fff; --c: #15120f; }
.fm-scene[data-ink="light"] .ss-btn--ghost { --b: transparent; --c: #fff; }

.fm-scene[data-ink="light"] .fm-sticky::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(10, 8, 6, 0.42), rgba(10, 8, 6, 0) 55%);
}
.fm-scene--right[data-ink="light"] .fm-sticky::before { background: linear-gradient(270deg, rgba(10, 8, 6, 0.42), rgba(10, 8, 6, 0) 55%); }
.fm-scene--center[data-ink="light"] .fm-sticky::before { background: radial-gradient(60% 50% at 50% 50%, rgba(10, 8, 6, 0.35), rgba(10, 8, 6, 0)); }
.fm-sticky { isolation: isolate; }
@media (max-width: 767px) {
  .fm-scene[data-ink="light"] .fm-sticky::before, .fm-scene--right[data-ink="light"] .fm-sticky::before { background: linear-gradient(180deg, rgba(10, 8, 6, 0.45), rgba(10, 8, 6, 0) 50%); }
  .fm-scene--m-bottom[data-ink="light"] .fm-sticky::before { background: linear-gradient(0deg, rgba(10, 8, 6, 0.5), rgba(10, 8, 6, 0) 55%); }
}

/* Chữ đứng yên giữa màn hình suốt chiều dài cảnh (phim chạy phía sau), như video mẫu */
.fm-scene { display: block; padding: 0; }
.fm-sticky {
  position: sticky;
  top: 0;
  height: calc(var(--vh) * 100);
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + 4vh) var(--gutter) 8vh;
}
.fm-scene--right .fm-sticky { justify-content: flex-end; }
.fm-scene--center .fm-sticky { justify-content: center; text-align: center; }
.fm-scene--top .fm-sticky { align-items: flex-start; }
.fm-scene--bottom .fm-sticky { align-items: flex-end; }
@media (max-width: 767px) {
  .fm-sticky { padding: calc(var(--header-h) + 20px) var(--gutter) 10vh; }
  .fm-scene--m-top .fm-sticky { align-items: flex-start; }
  .fm-scene--m-bottom .fm-sticky { align-items: flex-end; }
  .fm-scene--m-center .fm-sticky { align-items: center; }
  .fm-scene--center .fm-sticky { justify-content: center; text-align: center; }
  .fm-scene--center .fm-actions { justify-content: center; }
  .fm-scene--center .fm-body { margin-left: auto; }
}

/* Section chèn giữa phim (vd. danh sách sản phẩm): che phim, phim đứng yên phía sau */
.fm-interlude { position: relative; z-index: 3; background: var(--bg); }
.fm-interlude > .ss-section { border-top: 0; }
/* Hạt rơi: lớp cố định theo màn hình, KHÔNG nhận chuột/chạm -> vẫn bấm được sản phẩm bên dưới */
.fm-seeds { position: fixed; inset: 0; z-index: 50; pointer-events: none; overflow: hidden; }
.fm-seed {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(92px, 13vw, 230px);
  height: auto;
  visibility: hidden;
  will-change: transform, opacity;
  filter: drop-shadow(0 22px 26px rgba(45, 32, 12, 0.28));
}

/* Số đếm giỏ hàng đọc được cả khi header chữ trắng */
.is-film .ss-header[data-ink="light"] .ss-bag b span { color: #1c140e; }
