/* 商城结账页：步骤引导版。只影响 #checkout。 */
body:has(#checkout.page.active) { background: #fff; }
/* 换页动画会让底栏跟着页面走；关掉后底栏才会固定在屏幕底部。 */
#checkout.page.active { animation: none; }
#checkout { color: #1c2521; font-size: 14px; line-height: 1.5; max-width: 560px; margin: 0 auto; }
#checkout .checkout-nav-bar { box-shadow: none; border-bottom: 1px solid #edf0ee; }
#checkout .checkout-nav-bar .nav-title { font-weight: 700; font-size: 17px; color: #1c2521; }
#checkout .checkout-nav-bar i { color: #2e7d32; }
#checkout .co-steps { background: #fff; margin: -1rem max(calc(50% - 50vw), -16px) 0; }
#checkout .co-step { position: relative; padding: 18px 18px 20px 56px; min-width: 0; }
#checkout .co-step::before { content: ""; position: absolute; left: 31px; top: 24px; bottom: -24px; width: 2px; background: #dfe9e0; }
#checkout .co-step:last-child::before { display: none; }
#checkout .co-no { position: absolute; left: 18px; top: 17px; width: 28px; height: 28px; border-radius: 50%; background: #2e7d32; color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center; }
#checkout .co-title { margin: 1px 0 10px; font-size: 16px; line-height: 1.5; font-weight: 700; color: #1c2521; }
#checkout .co-box { background: #f5f8f6; border-radius: 13px; padding: 12px; }
#checkout .co-x, #checkout [hidden] { display: none !important; }

/* 1 地址 */
#checkout .co-address:has(.co-need) { background: #fdf1ee; }
#checkout .co-addr, #checkout .co-need { display: flex; align-items: center; gap: 10px; }
#checkout .co-addr > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
#checkout .co-addr b { font-weight: 700; }
#checkout .co-addr span { color: #6b756f; }
#checkout .co-addr p { margin: 0; font-size: 12px; line-height: 1.5; color: #6b756f; }
#checkout .co-addr strong { font-size: 12px; font-weight: 700; color: #2e7d32; white-space: nowrap; }
#checkout .co-need { color: #c5301a; }
#checkout .co-need i { font-size: 21px; }
#checkout .co-need span { flex: 1; font-weight: 700; }
#checkout .co-ship { margin-top: 9px; font-size: 12px; overflow: hidden; }
#checkout .co-sub { float: left; margin: 0 12px 0 0; font-size: 12px; font-weight: 400; color: #6b756f; }
#checkout #shippingMethodContainer { display: grid; gap: 8px; justify-content: end; }
#checkout #shippingMethodContainer > div { margin: 0 !important; }
#checkout #shippingMethodContainer label { margin: 0; line-height: 1.5; }
#checkout #shippingMethodContainer input { accent-color: #2e7d32; width: 16px; height: 16px; margin: 0; flex: 0 0 auto; }
#checkout #shippingMethodContainer:not(:has(> div:nth-of-type(2))) input { display: none; }

/* 2 商品 */
#checkout #checkoutProductsList { background: transparent; box-shadow: none; border-radius: 0; margin: 0; overflow: visible; }
#checkout #checkoutProductsList > div { background: #f5f8f6 !important; border: 0 !important; border-radius: 13px !important; padding: 12px; margin-bottom: 9px !important; }
#checkout #checkoutProductsList > div > div:first-child { background: transparent !important; border: 0 !important; padding: 0 !important; gap: 10px !important; }
#checkout #checkoutProductsList > div > div:first-child i { display: none; }
#checkout #checkoutProductsList > div > div:first-child span { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 14px !important; font-weight: 700 !important; color: #1c2521 !important; }
#checkout .co-store-total { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
#checkout #checkoutProductsList > div > div:nth-child(2) { padding: 0 !important; }
#checkout #checkoutProductsList > div > div:nth-child(3) { padding: 0 !important; border: 0 !important; gap: 0 !important; }
#checkout #checkoutProductsList > div > div:nth-child(3) > div:first-child { display: none; }
#checkout #checkoutProductsList > div > div:nth-child(3) > div:nth-child(2) { gap: 0 !important; }
#checkout #checkoutProductsList > div > div:nth-child(3) > div:nth-child(2) > div:first-child { border: 0 !important; padding: 0 !important; }
#checkout #checkoutProductsList > div > div:nth-child(3) > div:nth-child(2) > div:first-child > span,
#checkout .store-remark-input + button { display: none; }
#checkout .checkout-product-item { background: transparent; border: 0; margin: 0; padding: 7px 0; }
#checkout .checkout-product-img { width: 60px; height: 60px; border-radius: 10px; margin-right: 11px; background: #eef2f0; flex: 0 0 auto; }
#checkout .co-gift-img { display: grid; place-items: center; font-size: 27px; color: #d9381e; background: #fdeeeb; }
#checkout .checkout-product-info { display: block; min-width: 0; overflow-wrap: anywhere; }
#checkout .checkout-product-name { font-size: 14px; line-height: 1.35; margin: 0; color: #1c2521; }
#checkout .co-variant { font-size: 12px; color: #6b756f; }
#checkout .checkout-product-price-row { margin-top: 4px; align-items: center; gap: 10px; }
#checkout .checkout-product-price { font-size: 14px; font-weight: 700; color: #1c2521; font-variant-numeric: tabular-nums; }
#checkout .checkout-product-qty { font-size: 12px; color: #6b756f; }
#checkout .co-tag { display: inline-block; border-radius: 5px; padding: 0 6px; font-size: 11px; line-height: 18px; background: #fdeeeb; color: #c5301a; font-weight: 600; }
#checkout .store-remark-input { width: 100%; min-width: 0; background: #fff !important; border: 1px solid #dbe2de !important; border-radius: 9px !important; padding: 9px 12px !important; line-height: 1.5; }
#checkout .store-remark-input:focus { border-color: #2e7d32 !important; outline: 1px solid #2e7d32; }
#checkout [id^="remarks-list-"] { padding: 0 !important; }
#checkout [id^="remark_"] { margin: 6px 0 0 !important; overflow-wrap: anywhere; }

/* 优惠开关 */
#checkout .co-perks { display: grid; gap: 11px; }
#checkout .co-perk i { display: none; }
#checkout .co-perk > div:first-child > div > div { flex-direction: row !important; flex-wrap: wrap; align-items: baseline; column-gap: 4px; min-width: 0; }
#checkout .co-perk > div:first-child > div > div > span:first-child { font-size: 14px !important; font-weight: 400 !important; color: #1c2521 !important; }
#checkout .co-perk > div:first-child > div > div > span:nth-child(2),
#checkout .co-perk > div:first-child > div > div > span:nth-child(2) span { font-size: 12px !important; font-weight: 400 !important; margin-top: 0 !important; color: #6b756f !important; }
#checkout .co-perk .co-red.co-red { color: #d9381e !important; }
#checkout .co-perk > div:first-child > button { flex: 0 0 auto; position: relative; width: 42px; height: 24px; min-height: 0; padding: 0 !important; border: 0 !important; border-radius: 12px !important; background: #cfd6d2 !important; font-size: 0 !important; opacity: 1 !important; transform: none !important; box-shadow: none !important; }
#checkout .co-perk > div:first-child > button::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; }
#checkout .co-perk > div:first-child > button[aria-pressed="true"] { background: #2e7d32 !important; }
#checkout .co-perk > div:first-child > button[aria-pressed="true"]::after { left: 21px; }
#checkout .co-perk > div:first-child > button:disabled { cursor: not-allowed; }
#checkout .co-perk > div:first-child > button:focus-visible { outline: 2px solid #2e7d32; outline-offset: 2px; }

/* 3 付款 */
#checkout .co-pays { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: #eaf0ec; border-radius: 12px; padding: 4px; margin-bottom: 10px; }
#checkout .co-pay { position: relative; display: block; text-align: center; padding: 9px 6px; margin: 0; border-radius: 9px; cursor: pointer; }
#checkout .co-pay input { position: absolute; opacity: 0; }
#checkout .co-pay > div > div:first-child { font-size: 13px; line-height: 1.5; font-weight: 400 !important; color: #55605a !important; }
#checkout .co-pay > div > div:nth-child(2) { display: none; }
#checkout .co-pay:has(input:checked) { background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .1); }
#checkout .co-pay:has(input:checked) > div > div:first-child { color: #1b5e20 !important; font-weight: 700 !important; }
#checkout .co-pay:has(input:focus-visible) { outline: 2px solid #2e7d32; }
#checkout #checkoutPaymentInfoSection { margin-bottom: 10px; font-size: 13px; }
#checkout #paymentInfoContent { display: grid; gap: 7px; }
#checkout .co-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: 10px; }
#checkout .co-line > span:first-child { color: #6b756f; }
#checkout .co-line > span:last-child { margin-left: auto; min-width: 0; text-align: right; overflow-wrap: anywhere; }
#checkout .co-acc { display: flex; align-items: center; gap: 8px; }
#checkout .co-acc b { font-weight: 700; font-variant-numeric: tabular-nums; }
#checkout .co-acc button { flex: 0 0 auto; border: 1px solid #bcd3bf; background: #f1f8f1; color: #1b5e20; border-radius: 7px; padding: 2px 10px; font-size: 12px; line-height: 1.5; cursor: pointer; }
#checkout .co-qr { display: grid; justify-items: center; gap: 6px; color: #6b756f; padding-top: 4px; }
#checkout .co-qr img { width: 100%; max-width: 200px; border-radius: 10px; }
#checkout .co-up { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; border: 1.5px dashed #8fb593; background: #f6fbf6; color: #1b5e20; border-radius: 10px; padding: 12px; font-size: 14px; line-height: 1.5; font-weight: 600; cursor: pointer; }
#checkout .co-hint { margin-top: 5px; font-size: 12px; color: #6b756f; text-align: center; }
#checkout .co-sum { margin-top: 15px; }
#checkout .co-sum > div { margin: 0 0 8px !important; font-size: 13px !important; color: #1c2521 !important; }
#checkout .co-sum > div > span:first-child:not(:only-child) { color: #6b756f; }
#checkout .co-sum > div[id] > span:last-child:not(:only-child) { color: #d9381e !important; }
#checkout .co-sum span { font-variant-numeric: tabular-nums; }

/* 底部 */
#checkout .co-bar { justify-content: space-between; border-radius: 0; border-top: 1px solid #edf0ee; box-shadow: 0 -4px 16px rgba(20, 40, 30, .07); padding: 12px max(16px, calc(50% - 264px)) calc(18px + env(safe-area-inset-bottom)); }
#checkout .co-total > span { display: block; margin: 0 !important; line-height: 1.5; }
#checkout .co-total > span:first-child { font-size: 12px !important; color: #6b756f !important; }
#checkout .co-total > span:nth-child(2) { font-size: 20px !important; color: #d9381e !important; font-variant-numeric: tabular-nums; }
#checkout .co-bar .checkout-btn { border-radius: 12px; background: #2e7d32 !important; font-weight: 700; font-size: 15px; line-height: 1.5; padding: 13px 20px; white-space: nowrap; box-shadow: none !important; transform: none !important; }

@media (max-width: 799px) {
    #checkout .checkout-nav-bar { margin-left: max(calc(50% - 50vw), -16px); margin-right: max(calc(50% - 50vw), -16px); }
}
#checkout .co-perk > div:first-child > div > div > span.co-red:nth-child(2) { color: #d9381e !important; }
#checkout .checkout-product-price { line-height: 1.5; }
.main:has(> .container > #checkout.page.active) { padding-top: 16px; padding-bottom: 0; }
#checkout .checkout-nav-bar { height: 55px; padding-top: 0; padding-bottom: 0; margin-bottom: 16px; }
