/* ============================================================
   幼师藏宝箱 · 商城 — cart.css (Apple 风格)
   购物车 / 游客购物车 / 支付页
   ============================================================ */

/* ---- 购物车商品 ---- */
.cart-item {
    display: flex; gap: 16px; padding: 16px;
    border: 1px solid var(--mall-border); border-radius: var(--mall-radius);
    background: var(--mall-card-bg); margin-bottom: 12px;
    transition: box-shadow 0.25s var(--mall-ease);
}
.cart-item:hover { box-shadow: var(--mall-shadow); }
.cart-item-image {
    width: 80px; height: 80px; border-radius: var(--mall-radius-sm); object-fit: cover;
    flex-shrink: 0; background: var(--mall-bg); overflow: hidden;
}
.cart-item-image img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-title {
    font-weight: 600; font-size: 14px; margin-bottom: 4px;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}
.cart-item-title a { color: var(--mall-text); text-decoration: none; }
.cart-item-title a:hover { color: var(--mall-primary); }
.cart-item-price { color: var(--mall-accent); font-weight: 700; font-size: 16px; }
.cart-item-price .xhs-price-strike { font-size: 12px; }
.cart-item-preorder-badge {
    display: inline-block; padding: 2px 9px; border-radius: 20px;
    background: rgba(255,149,0,0.14); color: #bc4c00; font-size: 11px; font-weight: 600;
    margin-left: 8px; vertical-align: middle;
}
.cart-item-disabled { opacity: 0.75; }
.cart-item-disabled .qty-group, .cart-item-disabled .btn-remove-cart { display: none; }
.cart-subtotal-excluded { color: var(--mall-text-muted); font-style: italic; }
/* T-MALL-BUNDLE: 结算页多买优惠行金额 (走商城 CSS 变量, 禁硬编码颜色) */
.cart-tier-discount { font-size: 13px; color: var(--mall-primary); font-weight: 600; }

/* 数量选择器 */
.qty-group { gap: 4px; }
.qty-group .btn { border-radius: 8px; }
.qty-input { text-align: center; }

/* ---- 购物车汇总 (sticky, 毛玻璃) ---- */
.cart-summary {
    background: rgba(255, 255, 255, 0.8);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid var(--mall-border);
    border-radius: var(--mall-radius-lg); padding: 20px;
    position: sticky; bottom: 16px; box-shadow: var(--mall-shadow);
}
@media (prefers-color-scheme: dark) {
/* T-MALL-DAYMODE-0922: 门控 — 用户显式选白天 (html[data-theme=day]) 时系统深色媒体规则不生效
   (防白字压浅底); :where() 零特异性, 不改变级联; 旧浏览器不支持 :where 时整条规则失效=保持浅色, 安全。 */

    :where(html:not([data-theme="day"])) .cart-summary { background: rgba(28, 28, 30, 0.8); }

}
/* T-NIGHT-CARTCSS-1011: 站内手动夜间 (body[data-night], localStorage app-theme, 独立于系统)
   根因: 深色表面只写在 @media(prefers-color-scheme:dark) (系统级), 浅色系统开应用夜间时
   汇总条仍是白玻璃, 而 --mall-text 已被 theme.css body[data-night] 翻成白色 → 白字压白底。
   补 body[data-night] 等价规则 (与 theme.css 夜间写法同特异性 (0,2,1), theme.css 后加载靠
   源码顺序取胜走 --glass-bg-strong 变量; 本条为文件内自洽备份)。 */
body[data-night] .cart-summary { background: rgba(28, 28, 30, 0.8); }

/* ---- 游客购物车提示 ---- */
.guest-cart-hint {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 16px; margin-bottom: 12px;
    background: rgba(0,122,255,0.08); border: 1px solid rgba(0,122,255,0.2);
    border-radius: var(--mall-radius); color: #0969da; font-size: 13px;
}
.guest-cart-hint a { color: #0969da; font-weight: 600; text-decoration: none; }
.guest-cart-hint a:hover { text-decoration: underline; }

/* ---- 支付页 ---- */
.payment-status-icon { font-size: 64px; margin-bottom: 16px; }
.payment-steps {
    background: var(--mall-bg); border: 1px solid var(--mall-border);
    border-radius: var(--mall-radius); padding: 16px; margin: 16px 0;
}
.payment-steps h4 { margin: 0 0 10px; font-size: 15px; }
.payment-steps ol { margin: 0; padding-left: 20px; }
.payment-steps li { font-size: 13px; color: var(--mall-text); line-height: 1.9; }
.payment-steps li strong { color: var(--mall-accent); }
.member-hint {
    padding: 12px 14px; border-radius: var(--mall-radius-sm); margin: 12px 0;
    background: rgba(255,204,0,0.12); border: 1px solid rgba(255,204,0,0.35);
    color: #9a6700; font-size: 13px;
}
.payment-success-box { text-align: center; padding: 24px 0; }
.payment-success-box .ok-icon { font-size: 56px; margin-bottom: 12px; }

/* ---- 响应式 ---- */
/* T-MALL-RESP-DEVICES: 768 边界统一 — max-width:768 → 767, 避免 768 宽 (iPad mini 5 竖屏)
   与 min-width:768 两套规则同时命中 (生效取决于加载顺序, 边界不干净) */
@media (max-width: 767px) {
    .cart-item { flex-direction: column; }
    .cart-item-image { width: 100%; height: 120px; }
    .cart-summary {
        /* T-MALL-TAB-0917: 同步 layout.css — 悬浮栏停在导航栏(含 safe-area)上方, 不压进安全区 */
        position: fixed; bottom: calc(var(--mall-bottom-nav-height) + env(safe-area-inset-bottom));
        left: 0; right: 0; border-radius: var(--mall-radius) var(--mall-radius) 0 0; z-index: 199;
    }
}
