/* ==========================================================================
   商品详情页
   ========================================================================== */

/* 详情页没有底部 tab 栏，改为给底部购买栏留位 */
.app--detail { padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }

.pd { padding: 10px 10px 14px; }

/* ---------- 悬浮返回 ---------- */
.pd-topbar {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  width: 100%;
  max-width: 430px;
  padding: 0 10px;
  display: flex;
  pointer-events: none;
}

.pd-back {
  position: relative;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #FFFFFF;
  color: #111111;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* 视觉 30px，点击热区仍保持 46px */
.pd-back::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
}

.pd-back svg { width: 17px; height: 17px; }
.pd-back:active { background: #F2F2F2; }

/* ---------- 商品主图 ---------- */
.pd-gallery {
  position: relative;
  aspect-ratio: 1.84;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 16px;
  background: #EDEDED;
}

.pd-gallery__tag {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #FFFFFF;
  color: #1A1A1A;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
}

.pd-gallery__inner {
  width: 54%;
  height: 100%;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: linear-gradient(180deg, #2F73D2 0%, #1F5CB8 100%);
  color: #FFFFFF;
  text-align: center;
}

.pd-gallery__logo { width: 118px; height: auto; margin-bottom: 2px; }

.pd-gallery__brand {
  font-size: 26px;
  font-weight: 800;
  font-style: italic;
  letter-spacing: 3px;
  line-height: 1.15;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

.pd-gallery__en {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.6px;
  opacity: 0.92;
}

/* 主图配色按商品品牌切换 */
.pd-gallery__inner--jd { background: linear-gradient(180deg, #EF3B2E 0%, #C3140C 100%); }
.pd-gallery__inner--qq { background: linear-gradient(180deg, #2C9BF0 0%, #0B69C9 100%); }

.pd-gallery__inner--agent {
  background: linear-gradient(180deg, #F3DA9E 0%, #D3AA55 100%);
  color: #6B4E14;
}

.pd-gallery__inner--cmcc {
  background: linear-gradient(180deg, #EDF5FB 0%, #C9E0F2 100%);
  color: #1B5FA8;
}

.pd-gallery__inner--agent .pd-gallery__brand,
.pd-gallery__inner--agent .pd-gallery__en,
.pd-gallery__inner--cmcc .pd-gallery__brand,
.pd-gallery__inner--cmcc .pd-gallery__en { text-shadow: none; }

/* ---------- 商品基本信息 ---------- */
.pd-info {
  margin-top: 10px;
  padding: 16px;
  background: #FFFFFF;
  border-radius: 16px;
}

.pd-info__title { font-size: 20px; font-weight: 800; letter-spacing: 0.3px; }

.pd-info__price {
  display: flex;
  align-items: baseline;
  gap: 1px;
  margin-top: 10px;
  color: var(--gold-deep);
  font-weight: 800;
}

.pd-info__price i { font-style: normal; font-size: 19px; }
.pd-info__price b { font-size: 30px; letter-spacing: -0.5px; }

.pd-info__sold { margin-top: 10px; font-size: 13px; color: #9E9E9E; }
.pd-info__desc { margin-top: 8px; font-size: 14px; color: #4A4A4A; }

/* ---------- 通用分区卡片 ---------- */
.pd-card {
  margin-top: 10px;
  overflow: hidden;
  background: #FFFFFF;
  border-radius: 16px;
}

.pd-card__head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 16px;
  background: #F8F4EC;
  border-bottom: 1px solid #F1EBE0;
}

.pd-card__icon {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FBF3E1;
  border: 1px solid #F0E3C4;
  color: var(--gold);
}

.pd-card__icon svg { width: 15px; height: 15px; }
.pd-card__icon--round { border-radius: 50%; }

.pd-card__title { font-size: 16px; font-weight: 700; }

.pd-card__body { background: #FFFFFF; }
.pd-card--tinted .pd-card__body { background: #FBF8F2; }

/* ---------- 商品详情 ---------- */
.pd-detail { padding: 12px; }

.pd-detail__box {
  padding: 16px 14px;
  background: #FFFFFF;
  border: 1px solid #F1EEE7;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.78;
  color: #333333;
}

.pd-detail__gap { margin-top: 15px; }
.pd-detail__mark { color: #E23B2E; }

/* ---------- 选择规格 ---------- */
.pd-spec { padding: 14px 16px 20px; }

.pd-spec__item {
  display: block;
  width: 47%;
  max-width: 168px;
  padding: 13px 12px 12px;
  text-align: left;
  border-radius: 12px;
  border: 1px solid #EBD79B;
  background: linear-gradient(140deg, #FAEFCE 0%, #F1DFA4 52%, #E5CB84 100%);
  box-shadow: 0 2px 8px rgba(198, 166, 92, 0.2);
}

.pd-spec__name {
  display: block;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  color: #3B2C10;
}

.pd-spec__price {
  display: flex;
  align-items: baseline;
  gap: 1px;
  margin-top: 10px;
  color: #8A6614;
  font-weight: 800;
}

.pd-spec__price i { font-style: normal; font-size: 13px; }
.pd-spec__price b { font-size: 17px; }

/* ---------- 使用优惠券 ---------- */
.pd-coupon { padding: 14px 16px 16px; }
.pd-coupon__row { display: flex; gap: 10px; }

.pd-coupon__input {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: #FFFFFF;
  border: 1px solid #EDEAE2;
  border-radius: 10px;
  outline: none;
  -webkit-appearance: none;
}

.pd-coupon__input::placeholder { color: #B6B6B6; }
.pd-coupon__input:focus { border-color: var(--gold-border); }

.pd-coupon__verify {
  flex: none;
  width: 70px;
  height: 46px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  color: #3C3C3C;
  background: #FFFFFF;
  border: 1px solid var(--gold-border);
  box-shadow: 0 1px 4px rgba(198, 170, 100, 0.16);
}

.pd-coupon__tip { margin-top: 10px; font-size: 13px; color: #ACACAC; }

/* ---------- 购买数量 ---------- */
.pd-qty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 18px;
}

.pd-qty__label { font-size: 14px; color: #3C3C3C; }

.pd-qty__stepper {
  display: flex;
  align-items: center;
  width: 152px;
  height: 46px;
  background: #FFFFFF;
  border: 1px solid #EDEAE2;
  border-radius: 999px;
}

.pd-qty__btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  color: #8A8A8A;
}

.pd-qty__btn:disabled { color: #D2D2D2; }

.pd-qty__num {
  flex: none;
  width: 42px;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
}

/* ---------- 底部购买栏 ---------- */
.pd-bar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 50;
  width: 100%;
  max-width: 430px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  background: #FFFFFF;
  border-top: 1px solid #EFECE6;
}

.pd-bar__total { flex: none; font-size: 14px; color: #2B2B2B; white-space: nowrap; }
.pd-bar__total b { margin-left: 2px; font-size: 18px; font-weight: 800; color: var(--gold-deep); }

.pd-bar__buy {
  margin-left: auto;
  width: 53%;
  max-width: 210px;
  height: 46px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  color: #4A3714;
  background: linear-gradient(180deg, #F7E5AE 0%, #E4C574 100%);
  box-shadow: 0 2px 10px rgba(200, 170, 90, 0.3);
}

.pd-bar__buy:active { background: linear-gradient(180deg, #F0DA97 0%, #D9B85F 100%); }

/* ---------- 轻提示 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 90;
  max-width: 260px;
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(30, 30, 30, 0.88);
  color: #FFFFFF;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.toast[hidden] { display: none; }
