/** Hero, how it works, bộ sưu tập, thư viện, đặt hàng, header và footer. */

/* ── Header ──────────────────────────────────────────────────────── */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  padding: 0 clamp(20px, 5vw, 48px);
}

/*
 * Nền và lớp mờ nằm ở ::before chứ không đặt thẳng lên header.
 *
 * backdrop-filter biến phần tử mang nó thành containing block cho mọi con
 * position: fixed. Để trên header thì drawer sẽ bị nhốt trong dải cao 68px
 * ngay khi trang cuộn xuống và class is-scrolled bật lên. Đẩy xuống ::before
 * (không có con) là hết chuyện.
 *
 * z-index -1 giữ nó ở đáy stacking context của header, tức vẫn nằm trên nội
 * dung trang nhưng dưới brand, nút burger và nav.
 */
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-bottom: 1px solid transparent;
  transition:
    background var(--dur-sm) var(--ease),
    border-color var(--dur-sm) var(--ease);
}

.site-header.is-scrolled::before {
  background: rgba(251, 251, 249, 0.93);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}

/*
 * Unscrolled header sits directly on the hero's dark photo carousel — the
 * default dark-on-transparent text (built for the old light hero) needs a
 * light variant here. Once is-scrolled adds its own opaque backdrop, the
 * base dark colors take over again.
 */
.site-header:not(.is-scrolled) .site-nav a,
.site-header:not(.is-scrolled) .nav-toggle {
  color: #fff;
}

.site-header:not(.is-scrolled) .site-nav a::after {
  background: #fff;
}

.brand {
  font-family: var(--font-display);
  font-size: 21px;
  letter-spacing: 0.02em;
}

.brand span {
  color: var(--accent);
}

.brand--footer {
  font-size: 24px;
  margin-bottom: var(--space-1);
}

.header__right {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.brand img {
  display: block;
  height: 24px;
  width: auto;
}


.site-nav {
  display: flex;
  gap: clamp(14px, 2vw, 30px);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.site-nav a {
  position: relative;
  padding: 4px 0;
  transition: color var(--dur-sm) var(--ease);
}

.site-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-sm) var(--ease);
}

.site-nav a:hover {
  color: var(--text);
}

.site-header:not(.is-scrolled) .site-nav a:hover {
  color: #fff;
  opacity: 0.75;
}

.site-nav a:hover::after {
  transform: scaleX(1);
}

/* ── Nút burger ──────────────────────────────────────────────────── */

/* Chỉ hiện ở khổ điện thoại, xem media query 640px ở cuối file. */
.nav-toggle {
  display: none;
  position: relative;
  /* Trên nav-scrim (z-index: 1) nên nút vẫn bấm được lúc drawer mở. */
  z-index: 2;
  width: 44px;
  height: 44px;
  /* Kéo mép phải trùng với mép nội dung, phần dôi ra chỉ là vùng chạm. */
  margin-right: -11px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  cursor: pointer;
}

.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 1.5px;
  margin: -0.75px 0 0 -11px;
  background: currentColor;
  transition:
    background var(--dur-sm) var(--ease),
    transform var(--dur-sm) var(--ease);
}

.nav-toggle__bars::before {
  content: '';
  transform: translateY(-7px);
}

.nav-toggle__bars::after {
  content: '';
  transform: translateY(7px);
}

/* Ba gạch gập thành dấu X: gạch giữa tàng hình, hai gạch ngoài chụm lại. */
body.nav-open .nav-toggle__bars {
  background: transparent;
}

body.nav-open .nav-toggle__bars::before {
  transform: rotate(45deg);
}

body.nav-open .nav-toggle__bars::after {
  transform: rotate(-45deg);
}

/* ── Lớp phủ sau drawer ──────────────────────────────────────────── */

/*
 * Dùng visibility chứ không dùng thuộc tính hidden: hidden thì phải ép reflow
 * mới chạy được transition opacity, còn visibility nội suy theo bước nên chỉ
 * cần hoãn nó tới cuối lượt mờ dần.
 */
.nav-scrim {
  position: fixed;
  inset: 0;
  /* Đứng sau .header__right trong DOM nên mặc định sẽ vẽ đè lên drawer;
   * ghim z-index thấp hơn để nó chỉ phủ phần trang phía sau drawer. */
  z-index: 1;
  background: rgba(10, 10, 11, 0.62);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--dur-lg) var(--ease),
    visibility 0s linear var(--dur-lg);
}

body.nav-open .nav-scrim {
  opacity: 1;
  visibility: visible;
  transition:
    opacity var(--dur-lg) var(--ease),
    visibility 0s;
}

/* ── Khung section chung ─────────────────────────────────────────── */

.section {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: var(--space-9) clamp(20px, 5vw, 48px);
}

.section--flush {
  padding-top: clamp(40px, 6vh, 72px);
}

.section__head {
  max-width: 62ch;
  margin-bottom: var(--space-8);
}

.section__head .eyebrow {
  margin-bottom: var(--space-3);
}

.section__head h2 {
  margin-bottom: var(--space-4);
}

/* ── Hero ────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  min-height: min(90vh, 760px);
  overflow: hidden;
}

.hero__track {
  position: relative;
  width: 100%;
  height: min(90vh, 760px);
}

.hero__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-lg) var(--ease), visibility 0s linear var(--dur-lg);
}

.hero__slide.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--dur-lg) var(--ease);
}

.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(12, 10, 9, 0.72) 0%, rgba(12, 10, 9, 0.38) 45%, rgba(12, 10, 9, 0.05) 72%);
}

.hero__copy {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--header-h) + 40px) clamp(20px, 5vw, 48px) 80px;
  margin: 0 auto;
  max-width: var(--wrap);
}

.hero .eyebrow {
  color: #F1ECE2;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
  font-size: clamp(44px, 7vw, 88px);
  margin: var(--space-4) 0 var(--space-5);
  color: #fff;
  max-width: 14ch;
}

.hero .lead {
  color: rgba(255, 255, 255, 0.86);
}

.hero .btn--ghost {
  --btn-fg: #fff;
  --btn-line: rgba(255, 255, 255, 0.5);
}

.hero .btn--ghost:hover:not(:disabled) {
  --btn-bg: rgba(255, 255, 255, 0.12);
  --btn-line: #fff;
}

/*
 * Chỉ còn khoảng cách phía trên. Phần bố cục do .btn-row lo, vì trước đây chỗ
 * này chép lại y hệt flex của .btn-row và hệ quả là quy tắc mobile chỉ nhắm
 * .btn-row đã bỏ sót đúng hai nút ở Hero.
 */
.hero__actions {
  margin-top: var(--space-7);
}

.hero__arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  background: rgba(12, 10, 9, 0.3);
  color: #fff;
  cursor: pointer;
  transform: translateY(-50%);
  transition: background var(--dur-sm) var(--ease), border-color var(--dur-sm) var(--ease);
}

.hero__arrow svg {
  width: 20px;
  height: 20px;
}

.hero__arrow:hover {
  background: rgba(12, 10, 9, 0.55);
  border-color: #fff;
}

.hero__arrow:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.hero__arrow--prev {
  left: clamp(12px, 3vw, 32px);
}

.hero__arrow--next {
  right: clamp(12px, 3vw, 32px);
}

.hero__dots {
  position: absolute;
  left: 50%;
  bottom: clamp(20px, 4vh, 40px);
  z-index: 2;
  display: flex;
  gap: var(--space-2);
  transform: translateX(-50%);
}

.hero__dot {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.hero__dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transition: background var(--dur-sm) var(--ease), transform var(--dur-sm) var(--ease);
}

.hero__dot.is-active::before {
  background: #fff;
  transform: scale(1.3);
}

/* ── Trust bar ───────────────────────────────────────────────────── */

.trust-bar {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: var(--space-6) clamp(20px, 5vw, 48px);
}

.trust-bar__list {
  max-width: 1220px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-5) 0;
}

.trust-bar__list li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1 1 200px;
  min-width: 0;
  padding: 0 var(--space-5);
  border-left: 1px solid var(--line);
}

.trust-bar__list li:first-child {
  border-left: 0;
}

.trust-bar__icon-wrap {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg);
}

.trust-bar__icon {
  width: 18px;
  height: 18px;
  color: var(--brass);
}

.trust-bar__text {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}

.trust-bar__text b {
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text);
}

@media (max-width: 900px) {
  .trust-bar__list li {
    flex: 1 1 45%;
  }

  .trust-bar__list li:nth-child(odd) {
    border-left: 0;
  }
}

@media (max-width: 560px) {
  .trust-bar__list {
    flex-direction: column;
    gap: 0;
  }

  .trust-bar__list li {
    flex: 1 1 auto;
    width: 100%;
    padding: var(--space-4) 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .trust-bar__list li:first-child {
    border-top: 0;
    padding-top: 0;
  }

  .trust-bar__text {
    white-space: normal;
  }
}

/* ── Bộ sưu tập ──────────────────────────────────────────────────── */

.collection__grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-4);
}

.model-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-4) var(--space-4) var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition:
    transform var(--dur-sm) var(--ease),
    border-color var(--dur-sm) var(--ease),
    background var(--dur-sm) var(--ease),
    box-shadow var(--dur-sm) var(--ease);
}

.model-card:hover {
  transform: translateY(-6px);
  border-color: var(--line-hi);
  background: var(--surface-hi);
  box-shadow: var(--shadow-md);
}

.model-card__thumb {
  width: 100%;
  aspect-ratio: 1;
  margin-bottom: var(--space-3);
  object-fit: cover;
  display: block;
  border-radius: var(--radius);
  background: #fff;
}

.model-card__name {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.25;
}

.model-card__tagline {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: var(--space-1);
}

.model-card__desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-top: var(--space-3);
}

.model-card__price {
  margin-top: auto;
  padding-top: var(--space-4);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.model-card__was {
  margin-left: var(--space-2);
  font-weight: 400;
  font-size: 13px;
  color: var(--text-dim);
  text-decoration: line-through;
}

/* ── Thư viện ────────────────────────────────────────────────────── */

#gallery .eyebrow {
  color: var(--brass);
}

.gallery__carousel {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.gallery__track {
  display: flex;
  gap: clamp(var(--space-6), 4vw, var(--space-8));
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  /* Room for the image's own shadow so it doesn't clip at the edges. */
  padding: var(--space-5) var(--space-2);
}

.gallery__track::-webkit-scrollbar {
  display: none;
}

.gallery__item {
  position: relative;
  flex: 0 0 auto;
  width: clamp(240px, 26vw, 320px);
  scroll-snap-align: center;
}

.gallery__item canvas,
.gallery__item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-md);
}

.gallery__arrow {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--dur-sm) var(--ease), background var(--dur-sm) var(--ease);
}

.gallery__arrow svg {
  width: 20px;
  height: 20px;
}

.gallery__arrow:hover {
  border-color: var(--line-hi);
  background: var(--surface-hi);
}

.gallery__arrow:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.gallery__caption {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-4) var(--space-1) 0;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brass);
}

.gallery__caption b {
  order: -1;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
}

.gallery__note {
  margin-top: var(--space-6);
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
}

/* ── Đặt hàng ────────────────────────────────────────────────────── */

/*
 * Không còn form nhập liệu, chỉ còn một thẻ tóm tắt. Một cột canh giữa đọc đúng
 * hơn hai cột với một bên bỏ trống, và cũng khớp với dáng khay giỏ hàng Shopify
 * mà trang này sẽ chuyển sang.
 *
 * Canh giữa bằng margin auto chứ không bằng justify-content của grid: grid canh
 * giữa cái track, mà track auto-size theo max-content thì rộng hơn thẻ, kết quả
 * là thẻ nằm lệch ở đầu track.
 */
/*
 * Riêng section này canh giữa cả cụm. Mọi section khác canh trái, nhưng ở đây
 * chỉ còn đúng một thẻ hẹp, để tiêu đề lệch trái thì nhìn chông chênh.
 */
#order .section__head {
  margin-inline: auto;
  text-align: center;
}

.order__card {
  width: min(100%, 560px);
  margin-inline: auto;
  padding: var(--space-6);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.order__checkout {
  margin-top: var(--space-6);
}

.order__note {
  margin-top: var(--space-4);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-dim);
}

.order__checkout .msg {
  margin-top: var(--space-4);
}

.summary__title {
  font-family: var(--font-display);
  font-size: 24px;
  margin-bottom: var(--space-5);
}

.summary__list {
  display: grid;
  gap: var(--space-3);
  margin: 0;
}

.summary__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--line);
}

.summary__row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.summary__key {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}

.summary__value {
  text-align: right;
  font-size: 15px;
}

.summary__value--empty {
  color: var(--text-dim);
  font-style: italic;
}

.summary__total {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line-hi);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.summary__total b {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  color: var(--accent);
}

/* ── FAQ ─────────────────────────────────────────────────────────── */

.faq__list {
  max-width: 720px;
}

.faq__item {
  border-top: 1px solid var(--line);
}

.faq__item:last-child {
  border-bottom: 1px solid var(--line);
}

/* Native marker/outline replaced by .faq__icon and the row's own hover/focus state. */
.faq__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  padding: var(--space-5) 0;
  list-style: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: clamp(18px, 1.7vw, 21px);
  color: var(--text);
  transition: color var(--dur-sm) var(--ease);
}

.faq__q::-webkit-details-marker {
  display: none;
}

.faq__q:hover {
  color: var(--accent);
}

.faq__icon {
  position: relative;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.faq__icon::before,
.faq__icon::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  background: var(--brass);
}

.faq__icon::before {
  width: 12px;
  height: 1px;
}

.faq__icon::after {
  width: 1px;
  height: 12px;
  transition: transform var(--dur-sm) var(--ease);
}

.faq__item[open] .faq__icon::after {
  transform: scaleY(0);
}

/* grid-template-rows 0fr → 1fr animates height without a fixed max-height guess. */
.faq__a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur-lg) var(--ease);
}

.faq__item[open] .faq__a {
  grid-template-rows: 1fr;
}

.faq__a > p {
  overflow: hidden;
  padding-bottom: var(--space-5);
}

/* ── Footer ──────────────────────────────────────────────────────── */

.site-footer {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: var(--space-8) clamp(20px, 5vw, 48px) var(--space-6);
  border-top: 1px solid var(--line);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-5);
}

.site-footer__inner .muted p + p {
  margin-top: var(--space-1);
}

.site-footer__contact {
  margin-top: var(--space-4);
}

.site-footer__legal {
  margin-top: var(--space-7);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
  font-size: 13px;
}

/* ── Điểm gãy ────────────────────────────────────────────────────── */

@media (max-width: 1080px) {
  .collection__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .hero,
  .hero__track {
    height: min(85vh, 620px);
    min-height: min(85vh, 620px);
  }
  .hero__copy {
    justify-content: flex-end;
    padding-bottom: 120px;
  }
  .hero__title {
    max-width: 100%;
  }
  .hero__scrim {
    background: linear-gradient(180deg, rgba(12, 10, 9, 0.25) 0%, rgba(12, 10, 9, 0.72) 55%, rgba(12, 10, 9, 0.85) 100%);
  }
  .hero__arrow {
    display: none;
  }
}

@media (max-width: 640px) {
  .nav-toggle {
    display: block;
  }

  /*
   * Nav biến thành ngăn kéo trượt từ phải. visibility: hidden lúc đóng để các
   * liên kết không lọt vào thứ tự Tab, và hoãn tới cuối lượt trượt để còn kịp
   * nhìn thấy nó đi ra.
   */
  .site-nav {
    position: fixed;
    /* Trên nav-scrim (z-index: 1) nên drawer không bị tô tối và vẫn bấm được. */
    z-index: 2;
    inset: 0 0 0 auto;
    width: min(78vw, 320px);
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
    padding: calc(var(--header-h) + var(--space-4)) var(--space-6) var(--space-6);
    background: var(--surface);
    border-left: 1px solid var(--line);
    font-size: 13px;
    letter-spacing: 0.12em;
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateX(100%);
    visibility: hidden;
    transition:
      transform var(--dur-lg) var(--ease),
      visibility 0s linear var(--dur-lg);
  }

  body.nav-open .site-nav {
    transform: none;
    visibility: visible;
    transition:
      transform var(--dur-lg) var(--ease),
      visibility 0s;
  }

  .site-nav a {
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--line);
  }

  /* Gạch chân hover vô nghĩa trong drawer, đã có đường kẻ phân cách rồi. */
  .site-nav a::after {
    display: none;
  }

  /*
   * Drawer luôn có nền sáng (var(--surface)) bất kể header đã cuộn hay chưa,
   * nên chữ trắng dành cho header trong suốt trên hero tối làm link vô hình
   * ở đầu trang. Trả lại màu đọc được trong phạm vi drawer.
   */
  .site-header:not(.is-scrolled) .site-nav a {
    color: var(--text-dim);
  }

  .site-header:not(.is-scrolled) .site-nav a:hover {
    color: var(--text);
    opacity: 1;
  }

  .collection__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  /* Touch swipe is the primary interaction on phones — the arrow buttons
     just eat width, and one full-width card with a peek of the next
     reads better than a squeezed multi-column strip. */
  .gallery__arrow {
    display: none;
  }
  .gallery__item {
    width: 82vw;
  }
  .order__card {
    padding: var(--space-5);
  }
}

@media (max-width: 420px) {
  .collection__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
