/* ============================================================
   LEAP · Storefront
   ------------------------------------------------------------
   前台页面专属样式：Hero 轮播、主推交错卡、瀑布流、分类页、
   Why/统计、商品详情（scroll-snap + 放大镜 + Lightbox）、
   Journey 文档、CTA。依赖 theme.css + components.css。
   ============================================================ */

/* ---------- Hero：微陈述 + full-bleed 轮播 ---------- */
.hero {
  padding: 40px 0 64px;
}
.hero-micro {
  text-align: center;
  margin-bottom: 26px;
}
.carousel {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  height: min(80vh, 700px);
  overflow: hidden;
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.9s ease;
}
.slide.is-active {
  opacity: 1;
}
.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-foot {
  max-width: var(--wrap);
  margin: 22px auto 0;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.dots {
  display: flex;
  gap: 10px;
}
.dot {
  width: 30px;
  height: 3px;
  background: #dcd5c6;
  transition: background 0.3s, width 0.3s;
}
.dot:hover {
  background: var(--muted);
}
.dot.is-active {
  background: var(--ink);
  width: 46px;
}
.hero-note {
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ---------- 商品卡（主推交错编辑卡） ---------- */
.p-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px 56px;
}
.p-card:nth-child(even) {
  margin-top: 56px;
}
.p-card {
  position: relative;
}
.p-card.is-hero .p-media {
  border-color: var(--gold);
}
.p-media {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 1 / 1;
  background: var(--paper);
}
.p-media::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid var(--line-gold);
  opacity: 0;
  transform: translate(8px, 8px);
  transition: opacity 0.4s, transform 0.4s;
  pointer-events: none;
}
.p-card:hover .p-media::after,
.m-item:hover .p-media::after {
  opacity: 1;
  transform: translate(0, 0);
}
.p-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.8s var(--ease);
}
.p-card:hover .p-media img,
.m-item:hover .p-media img {
  transform: scale(1.05);
}
.p-cat {
  margin: 18px 0 6px;
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.p-name {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.p-tags {
  margin: 8px 0 0;
}
.p-desc {
  color: var(--muted);
  font-size: 14px;
  margin: 8px 0 16px;
  max-width: 46ch;
}
.p-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
  flex-wrap: wrap;
}
.p-price {
  font-family: var(--serif);
  font-size: 19px;
  color: var(--ink);
}
.p-price small {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-right: 6px;
}
.btn-add {
  padding: 10px 18px;
  border: 1px solid var(--ink);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.btn-add:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}
.grid-more {
  text-align: center;
  margin-top: 72px;
}

/* ---------- 瀑布流（Product Overview / 分类页） ---------- */
.masonry {
  columns: 3;
  column-gap: 30px;
}
.m-item {
  display: block;
  break-inside: avoid;
  margin: 0 0 34px;
  position: relative;
}
.m-item .p-media {
  aspect-ratio: auto;
}
.m-name {
  display: block;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  margin-top: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.m-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}
.m-meta .price {
  color: var(--gold-deep);
  font-family: var(--serif);
}
.ov-sec {
  margin-bottom: 88px;
}
.ov-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 34px;
}
.ov-head h3 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
}
.ov-count {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
/* 分类筛选条 */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 44px;
}
.chip {
  padding: 8px 18px;
  border: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
  transition: all var(--t-fast);
}
.chip:hover {
  border-color: var(--gold-deep);
  color: var(--gold-deep);
}
.chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--gold-soft);
}

/* ---------- 分类页 Hero ---------- */
.cat-hero {
  text-align: center;
  padding: 76px 0 58px;
}
.cat-hero .sec-title {
  margin-bottom: 14px;
}

/* ---------- Why Choose Leap ---------- */
.why-statement {
  font-family: var(--serif);
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.45;
  max-width: 820px;
  margin: 0 auto 60px;
  text-align: center;
}
.why-statement em {
  font-style: italic;
  color: var(--gold-deep);
}
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 64px;
}
.why-item {
  border-top: 1px solid var(--line);
  padding-top: 22px;
}
.why-item .n {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--gold-deep);
  letter-spacing: 0.2em;
  display: block;
  margin-bottom: 12px;
}
.why-item h3 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  margin-bottom: 10px;
}
.why-item p {
  color: var(--muted);
  font-size: 14px;
}
.why-link {
  text-align: center;
}
.why-link a {
  font-family: var(--serif);
  font-size: clamp(18px, 2.2vw, 24px);
  font-style: italic;
  color: var(--ink);
  border-bottom: 1px solid var(--gold);
  padding-bottom: 4px;
  transition: color 0.3s, letter-spacing 0.3s;
}
.why-link a:hover {
  color: var(--gold-deep);
  letter-spacing: 0.02em;
}

/* ---------- 品牌历程（黑面撞色 + 计数动画） ---------- */
.journey {
  background: var(--ink);
  color: #f5f1e8;
}
.journey .micro-label {
  color: var(--gold-soft);
}
.journey .sec-sub {
  color: rgba(245, 241, 232, 0.62);
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 36px;
  margin: 64px 0 70px;
  text-align: center;
}
.stat {
  border-left: 1px solid rgba(212, 175, 55, 0.28);
  padding: 8px 10px;
}
.stat-num {
  --n: 0;
  counter-reset: sn var(--n);
  font-family: var(--serif);
  font-size: clamp(40px, 4.6vw, 60px);
  color: var(--gold-soft);
  line-height: 1.1;
}
.stat-num::after {
  content: counter(sn);
}
.stat-suf {
  font-family: var(--serif);
  font-size: clamp(22px, 2.4vw, 30px);
  color: var(--gold);
}
.stat-label {
  display: block;
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(245, 241, 232, 0.58);
}
@property --n {
  syntax: "<integer>";
  inherits: false;
  initial-value: 0;
}
.stats.in-view .stat-num {
  animation: count-up 1.8s var(--ease) forwards;
}
@keyframes count-up {
  to {
    --n: var(--to);
  }
}
.heritage {
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
}
.heritage p {
  color: rgba(245, 241, 232, 0.78);
  margin-bottom: 18px;
}
.journey-more {
  margin-top: 34px;
  text-align: center;
}
.journey-more .link-more {
  color: var(--gold-soft);
}

/* ---------- Journey 文档页 ---------- */
.journey-doc {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  text-align: center;
}
.jd-h {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(24px, 3vw, 34px);
  margin: 72px 0 22px;
}
.journey-doc > section:first-child .jd-h {
  margin-top: 0;
}
.jd-p {
  color: var(--ink-2);
  margin-bottom: 16px;
}
.jd-ul {
  list-style: none;
  margin: 26px 0 6px;
}
.jd-ul li {
  padding: 16px 0;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-2);
  font-size: 14.5px;
  text-align: left;
}
.jd-ul li::before {
  content: "— ";
  color: var(--gold-deep);
}

/* ---------- CTA ---------- */
.cta-panel {
  position: relative;
  border: 1px solid var(--line);
  padding: 76px 40px;
  text-align: center;
  background: var(--white);
}
.cta-panel::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid var(--line-gold);
  pointer-events: none;
}
.cta-title {
  font-family: var(--serif);
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.2;
  margin: 16px 0 12px;
}
.cta-title em {
  font-style: italic;
  color: var(--gold-deep);
}
.cta-sub {
  color: var(--muted);
  margin-bottom: 34px;
}

/* ---------- 商品详情页 ---------- */
.pd-wrap {
  padding: 52px 0 var(--sec);
}
.pd-crumb {
  margin-bottom: 30px;
}
.pd-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: start;
}
.pd-media {
  min-width: 0;
  height: calc(100vh - 168px);
  min-height: 460px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 12px;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  transition: scrollbar-color 0.25s ease;
}
.pd-media:hover,
.pd-media:active,
.pd-media:focus-within {
  scrollbar-color: var(--line) transparent;
}
.pd-media::-webkit-scrollbar {
  width: 5px;
}
.pd-media::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 3px;
}
.pd-media:hover::-webkit-scrollbar-thumb,
.pd-media:active::-webkit-scrollbar-thumb,
.pd-media:focus-within::-webkit-scrollbar-thumb {
  background: var(--line);
}
.pd-main {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.pd-main::-webkit-scrollbar {
  display: none;
}
.pd-main img {
  flex: 0 0 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  scroll-snap-align: center;
  border: 1px solid var(--line);
  background: var(--paper);
}
.pd-swipe-hint {
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--muted);
  text-transform: uppercase;
  margin: 0 0 12px;
}
.pd-gallery {
  position: relative;
}
.pd-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 16, 14, 0.5);
  color: var(--white);
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1;
  opacity: 0.7;
  transition: background 0.2s, opacity 0.2s;
}
.pd-arrow:hover {
  background: rgba(18, 16, 14, 0.7);
  opacity: 1;
}
.pd-arrow[disabled] {
  opacity: 0.3;
  pointer-events: none;
}
.pd-prev {
  left: 12px;
}
.pd-next {
  right: 12px;
}
.pd-detail img {
  width: 100%;
  display: block;
  border: 1px solid var(--line);
  margin-top: 12px;
}
.pd-detail img:first-child {
  margin-top: 0;
}
.pd-name {
  font-family: var(--serif);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 500;
  margin: 12px 0 6px;
}
.pd-price {
  font-family: var(--serif);
  font-size: 26px;
  color: var(--gold-deep);
  margin: 10px 0 14px;
}
.pd-desc {
  color: var(--muted);
  max-width: 52ch;
}
.pd-buy {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 28px 0 30px;
  flex-wrap: wrap;
}
.pd-block2 {
  border-top: 1px solid var(--line);
  padding-top: 26px;
}
.pd-block2 h3 {
  margin-bottom: 16px;
}

/* ---------- 悬停放大镜 ---------- */
.pd-main img,
.pd-detail img {
  cursor: zoom-in;
}
.pd-lens {
  position: fixed;
  z-index: var(--z-lens);
  width: 200px;
  height: 200px;
  border-radius: 50%;
  display: none;
  pointer-events: none;
  background-repeat: no-repeat;
  background-color: var(--white);
  border: 1px solid var(--gold);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}
.pd-lens.on {
  display: block;
}

/* ---------- Lightbox 全屏查看器 ---------- */
.pd-lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-lightbox);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 13, 11, 0.93);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
}
.pd-lightbox.open {
  opacity: 1;
  visibility: visible;
}
.lb-stage {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-img {
  max-width: 88vw;
  max-height: 86vh;
  object-fit: contain;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
  transition: opacity 0.25s ease;
}
.lb-close {
  position: absolute;
  top: 18px;
  right: 22px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  color: var(--white);
  font-size: 22px;
  cursor: pointer;
}
.lb-close:hover,
.lb-close:focus-visible {
  background: rgba(255, 255, 255, 0.15);
}
.lb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.25);
  color: var(--white);
  font-size: 24px;
  cursor: pointer;
}
.lb-arrow:hover,
.lb-arrow:focus-visible {
  background: rgba(255, 255, 255, 0.18);
}
.lb-prev {
  left: 22px;
}
.lb-next {
  right: 22px;
}
.lb-count {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  letter-spacing: 0.2em;
}

/* ---------- Markdown 渲染（Product Information） ---------- */
.md p {
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.7;
  margin-bottom: 12px;
}
.md strong {
  color: var(--ink);
  font-weight: 600;
}
.md em {
  font-style: italic;
}
.md h4,
.md h5,
.md h6 {
  font-family: var(--serif);
  font-weight: 500;
  color: var(--ink);
  margin: 18px 0 8px;
}
.md h4 {
  font-size: 17px;
}
.md h5 {
  font-size: 15.5px;
}
.md h6 {
  font-size: 14px;
  color: var(--ink-2);
}
.md ul,
.md ol {
  margin: 0 0 14px;
  padding-left: 22px;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.7;
}
.md ul {
  list-style: disc;
}
.md ol {
  list-style: decimal;
}
.md li {
  margin-bottom: 5px;
}
.md li::marker {
  color: var(--gold-deep);
}
.md a {
  color: var(--gold-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.md a:hover {
  color: var(--ink);
}
.md code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  padding: 1px 5px;
}

/* ---------- 空/错误占位 ---------- */
.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 60px 0;
  font-size: 14px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .why-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .masonry {
    columns: 2;
  }
  .pd-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .pd-media {
    height: auto;
    min-height: 0;
    overflow: visible;
    padding-right: 0;
  }
}
@media (max-width: 768px) {
  .pd-arrow {
    opacity: 0;
  }
  .pd-gallery:hover .pd-arrow:not([disabled]),
  .pd-arrow:focus-visible {
    opacity: 0.7;
  }
  .pd-lens {
    display: none !important;
  }
  .lb-arrow {
    width: 40px;
    height: 40px;
  }
  .lb-prev {
    left: 8px;
  }
  .lb-next {
    right: 8px;
  }
}
@media (max-width: 720px) {
  .p-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .p-card:nth-child(even) {
    margin-top: 0;
  }
  .hero-foot {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }
  .masonry {
    columns: 1;
  }
  .ov-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .pd-grid {
    gap: 32px;
  }
  .cta-panel {
    padding: 56px 24px;
  }
}
