/* Shopify Checkout–style customer page (scoped; does not alter 3DS / result screens) */
:root {
  --ch-bg: #ffffff;
  --ch-text: #202223;
  --ch-text-secondary: #6d7175;
  --ch-border: #c9cccf;
  --ch-border-light: #e3e5e7;
  --ch-summary-bg: #fafafa;
  --ch-radius: 5px;
  --ch-radius-shell: 8px;
  --ch-font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif;
  --ch-black: #000000;
  --ch-focus: #1773b0;
  --ch-skeleton-base: #e8e9eb;
  --ch-skeleton-shine: #f4f5f6;
  /* iOS Safari：可编辑字段 < 16px 会强制缩放视口；结账表单统一 16px */
  --ch-input-font: 16px;
  --ch-label-float: 13px;
  --ch-input-pad-top: 22px;
  --ch-input-pad-x: 14px;
  --ch-input-pad-bottom: 12px;
  --ch-input-min-h: 52px;
}

body:has(#screen-checkout:not(.hidden)) {
  background: #fafafa;
}

.checkout-shopify-page {
  position: relative;
  font-family: var(--ch-font);
  color: var(--ch-text);
  background: var(--ch-bg);
  min-height: 100vh;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 16px 48px;
  box-sizing: border-box;
}

.checkout-main {
  min-height: 40vh;
}

/* —— Initial load skeleton (Shopify-style) —— */
@keyframes ch-sk-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.checkout-skeleton {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  min-height: 100vh;
  z-index: 30;
  padding: 0 16px 40px;
  margin: 0 -16px;
  background: #fafafa;
  transition: opacity 0.38s ease, visibility 0.38s ease;
}

.checkout-skeleton.checkout-skeleton--hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* 分模块骨架：各块独立卡片 + 错峰 shimmer */
.checkout-skeleton__module {
  border: 1px solid var(--ch-border-light);
  border-radius: 8px;
  background: var(--ch-bg);
  margin-bottom: 14px;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.checkout-skeleton__module--header {
  border: none;
  box-shadow: none;
  padding: 4px 0 8px;
  margin-bottom: 2px;
  background: transparent;
}

.checkout-skeleton__module--summary {
  padding: 14px 16px 16px;
  background: var(--ch-summary-bg);
}

.checkout-skeleton__module--form .checkout-skeleton__section {
  margin-top: 0;
}

.checkout-skeleton__module--payment .checkout-skeleton__payment-heading {
  margin-top: 0;
}

.checkout-skeleton__module[data-sk-delay="0"] .ch-sk {
  animation-delay: 0s;
}
.checkout-skeleton__module[data-sk-delay="1"] .ch-sk {
  animation-delay: 0.1s;
}
.checkout-skeleton__module[data-sk-delay="2"] .ch-sk {
  animation-delay: 0.22s;
}
.checkout-skeleton__module[data-sk-delay="3"] .ch-sk {
  animation-delay: 0.34s;
}
.checkout-skeleton__module[data-sk-delay="4"] .ch-sk {
  animation-delay: 0.46s;
}

.ch-sk--modtitle {
  width: 36%;
  height: 14px;
  margin-bottom: 4px;
  border-radius: 4px;
}

.checkout-skeleton__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 10px;
  border-bottom: 1px solid var(--ch-border-light);
}

.checkout-skeleton__module--summary .checkout-skeleton__summary {
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
}

.checkout-skeleton__summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0 12px;
}

.checkout-skeleton__line {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding-bottom: 14px;
}

.checkout-skeleton__line-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 6px;
}

.checkout-skeleton__ledger {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 8px;
}

.checkout-skeleton__section {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkout-skeleton__field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ch-sk {
  display: block;
  background: linear-gradient(
    110deg,
    var(--ch-skeleton-base) 0%,
    var(--ch-skeleton-shine) 42%,
    var(--ch-skeleton-base) 84%
  );
  background-size: 220% 100%;
  animation: ch-sk-shimmer 1.35s ease-in-out infinite;
  border-radius: 5px;
}

.ch-sk--brand {
  width: 42%;
  max-width: 180px;
  height: 22px;
}

.ch-sk--icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.ch-sk--text-md {
  width: 38%;
  height: 14px;
}

.ch-sk--text-sm {
  width: 72px;
  height: 16px;
}

.ch-sk--thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  flex-shrink: 0;
}

.ch-sk--line {
  width: 100%;
  height: 12px;
}

.ch-sk--line-short {
  width: 55%;
  height: 10px;
}

.ch-sk--bar {
  width: 100%;
  height: 44px;
  margin-bottom: 4px;
}

.ch-sk--ledger-row {
  width: 100%;
  height: 14px;
}

.ch-sk--heading {
  width: 28%;
  height: 18px;
  margin-bottom: 2px;
}

.ch-sk--field {
  width: 100%;
  height: 48px;
}

.ch-sk--field-half {
  width: 100%;
  height: 48px;
}

.ch-sk--check {
  width: 72%;
  height: 18px;
}

/* Payment 区块骨架（对齐 Shopify：头行 + 浅灰区 + 白字段槽 + 锁 / 问号） */
.checkout-skeleton__payment-heading {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.ch-sk--payment-h2 {
  width: 78px;
  height: 17px;
  border-radius: 4px;
}

.ch-sk--payment-subline {
  width: min(100%, 300px);
  height: 11px;
  border-radius: 4px;
}

.checkout-skeleton__payment-card {
  border: 1px solid #d9d9d9;
  border-radius: var(--ch-radius-shell);
  overflow: hidden;
  background: #fff;
}

.checkout-skeleton__payment-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 13px;
  background: #fff;
  border-bottom: 1px solid #d9d9d9;
}

.ch-sk--pay-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ch-sk--pay-cc-title {
  flex: 1;
  height: 15px;
  max-width: 104px;
  border-radius: 4px;
}

.checkout-skeleton__payment-brands {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.ch-sk--pay-logo {
  width: 38px;
  height: 24px;
  border-radius: 3px;
  flex-shrink: 0;
}

.ch-sk--pay-more-badge {
  width: 28px;
  height: 24px;
  border-radius: 4px;
  flex-shrink: 0;
}

.checkout-skeleton__payment-fields {
  background: #f4f4f4;
  padding: 12px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkout-skeleton__pay-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid #e1e1e1;
  border-radius: 5px;
  box-sizing: border-box;
}

.ch-sk--pay-field-bar {
  flex: 1;
  height: 11px;
  border-radius: 4px;
  max-width: 42%;
}

.ch-sk--pay-field-bar--wide {
  max-width: 58%;
}

.ch-sk--pay-field-bar--mid {
  max-width: 50%;
}

.ch-sk--pay-field-icon {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  flex-shrink: 0;
  opacity: 0.92;
}

.ch-sk--pay-field-icon--round {
  border-radius: 50%;
}

.checkout-skeleton__pay-billing {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-top: 2px;
}

.ch-sk--pay-billing-cb {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  flex-shrink: 0;
  margin-top: 1px;
}

.ch-sk--pay-billing-text {
  flex: 1;
  height: 14px;
  max-width: 280px;
  border-radius: 4px;
  margin-top: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .ch-sk {
    animation: none;
    background: var(--ch-skeleton-base);
  }

  .checkout-skeleton {
    transition: opacity 0.15s ease;
  }
}

.checkout-shopify-page *,
.checkout-shopify-page *::before,
.checkout-shopify-page *::after {
  box-sizing: border-box;
}

.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;
}

/* Header */
.ch-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 16px 0 12px;
  border-bottom: 1px solid var(--ch-border-light);
}

.ch-header__spacer {
  width: 40px;
  height: 1px;
}

.ch-header__brand {
  justify-self: center;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ch-black);
}

.ch-header__cart {
  justify-self: end;
  border: none;
  background: transparent;
  padding: 8px;
  cursor: default;
  color: var(--ch-black);
  line-height: 0;
}

/* Order summary */
.ch-order-summary {
  margin: 0 -16px;
  background: var(--ch-summary-bg);
  border-bottom: 1px solid var(--ch-border-light);
}

.ch-os-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: none;
  background: transparent;
  font: inherit;
  cursor: pointer;
  text-align: left;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.ch-os-toggle:hover {
  background: rgba(0, 0, 0, 0.03);
}

.ch-os-toggle:focus-visible {
  outline: 2px solid var(--ch-focus);
  outline-offset: 2px;
}

.ch-os-toggle__left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--ch-text);
}

.ch-os-toggle strong {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ch-black);
}

.ch-os-toggle__chev {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.ch-order-summary.is-collapsed .ch-os-toggle__chev {
  transform: rotate(180deg);
}

.ch-order-summary.is-collapsed .ch-os-body {
  display: none;
}

.ch-os-body {
  padding: 0 16px 16px;
}

.ch-line-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding-bottom: 16px;
}

.ch-line-item__thumb-wrap {
  position: relative;
  flex-shrink: 0;
}

.ch-line-item__thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  border: 1px solid var(--ch-border-light);
  background: linear-gradient(145deg, #e8e9eb 0%, #f4f5f6 100%);
}

.ch-qty {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--ch-black);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ch-line-item__meta {
  flex: 1;
  min-width: 0;
  padding-top: 4px;
}

.ch-line-item__title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
}

.ch-line-item__variant {
  font-size: 0.8rem;
  color: var(--ch-text-secondary);
  margin-top: 4px;
}

.ch-line-item__price {
  font-size: 0.9rem;
  font-weight: 500;
  padding-top: 4px;
}

.ch-discount-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.ch-discount-row input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--ch-border-light);
  border-radius: var(--ch-radius);
  font-size: var(--ch-input-font);
  background: #f5f5f5;
  color: var(--ch-text);
}

.ch-discount-row input:focus {
  outline: none;
  border-color: var(--ch-black);
  box-shadow: 0 0 0 1px var(--ch-black);
}

.ch-discount-row button {
  padding: 12px 18px;
  border-radius: var(--ch-radius);
  border: 1px solid var(--ch-border);
  background: #fafafa;
  color: var(--ch-text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: not-allowed;
}

.ch-ledger__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.9rem;
  padding: 6px 0;
  gap: 12px;
}

.ch-ledger__row--muted .ch-ledger__label {
  color: var(--ch-text-secondary);
}

.ch-ledger__row--muted > span:last-child {
  color: var(--ch-text-secondary);
  font-size: 0.875rem;
  text-align: right;
}

.ch-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 4px;
  border-radius: 50%;
  border: 1px solid var(--ch-border);
  font-size: 10px;
  color: var(--ch-text-secondary);
  vertical-align: middle;
}

.ch-help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 4px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  vertical-align: middle;
  color: inherit;
}

.ch-help-btn__glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--ch-border);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  color: var(--ch-text-secondary);
}

.ch-help-btn:hover .ch-help-btn__glyph,
.ch-help-btn:focus-visible .ch-help-btn__glyph {
  border-color: var(--ch-text-secondary);
  color: var(--ch-text);
}

.ch-help-btn:focus-visible {
  outline: 2px solid var(--ch-focus);
  outline-offset: 2px;
}

.ch-help-btn[aria-expanded="true"] .ch-help-btn__glyph {
  border-color: var(--ch-black);
  color: var(--ch-black);
}

.ch-ledger-tip {
  margin: -2px 0 8px;
  padding: 10px 12px;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--ch-text-secondary);
  background: #f6f6f6;
  border-radius: var(--ch-radius);
  border: 1px solid var(--ch-border-light);
}

.ch-ledger__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  margin-top: 8px;
  border-top: 1px solid var(--ch-border-light);
  font-size: 1rem;
}

.ch-ledger__total-label {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ch-black);
}

.ch-ledger__total-amount {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.ch-total-ccy {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ch-text-secondary);
  text-transform: uppercase;
}

.ch-ledger__total .ch-total-strong {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ch-black);
}

/* Form sections */
#pay-form.checkout-shopify-form {
  margin: 0;
  padding: 0;
}

.ch-section {
  margin-top: 24px;
}

/* 邮箱域名建议（与地址 Suggestions 下拉同一套样式） */
.ch-email-autocomplete {
  position: relative;
  margin-bottom: 12px;
}

.ch-email-autocomplete > .ch-field {
  margin-bottom: 0;
}

.ch-section__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.ch-section h2 {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ch-black);
}

.ch-link {
  font-size: 0.85rem;
  color: var(--ch-focus);
  text-decoration: underline;
  cursor: default;
  pointer-events: none;
}

.ch-shipping-hint {
  margin: 4px 0 12px;
  font-size: 0.85rem;
  color: var(--ch-text-secondary);
}

.ch-shipping-box {
  padding: 16px;
  background: var(--ch-summary-bg);
  border-radius: var(--ch-radius);
  border: 1px solid var(--ch-border-light);
  font-size: 0.9rem;
  color: var(--ch-text-secondary);
  text-align: center;
}

/* Floating label fields（与 Shopify 一致：标签上浮 + 16px 防 iOS 缩放；.is-floating 由 JS 驱动以兼容 autofill） */
.ch-field {
  position: relative;
  margin-bottom: 12px;
}

.ch-field--half {
  margin-bottom: 0;
}

.ch-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.ch-field--float input,
.ch-field--float select {
  width: 100%;
  margin: 0;
  padding: var(--ch-input-pad-top) var(--ch-input-pad-x) var(--ch-input-pad-bottom);
  border: 1px solid var(--ch-border);
  border-radius: var(--ch-radius);
  font-size: var(--ch-input-font);
  line-height: 1.25;
  min-height: var(--ch-input-min-h);
  color: var(--ch-text);
  background-color: var(--ch-bg);
  appearance: none;
  -webkit-appearance: none;
}

.ch-field--float select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236d7175' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
  cursor: pointer;
}

.ch-field--float label {
  position: absolute;
  left: calc(var(--ch-input-pad-x) - 1px);
  top: 50%;
  transform: translateY(-50%);
  max-width: calc(100% - 48px);
  font-size: var(--ch-input-font);
  line-height: 1.2;
  color: var(--ch-text-secondary);
  pointer-events: none;
  transition: top 0.15s ease, transform 0.15s ease, font-size 0.15s ease, color 0.15s ease;
  background: linear-gradient(to bottom, var(--ch-bg) 55%, transparent 55%);
  padding: 0 4px;
  margin-left: -4px;
  z-index: 2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ch-field--float input:focus,
.ch-field--float select:focus {
  outline: 2px solid var(--ch-black);
  outline-offset: -1px;
  border-color: var(--ch-black);
  box-shadow: none;
}

/* WebKit 自动填充背景色与标签层 */
.ch-field--float input:-webkit-autofill,
.ch-field--float input:-webkit-autofill:hover,
.ch-field--float input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--ch-bg) inset;
  box-shadow: 0 0 0 1000px var(--ch-bg) inset;
  -webkit-text-fill-color: var(--ch-text);
}

@keyframes ch-autofill-detect {
  from {
    opacity: 1;
  }
  to {
    opacity: 1;
  }
}

.ch-field--float input:-webkit-autofill {
  animation-name: ch-autofill-detect;
  animation-duration: 0.001s;
}

.ch-field--float.is-floating label,
.ch-field--float.has-value label {
  top: 10px;
  transform: translateY(0);
  font-size: var(--ch-label-float);
  line-height: 1.15;
  color: var(--ch-text-secondary);
  max-width: calc(100% - 8px);
}

.ch-field--icon {
  position: relative;
}

/* 图标对齐输入文字区域底部，避免与上浮标签重叠 */
.ch-field--icon .ch-input-icon {
  position: absolute;
  right: var(--ch-input-pad-x);
  bottom: calc(var(--ch-input-pad-bottom) + 2px);
  width: 20px;
  height: 20px;
  color: var(--ch-text-secondary);
  pointer-events: none;
  z-index: 1;
}

.ch-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 15px;
  line-height: 1.35;
  margin: 12px 0 0;
  cursor: pointer;
}

.ch-check input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--ch-black);
}

.ch-check input[type="checkbox"] {
  border-radius: 4px;
}

/* 地址自动完成（Photon komoot，浏览器直连） */
.ch-address-autocomplete {
  position: relative;
  margin-bottom: 12px;
}

.ch-address-autocomplete > .ch-field {
  margin-bottom: 8px;
}

.ch-address-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 4px;
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--ch-text-secondary);
}

.ch-address-hint__icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  border-radius: 50%;
  border: 1px solid var(--ch-border);
  font-size: 10px;
  font-weight: 600;
  font-style: normal;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ch-text-secondary);
}

.ch-address-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 4px);
  z-index: 40;
  background: var(--ch-bg);
  border: 1px solid var(--ch-border-light);
  border-radius: var(--ch-radius-shell);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.ch-address-suggest__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #f3f3f3;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ch-text-secondary);
  text-transform: uppercase;
}

.ch-address-suggest__close {
  border: none;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
  color: var(--ch-text-secondary);
}

.ch-address-suggest__list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
}

.ch-address-suggest__item {
  margin: 0;
  padding: 12px 14px;
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--ch-text-secondary);
  cursor: pointer;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  background: var(--ch-bg);
  display: block;
  box-sizing: border-box;
}

.ch-address-suggest__item strong {
  font-weight: 700;
  color: var(--ch-black);
}

.ch-address-suggest__item:hover,
.ch-address-suggest__item.is-active {
  background: var(--ch-black);
  color: #fff;
}

.ch-address-suggest__item:hover strong,
.ch-address-suggest__item.is-active strong {
  color: #fff;
}

.ch-email-autocomplete .ch-address-suggest {
  top: calc(100% - 2px);
}

.ch-shipping-hint--title {
  margin-top: 20px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ch-black);
}

.ch-shipping-skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0 12px;
}

.ch-shipping-skeleton__row {
  height: 52px;
  border-radius: var(--ch-radius);
}

.ch-shipping-skeleton__row--short {
  width: 72%;
}

.ch-shipping-skeleton--cleared {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.ch-shipping-methods {
  border: 1px solid var(--ch-border-light);
  border-radius: var(--ch-radius-shell);
  overflow: hidden;
  background: var(--ch-bg);
}

.ch-ship-option {
  display: block;
  margin: 0;
  cursor: pointer;
  border-bottom: 1px solid var(--ch-border-light);
  position: relative;
}

.ch-ship-option:last-child {
  border-bottom: none;
}

.ch-ship-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.ch-ship-option__main {
  display: block;
  padding: 14px 14px 12px;
  transition: background 0.12s ease;
}

.ch-ship-option:hover .ch-ship-option__main {
  background: rgba(0, 0, 0, 0.02);
}

.ch-ship-option__line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ch-ship-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #8a8a8a;
  flex-shrink: 0;
  box-sizing: border-box;
}

.ch-ship-option input:checked + .ch-ship-option__main .ch-ship-radio {
  border-color: var(--ch-black);
  background: radial-gradient(circle at center, var(--ch-black) 42%, var(--ch-bg) 44%);
}

.ch-ship-option__name {
  flex: 1;
  font-size: 0.95rem;
  color: var(--ch-text);
}

.ch-ship-option__price {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ch-text);
}

.ch-ship-option__sub {
  display: block;
  margin: 4px 0 0 28px;
  font-size: 0.8rem;
  color: var(--ch-text-secondary);
}

/* Payment（对齐 Shopify 结账：外白框 #d9d9d9、卡片区浅灰底、白输入框） */
.ch-pay-intro {
  margin: 0 0 10px;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--ch-text-secondary);
}

.ch-payment-shell {
  border: 1px solid #d9d9d9;
  border-radius: var(--ch-radius-shell);
  overflow: visible;
  margin-top: 12px;
  background: #ffffff;
  box-shadow: none;
}

.ch-pay-method-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 13px;
  background: #ffffff;
  border-bottom: 1px solid #d9d9d9;
  border-radius: 7px 7px 0 0;
}

.ch-pay-radio {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #8a8a8a;
  background: #ffffff;
  box-sizing: border-box;
}

.ch-pay-radio--on {
  border-color: var(--ch-black);
  background: radial-gradient(circle at center, var(--ch-black) 44%, #ffffff 46%);
}

.ch-pay-method-label {
  flex: 1;
  font-weight: 400;
  font-size: 16px;
  color: var(--ch-text);
  min-width: 0;
}

.ch-pay-brands {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
  position: relative;
}

.ch-pay-brand {
  display: block;
  width: 38px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 3px;
  overflow: hidden;
  line-height: 0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
  background: #fff;
}

.ch-pay-brand img {
  width: 38px;
  height: 24px;
  display: block;
  object-fit: contain;
  object-position: center;
}

.ch-pay-more {
  position: relative;
  flex-shrink: 0;
  margin-left: 2px;
}

.ch-pay-more__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 6px;
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  color: #5c5f62;
  background: #e3e5e7;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.ch-pay-more__btn:hover {
  background: #d8dbde;
}

.ch-pay-more__btn:focus-visible {
  outline: 2px solid var(--ch-focus);
  outline-offset: 2px;
}

.ch-pay-more__popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 60;
  width: max-content;
  max-width: min(292px, calc(100vw - 40px));
  padding: 14px 14px 16px;
  background: #1a1a1a;
  border-radius: 10px;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.38);
}

.ch-pay-more__popover::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 8px;
  border: 7px solid transparent;
  border-top-color: #1a1a1a;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.12));
}

.ch-pay-more__grid {
  display: grid;
  grid-template-columns: repeat(3, 38px);
  gap: 10px 14px;
  justify-content: center;
}

.ch-pay-more__grid .ch-pay-brand--popover:nth-child(7) {
  grid-column: 2;
}

.ch-pay-brand--popover {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.ch-pay-method-body {
  background: #f6f6f6;
  border-radius: 0 0 7px 7px;
}

.ch-field--expiry-single input {
  letter-spacing: 0.04em;
}

#ch-field-cardNo.ch-field--error input {
  border-color: #d72c0d;
}

#ch-field-cardNo.ch-field--error input:focus {
  outline-color: #d72c0d;
  border-color: #d72c0d;
}

#ch-field-cardExpiry.ch-field--error input {
  border-color: #d72c0d;
}

#ch-field-cardExpiry.ch-field--error input:focus {
  outline-color: #d72c0d;
  border-color: #d72c0d;
}

.ch-field-error {
  margin: -6px 0 10px;
  font-size: 0.8rem;
  line-height: 1.35;
  color: #d72c0d;
}

.ch-pay-card-fields {
  padding: 12px 14px 16px;
  background: transparent;
}

.ch-pay-method-body .ch-field--float label {
  background: linear-gradient(to bottom, #f6f6f6 58%, transparent 58%);
  color: #6d7175;
}

.ch-pay-method-body .ch-field--float.is-floating label,
.ch-pay-method-body .ch-field--float.has-value label {
  color: #6d7175;
}

.ch-pay-method-body .ch-field--float input,
.ch-pay-method-body .ch-field--float select {
  background-color: #ffffff;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  min-height: 48px;
  padding-top: 20px;
  padding-bottom: 11px;
  color: #202223;
  box-shadow: none;
}

.ch-pay-method-body .ch-field--float input::placeholder {
  color: #707070;
  opacity: 1;
}

.ch-pay-method-body .ch-field--float input:focus,
.ch-pay-method-body .ch-field--float select:focus {
  outline: 2px solid #202223;
  outline-offset: -1px;
  border-color: #202223;
  box-shadow: none;
}

.ch-pay-method-body .ch-field--float input:-webkit-autofill,
.ch-pay-method-body .ch-field--float input:-webkit-autofill:hover,
.ch-pay-method-body .ch-field--float input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
  box-shadow: 0 0 0 1000px #ffffff inset;
}

.ch-pay-method-body .ch-field--icon .ch-input-icon {
  color: #6d7175;
  bottom: calc(var(--ch-input-pad-bottom) + 3px);
}

.ch-pay-card-fields .ch-field {
  margin-bottom: 12px;
}

.ch-pay-card-fields .ch-check--pay {
  margin-top: 2px;
  margin-bottom: 0;
  font-size: 15px;
  color: #202223;
}

.ch-pay-card-fields .ch-check--pay input[type="checkbox"] {
  border-radius: 3px;
}

/* Bottom total + CTA */
.ch-bottom-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding: 12px 0;
  border-top: 1px solid var(--ch-border-light);
  width: 100%;
  border-left: none;
  border-right: none;
  border-bottom: none;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  color: inherit;
}

.ch-bottom-summary__thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  border: 1px solid var(--ch-border-light);
  background: linear-gradient(145deg, #e8e9eb, #f4f5f6);
  flex-shrink: 0;
}

.ch-bottom-summary__mid {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.ch-bottom-summary__chev {
  flex-shrink: 0;
  transition: transform 0.2s ease;
  transform: rotate(180deg);
}

.checkout-main--summary-expanded .ch-bottom-summary__chev {
  transform: rotate(0deg);
}

.ch-bottom-summary__mid strong {
  display: block;
  font-size: 0.95rem;
}

.ch-bottom-summary__mid small {
  color: var(--ch-text-secondary);
  font-size: 0.8rem;
}

.ch-bottom-summary__price {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--ch-input-font);
}

.ch-bottom-total-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-weight: 700;
}

.ch-bottom-total-ccy {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ch-text-secondary);
  text-transform: uppercase;
}

.ch-bottom-total-amt {
  font-weight: 700;
  color: var(--ch-black);
}

.btn-pay-now {
  width: 100%;
  margin-top: 12px;
  padding: 18px 16px;
  font-size: var(--ch-input-font);
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: opacity 0.15s ease, transform 0.12s ease;
  color: #fff;
  background: var(--ch-black);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  touch-action: manipulation;
  min-height: 54px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.btn-pay-now:hover {
  opacity: 0.92;
}

.btn-pay-now:active {
  transform: scale(0.995);
}

.btn-pay-now:focus-visible {
  outline: 2px solid var(--ch-focus);
  outline-offset: 3px;
}

/* Order edit details */
.ch-order-edit {
  margin: 16px 0;
  border: 1px solid var(--ch-border-light);
  border-radius: var(--ch-radius);
  padding: 0 12px;
  background: #fafbfb;
}

.ch-order-edit summary {
  padding: 12px 4px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--ch-text-secondary);
}

.ch-order-edit[open] summary {
  margin-bottom: 8px;
  border-bottom: 1px solid var(--ch-border-light);
}

.checkout-shopify-form .ch-field--classic input,
.checkout-shopify-form .ch-field--classic select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--ch-border);
  border-radius: var(--ch-radius);
  font-size: var(--ch-input-font);
  line-height: 1.25;
  min-height: 48px;
  color: var(--ch-text);
  background-color: var(--ch-bg);
}

.ch-field--classic {
  margin-bottom: 10px;
}

/* Footer policies */
.ch-policies {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 12px 16px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--ch-border-light);
  font-size: 0.78rem;
}

.ch-policies a {
  color: var(--ch-focus);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity 0.15s ease;
}

.ch-policies a:hover {
  opacity: 0.85;
}

.checkout-shopify-page .err {
  margin-top: 12px;
  font-size: 0.875rem;
  color: #bf0711;
}

@media (min-width: 750px) {
  .checkout-shopify-page {
    padding: 0 24px 64px;
  }
}
