/* ==================== 结算页：分区式版式 ==================== */
.woocommerce-checkout .page-wrap{background:#f4f4f4;padding:0}
.co-form{display:block}
.co-sec{display:flex;align-items:flex-start;background:#fff;margin:0 0 10px}
.co-tag{flex:0 0 112px;padding:24px 0 0 26px;font-size:14px;color:#666;line-height:1.5}
.co-ct{flex:1;min-width:0;padding:22px 30px 24px 0}
.co-hd{font-size:13px;color:#999;margin-bottom:10px;line-height:1}

/* 地址卡片 */
.co-addr-box{display:flex;gap:18px;align-items:stretch;flex-wrap:wrap}
.co-addr-box.is-empty{display:none}
.co-card{position:relative;width:420px;max-width:100%;min-height:96px;border:1px solid #e4e4e4;background:#fff;padding:13px 16px 30px;cursor:pointer;transition:.15s}
.co-card.on{border-color:#7db4dc;background:#f5fbfe;box-shadow:0 0 0 1px rgba(125,180,220,.15) inset}
.cc-top{display:flex;align-items:center;gap:10px;font-size:14px;line-height:22px}
.cc-name{color:#333;font-weight:500}
.cc-line{color:#dcdcdc}
.cc-phone{color:#666}
.cc-default{margin-left:auto;font-size:13px;color:#2f8fd0;text-decoration:none;white-space:nowrap}
.cc-default:hover{text-decoration:underline}
.cc-addr{margin-top:5px;font-size:12px;color:#8d8d8d;line-height:1.8;max-height:44px;overflow:hidden}
.cc-tools{position:absolute;right:14px;bottom:9px;display:flex;gap:12px;color:#a8a8a8}
.cc-tools a{color:#a8a8a8;display:flex}
.cc-tools a:hover{color:#2f8fd0}
.co-add{display:flex;align-items:center;justify-content:center;width:420px;max-width:100%;min-height:96px;background:#f7f7f7;color:#999!important;font-size:14px;text-decoration:none!important}
.co-add:hover{background:#f0f0f0;color:#666}

/* 地址表单 */
.co-fields{margin-top:20px}
.co-fields.is-collapsed{display:none}
.co-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0 16px}
.co-grid .co-cell{min-width:0}
.co-grid .co-cell.col-3{grid-column:span 3}
.co-form .form-row{width:100%!important;float:none!important;padding:0 0 14px!important;margin:0!important}
.co-form .form-row label,.co-form .co-label{display:block;font-size:12px;color:#999;margin:0 0 6px;line-height:18px;font-weight:400}
.co-form .form-row .required{color:#e60012}
.co-form .form-row input.input-text,.co-form .form-row select,.co-form .form-row textarea{
    width:100%!important;height:38px;line-height:38px;border:1px solid #e2e2e2;background:#fff;padding:0 10px;font-size:13px;color:#333;border-radius:0;box-shadow:none;box-sizing:border-box
}
.co-form .form-row textarea{height:auto;line-height:1.7;padding:9px 10px;min-height:88px;resize:vertical}
.co-form .form-row input:focus,.co-form .form-row select:focus,.co-form .form-row textarea:focus{border-color:#9cc7e6;outline:0}
.co-form .select2-container{width:100%!important}
.co-form .select2-container--default .select2-selection--single{height:38px;border:1px solid #e2e2e2;border-radius:0}
.co-form .select2-container--default .select2-selection--single .select2-selection__rendered{line-height:36px;font-size:13px;color:#333;padding-left:10px}
.co-form .select2-container--default .select2-selection--single .select2-selection__arrow{height:36px}
.co-form .woocommerce-invalid input,.co-form .woocommerce-invalid select{border-color:#e60012!important}
.co-form .woocommerce-input-wrapper{display:block;width:100%}

/* 选项按钮（配送方式 / 发票 / 支付方式） */
.co-opts{display:flex;flex-wrap:wrap;gap:14px;min-height:38px;align-items:center}
.co-opt{position:relative;display:inline-flex;align-items:center;height:38px;padding:0 20px;border:1px solid #e2e2e2;background:#fff;color:#666;font-size:13px;cursor:pointer;transition:.15s;margin:0}
.co-opt input{position:absolute;opacity:0;width:0;height:0;pointer-events:none}
.co-opt:hover{border-color:#bbb;color:#333}
.co-opt.on{border-color:#e60012;color:#333}
.co-opt.on::after{content:"";position:absolute;top:0;right:0;width:0;height:0;border-top:9px solid #e60012;border-left:9px solid transparent}
.co-opt-p{font-style:normal;margin-left:8px;color:#e60012;font-weight:600;font-family:Arial,Helvetica,sans-serif}
.co-tip{margin:10px 0 0;font-size:12px;color:#9aa7b2;line-height:20px}
.co-none{font-size:13px;color:#999}

/* 支付方式 */
.co-pay{padding-bottom:6px}
.co-pay #payment{background:transparent;padding:0}
.co-pay #payment ul.wc_payment_methods{display:flex;flex-wrap:wrap;gap:14px;padding:0!important;margin:0;border:0;list-style:none}
.co-pay #payment ul.wc_payment_methods::before,.co-pay #payment ul.wc_payment_methods::after{display:none}
.co-pay li.wc_payment_method{position:relative;margin:0;padding:0;border:1px solid #e2e2e2;background:#fff;height:38px;line-height:36px;list-style:none;flex:none}
.co-pay li.wc_payment_method:hover{border-color:#bbb}
.co-pay li.wc_payment_method:has(input:checked){border-color:#e60012}
.co-pay li.wc_payment_method:has(input:checked)::after{content:"";position:absolute;top:0;right:0;width:0;height:0;border-top:9px solid #e60012;border-left:9px solid transparent}
.co-pay li.wc_payment_method input.input-radio{position:absolute;opacity:0;width:0;height:0;margin:0;pointer-events:none}
.co-pay li.wc_payment_method > label{display:block;padding:0 20px;margin:0;font-size:13px;color:#666;cursor:pointer;line-height:36px;font-weight:400}
.co-pay li.wc_payment_method > label img{height:15px;width:auto;vertical-align:-2px;margin-left:4px}
.co-pay li.wc_payment_method:has(input:checked) > label{color:#333}
.co-pay .payment_box{display:none!important}
.co-pay .payment_box p{margin:0;font-size:12px;line-height:1.8;color:#888}
.co-pay .payment_box::before{display:none!important}
.co-pay #payment .place-order{position:static;padding:0;margin:0}

/* 提交区（JS 把 .place-order 移到这里） */
.co-submit{text-align:right;padding-top:6px}
.co-submit .place-order{padding:0!important;margin:0!important}
.co-submit .woocommerce-terms-and-conditions-wrapper{display:block;text-align:right;margin:0 0 8px;font-size:12px;color:#aaa}
.co-submit .woocommerce-terms-and-conditions-wrapper .form-row{display:block;margin:0 0 6px}
.co-submit .woocommerce-terms-and-conditions-wrapper label{font-size:12px;color:#999;display:inline}
.co-submit .woocommerce-privacy-policy-text p{margin:0;font-size:12px;color:#bbb;line-height:1.7;display:inline-block;max-width:640px}
.co-submit .woocommerce-privacy-policy-text a{color:#999;text-decoration:underline}
.co-submit #place_order{width:150px;height:44px;line-height:44px;background:#e60012!important;color:#fff!important;font-size:16px;border:0;border-radius:0;float:none;display:inline-block;padding:0!important}
.co-submit #place_order:hover{background:#c90010!important}

/* 商品清单 */
.co-sec-sum .co-ct{padding-top:18px}
#order_review{background:transparent;padding:0}
.co-sec-sum #order_review{background:transparent!important;padding:0!important}
#order_review table.shop_table{width:100%;border:0;border-collapse:collapse;table-layout:auto}
#order_review table.shop_table tbody tr.cart_item td{border-bottom:1px solid #f2f2f2;padding:14px 0;vertical-align:middle;background:transparent}
#order_review table.shop_table tbody tr.cart_item:first-child td{padding-top:4px}
#order_review td.product-name{padding-right:24px}
#order_review td.product-name .ci{display:flex;align-items:center;gap:14px;min-width:0}
#order_review td.product-name .ci-img{flex:0 0 60px;width:60px;height:60px;border:1px solid #f0f0f0;display:flex;align-items:center;justify-content:center;background:#fff}
#order_review td.product-name .ci-img img{max-width:54px;max-height:54px;width:auto;height:auto;display:block}
#order_review td.product-name .ci-txt{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}
#order_review td.product-name .ci-name{font-size:13px;color:#666;line-height:1.6;text-decoration:none;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
#order_review td.product-name .ci-name:hover{color:#e60012}
#order_review td.product-name .ci-sku{font-size:12px;color:#a8a8a8;line-height:1.5}
#order_review td.product-name dl.variation{margin:0;font-size:12px;color:#a8a8a8}
#order_review td.product-name dl.variation dt,#order_review td.product-name dl.variation dd{display:inline;margin:0;float:none;padding:0;font-size:12px}
#order_review td.product-total{width:200px;text-align:right;white-space:nowrap;vertical-align:middle}
#order_review td.product-total .ci-price{display:inline-block;font-size:14px;color:#666}
#order_review td.product-total .ci-qty{display:inline-block;width:54px;text-align:right;font-size:13px;color:#999}

#order_review table.shop_table tfoot th{background:transparent;border:0;text-align:right;font-size:13px;color:#666;font-weight:400;padding:5px 0;width:auto}
#order_review table.shop_table tfoot td{background:transparent;border:0;text-align:right;font-size:13px;color:#333;padding:5px 0;width:200px;white-space:nowrap}
#order_review table.shop_table tfoot tr.cart-subtotal th,#order_review table.shop_table tfoot tr.cart-subtotal td{border-top:1px solid #f2f2f2;padding-top:14px}
#order_review table.shop_table tfoot tr.order-total th{font-size:14px;color:#333;padding-top:16px;padding-bottom:4px}
#order_review table.shop_table tfoot tr.order-total td{font-size:22px;color:#e60012;font-weight:600;padding-top:12px;padding-bottom:4px}
#order_review table.shop_table tfoot tr.order-total td .amount{color:#e60012}
#order_review table.shop_table tfoot tr.cart-discount th,#order_review table.shop_table tfoot tr.cart-discount td{color:#e60012}
#order_review table.shop_table tfoot tr.fee th,#order_review table.shop_table tfoot tr.fee td,
#order_review table.shop_table tfoot tr.tax-rate th,#order_review table.shop_table tfoot tr.tax-rate td,
#order_review table.shop_table tfoot tr.tax-total th,#order_review table.shop_table tfoot tr.tax-total td{color:#888}
#order_review table.shop_table thead{display:none}

/* 备注 */
.co-notes{margin:0!important;max-width:420px}
.co-notes .woocommerce-input-wrapper{display:block}
.co-notes textarea{width:100%;min-height:88px;border:1px solid #e2e2e2;padding:10px;font-size:13px;color:#333;line-height:1.7;resize:vertical;background:#fff}

/* 结算页提示信息 */
.woocommerce-checkout .woocommerce-info,.woocommerce-checkout .woocommerce-error,.woocommerce-checkout .woocommerce-message{margin:0 0 10px}

@media (max-width:820px){
    .co-sec{flex-direction:column;align-items:stretch}
    .co-tag{flex:none;padding:16px 16px 0;font-size:13px}
    .co-ct{padding:10px 16px 18px}
    .co-card,.co-add{width:100%}
    .co-grid{grid-template-columns:1fr}
    .co-grid .co-cell.col-3{grid-column:span 1}
    .co-opt{padding:0 12px;font-size:12px;height:34px}
    .co-pay li.wc_payment_method{height:34px;line-height:32px}
    .co-pay li.wc_payment_method > label{padding:0 12px;font-size:12px;line-height:32px}
    #order_review td.product-total{width:110px}
    #order_review td.product-name .ci-img{flex:0 0 48px;width:48px;height:48px}
    #order_review table.shop_table tfoot td{width:110px}
    .co-submit{text-align:center}
    .co-submit #place_order{width:100%}
    .co-notes{max-width:100%}
}


/* 顶部优惠券提示 */
.woocommerce-checkout .checkout_coupon.woocommerce-form-coupon-toggle,
.woocommerce-checkout .woocommerce-form-coupon-toggle{background:#fff;border-left:2px solid #e60012;font-size:13px;color:#888;padding:10px 16px;margin:0 0 10px}
.woocommerce-checkout .woocommerce-form-coupon-toggle .woocommerce-info{background:transparent;border:0;padding:0;margin:0;font-size:13px;color:#888}
.woocommerce-checkout form.checkout_coupon{border:0;background:#fff;padding:14px 16px!important;margin:0 0 10px;display:flex;gap:10px;align-items:center;max-width:none}
.woocommerce-checkout form.checkout_coupon p{margin:0}
.woocommerce-checkout form.checkout_coupon input.input-text{height:36px;width:220px;border:1px solid #e2e2e2;padding:0 10px;font-size:13px}
.woocommerce-checkout form.checkout_coupon button{height:36px;line-height:36px;background:#e60012!important;color:#fff!important;padding:0 20px;font-size:13px;border:0}


/* 优惠券（商品清单区右上，独立于主表单避免嵌套 form） */
.co-coupon{text-align:right;font-size:13px;margin:0 0 6px}
.co-coupon-toggle{color:#2f8fd0;text-decoration:none;font-size:13px}
.co-coupon-toggle:hover{text-decoration:underline}
.co-coupon-box{display:none;justify-content:flex-end;gap:8px;margin-top:10px}
.co-coupon-box.show{display:flex}
.co-coupon-box input{height:34px;width:200px;border:1px solid #e2e2e2;padding:0 10px;font-size:13px;background:#fff;box-sizing:border-box}
.co-coupon-box button{height:34px;line-height:34px;background:#e60012;color:#fff;padding:0 16px;font-size:13px;border:0;border-radius:0;cursor:pointer}
.co-coupon-box button:hover{background:#c90010}
.co-coupon-msg{font-size:12px;color:#e60012;margin-top:6px;display:none}
.co-coupon-msg.show{display:block}
