/* Meili Home ── Product Detail Page Styles */

/* ── Breadcrumb ───────────────────────────────────────── */
body[data-page="product"] .header-inner {
  max-width: 1600px;
  padding-left: clamp(20px, 2vw, 30px);
  padding-right: clamp(20px, 2vw, 30px);
}

.pd-breadcrumb {
  background: var(--bg);
  padding: 16px 0 0;
}

.pd-breadcrumb-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 clamp(20px, 2vw, 30px);
}

.pd-breadcrumb ol {
  list-style: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 12px;
  font-weight: 300;
  color: var(--ink-muted);
}

.pd-breadcrumb li + li::before {
  content: '/';
  margin-right: 4px;
  opacity: 0.5;
}

.pd-breadcrumb a {
  color: var(--ink-muted);
  transition: color 0.2s;
}

.pd-breadcrumb a:hover { color: var(--ink); }

.pd-breadcrumb [aria-current="page"] {
  color: var(--ink);
  font-weight: 400;
}

/* ── Product Detail Section ───────────────────────────── */
.pd-sec {
  background: var(--bg);
  padding: 32px 0 64px;
}

.pd-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 clamp(20px, 2vw, 30px);
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: clamp(40px, 5vw, 80px);
  align-items: start;
}


/* ── Gallery ──────────────────────────────────────────── */
.pd-gallery {
  display: block;
  padding-left: 108px;
  padding-bottom: 42px;
  position: sticky;
  top: calc(64px + 32px + 2px);
}

.pd-gallery--single { padding-left: 0; }

/* Desktop: reset all order values set by mobile */
.pd-eyebrow, .pd-title, .pd-price,
.pd-option-group--size, .pd-option-group--color,
.pd-purchase, .pd-accordion, .pd-wishlist { order: 0; }

/* The rail follows the square image height, without affecting the page height. */
.pd-thumbs-rail {
  position: absolute;
  top: 0;
  left: 0;
  width: 96px;
  height: min(65vh, 680px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}

.pd-rail-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 26px;
  width: 100%;
  border: 1px solid #d5d0c8;
  border-radius: 3px;
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
}
.pd-rail-arrow:hover:not(:disabled) { background: #e8e3db; }
.pd-rail-arrow:disabled { opacity: 0.4; cursor: default; }
.pd-rail-arrow[hidden] { display: none; }

.pd-thumbs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  width: 96px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.pd-thumbs::-webkit-scrollbar { display: none; }

/* 每张缩略图：固定 96×96 正方形 */
.pd-thumb {
  width: 96px;
  height: 96px;
  flex-shrink: 0;       /* 不被压缩 */
  border-radius: 3px;
  overflow: hidden;
  border: 1.5px solid transparent;
  padding: 0;
  background: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.pd-thumb--active { border-color: var(--ink); }

.pd-thumb-img {
  width: 100%;
  height: 100%;
  background: #ddd8d0;
}

.pd-thumb-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Main image — padding-top trick 强制 1:1 正方形 */
.pd-main-img {
  width: 100%;
  min-width: 0;
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  background: #ddd8d0;
}

.pd-main-img::before {
  content: '';
  display: block;
  padding-top: 100%;
}

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

/* Prev / Next arrows */
.pd-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(247, 244, 238, 0.85);
  border: 1px solid rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  cursor: pointer;
  transition: opacity 0.2s;
  z-index: 2;
}

.pd-arrow:hover { opacity: 0.7; }
.pd-arrow--prev { left: 12px; }
.pd-arrow--next { right: 12px; }

/* ── Product Info ─────────────────────────────────────── */
.pd-info {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.pd-eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 12px;
  font-family: var(--font-body);
}

.pd-title {
  font-family: var(--font-heading);
  font-size: clamp(28px, 2.8vw, 40px);
  font-weight: 500;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 16px;
}

.pd-price {
  font-size: 20px;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 24px;
  font-family: var(--font-body);
}

.pd-option-group { margin-bottom: 24px; }

.pd-option-label {
  font-size: 13px;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 10px;
  font-family: var(--font-body);
}

.pd-option-value {
  font-weight: 300;
  color: var(--ink-muted);
}

/* Color swatches */
.pd-color-swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pd-color-swatch {
  width: 72px;
  height: 72px;
  border-radius: 3px;
  overflow: hidden;
  border: 2px solid transparent;
  outline: 2px solid transparent;
  outline-offset: 1px;
  cursor: pointer;
  padding: 0;
  background: #ddd8d0;
  transition: outline-color 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

.pd-color-swatch img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pd-color-swatch:hover { outline-color: var(--ink-muted); }

.pd-color-swatch--active {
  outline-color: var(--ink);
  border-color: #fff;
}

/* Size buttons */
.pd-size-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pd-size-btn {
  height: 38px;
  padding: 0 16px;
  border: 1px solid #c8c2ba;
  border-radius: 2px;
  background: transparent;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 300;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  white-space: nowrap;
}

.pd-size-btn:hover { border-color: var(--ink); }

.pd-size-btn--active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
  font-weight: 400;
}

/* Quantity */
.pd-purchase {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

.pd-qty {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.pd-qty-label {
  font-size: 13px;
  font-weight: 400;
  color: var(--ink);
  font-family: var(--font-body);
}

.pd-qty-ctrl {
  display: flex;
  align-items: center;
  border: 1px solid #c8c2ba;
  border-radius: 2px;
  height: 38px;
  overflow: hidden;
}

.pd-qty-btn {
  width: 36px;
  height: 100%;
  border: none;
  background: transparent;
  font-size: 18px;
  font-weight: 300;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.pd-qty-btn:hover { background: #ede9e2; }

.pd-qty-val {
  width: 40px;
  text-align: center;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink);
  font-family: var(--font-body);
  border-left: 1px solid #c8c2ba;
  border-right: 1px solid #c8c2ba;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.pd-add-to-cart {
  flex: none;
  width: 100%;
  height: 50px;
  background: #4a4a3a;
  color: #f7f4ee;
  border: none;
  border-radius: 2px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.2s;
}

.pd-add-to-cart:hover { opacity: 0.85; }

/* ── Accordion ────────────────────────────────────────── */
.pd-accordion {
  border-top: 1px solid var(--header-border);
  margin-bottom: 20px;
}

.pd-accordion-item { border-bottom: 1px solid var(--header-border); }

.pd-accordion-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink);
  font-family: var(--font-body);
  cursor: pointer;
  list-style: none;
  user-select: none;
  gap: 12px;
}

.pd-accordion-head::-webkit-details-marker { display: none; }
.pd-accordion-head::marker { display: none; }

.pd-accordion-icon {
  flex-shrink: 0;
  color: var(--ink-muted);
  transition: transform 0.25s ease;
}

details[open] .pd-accordion-icon { transform: rotate(180deg); }

.pd-accordion-body {
  padding: 0 0 16px;
  font-size: 13px;
  font-weight: 300;
  line-height: 1.8;
  color: var(--ink-muted);
}

/* ── Wishlist ─────────────────────────────────────────── */
.pd-wishlist {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 300;
  color: var(--ink-muted);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s;
}

.pd-wishlist:hover { color: var(--ink); }

/* ── Product Description Section (Full Width) ────────── */
.pd-desc-sec {
  background: var(--bg);
  padding: 0 0 80px;
}

/* pd-desc-inner 不设 padding，内部各元素自己控制 */
.pd-desc-inner {
  max-width: 100%;
  margin: 0;
  padding: 0;
}

/* 普通内容区（About + Material + Shipping）需要 max-width + padding */
.pd-desc-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 56px var(--side-pad) 0;
}

/* Tab nav — 全宽通栏 */
.pd-desc-tabs {
  width: 100%;
  background: #e8e3db;
  margin-bottom: 0;
}

.pd-desc-tabs-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 clamp(20px, 2vw, 30px);
  display: flex;
}

.pd-desc-tab {
  padding: 36px 16px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  color: #222222;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: border-color 0.2s;
  white-space: nowrap;
}

.pd-desc-tab:hover { background: none; }

.pd-desc-tab--active {
  color: #222222;
  border-bottom-color: #222222;
  font-weight: 500;
}

/* Panels */
.pd-desc-panel--hidden { display: none; }

.pd-desc-tab--active {
  color: #222222;
  border-bottom-color: #222222;
  font-weight: 500;
}

/* Panels */
.pd-desc-panel--hidden { display: none; }

/* Two-column grid: text left, image right */
.pd-desc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.pd-desc-text {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pd-desc-text h2 {
  font-family: var(--font-heading);
  font-size: clamp(22px, 2vw, 32px);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 4px;
}

.pd-desc-text h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 400;
  color: var(--ink);
  margin-top: 8px;
}

.pd-desc-text p {
  font-size: 14px;
  font-weight: 300;
  color: var(--ink-muted);
  line-height: 1.8;
}

.pd-desc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
}

.pd-desc-list li {
  font-size: 13px;
  font-weight: 300;
  color: var(--ink-muted);
  line-height: 1.6;
  padding-left: 16px;
  position: relative;
}

.pd-desc-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--ink-muted);
  opacity: 0.5;
}

.pd-desc-note {
  font-size: 12px !important;
  color: var(--ink-muted);
  opacity: 0.7;
  font-style: italic;
  border-left: 2px solid var(--header-border);
  padding-left: 12px !important;
  margin-top: 4px;
}

.pd-desc-img {
  aspect-ratio: 4 / 3;
  border-radius: 4px;
  overflow: hidden;
  background: #ddd8d0;
}

.pd-desc-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Philosophy Banner ───────────────────────────────── */
.pd-philosophy {
  display: grid;
  grid-template-columns: 1fr;
  margin-bottom: 0;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  height: auto;
}

.pd-philosophy-img {
  position: relative;
  overflow: hidden;
}

.pd-philosophy-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pd-philosophy-copy {
  background: #f0ece5;
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  overflow: hidden;
}

.pd-philosophy-eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 16px;
}

.pd-philosophy-title {
  font-family: var(--font-heading);
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 400;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 12px;
}

.pd-philosophy-body {
  font-size: 13px;
  font-weight: 300;
  line-height: 1.7;
  color: var(--ink-muted);
  max-width: 400px;
  margin-bottom: 24px;
}

/* Three pillars */
.pd-philosophy-pillars {
  display: flex;
  gap: 20px;
}

.pd-pillar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.pd-pillar-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #c8c2ba;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  margin-bottom: 4px;
}

.pd-pillar-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  font-family: var(--font-body);
}

.pd-pillar-sub {
  font-size: 11px;
  font-weight: 300;
  color: var(--ink-muted);
  line-height: 1.4;
}

/* ── Rich Text ───────────────────────────────────────── */
.pd-richtext {
  font-size: 14px;
  font-weight: 300;
  line-height: 1.8;
  color: var(--ink-muted);
}

.pd-richtext h2 {
  font-family: var(--font-heading);
  font-size: clamp(20px, 1.8vw, 28px);
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 16px;
}

.pd-richtext h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 400;
  color: var(--ink);
  margin: 24px 0 10px;
}

.pd-richtext p { margin-bottom: 12px; }

.pd-richtext ul {
  padding-left: 20px;
  margin-bottom: 12px;
}

.pd-richtext li { margin-bottom: 6px; }


/* ── Share Button ─────────────────────────────────────── */
.pd-share-wrap {
  position: absolute;
  bottom: 0;
  right: 0;
  z-index: 10;
}

.pd-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: transparent;
  border: 1px solid #c8c2ba;
  border-radius: 2px;
  padding: 6px 14px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.pd-share-btn:hover { border-color: var(--ink); }

.pd-share-popup {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.13);
  min-width: 185px;
  z-index: 200;
  padding: 10px 0 6px;
}

.pd-share-popup::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 20px;
  width: 12px;
  height: 12px;
  background: #fff;
  transform: rotate(45deg);
  box-shadow: 2px 2px 4px rgba(0,0,0,0.08);
  clip-path: polygon(0 100%, 100% 100%, 100% 0);
}

.pd-share-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #aaa;
  transition: color 0.15s;
  border-radius: 50%;
}
.pd-share-close:hover { color: var(--ink); }

.pd-share-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pd-share-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 20px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  color: #222;
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
  white-space: nowrap;
}
.pd-share-item:hover { background: #f5f5f5; }


/* ── Favourite on Detail Page ─────────────────────────── */
.pd-fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: transform 0.18s;
}
.pd-fav-btn:hover { transform: scale(1.15); }
.pd-fav-btn svg {
  width: 20px;
  height: 20px;
  stroke: #222;
  fill: #fff;
  transition: stroke 0.18s, fill 0.18s;
}
.pd-fav-btn.is-active svg {
  stroke: #e53535;
  fill: #e53535;
}

.pd-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}



/* ── Mobile: product gallery layout ──────────────────── */
@media (max-width: 767px) {

  /* 面包屑折行 */
  .pd-breadcrumb { overflow: hidden; }
  .pd-breadcrumb-inner { padding: 12px 16px; max-width: 100%; box-sizing: border-box; }
  .pd-breadcrumb ol { flex-wrap: wrap; }
  .pd-breadcrumb [aria-current="page"] { min-width: 0; overflow-wrap: anywhere; }

  /* pd-sec 和 pd-inner 全部去掉 padding */
  .pd-sec    { padding: 0; }
  .pd-inner  { grid-template-columns: 1fr; gap: 0; padding: 0; width: 100%; max-width: 100%; box-sizing: border-box; }
  .pd-inner > * { min-width: 0; }

  /* gallery 纵向堆叠 */
  .pd-gallery {
    position: static;
    display: flex;
    flex-direction: column;
    padding: 0;
    margin-top: 16px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
  }

  /* 大图在上，缩略图在下 */
  .pd-main-img { order: 1; width: 100%; max-width: 100%; flex: none; border-radius: 0; }

  .pd-thumbs-rail {
    position: static;
    order: 2;
    width: 100%;
    height: auto !important;
    display: block;
  }
  .pd-rail-arrow { display: none; }

  .pd-thumbs {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 16px;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
  }
  .pd-thumbs::-webkit-scrollbar { display: none; }
  .pd-thumb { flex-shrink: 0; width: 68px; height: 68px; }

  .pd-share-wrap { display: none; }
  .pd-color-swatches { flex-wrap: nowrap; overflow-x: auto; }

  /* 商品信息顺序 */
  .pd-info { display: flex; flex-direction: column; padding: 16px 16px 0; }
  .pd-eyebrow             { order: 1; }
  .pd-title               { order: 2; }
  .pd-price               { order: 3; }
  .pd-option-group--size  { order: 4; }
  .pd-option-group--color { order: 5; display: none; }
  .pd-purchase            { order: 6; }
  .pd-purchase { flex-direction: column !important; gap: 12px; }
  .pd-add-to-cart { width: 100%; }
  .pd-accordion           { order: 7; }
  .pd-wishlist            { order: 9; }

  .pd-desc-grid  { grid-template-columns: 1fr; gap: 32px; }
  .pd-philosophy { grid-template-columns: 1fr; height: auto; }
  .pd-philosophy-copy { padding: 24px 16px; }
}
