/* ==========================================================
   首页快速购买弹窗（js/pages/quickbuy.js）
   复用 shop.css 的 .modal / .choice / .qty / .field / .summary，这里只放弹窗自己的排版
   ========================================================== */

.qb .modal__box { width: min(100%, 520px); }
.qb .modal__title { font-size: 20px; overflow-wrap: anywhere; }
.qb .modal__body { gap: 14px; }

/* 头部：图 + 价格 + 销量 / 库存 / 发货方式 */
.qb-head { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 14px; align-items: center; }
.qb-head__img {
  width: 76px; height: 76px; border-radius: 16px; overflow: hidden;
  border: 2px solid var(--choco); background: rgb(191 213 233 / .35);
  display: grid; place-items: center;
}
.qb-head__img img { width: 100%; height: 100%; object-fit: cover; }
.qb-head__img [data-dd] { width: 58px; height: 58px; }
.qb-head__price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px; color: #C2546D; }
.qb-head__price .price--big { font-size: 30px; }
.qb-head__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; color: var(--ink-3); }
.qb-head__sold { margin-right: 2px; }

/* 商品说明：限高可滚动 */
.qb-desc {
  max-height: 168px; overflow: auto;
  padding: 10px 14px; border-radius: 14px;
  background: rgb(191 213 233 / .22); border: 2px dashed var(--line);
  font-size: 14px;
}
.qb-desc:focus-visible { outline: 3px solid var(--choco); outline-offset: 2px; }
.qb-desc .rich p, .qb-desc .rich ul { margin: 0 0 6px; }
.qb-desc .rich > :last-child { margin-bottom: 0; }

/* 表单区 */
.qb-form { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; border-top: 2px dashed var(--line); }
.qb-row { display: flex; flex-direction: column; gap: 8px; }
.qb-row[hidden] { display: none; }
.qb-row--inline { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.qb-label { font-size: 14px; font-weight: 600; }
.qb-qty { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px 10px; }
.qb-qty .qty input:disabled { opacity: .5; }
.qb-qty .field__hint { text-align: right; }

.qb-contact { display: flex; flex-direction: column; gap: 10px; }
.qb-contact[hidden], .qb-guest[hidden], .qb-member[hidden] { display: none; }
.qb-guest { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.qb-member { font-size: 14px; line-height: 1.6; color: var(--ink-2); overflow-wrap: anywhere; }
.qb-show { font-weight: 400; font-size: 13px; gap: 4px; margin-left: 8px; }
.qb-show input { width: 15px; height: 15px; }

.qb-coupon__line { display: flex; gap: 8px; }
.qb-coupon__line .input { flex: 1; min-width: 0; text-transform: uppercase; }
.qb-coupon__field[hidden], .qb-coupon__on[hidden] { display: none; }
.qb-coupon__on { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 14px; }
.qb-coupon__bad { color: #B23A55; }

.qb-formnote, .qb-login { font-size: 14px; }
.qb-login__btns { display: flex; gap: 8px; margin-top: 8px; }

/* 支付方式 */
.qb-channels { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.qb-channels[hidden] { display: none; }
.qb-channel > span { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 46px; }
.qb-channel__name { display: flex; flex-direction: column; line-height: 1.3; font-weight: 600; }
.qb-channel__name small { font-weight: 400; }
.qb-channel__icon {
  flex: none; width: 24px; height: 24px; border-radius: 7px;
  display: grid; place-items: center;
  font: 700 13px/1 var(--font-body); font-style: normal; color: #fff;
  background: var(--cocoa);
}
.qb-channel--alipay .qb-channel__icon { background: #1677FF; }
.qb-channel--alipay .qb-channel__icon::before { content: "支"; }
.qb-channel--wxpay .qb-channel__icon { background: #07C160; }
.qb-channel--wxpay .qb-channel__icon::before { content: "微"; }
.qb-channel--qqpay .qb-channel__icon { background: #12B7F5; }
.qb-channel--qqpay .qb-channel__icon::before { content: "Q"; }
.qb-channel--other .qb-channel__icon::before { content: "¥"; }

/* 合计 */
.qb-sum { padding: 12px 14px; border-radius: 16px; background: rgb(252 228 233 / .55); border: 2px solid var(--choco); transition: opacity .15s; }
.qb-sum.is-stale { opacity: .6; }
.qb-sum__rows { margin-bottom: 8px; }
.qb-sum__rows[hidden] { display: none; }
.qb-sum .summary__total { margin-top: 0; padding-top: 0; border-top: 0; }
.qb-sum__rows:not([hidden]) + .summary__total { padding-top: 8px; border-top: 2px dashed var(--line); }
.qb-sum .summary__total .price { color: #C2546D; }
.qb-sum__status { margin-top: 4px; min-height: 0; }
.qb-sum__status:empty { display: none; }
.qb-sum__status.is-bad { color: #B23A55; }

.qb-hint { text-align: center; }
.qb-error { text-align: center; }
.qb-submit { font-size: 17px; padding-block: 12px; }
.qb-more { align-self: center; font-size: 13px; }

/* 商品卡可以直接点开弹窗：给个手型 */
.pcard { cursor: pointer; }

@media (max-width: 560px) {
  .qb.modal { padding: 8px; align-items: end; }
  .qb .modal__box { max-height: calc(100vh - 16px); border-radius: 22px 22px 18px 18px; }
  .qb-guest { grid-template-columns: 1fr; }
  .qb-head { grid-template-columns: 64px minmax(0, 1fr); }
  .qb-head__img { width: 64px; height: 64px; }
}
