/* ==========================================================================
   青岛栖湖数据 · 购物车抽屉 + 结算页
   与 shop.css 共用「暖砂 + 电商红」的零售局部主题
   --------------------------------------------------------------------------
   目录
   01  购物车抽屉
   02  结算页骨架与步骤条
   03  表单控件
   04  订单摘要
   05  下单成功
   06  响应式
   ========================================================================== */

/* ==========================================================================
   01  购物车抽屉
   ========================================================================== */
.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 120;
}

.cart-drawer[hidden] {
  display: none;
}

.cart-drawer__scrim {
  position: absolute;
  inset: 0;
  background: rgba(11, 11, 12, 0.44);
  opacity: 0;
  transition: opacity 0.3s ease;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.cart-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(430px, 94vw);
  background: var(--shop-card);
  border-radius: 28px 0 0 28px;
  box-shadow: -30px 0 70px -42px rgba(30, 20, 6, 0.6);
  transform: translateX(100%);
  transition: transform 0.34s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}

.cart-drawer.is-open .cart-drawer__scrim {
  opacity: 1;
}

.cart-drawer.is-open .cart-drawer__panel {
  transform: none;
}

/* —— 头部 —— */
.cart-drawer__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex: 0 0 auto;
  padding: 22px 22px 16px;
  border-bottom: 1px solid var(--sand-line);
}

.cart-drawer__title {
  font-size: 19px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--ink);
}

.cart-drawer__meta {
  margin-top: 3px;
  font-size: 12px;
  color: var(--txt-faint);
}

.cart-drawer__close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: var(--r-pill);
  color: var(--txt-muted);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.cart-drawer__close svg {
  width: 17px;
  height: 17px;
}

.cart-drawer__close:hover {
  background: var(--sand);
  color: var(--ink);
}

/* —— 列表 —— */
.cart-drawer__listwrap {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 22px;
  -webkit-overflow-scrolling: touch;
}

.cart-drawer__list {
  flex: 0 0 auto;
}

.cart-item {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--sand-line);
}

.cart-item:last-child {
  border-bottom: 0;
}

.cart-item__media {
  display: block;
  width: 78px;
  height: 78px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--shop-img);
}

.cart-item__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.cart-item__name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13.5px;
  line-height: 21px;
  color: var(--ink);
}

.cart-item__price {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  color: var(--price);
}

.cart-item__price .cur {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
}

.cart-item__price .val {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
}

.cart-item__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}

.cart-item__del {
  font-size: 12px;
  color: var(--txt-faint);
  transition: color 0.2s ease;
}

.cart-item__del:hover {
  color: var(--price);
}

/* —— 数量步进 —— */
.qty {
  display: inline-flex;
  align-items: center;
  height: 30px;
  border: 1px solid var(--sand-deep);
  border-radius: var(--r-pill);
  overflow: hidden;
}

.qty button {
  display: grid;
  place-items: center;
  width: 29px;
  height: 28px;
  font-size: 15px;
  line-height: 1;
  color: var(--txt);
  transition: background-color 0.18s ease;
}

.qty button:hover {
  background: var(--sand);
}

.qty button:disabled {
  color: #cfc7b6;
  pointer-events: none;
}

.qty__val {
  min-width: 26px;
  font-family: var(--font-num);
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* —— 空态 —— */
.cart-drawer__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1 1 auto;
  padding: 40px 10px 60px;
  text-align: center;
}

.cart-drawer__empty[hidden] {
  display: none;
}

.cart-drawer__emptyicon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--sand);
  color: #a8977a;
}

.cart-drawer__emptyicon svg {
  width: 26px;
  height: 26px;
}

.cart-drawer__emptytitle {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.cart-drawer__emptytext {
  font-size: 13px;
  line-height: 22px;
  color: var(--txt-faint);
}

.cart-drawer__emptybtn {
  margin-top: 12px;
  padding: 10px 24px;
  border-radius: var(--r-pill);
  background: var(--ink);
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  transition: background-color 0.2s ease;
}

.cart-drawer__emptybtn:hover {
  background: var(--price);
}

/* —— 底部结算区 —— */
.cart-drawer__foot {
  flex: 0 0 auto;
  padding: 16px 22px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--sand-line);
  background: var(--shop-card);
}

.cart-drawer__foot[hidden] {
  display: none;
}

.cart-drawer__sum {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.cart-drawer__sumlabel {
  font-size: 13px;
  color: var(--txt-muted);
}

.cart-drawer__sumval {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-family: var(--font-num);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--price);
  font-variant-numeric: tabular-nums;
}

.cart-drawer__sumval .cur {
  font-family: var(--font-sans);
  font-size: 14px;
}

.cart-drawer__note {
  margin-top: 6px;
  font-size: 12px;
  color: var(--txt-faint);
}

.cart-drawer__checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 14px;
  height: 50px;
  border-radius: var(--r-pill);
  background: var(--ink);
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.22s ease, transform 0.22s ease;
}

.cart-drawer__checkout:hover {
  background: var(--price);
  transform: translateY(-1px);
}

.cart-drawer__clear {
  display: block;
  width: 100%;
  margin-top: 10px;
  font-size: 12px;
  color: var(--txt-faint);
  transition: color 0.2s ease;
}

.cart-drawer__clear:hover {
  color: var(--price);
}

/* 加购时购物车按钮轻微弹一下 */
.cart-btn.is-bumped {
  animation: cart-bump 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cart-bump {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.14);
  }
  100% {
    transform: scale(1);
  }
}

/* 抽屉打开时锁滚动，并补偿滚动条宽度避免页面横跳 */
body.is-cart-locked {
  overflow: hidden;
  padding-right: var(--scrollbar-gap, 0);
}

/* ==========================================================================
   02  结算页骨架与步骤条
   ========================================================================== */
.checkout-main {
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 2vw, 28px);
  padding: clamp(16px, 1.8vw, 26px) var(--gutter) clamp(56px, 6vw, 96px);
}

.co-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.co-step {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  font-size: 13.5px;
  color: var(--txt-faint);
}

.co-step__no {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--sand);
  font-family: var(--font-num);
  font-size: 12px;
  font-weight: 600;
  color: #6f6146;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.co-step.is-current {
  font-weight: 600;
  color: var(--ink);
}

.co-step.is-current .co-step__no {
  background: var(--ink);
  color: #fff;
}

.co-step.is-done .co-step__no {
  background: var(--accent-soft);
  color: #0b4a4f;
}

.co-step__line {
  flex: 1 1 auto;
  height: 1px;
  min-width: 24px;
  background: var(--sand-deep);
}

.checkout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 382px;
  gap: clamp(16px, 1.8vw, 26px);
  align-items: start;
}

.co-form {
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 1.5vw, 18px);
  min-width: 0;
}

.co-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: clamp(18px, 2vw, 26px);
  border-radius: clamp(18px, 1.9vw, 24px);
  background: var(--shop-card);
  border: 1px solid var(--sand-line);
}

.co-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.co-card__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.co-card__hint {
  font-size: 12px;
  color: var(--txt-faint);
}

/* ==========================================================================
   03  表单控件
   ========================================================================== */
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.field-grid[hidden] {
  display: none;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.field--full {
  grid-column: 1 / -1;
}

.field__label {
  font-size: 13px;
  color: var(--txt-muted);
}

.field__label b {
  margin-left: 2px;
  font-weight: 400;
  color: var(--price);
}

.input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--sand-deep);
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input::placeholder {
  color: #b3a894;
}

.input:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(11, 11, 12, 0.07);
}

textarea.input {
  height: auto;
  min-height: 82px;
  padding: 11px 14px;
  line-height: 1.6;
  resize: vertical;
}

.field__err {
  display: none;
  font-size: 12px;
  line-height: 18px;
  color: var(--price);
}

.field.is-invalid .input {
  border-color: var(--price);
  box-shadow: 0 0 0 3px rgba(210, 56, 42, 0.08);
}

.field.is-invalid .field__err {
  display: block;
}

/* —— 单选卡（配送 / 支付） —— */
.choice-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

/* 支付方式：微信 / 支付宝并排两列，对公转账单独占整行 */
.choice-row--pay {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice-row--pay .choice:last-child {
  grid-column: 1 / -1;
}

.choice {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 15px;
  border-radius: 14px;
  border: 1px solid var(--sand-line);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease,
    box-shadow 0.2s ease;
}

.choice:hover {
  border-color: var(--sand-deep);
}

.choice:has(input:checked) {
  border-color: var(--ink);
  background: #fffdf8;
  box-shadow: 0 0 0 1px var(--ink) inset;
}

.choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.choice__mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin-top: 2px;
  border-radius: 50%;
  border: 1px solid var(--sand-deep);
  background: #fff;
  transition: border-color 0.2s ease;
}

.choice__mark::after {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ink);
  transform: scale(0);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.choice input:checked + .choice__mark {
  border-color: var(--ink);
}

.choice input:checked + .choice__mark::after {
  transform: scale(1);
}

.choice input:focus-visible + .choice__mark {
  box-shadow: 0 0 0 3px rgba(11, 11, 12, 0.14);
}

.choice__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.choice__text b {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.choice__text small {
  font-size: 12px;
  line-height: 19px;
  color: var(--txt-faint);
}

.choice__tag {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--price-soft);
  font-size: 11px;
  font-weight: 600;
  color: var(--price-ink);
  white-space: nowrap;
}

/* 非促销类标签（如"企业专线"）走中性色，避免被读成优惠 */
.choice__tag--plain {
  background: var(--sand);
  color: var(--txt-muted);
}

/* —— 分段控件（发票类型） —— */
.seg {
  display: inline-flex;
  align-self: flex-start;
  gap: 4px;
  padding: 4px;
  border-radius: var(--r-pill);
  background: var(--sand);
}

.seg__item {
  position: relative;
  cursor: pointer;
}

.seg__item input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.seg__item span {
  display: block;
  padding: 8px 18px;
  border-radius: var(--r-pill);
  font-size: 13px;
  color: var(--txt-muted);
  transition: background-color 0.22s ease, color 0.22s ease;
}

.seg__item:has(input:checked) span {
  background: #fff;
  font-weight: 600;
  color: var(--ink);
  box-shadow: 0 1px 4px -1px rgba(60, 44, 24, 0.2);
}

.seg__item input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(11, 11, 12, 0.14);
}

/* ==========================================================================
   04  订单摘要
   ========================================================================== */
.co-aside {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 104px;
}

.co-summary {
  padding: 20px;
  border-radius: clamp(18px, 1.9vw, 24px);
  background: var(--shop-card);
  border: 1px solid var(--sand-line);
  box-shadow: var(--shop-shadow);
}

.co-summary__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--sand-line);
}

.co-summary__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.co-summary__count {
  font-size: 12px;
  color: var(--txt-faint);
}

.co-mini {
  display: flex;
  flex-direction: column;
  max-height: 264px;
  margin: 0;
  padding: 4px 0;
  overflow-y: auto;
  list-style: none;
  overscroll-behavior: contain;
}

.co-mini__item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
}

.co-mini__item + .co-mini__item {
  border-top: 1px dashed var(--sand-line);
}

.co-mini__img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--shop-img);
}

.co-mini__name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12.5px;
  line-height: 18px;
  color: var(--txt);
}

.co-mini__qty {
  margin-top: 2px;
  font-size: 11px;
  color: var(--txt-faint);
  font-variant-numeric: tabular-nums;
}

.co-mini__price {
  font-family: var(--font-num);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* 优惠券 */
.co-coupon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--sand-line);
}

.co-coupon__label {
  font-size: 13px;
  color: var(--txt-muted);
  white-space: nowrap;
}

.co-select {
  flex: 0 1 210px;
  min-width: 0;
  height: 36px;
  padding: 0 30px 0 12px;
  border-radius: 10px;
  border: 1px solid var(--sand-deep);
  background-color: #fff;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%236B6B70' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
}

.co-select:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(11, 11, 12, 0.07);
}

/* 金额明细 */
.co-totals {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid var(--sand-line);
}

.co-totals > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.co-totals dt {
  font-size: 13px;
  color: var(--txt-muted);
}

.co-totals dd {
  margin: 0;
  font-family: var(--font-num);
  font-size: 13.5px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.co-totals dd.is-discount {
  color: var(--price);
}

.co-totals__final {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px dashed var(--sand-line);
}

.co-totals__final dt {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.co-totals__final dd {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--price);
}

.co-totals__final dd .cur {
  font-family: var(--font-sans);
  font-size: 14px;
}

.co-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 50px;
  margin-top: 16px;
  border-radius: var(--r-pill);
  background: var(--ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  transition: background-color 0.22s ease, transform 0.22s ease,
    box-shadow 0.22s ease;
}

.co-submit:hover {
  background: var(--price);
  transform: translateY(-1px);
  box-shadow: 0 12px 26px -14px rgba(210, 56, 42, 0.9);
}

.co-submit:disabled {
  background: #b8b0a2;
  transform: none;
  box-shadow: none;
  cursor: not-allowed;
}

.co-summary__agree {
  margin-top: 10px;
  font-size: 11.5px;
  line-height: 19px;
  color: var(--txt-faint);
}

.co-back {
  align-self: flex-start;
  font-size: 13px;
  color: var(--txt-muted);
  transition: color 0.2s ease;
}

.co-back:hover {
  color: var(--ink);
}

/* —— 空购物车 —— */
.co-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: clamp(48px, 8vw, 96px) 24px;
  border-radius: clamp(18px, 1.9vw, 24px);
  background: var(--shop-card);
  border: 1px dashed var(--sand-deep);
  text-align: center;
}

.co-empty[hidden] {
  display: none;
}

.co-empty__title {
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
}

.co-empty__text {
  font-size: 14px;
  line-height: 24px;
  color: var(--txt-faint);
}

.co-empty__actions {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

/* —— 移动端底部提交栏（默认隐藏） —— */
.co-bar {
  display: none;
}

/* ==========================================================================
   05  下单成功
   ========================================================================== */
.co-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: clamp(32px, 4vw, 56px) clamp(20px, 4vw, 56px);
  border-radius: var(--r-panel);
  background: var(--shop-card);
  border: 1px solid var(--sand-line);
  text-align: center;
}

.co-done[hidden] {
  display: none;
}

.co-done__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--accent-mint);
}

.co-done__icon svg {
  width: 28px;
  height: 28px;
}

.co-done__title {
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.35;
  font-weight: 500;
  color: var(--ink);
}

.co-done__sub {
  max-width: 520px;
  font-size: 14px;
  line-height: 24px;
  color: var(--txt-muted);
}

.co-done__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 20px;
  width: 100%;
  max-width: 620px;
  margin: 22px 0 4px;
  padding: 20px 24px;
  border-radius: 18px;
  background: var(--shop-bg);
  text-align: left;
}

.co-done__meta > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.co-done__meta dt {
  font-size: 12px;
  color: var(--txt-faint);
}

.co-done__meta dd {
  margin: 0;
  font-size: 14px;
  line-height: 21px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.co-done__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}

.co-done__note {
  margin-top: 16px;
  max-width: 560px;
  font-size: 12px;
  line-height: 20px;
  color: var(--txt-faint);
}

/* ==========================================================================
   06  响应式
   ========================================================================== */
@media (max-width: 1100px) {
  .checkout-grid {
    grid-template-columns: minmax(0, 1fr) 330px;
  }

  /* 主列变窄后，支付方式三张卡改为竖排，避免副文案挤成两行 */
  .choice-row--pay {
    grid-template-columns: minmax(0, 1fr);
  }

  .choice-row--pay .choice:last-child {
    grid-column: auto;
  }
}

@media (max-width: 860px) {
  /* 抽屉铺满屏幕宽度 */
  .cart-drawer__panel {
    width: 100%;
    max-width: 100%;
    border-radius: 0;
  }

  .checkout-main {
    gap: 16px;
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  .checkout-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* 摘要移到表单下方，不再吸顶 */
  .co-aside {
    position: static;
    order: 2;
  }

  .co-form {
    order: 1;
  }

  .co-steps {
    gap: 6px;
  }

  .co-step {
    font-size: 12.5px;
    gap: 7px;
  }

  .co-step__no {
    width: 22px;
    height: 22px;
    font-size: 11px;
  }

  .co-step__line {
    min-width: 12px;
  }

  .field-grid,
  .choice-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .co-mini {
    max-height: none;
  }

  /* 桌面提交按钮交给底部固定栏 */
  .co-submit {
    display: none;
  }

  .co-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--sand-line);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    backdrop-filter: saturate(180%) blur(18px);
  }

  .co-bar__sum {
    display: flex;
    flex-direction: column;
    gap: 1px;
    font-size: 11px;
    color: var(--txt-faint);
  }

  .co-bar__sum b {
    font-family: var(--font-num);
    font-size: 21px;
    font-weight: 600;
    line-height: 1.15;
    color: var(--price);
    font-variant-numeric: tabular-nums;
  }

  .co-bar__btn {
    flex: 0 0 auto;
    min-width: 148px;
    height: 44px;
    padding: 0 26px;
    border-radius: var(--r-pill);
    background: var(--ink);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
  }

  .co-bar__btn:disabled {
    background: #b8b0a2;
  }

  .co-done__meta {
    grid-template-columns: minmax(0, 1fr);
    padding: 18px;
  }

  .co-done__actions .btn {
    flex: 1 1 auto;
    padding: 13px 20px;
    font-size: 15px;
  }

  /* 结算页没有底部 tabbar，toast 需要抬到提交栏之上 */
  .checkout-page .toast {
    bottom: calc(86px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 480px) {
  .cart-drawer__head {
    padding: 18px 16px 13px;
  }

  .cart-drawer__listwrap {
    padding: 0 16px;
  }

  .cart-drawer__foot {
    padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
  }

  .cart-item {
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 12px;
  }

  .cart-item__media {
    width: 68px;
    height: 68px;
    border-radius: 12px;
  }

  .co-card {
    padding: 16px;
  }

  .co-summary {
    padding: 16px;
  }

  .co-done {
    padding: 28px 18px;
  }
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  .cart-drawer__panel,
  .cart-drawer__scrim {
    transition: none;
  }

  .cart-btn.is-bumped {
    animation: none;
  }
}

/* ==========================================================================
   07  隐藏态兜底
   这些容器自带 display:flex / grid，需要让 hidden 属性真正生效
   ========================================================================== */
.checkout-grid[hidden],
.co-form[hidden],
.co-aside[hidden],
.co-bar[hidden] {
  display: none !important;
}
