/* ══════════════════════════════════════════════════════════════
   GlassLove — 商城板块
   商品列表 / 详情 / 结算 / 购物车抽屉
   沿用 style.css 的 token，保持暗窑夜火调性
   ══════════════════════════════════════════════════════════════ */

/* ── 导航里的购物车按钮 ───────────────────────────────────── */
.nav__cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: none;
  color: var(--bone);
  cursor: pointer;
  flex: none;
  transition: border-color .35s, background .35s, color .35s;
}
.nav__cart:hover { border-color: rgba(255,122,47,.5); background: rgba(255,122,47,.06); }
.nav__cart svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; }

.nav__cart-count {
  position: absolute;
  top: -6px; right: -6px;
  min-width: 17px; height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--ember);
  color: #1A0F06;
  font-family: var(--f-sans);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 17px;
  text-align: center;
  transition: transform .3s var(--ease), opacity .3s;
}
.nav__cart-count.is-empty { opacity: 0; transform: scale(.6); }

@media (max-width: 920px) {
  .nav__cart { margin-left: auto; }   /* 汉堡按钮旁边，别被 auto margin 挤掉 */
  .brand { margin-right: 14px; }
}

/* ── 页面头（列表页 / 结算页共用） ────────────────────────── */
.page-head {
  padding: clamp(120px, 15vh, 190px) 0 clamp(36px, 4vw, 56px);
  border-bottom: 1px solid var(--line-soft);
}
.page-head h1 {
  font-family: var(--f-serif);
  font-size: clamp(34px, 5vw, 66px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -.004em;
}
.page-head__lead {
  margin: 20px 0 0;
  max-width: 42em;
  font-size: clamp(15px, 1.25vw, 17px);
  line-height: 1.62;
  color: var(--bone-dim);
}
.page-head--slim { padding-bottom: clamp(28px, 3vw, 40px); }

/* ── 面包屑 ───────────────────────────────────────────────── */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  padding-top: clamp(100px, 13vh, 150px);
  font-size: 12.5px;
  letter-spacing: .04em;
  color: var(--fog);
}
.crumbs a { transition: color .3s; }
.crumbs a:hover { color: var(--ember); }
.crumbs span::before {
  content: "/";
  margin-right: 9px;
  color: rgba(244,238,230,.22);
}

/* ── 筛选 / 排序条 ────────────────────────────────────────── */
.shop { padding-block: clamp(34px, 4vw, 52px) clamp(80px, 10vw, 130px); }

.shop-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 22px;
  padding-bottom: 22px;
  margin-bottom: clamp(26px, 3vw, 40px);
  border-bottom: 1px solid var(--line-soft);
}

.filters { display: flex; flex-wrap: wrap; gap: 8px; }

.filter {
  padding: 9px 17px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: none;
  color: var(--bone-dim);
  font-family: var(--f-sans);
  font-size: 13px;
  letter-spacing: .04em;
  cursor: pointer;
  transition: border-color .35s, color .35s, background .35s;
}
.filter:hover { border-color: rgba(244,238,230,.32); color: var(--bone); }
.filter.is-active {
  border-color: var(--ember);
  background: rgba(255,122,47,.10);
  color: var(--ember);
}

.shop-bar__right {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}
.shop-count { font-size: 12.5px; color: var(--fog); }

.sort {
  appearance: none;
  padding: 9px 34px 9px 15px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238E8375' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat right 13px center;
  color: var(--bone-dim);
  font-family: var(--f-sans);
  font-size: 13px;
  cursor: pointer;
}
.sort option { background: #16130F; color: var(--bone); }

/* ── 商品网格 ─────────────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(18px, 2.2vw, 32px);
}

.pcard {
  display: flex;
  flex-direction: column;
  background: var(--ink-3);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  overflow: hidden;
  transition: border-color .5s, transform .6s var(--ease), box-shadow .6s var(--ease);
}
.pcard:hover {
  border-color: rgba(255,122,47,.30);
  transform: translateY(-4px);
  box-shadow: 0 28px 56px -34px rgba(0,0,0,.9);
}

.pcard__media {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #0D0B0A;
}
.pcard__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1.1s var(--ease), filter .6s;
  filter: saturate(.94) brightness(.95);
}
.pcard:hover .pcard__media img { transform: scale(1.05); filter: saturate(1.02) brightness(1); }

.pcard__badge {
  position: absolute;
  top: 12px; left: 12px;
  padding: 5px 11px;
  border-radius: 2px;
  background: rgba(10,9,8,.78);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,122,47,.4);
  color: var(--ember);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.pcard__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 20px 22px 22px;
}
.pcard__name {
  font-family: var(--f-serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.2;
}
.pcard__name a { transition: color .3s; }
.pcard__name a:hover { color: var(--ember); }

.pcard__blurb {
  margin: 9px 0 0;
  font-size: 13.5px;
  line-height: 1.68;
  color: var(--fog);
}

.pcard__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: auto;
  padding-top: 20px;
}
.pcard__price {
  font-family: var(--f-display);
  font-size: 25px;
  font-weight: 600;
  color: var(--bone);
}

.pcard__add {
  padding: 11px 18px;
  border: 1px solid rgba(255,122,47,.42);
  border-radius: 2px;
  background: rgba(255,122,47,.08);
  color: var(--ember);
  font-family: var(--f-sans);
  font-size: 12.5px;
  letter-spacing: .06em;
  cursor: pointer;
  white-space: nowrap;
  transition: background .35s, color .35s, border-color .35s;
}
.pcard__add:hover {
  background: linear-gradient(135deg, var(--ember), var(--ember-lit));
  border-color: transparent;
  color: #1A0F06;
}

.shop__empty {
  padding: 70px 0;
  text-align: center;
  color: var(--fog);
  font-size: 14px;
}

/* 首页 collection 区块底部的"进店"按钮 */
.sec-more {
  margin: clamp(34px, 4vw, 54px) 0 0;
  text-align: center;
}

/* ── 商品详情页 ───────────────────────────────────────────── */
.pdp { padding-block: clamp(30px, 4vw, 54px) clamp(70px, 8vw, 110px); }

.pdp__grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(32px, 5vw, 76px);
  align-items: start;
}

.pdp__media {
  position: sticky;
  top: 104px;
  margin: 0;
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  overflow: hidden;
  background: #0D0B0A;
}
.pdp__media img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }

.pdp__info h1 {
  font-family: var(--f-serif);
  font-size: clamp(30px, 3.8vw, 50px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -.003em;
}

.pdp__price {
  margin: 18px 0 0;
  font-family: var(--f-display);
  font-size: clamp(26px, 2.6vw, 34px);
  font-weight: 600;
  color: var(--ember);
}

.pdp__blurb {
  margin: 18px 0 0;
  font-size: 15px;
  line-height: 1.68;
  color: var(--bone-dim);
}

.pdp__buy {
  display: flex;
  align-items: stretch;
  gap: 12px;
  margin: 30px 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--line-soft);
}

.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 2px;
  flex: none;
}
.qty button {
  width: 42px;
  border: 0;
  background: none;
  color: var(--bone-dim);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: color .3s, background .3s;
}
.qty button:hover { color: var(--ember); background: rgba(255,122,47,.06); }
.qty span {
  min-width: 34px;
  text-align: center;
  font-family: var(--f-display);
  font-size: 19px;
  font-weight: 600;
}

.pdp__add { flex: 1; }

.pdp__meta {
  display: grid;
  gap: 0;
  margin: 34px 0 0;
  border-top: 1px solid var(--line-soft);
}
.pdp__meta > div {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}
.pdp__meta dt {
  margin: 0;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fog);
  padding-top: 3px;
}
.pdp__meta dd { margin: 0; font-size: 14px; line-height: 1.6; color: var(--bone-dim); }

.pdp__detail {
  margin: 30px 0 0;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--bone-dim);
}

.pdp__note {
  display: flex;
  gap: 12px;
  margin: 30px 0 0;
  padding: 18px 20px;
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--ember);
  border-radius: 2px;
  background: rgba(255,122,47,.035);
  font-size: 13px;
  line-height: 1.65;
  color: var(--fog);
}

/* ── 结算页 ───────────────────────────────────────────────── */
.checkout { padding-block: clamp(30px, 4vw, 54px) clamp(80px, 10vw, 130px); }

.checkout__grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: clamp(34px, 5vw, 80px);
  align-items: start;
}

.coform fieldset {
  margin: 0 0 34px;
  padding: 0;
  border: 0;
}
.coform legend {
  padding: 0 0 18px;
  font-family: var(--f-serif);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--bone);
}

.field { display: block; margin-bottom: 16px; }
.field__label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fog);
}
.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(10,9,8,.5);
  color: var(--bone);
  font-family: var(--f-sans);
  font-size: 14.5px;
  transition: border-color .3s, background .3s;
}
.field textarea { min-height: 108px; resize: vertical; line-height: 1.6; }
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: rgba(255,122,47,.6);
  background: rgba(255,122,47,.04);
}
.field input::placeholder,
.field textarea::placeholder { color: rgba(142,131,117,.7); }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.summary {
  position: sticky;
  top: 104px;
  padding: 26px 26px 28px;
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  background: var(--ink-3);
}
.summary h2 {
  margin: 0 0 20px;
  font-family: var(--f-serif);
  font-size: 23px;
  font-weight: 600;
}

.summary__row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}
.summary__row:first-of-type { padding-top: 0; }
.summary__media {
  width: 56px; height: 56px;
  border-radius: 2px;
  overflow: hidden;
  background: #0D0B0A;
}
.summary__media img { width: 100%; height: 100%; object-fit: cover; }
.summary__name { font-size: 14px; line-height: 1.4; }
.summary__qty { display: block; margin-top: 3px; font-size: 12px; color: var(--fog); }
.summary__price {
  font-family: var(--f-display);
  font-size: 18px;
  font-weight: 600;
}

.summary__totals {
  margin: 22px 0 0;
  display: grid;
  gap: 11px;
}
.summary__totals > div {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--bone-dim);
}
.summary__totals > div.is-total {
  padding-top: 14px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
  font-size: 16px;
  color: var(--bone);
}
.summary__totals strong {
  font-family: var(--f-display);
  font-size: 22px;
  font-weight: 600;
}

.summary__note {
  margin: 20px 0 0;
  font-size: 12px;
  line-height: 1.65;
  color: var(--fog);
}

.summary__submit { width: 100%; margin-top: 22px; }

/* 预览版提示：上线接支付前必须删掉 */
.preview-banner {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  margin-bottom: 30px;
  padding: 17px 20px;
  border: 1px dashed rgba(255,122,47,.4);
  border-radius: 2px;
  background: rgba(255,122,47,.05);
  font-size: 13px;
  line-height: 1.6;
  color: var(--bone-dim);
}
.preview-banner strong { color: var(--ember); }

.cart-empty {
  padding: 60px 0;
  text-align: center;
  color: var(--fog);
  font-size: 14px;
}
.cart-empty .btn { margin-top: 20px; }

/* ── 购物车抽屉 ───────────────────────────────────────────── */
.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 9500;
  visibility: hidden;
  pointer-events: none;
}
.cart-drawer.is-open { visibility: visible; pointer-events: auto; }

.cart-drawer__scrim {
  position: absolute;
  inset: 0;
  background: rgba(6,5,5,.66);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .45s var(--ease);
}
.cart-drawer.is-open .cart-drawer__scrim { opacity: 1; }

.cart-drawer__panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--ink-2);
  border-left: 1px solid var(--line-soft);
  transform: translateX(101%);
  transition: transform .5s var(--ease);
}
.cart-drawer.is-open .cart-drawer__panel { transform: none; }

.cart-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line-soft);
}
.cart-drawer__head h2 {
  margin: 0;
  font-family: var(--f-serif);
  font-size: 24px;
  font-weight: 600;
}
.cart-drawer__x {
  width: 34px; height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: none;
  color: var(--bone-dim);
  cursor: pointer;
  transition: border-color .3s, color .3s;
}
.cart-drawer__x:hover { border-color: var(--ember); color: var(--ember); }
.cart-drawer__x svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.6; }

.cart-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 24px;
}

.cart-row {
  position: relative;
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-soft);
}
.cart-row__media {
  display: block;
  width: 74px; height: 74px;
  border-radius: 2px;
  overflow: hidden;
  background: #0D0B0A;
}
.cart-row__media img { width: 100%; height: 100%; object-fit: cover; }
.cart-row__info { padding-right: 26px; }
.cart-row__name {
  display: block;
  font-family: var(--f-serif);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
  transition: color .3s;
}
.cart-row__name:hover { color: var(--ember); }
.cart-row__price {
  display: block;
  margin-top: 5px;
  font-family: var(--f-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--fog);
}

.cart-row__qty {
  display: inline-flex;
  align-items: center;
  margin-top: 11px;
  border: 1px solid var(--line);
  border-radius: 2px;
}
.cart-row__qty button {
  width: 28px; height: 28px;
  border: 0;
  background: none;
  color: var(--bone-dim);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: color .3s, background .3s;
}
.cart-row__qty button:hover { color: var(--ember); background: rgba(255,122,47,.07); }
.cart-row__qty span {
  min-width: 26px;
  text-align: center;
  font-size: 13px;
}

.cart-row__remove {
  position: absolute;
  top: 20px; right: 0;
  width: 22px; height: 22px;
  padding: 0;
  border: 0;
  background: none;
  color: rgba(142,131,117,.65);
  cursor: pointer;
  transition: color .3s;
}
.cart-row__remove:hover { color: #FF6B5B; }
.cart-row__remove svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.cart-drawer__foot {
  padding: 22px 24px 26px;
  border-top: 1px solid var(--line-soft);
  background: var(--ink);
}
.cart-drawer__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 14px;
  color: var(--bone-dim);
}
.cart-drawer__total strong {
  font-family: var(--f-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--bone);
}
.cart-drawer__note {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--fog);
}
.cart-drawer__checkout {
  width: 100%;
  margin-top: 18px;
}
.cart-drawer__keep {
  width: 100%;
  margin-top: 10px;
  background: transparent;
  border-color: rgba(244, 238, 230, .28);
  color: var(--bone-dim);
  font-size: 13px;
}
.cart-drawer__keep:hover { border-color: var(--bone); color: var(--bone); background: rgba(244,238,230,.06); }

body.cart-open { overflow: hidden; }

/* ── 响应式 ───────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 920px) {
  .pdp__grid { grid-template-columns: 1fr; }
  .pdp__media { position: static; }
  .summary { position: static; }
  .checkout__grid { grid-template-columns: 1fr; }
  .shop-bar__right { margin-left: 0; width: 100%; justify-content: space-between; }
}

@media (max-width: 620px) {
  .product-grid { grid-template-columns: 1fr; max-width: 460px; }
  .field-row { grid-template-columns: 1fr; }
  .pdp__buy { flex-direction: column; }
  .qty { align-self: flex-start; }
  .pdp__meta > div { grid-template-columns: 1fr; gap: 5px; }
  .pdp__meta dt { padding-top: 0; }
  .cart-drawer__panel { width: 100%; }
}

/* ── 结算状态 / 回执页 ─────────────────────────────────── */
.co-status { min-height: 1.2em; margin: 6px 0 0; font-size: 14px; line-height: 1.5; }
.co-status--error { color: #e0726b; }

.success { max-width: 640px; margin: 0 auto; }
.success__card {
  background: rgba(244, 238, 230, 0.04);
  border: 1px solid var(--line, rgba(244, 238, 230, 0.16));
  border-radius: 4px;
  padding: 32px 28px;
}
.success__lead { color: var(--bone-dim, #b9b2a7); max-width: 42em; line-height: 1.7; margin: 6px 0 18px; }
.success__items { margin: 18px 0; }
.success__items .summary__row { padding: 12px 0; border-bottom: 1px solid var(--line, rgba(244, 238, 230, 0.12)); }
.success__items .summary__media { display: none; }
.success__note { margin-top: 16px; font-size: 13px; color: var(--bone-dim, #b9b2a7); }

.order-badge {
  display: inline-block;
  margin-left: 10px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(244, 238, 230, 0.12);
  color: var(--bone-dim, #b9b2a7);
  vertical-align: middle;
}
.order-badge--paid { background: rgba(120, 200, 140, 0.18); color: #9fe0b0; }
