/* ============================================================
   Personal Home · 商店与订单样式（pages/shop.css）
   仅商品列表 / 收银台 / 订单详情加载
   依赖 base.css 的设计令牌与通用组件
   ============================================================ */

/* ---------- 商店商品 ---------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.product-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.24s ease, box-shadow 0.24s ease, background 0.24s ease;
}

.product-cover { aspect-ratio: 16 / 9; overflow: hidden; }

.product-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
    padding: 18px 20px 20px;
}

.product-name {
    font-size: 16.5px;
    font-weight: 700;
    line-height: 1.4;
}

.product-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.product-desc {
    font-size: 14px;
    line-height: 1.7;
    color: var(--fg-2);
}

.product-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 6px;
}

/* ---------- 库存 / 状态徽标 ---------- */
.stock {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    background: var(--hairline);
    color: var(--fg-2);
}

.stock.is-ok { color: var(--accent); background: var(--accent-soft); }
.stock.is-out { color: #ff453a; background: rgba(255, 69, 58, 0.12); }
.stock.is-pending { color: #b8860b; background: rgba(255, 204, 0, 0.16); }

/* 库存徽标组：库存 + 低库存提醒，避免在 product-foot 里被两端对齐拆散 */
.stock-tags {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.stock.stock-warn {
    color: #b26a00;
    background: rgba(178, 106, 0, 0.15);
}

/* ---------- 收银台 / 结算 ---------- */
.checkout {
    display: grid;
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.cashier-card {
    max-width: 460px;
    margin: 0 auto;
    padding: clamp(22px, 4vw, 34px);
    text-align: center;
}

.cashier-qr {
    display: inline-flex;
    padding: 14px;
    border-radius: var(--radius-md);
    background: #fff;
    box-shadow: var(--shadow-card);
}

.cashier-qr img {
    display: block;
    width: 260px;
    max-width: 100%;
    height: auto;
}

.cashier-tip {
    margin-top: 18px;
    font-size: 14.5px;
    color: var(--fg-2);
}

.cashier-state {
    margin-top: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
}

.cashier-card .post-back { margin: 18px 0 0; }

/* ---------- 订单与卡密 ---------- */
.order-card {
    padding: clamp(20px, 3.4vw, 30px);
    margin-bottom: 26px;
}

.order-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.order-no {
    font-size: 15.5px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--fg);
    word-break: break-all;
}

.order-meta {
    margin-top: 6px;
    font-size: 13.5px;
    color: var(--fg-2);
}

.card-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.card-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--hairline);
    background: var(--glass-grad);
}

.card-index {
    flex: 0 0 auto;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--fg-3);
    font-variant-numeric: tabular-nums;
}

.code-input {
    flex: 1 1 180px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--glass-edge);
    border-radius: var(--radius-sm);
    background: var(--hairline);
    color: var(--fg);
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
}

.code-input:focus { outline: none; border-color: var(--accent); }

.order-card .field-tip { margin-top: 16px; }

/* ---------- 交互增强（指针精细设备） ---------- */
@media (hover: hover) and (pointer: fine) {
    .product-card:hover {
        transform: translateY(-5px);
        background: var(--glass-grad-hover);
        box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 -1px 0 var(--glass-lo), var(--shadow-lift);
    }
}

/* ---------- 交互增强（触摸设备） ---------- */
@media (hover: none) {
    .product-card { touch-action: manipulation; }
    .product-card:active { transform: scale(0.985); }
}

/* ---------- 响应式：收银台与订单 ---------- */
@media (max-width: 760px) {
    .checkout { grid-template-columns: minmax(0, 1fr); }
    .order-head { flex-direction: column; }
}

/* ---------- 动效降级 ---------- */
@media (prefers-reduced-motion: reduce) {
    .product-card { transition: none; }
}