/**
 * RonVue — 国内结算页样式 (China Checkout)
 * 
 * 编号步骤 · 左宽右窄双栏 · 现代简约风格
 */

/* ═══════════════════════════════════════════
   整体布局
   ═══════════════════════════════════════════ */
.rv-checkout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* 移除 WooCommerce 默认的 checkout 通知和 coupon */
.woocommerce-checkout .woocommerce-notices-wrapper { max-width: 1100px; margin: 1rem auto; padding: 0 1rem; }
.woocommerce-form-coupon-toggle { display: none; }

/* ═══════════════════════════════════════════
   左列：收货信息 (60%)
   ═══════════════════════════════════════════ */
.rv-checkout-main {
    flex: 0 0 58%;
    min-width: 0;
}

/* ═══════════════════════════════════════════
   右列：订单摘要 + 支付 (40%)
   ═══════════════════════════════════════════ */
.rv-checkout-sidebar {
    flex: 0 0 38%;
    min-width: 0;
    position: sticky;
    top: 1rem;
}

/* ═══════════════════════════════════════════
   步骤卡片
   ═══════════════════════════════════════════ */
.rv-checkout-step {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

/* 步骤头部 */
.rv-step-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #f0f0f0;
}

.rv-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #333;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.rv-step-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    padding: 0;
    border: none;
}

/* ═══════════════════════════════════════════
   表单字段
   ═══════════════════════════════════════════ */
/* 08-24: 地址簿弹窗(.rv-addr-form)与结账页共用本套表单样式，单一样式源 */
.rv-step-body label,
.rv-addr-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #555;
    margin-bottom: 0.35rem;
}

.rv-required { color: #e74c3c; }
.rv-optional { color: #999; font-weight: 400; font-size: 0.8rem; }

/* 隐藏 WooCommerce 默认字段 */
.rv-step-body .woocommerce-billing-fields__field-wrapper {
    display: none;
}

/* 输入框 */
.rv-step-body input[type="text"],
.rv-step-body input[type="tel"],
.rv-step-body input[type="number"],
.rv-step-body select,
.rv-addr-form input[type="text"],
.rv-addr-form input[type="tel"],
.rv-addr-form input[type="number"],
.rv-addr-form select {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #333;
    background: #fafafa;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.rv-step-body input:focus,
.rv-step-body select:focus,
.rv-addr-form input:focus,
.rv-addr-form select:focus {
    outline: none;
    border-color: #333;
    background: #fff;
}

.rv-step-body input::placeholder,
.rv-addr-form input::placeholder {
    color: #bbb;
}

/* 字段行 */
.rv-field-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.rv-field-half { flex: 1; min-width: 0; }
.rv-field-third { flex: 1; min-width: 0; }
.rv-field-full { width: 100%; margin-bottom: 1rem; }
.rv-field { margin-bottom: 0.5rem; }

/* 手机号 +86 前缀 */
.rv-phone-group {
    display: flex;
    align-items: stretch;
}

.rv-phone-prefix {
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-right: none;
    border-radius: 6px 0 0 6px;
    font-size: 0.9rem;
    color: #666;
    white-space: nowrap;
}

.rv-phone-group .rv-phone-input { flex: 1; }
.rv-phone-group input {
    border-radius: 0 6px 6px 0 !important;
}

/* 省市区 select */
.rv-region-select {
    width: 100%;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px !important;
}

.rv-region-select:disabled {
    background: #f5f5f5;
    color: #ccc;
    cursor: not-allowed;
}

/* 地址类型选择 */
.rv-address-types {
    display: flex;
    gap: 0.75rem;
}

.rv-addr-type {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.75rem 0.5rem;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.rv-addr-type input[type="radio"] {
    display: none;
}

.rv-addr-type:hover {
    border-color: #ccc;
}

.rv-addr-type:has(input:checked) {
    border-color: #333;
    background: #fafafa;
}

.rv-addr-type-icon {
    font-size: 1.3rem;
}

.rv-addr-type-label {
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
}

/* Checkbox */
.rv-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #666;
    cursor: pointer;
    margin: 1rem 0;
}

.rv-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #333;
}

/* ═══════════════════════════════════════════
   配送方式提示
   ═══════════════════════════════════════════ */
.rv-shipping-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1.2rem;
    background: #f8f8f8;
    border-radius: 8px;
    color: #999;
    font-size: 0.85rem;
}

/* ═══════════════════════════════════════════
   订单摘要
   ═══════════════════════════════════════════ */
.rv-order-items {
    margin-bottom: 1rem;
}

.rv-order-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f5f5f5;
}

.rv-order-item:last-child {
    border-bottom: none;
}

.rv-order-item-image {
    width: 56px;
    height: 56px;
    border-radius: 6px;
    overflow: hidden;
    background: #f5f5f5;
    flex-shrink: 0;
}

.rv-order-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rv-order-item-info {
    flex: 1;
    min-width: 0;
}

.rv-order-item-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 0.2rem;
    line-height: 1.3;
}

.rv-order-item-meta {
    margin-bottom: 0.2rem;
}

.rv-item-variant {
    font-size: 0.75rem;
    color: #999;
}

.rv-order-item-price {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.rv-item-unit-price {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
}

.rv-item-qty {
    font-size: 0.8rem;
    color: #999;
}

/* 金额汇总 */
.rv-order-totals {
    border-top: 1px solid #f0f0f0;
    padding-top: 0.75rem;
}

.rv-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
    font-size: 0.85rem;
    color: #666;
}

.rv-total-row.rv-total-final {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    padding-top: 0.5rem;
    margin-top: 0.25rem;
    border-top: 1px dashed #e8e8e8;
}

.rv-total-amount {
    font-size: 1.15rem;
    color: #e74c3c;
}

.rv-shipping-pending {
    color: #bbb;
    font-style: italic;
}

/* ═══════════════════════════════════════════
   支付方式
   ═══════════════════════════════════════════ */
.rv-payment-methods {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.rv-payment-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0.5rem;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.rv-payment-card:hover {
    border-color: #ccc;
}

.rv-payment-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.rv-payment-active {
    border-color: #333 !important;
    box-shadow: 0 0 0 1px #333;
}

.rv-payment-icon {
    display: flex;
    align-items: center;
}

.rv-payment-name {
    font-size: 0.8rem;
    color: #555;
    font-weight: 500;
}

/* ═══════════════════════════════════════════
   提交按钮
   ═══════════════════════════════════════════ */
.rv-checkout-submit-wrap {
    margin-top: 0.5rem;
}

/* 空字段校验高亮 */
.rv-field-error {
    border-color: #F5A623 !important;
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.25) !important;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.rv-checkout-submit {
    width: 100%;
    height: 48px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.rv-checkout-submit:hover {
    background: #333;
}



.rv-submit-arrow {
    font-size: 1.1rem;
}

.rv-checkout-secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 0.6rem;
    font-size: 0.75rem;
    color: #bbb;
}

/* 标准支付表单：隐藏 UI（用自定义按钮），保留 nonce 等关键字段 */
.rv-hidden-payment .payment_methods,
.rv-hidden-payment .payment_box,
.rv-hidden-payment .form-row.place-order,
.rv-hidden-payment #place_order { display: none !important; }
/* 保留支付 nonce 和隐藏字段可见 */
.rv-hidden-payment .woocommerce-checkout-payment-nonce,
.rv-hidden-payment input[type="hidden"] { display: inline !important; }
.woocommerce-checkout .woocommerce-billing-fields,
.woocommerce-checkout .woocommerce-shipping-fields,
.woocommerce-checkout .woocommerce-additional-fields,
.woocommerce-checkout .woocommerce-checkout-review-order-table,
.woocommerce-checkout .woocommerce-checkout-payment,
.woocommerce-checkout #order_review,
.woocommerce-checkout #order_review_heading,
.woocommerce-checkout #customer_details,
.rv-checkout .woocommerce-billing-fields > h3,
.rv-checkout .woocommerce-shipping-fields > h3,
.rv-checkout #order_review_heading,
.rv-checkout .woocommerce-checkout-payment,
.rv-checkout .woocommerce-checkout-review-order-table,
.rv-checkout .woocommerce-additional-fields,
#order_review,
#order_review_heading {
    display: none !important;
}

/* ═══════════════════════════════════════════
   错误提示 —— 紧凑横向卡片，覆盖 Astra 默认纵向列表
   ═══════════════════════════════════════════ */
/* 容器：居中，限制宽度 */
.woocommerce-notices-wrapper,
.entry-content .woocommerce-notices-wrapper,
.woocommerce-checkout .woocommerce-notices-wrapper {
    max-width: 1100px !important;
    margin: 0 auto 1rem !important;
    padding: 0 1rem !important;
    float: none !important;
    width: auto !important;
}

/* 错误卡片主体 */
.woocommerce .woocommerce-error,
.entry-content .woocommerce-error,
.woocommerce-notices-wrapper .woocommerce-error,
.woocommerce-checkout .woocommerce-error,
.woocommerce-error {
    display: block !important;
    background: #fef2f2 !important;
    border: 1px solid #fecaca !important;
    border-left: 4px solid #dc2626 !important;
    border-top: 1px solid #fecaca !important;
    border-radius: 6px !important;
    padding: 0.75rem 1rem !important;
    margin: 0 0 0.5rem 0 !important;
    list-style: none !important;
    color: #991b1b !important;
    font-size: 0.85rem !important;
    line-height: 1.5 !important;
    width: auto !important;
    float: none !important;
    position: static !important;
    overflow: hidden !important;
}

/* 去掉 Astra 默认的大 padding-left + ::before icon */
.woocommerce .woocommerce-error::before,
.entry-content .woocommerce-error::before,
.woocommerce-error::before {
    content: none !important;
    display: none !important;
}

.woocommerce .woocommerce-error,
.entry-content .woocommerce-error {
    padding: 0.75rem 1rem !important;
}

/* 列表项：横向排列，逗号分隔 */
.woocommerce .woocommerce-error li,
.entry-content .woocommerce-error li,
.woocommerce-error li {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    display: inline !important;
    width: auto !important;
    font-size: inherit !important;
    line-height: inherit !important;
}

.woocommerce .woocommerce-error li::before,
.entry-content .woocommerce-error li::before,
.woocommerce-error li::before {
    display: none !important;
}

/* 项之间用 · 分隔（除了第一项） */
.woocommerce .woocommerce-error li + li::before,
.entry-content .woocommerce-error li + li::before,
.woocommerce-error li + li::before {
    content: ' · ' !important;
    display: inline !important;
    color: #dc2626 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    width: auto !important;
    height: auto !important;
}

/* strong 标签内联 */
.woocommerce .woocommerce-error strong,
.entry-content .woocommerce-error strong,
.woocommerce-error strong {
    font-weight: 600 !important;
    color: #991b1b !important;
}

/* ═══════════════════════════════════════════
   移动端 (≤768px)
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
    .rv-checkout {
        flex-direction: column;
        padding: 0 0.5rem;
        gap: 0.75rem;
        margin: 1rem auto;
    }
    
    .rv-checkout-main,
    .rv-checkout-sidebar {
        flex: 1 1 100%;
    }
    
    .rv-checkout-sidebar {
        position: static;
    }
    
    /* 省市区横向排列 → 纵向 */
    .rv-field-row.rv-region-row {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    /* 手机号组 */
    .rv-phone-group {
        flex-wrap: nowrap;
    }
    
    /* 支付方式 */
    .rv-payment-methods {
        flex-wrap: wrap;
    }
    
    .rv-payment-card {
        flex: 1 1 calc(33.33% - 0.5rem);
        min-width: 90px;
    }
    
    .rv-checkout-step {
        padding: 1rem;
        border-radius: 0;
        margin-bottom: 0.5rem;
        border-bottom: 1px solid #f0f0f0;
    }
}

/* ── 配送方式卡片 (Phase 8 — display:none → 可见) ── */
.rv-shipping-methods { display: flex; flex-direction: column; gap: 10px; }
.rv-shipping-methods .woocommerce-shipping-methods,
.rv-shipping-methods ul#shipping_method { list-style: none; padding: 0; margin: 0; }
.rv-shipping-methods li,
.rv-shipping-methods .shipping_method {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line-soft, #e8e2d6);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s;
  background: var(--white, #fff);
  margin-bottom: 8px;
}
.rv-shipping-methods li:hover,
.rv-shipping-methods .shipping_method:hover { border-color: var(--brand-gold, #A88E6A); }
.rv-shipping-methods input[type="radio"] {
  accent-color: var(--brand-gold, #A88E6A);
  width: 16px; height: 16px; cursor: pointer; flex-shrink: 0;
}
.rv-shipping-methods label {
  flex: 1; font-size: 0.92rem; color: var(--navy, #0e1e3a); cursor: pointer;
  display: flex; align-items: center; gap: 8px;
}
.rv-shipping-methods .amount,
.rv-shipping-methods .woocommerce-Price-amount {
  font-size: 0.92rem; font-weight: 500; color: var(--navy, #0e1e3a);
}
.rv-shipping-methods .free-shipping,
.rv-shipping-methods .woocommerce-Price-amount:contains('0') { color: #2d5a27; font-weight: 500; }
.rv-shipping-empty { font-size: 0.85rem; color: #999; padding: 1rem 0; }

/* ═══════════════════════════════════════════
   微信支付 PC 扫码页（order-receipt 覆盖 · 方案 B，08-24）
   引擎=插件 script.js（画码/倒计时/过期刷新/2s 轮询），外观=本节
   ═══════════════════════════════════════════ */
.rv-receipt .rv-wechat-logo { display: inline-flex; align-items: center; }

/* 左列：订单信息行 */
.rv-receipt-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.45rem 0;
    font-size: 0.85rem;
    border-bottom: 1px solid #f5f5f5;
}
.rv-receipt-row:last-child { border-bottom: none; }
.rv-receipt-label { color: #666; flex-shrink: 0; }
.rv-receipt-value {
    color: #1a1a1a;
    font-weight: 500;
    text-align: right;
    min-width: 0;
    overflow-wrap: anywhere;
}
.rv-receipt-row-total {
    border-top: 1px dashed #e8e8e8;
    border-bottom: none;
    margin-top: 0.4rem;
    padding-top: 0.7rem;
}
.rv-receipt-amount { font-size: 1.35rem; font-weight: 700; color: #e74c3c; }

/* 右列：二维码槽位 */
.rv-qr-slot {
    position: relative;
    width: 282px;
    max-width: 100%;
    margin: 0 auto;
    padding: 12px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    box-sizing: border-box;
}
.rv-qr-slot #js-wprs-wc-wechatpay canvas { display: block; width: 100%; height: auto; }
.rv-qr-slot #js-wprs-wc-wechatpay table { margin: 0 auto; }

/* 加载态（初始即显示，插件 hideQrcodeLoading 后隐藏） */
.wprs-wechatpay-qrcode__loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 8px;
}
.wprs-wechatpay-qrcode__spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f0f0f0;
    border-top-color: #07C160;
    border-radius: 50%;
    animation: rv-qr-spin 0.8s linear infinite;
}
@keyframes rv-qr-spin { to { transform: rotate(360deg); } }

/* 过期覆盖层（插件 $qrcodeExpired.show() 后生效） */
.rv-qr-expired {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 8px;
    text-align: center;
}
.rv-qr-expired p { margin: 0; font-size: 0.85rem; color: #666; }
.rv-receipt-refresh {
    height: 38px;
    padding: 0 1.2rem;
    background: #07C160;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.rv-receipt-refresh:hover { background: #06ad56; }
.rv-receipt-refresh:disabled { opacity: 0.6; cursor: wait; }

/* 倒计时状态行（插件 setQrcodeStatus 控制 is-loading/is-ready/is-expired） */
.rv-qr-status { display: flex; justify-content: center; margin-top: 0.85rem; }
.rv-qr-status p { margin: 0; font-size: 0.8rem; color: #666; }
.rv-qr-status.is-expired p { color: #e74c3c; }
.rv-qr-status.is-ready p { color: #333; font-weight: 500; }

/* 提示文案 */
.rv-qr-tips { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #f0f0f0; text-align: center; }
.rv-qr-tips p { margin: 0.3rem 0; font-size: 0.8rem; color: #999; }
.rv-qr-tips a { color: #1a1a1a; text-decoration: underline; }

/* ═══ 地址簿选择器（08-24，结账页 + order-pay 共用） ═══ */
.rv-addr-picker { margin-bottom: 18px; }
.rv-addr-picker-label { font-size: 13px; color: #666; margin-bottom: 8px; }
.rv-addr-picker-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 640px) { .rv-addr-picker-list { grid-template-columns: 1fr; } }
.rv-addr-pick-card {
    border: 1.5px solid #e5e5e5; border-radius: 10px; padding: 12px 14px;
    cursor: pointer; transition: border-color .15s, background .15s; background: #fff;
}
.rv-addr-pick-card:hover { border-color: #999; }
.rv-addr-pick-card.rv-addr-pick-active { border-color: #080C16; background: #fafafa; }
.rv-addr-pick-name { font-size: 14px; font-weight: 600; color: #222; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rv-addr-pick-phone { font-weight: 400; color: #666; font-size: 13px; }
.rv-addr-pick-full { font-size: 12.5px; color: #666; margin-top: 5px; line-height: 1.5; }
.rv-addr-pick-default { font-size: 10.5px; background: #1a1a1a; color: #fff; border-radius: 8px; padding: 1px 7px; } /* 轮二: 去蓝 */
.rv-addr-pick-card .rv-addr-type-tag { font-size: 10.5px; color: #666; background: #f2f2f2; border-radius: 8px; padding: 1px 7px; font-weight: 400; }
.rv-addr-pick-new { display: flex; align-items: center; justify-content: center; border-style: dashed; color: #666; font-size: 14px; min-height: 64px; }
.rv-addr-pick-new:hover { color: #222; }

/* ═══ 地址簿选择器 · 弹窗模式（08-24，order-pay 用；结账页仍平铺） ═══ */
.rv-addr-pick-trigger {
    display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px;
    padding: 13px 14px; border: 1px solid #e0e0e0; border-radius: 8px; background: #fafafa;
    cursor: pointer; text-align: left; font-size: 13.5px; color: #333; line-height: 1.5;
    transition: border-color .15s;
}
.rv-addr-pick-trigger:hover { border-color: #999; }
.rv-addr-pick-trigger-text { flex: 1; }
.rv-addr-pick-switch { color: #888; font-size: 12.5px; white-space: nowrap; flex-shrink: 0; }
.rv-addr-pick-overlay {
    position: fixed; inset: 0; z-index: 99999; background: rgba(0, 0, 0, .45);
    display: none; align-items: center; justify-content: center; padding: 20px;
}
.rv-addr-pick-overlay.open { display: flex; }
.rv-addr-pick-modal {
    background: #fff; border-radius: 12px; width: 560px; max-width: 92vw;
    max-height: 80vh; overflow-y: auto; padding: 22px;
}
.rv-addr-pick-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.rv-addr-pick-modal-head h3 { margin: 0; font-size: 16px; font-weight: 600; color: #222; }
.rv-addr-pick-close { border: none; background: none; font-size: 22px; line-height: 1; color: #999; cursor: pointer; padding: 4px; }
.rv-addr-pick-close:hover { color: #333; }
.rv-addr-pick-modal .rv-addr-picker-list { grid-template-columns: 1fr; }

/* H5 适配 2026-08-29（T12） */
@media (max-width: 768px) {
  input.shipping_method, #shipping_method input { width: 22px; height: 22px; }
  .rv-addr-type input { width: 22px; height: 22px; }
}

/* H5 原生级（轮一 T2）：购物车卡片化 */
@media (max-width: 768px) {
  .woocommerce-cart-form__contents thead { display: none; }
  .woocommerce-cart-form__contents, .woocommerce-cart-form__contents tbody, tr.cart_item, tr.cart_item td { display: block; width: 100%; }
  tr.cart_item { display: grid; grid-template-columns: 72px 1fr auto; grid-template-areas: "thumb name remove" "thumb qty qty" "thumb subtotal subtotal"; gap: 4px 12px; padding: 14px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
  tr.cart_item td { border: none; padding: 0; width: auto !important; } /* 轮二: 收回轮一 width:100%, 防撑破grid列 */
  tr.cart_item td::before { display: none; }
  td.product-thumbnail { grid-area: thumb; }
  td.product-thumbnail img { width: 72px; height: auto; border-radius: 4px; }
  td.product-name { grid-area: name; font-size: 0.9rem; }
  td.product-remove { grid-area: remove; text-align: right; }
  td.product-quantity { grid-area: qty !important; }
  td.product-subtotal { grid-area: subtotal; font-weight: 600; color: var(--navy); }
  .woocommerce-cart-form .actions { display: none; }
  body.rv-cartjs [name="update_cart"] { display: none; }
  .cart_totals { border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
  .cart_totals .wc-proceed-to-checkout { position: fixed; left: 0; right: 0; bottom: 0; z-index: 120; padding: 0; }
  .cart_totals .wc-proceed-to-checkout .checkout-button { display: block; width: 100%; min-height: 52px; line-height: 52px; text-align: center; font-size: 1rem; }
  .woocommerce-cart-form { margin-bottom: 1rem; }
  
  .woo-multi-currency, div:has(> .woo-multi-currency) { display: none !important; }
}

/* ═══ 轮二: 购物车页 776式条目 + 结算条去吸底 + iOS 点按白闪 ═══ */
a, button { -webkit-tap-highlight-color: transparent; } /* 治 iOS 点按白/灰闪盖文字 */

@media (max-width: 768px) {
  /* 条目: 92图 | 名+尺码+数量+价 | 右上删除; 行间细分隔线 */
  tr.cart_item {
    display: grid !important; /* 压 WC smallscreen 的 display:block(优先级 0,2,2) */
    grid-template-columns: 92px 1fr auto;
    grid-template-areas:
      "thumb name remove"
      "thumb qty remove"
      "thumb price remove";
    gap: 8px 14px;
    padding: 1.1rem 0; margin: 0;
    border: none; border-radius: 0; background: none;
    border-bottom: 1px solid #eee;
  }
  td.product-thumbnail { grid-area: thumb !important; }
  td.product-thumbnail img { width: 92px; height: 112px; object-fit: cover; border-radius: 0; }
  td.product-name { grid-area: name !important; font-size: 0.92rem; font-weight: 600; line-height: 1.5; color: #1a1f2e; }
  td.product-name a { color: #1a1f2e; }
  td.product-name dl.variation { display: block !important; font-weight: 400; color: #777; font-size: 0.85rem; margin: 2px 0 0; }
  td.product-name .variation dt, td.product-name .variation dd { display: inline !important; text-align: left !important; margin: 0 !important; float: none !important; }
  td.product-name .variation dd p { display: inline; margin: 0; }
  td.product-price { display: none !important; } /* 移动端只显小计, 免重复 */
  td.product-quantity { grid-area: qty; }
  td.product-quantity input.qty {
    width: 76px; height: 42px; text-align: center;
    border: 1px solid #ddd; border-radius: 0; font-size: 15px; color: #1a1f2e;
  }
  td.product-subtotal { grid-area: price !important; font-weight: 700; color: #1a1f2e; font-size: 1.02rem; }
  td.product-remove { grid-area: remove !important; text-align: right; vertical-align: top; width: auto !important; }
  /* 主题 cart.php 自定义: 真正的删除钮在 .rv-trash-col(.product-remove 内联隐藏), 归位右上 */
  td.rv-trash-col { grid-area: remove !important; text-align: right; width: auto !important; padding: 0 !important; border: none !important; }
  td.rv-trash-col .rv-trash-btn { display: inline-flex; padding: 4px; color: #999; text-decoration: none; }
  td.rv-trash-col .rv-trash-btn svg { width: 18px; height: 18px; }
  td.rv-trash-col .rv-trash-btn:hover { color: #c0392b; }
  td.product-remove a {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; color: #999; font-size: 18px; text-decoration: none;
  }
  td.product-remove a:hover { color: #c0392b; background: none; }

  /* 结算条: 去吸底, 776式静态全宽黑钮(原 fixed 遮挡配送区) */
  .cart_totals .wc-proceed-to-checkout { position: static !important; }
  .cart_totals .wc-proceed-to-checkout .checkout-button {
    display: flex; align-items: center; justify-content: center;
    width: 100%; min-height: 52px; margin-top: 1rem;
    background: #111111; color: #fff; font-size: 1rem; font-weight: 700; letter-spacing: 0.06em; /* 轮二: CTA统一真黑 */
    border-radius: 0; text-decoration: none;
  }
  /* 总计表: 776式左右分布收紧 */
  .cart_totals table.shop_table th, .cart_totals table.shop_table td { font-size: 0.95rem; }
  .cart_totals .order-total th, .cart_totals .order-total td { font-weight: 700; font-size: 1.05rem; }
}

/* ═══ 轮二·购物车页二次打磨(用户实测): 去多余线条/全左对齐/数量步进器 ═══ */
@media (max-width: 768px) {
  /* 1. 线条清理: WC shop_table 默认边框全灭, 只留条目间 1px #eee */
  .woocommerce-cart-form table.shop_table,
  .woocommerce-cart-form table.shop_table tbody,
  .woocommerce-cart-form table.shop_table tr,
  .woocommerce-cart-form table.shop_table td,
  .woocommerce-cart-form table.shop_table th { border: none !important; }
  .cart_totals { border: none !important; }
  .cart_totals table.shop_table,
  .cart_totals table.shop_table tr,
  .cart_totals table.shop_table th,
  .cart_totals table.shop_table td { border: none !important; }
  .cart_totals table.shop_table tr th, .cart_totals table.shop_table tr td { padding: 0.45rem 0 !important; }
  .cart_totals h2 { font-size: 1.1rem; margin-bottom: 0.5rem; }
  .woocommerce-cart-form { border: none !important; }

  /* 2. 全左对齐(压 WC smallscreen 的 td 右对齐+内边距); 金额个数一行: 左金额右个数 */
  table.shop_table tr.cart_item td.product-name,
  table.shop_table tr.cart_item td.product-quantity,
  table.shop_table tr.cart_item td.product-subtotal {
    text-align: left !important; padding-left: 0 !important; padding-right: 0 !important;
  }
  table.shop_table tr.cart_item td.product-name { justify-self: start !important; }
  table.shop_table tr.cart_item td.product-name > a { display: block; text-align: left !important; }
  table.shop_table tr.cart_item td { padding-top: 0 !important; padding-bottom: 0 !important; }
  table.shop_table tr.cart_item td.product-thumbnail { padding: 0 !important; align-self: stretch !important; }
  table.shop_table tr.cart_item td.product-thumbnail a { display: block; height: 100%; }
  table.shop_table tr.cart_item td.product-thumbnail img { display: block; width: 92px !important; height: 100% !important; max-width: none !important; object-fit: cover; } /* 轮二: 图撑满内容行高, 上下缘对齐 */
  table.shop_table tr.cart_item td.product-name dl.variation { margin-bottom: 0 !important; }
  table.shop_table tr.cart_item td.product-name > a { margin-bottom: 2px; }
  tr.cart_item {
    grid-template-areas:
      "thumb name remove"
      "thumb price qty" !important;
    gap: 6px 12px;
    padding: 1.1rem 16px !important; /* 条目内边距(压WC td padding), 间隔线随条目满幅 */
    align-content: space-between !important; /* 轮二: 内容行顶天(名称)立地(金额+个数), 与图片上下缘对齐 */
    align-items: start;
  }
  tr.cart_item td.product-name { line-height: 1.4; }
  tr.cart_item td.product-name > a { line-height: 1.45; }
  }
  .woocommerce-cart-form table.shop_table { border-collapse: collapse !important; }
  tr.cart_item td.product-subtotal { grid-area: price !important; align-self: end; }
  tr.cart_item td.product-quantity { grid-area: qty !important; justify-self: end !important; align-self: end; }

  /* 3. 数量步进器(776式 – n +) */
  tr.cart_item .quantity {
    display: inline-flex; align-items: stretch;
    border: 1px solid #ddd; background: #fff;
  }
  tr.cart_item .quantity input.qty {
    width: 44px !important; height: 42px; border: none !important; border-radius: 0;
    text-align: center; font-size: 15px; color: #1a1f2e; background: transparent;
    -moz-appearance: textfield; appearance: textfield;
  }
  tr.cart_item .quantity input.qty::-webkit-outer-spin-button,
  tr.cart_item .quantity input.qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
  .rv-qty-btn {
    width: 34px; height: 42px; background: none; border: none;
    font-size: 17px; line-height: 1; color: #555; cursor: pointer;
    display: flex; align-items: center; justify-content: center; padding: 0;
  }
  .rv-qty-btn:active { transform: none; color: #000; }
}

/* 步进器按钮: 去 Astra 聚焦填充(点按后黑底残留) */
@media (max-width: 768px) {
  .rv-qty-btn:hover, .rv-qty-btn:focus, .rv-qty-btn:active { background: none !important; color: #555 !important; box-shadow: none !important; transform: none !important; }
}

/* ═══ 轮二(08-30): 购物车总计+提单页精简 ═══ */
/* 运费计算器/更换地址入口 全端隐藏(配合 mu-plugin 只留包邮) */
.woocommerce-shipping-calculator,
.shipping-calculator-form,
.shipping-calculator-button,
a.shipping-calculator-button { display: none !important; }

/* 提单页输入框 16px 防 iOS 聚焦放大不回缩(与筛选价格输入同款) */
@media (max-width: 768px) {
  form.checkout input[type="text"],
  form.checkout input[type="tel"],
  form.checkout input[type="email"],
  form.checkout input[type="number"],
  form.checkout input[type="password"],
  form.checkout select,
  form.checkout textarea,
  .woocommerce-checkout .rv-region-select { font-size: 16px !important; }
}

/* 配送目的地文案隐藏(用户裁定: 配送区只留包邮) */
.woocommerce-shipping-destination { display: none !important; }

/* 提单页邮箱账号提示卡(2026-09-06): 账号心智关键文案, 突出但不吵 */
.rv-email-account-hint {
  display: flex; align-items: flex-start; gap: 9px;
  margin: 10px 0 0; padding: 11px 13px;
  background: #eef3fb;
  border-left: 3px solid #1a2c4d;
  border-radius: 6px;
  font-size: 13px; line-height: 1.7; color: #1a2c4d;
}
.rv-email-account-hint svg { flex-shrink: 0; margin-top: 3px; color: #1a2c4d; }
.rv-email-account-hint strong { font-weight: 700; }
@media (max-width: 768px) {
  .rv-email-account-hint { font-size: 12.5px; }
}

/* 游客订单确认页摘要卡(2026-09-06): 从 page-account.css 移植 od- 风格 */
.rv-guest-thankyou .od-card { background: #fff; border: 1px solid #ececec; border-radius: 14px; padding: 22px 24px; margin-bottom: 14px; }
.rv-guest-thankyou .od-item { display: flex; gap: 16px; align-items: center; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid #f0f0f0; }
.rv-guest-thankyou .od-item:last-of-type { border-bottom: none; }
.rv-guest-thankyou .od-item-thumb { position: relative; width: 64px; height: 64px; flex-shrink: 0; }
.rv-guest-thankyou .od-item-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; background: #eee; }
.rv-guest-thankyou .od-item-qty { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; background: #1a1a1a; color: #fff; border-radius: 50%; font-size: 11px; display: flex; align-items: center; justify-content: center; }
.rv-guest-thankyou .od-item-info { flex: 1; }
.rv-guest-thankyou .od-item-name { font-size: 14px; font-weight: 500; line-height: 1.4; }
.rv-guest-thankyou .od-item-meta { font-size: 12px; color: #999; margin-top: 3px; }
.rv-guest-thankyou .od-item-price { font-size: 14px; font-weight: 600; }
.rv-guest-thankyou .od-totals-row { display: flex; justify-content: space-between; font-size: 14px; color: #555; padding: 5px 0; }
.rv-guest-thankyou .od-totals-row.total { font-size: 16px; font-weight: 700; color: #1a1a1a; padding-top: 12px; }
@media (max-width: 640px) {
  .rv-guest-thankyou .od-card { padding: 18px 16px; }
}

/* 条款未勾红框+抖动(2026-09-07, 与输入框飙红同款语言) */
.rv-terms-error {
  outline: 2px solid #e53e3e !important;
  outline-offset: 5px;
  border-radius: 6px;
  animation: rvTermsShake 0.45s ease;
}
@keyframes rvTermsShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}
