/* assets/css/woocommerce.css - 购物车样式 (移动优先) */

/* 基本容器 */
.cart-page-wrapper {
    max-width: 960px;
    margin: 0 auto;
    padding: 1rem;
    font-family: "Helvetica Neue", Arial, sans-serif;
}

/* 标题 */
.cart-title {
    font-size: 1.3rem;
    margin: 0 0 0.6rem;
    padding: 0 0.25rem;
}

/* 空购物车 */
.cart-empty {
    text-align: center;
    color: #666;
    padding: 2rem 0;
}

/* 商品卡片 */
.cart-item.card {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(24,24,24,0.04);
    padding: 0.6rem;
    margin-bottom: 0.8rem;
    position: relative;
    transition: transform .12s ease, box-shadow .12s ease;
    overflow: hidden;
}

.cart-item.card.is-loading {
    opacity: 0.6;
}

.cart-item.card.updated {
    transform: translateY(-4px);
}

/* 缩略图 */
.cart-item-thumb {
    flex: 0 0 84px;
    width: 84px;
    height: 84px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cart-item-thumb img {
    max-width: 100%;
    height: auto;
    display:block;
}

/* 文字区域 */
.cart-item-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 标题 + 删除 */
.cart-item-header {
    display:flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}
.cart-item-title {
    font-size: 1rem;
    margin: 0;
    line-height: 1.25;
}
.cart-item-remove {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: #999;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
}
.cart-item-remove:hover { color: #333; }

/* 变体文本 */
.cart-item-variation {
    font-size: 0.86rem;
    color: #666;
    margin-top: 0.35rem;
}

/* 元信息 */
.cart-item-meta {
    margin-top: 0.6rem;
    display:flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

/* 单价 */
.cart-item-price { font-size: 0.92rem; color: #222; }

/* 数量控制 */
.qty-wrapper {
    display:flex;
    align-items:center;
    gap: 0.35rem;
}
.qty-btn {
    border: 1px solid #eee;
    background: #fafafa;
    padding: 6px 8px;
    border-radius: 6px;
    cursor:pointer;
    font-size: 1rem;
}
.qty-btn:active { transform: translateY(1px); }

.quantity .qty {
    width: 56px;
    text-align: center;
    border-radius: 6px;
    border: 1px solid #eee;
    padding: 6px 8px;
    font-size: 0.95rem;
}

/* 小计 */
.cart-item-subtotal { font-size: 0.95rem; color: #111; }

/* 操作区 */
.cart-actions-row {
    display:flex;
    gap: 0.6rem;
    margin-top: 0.6rem;
}
.update-cart-btn {
    background: #111;
    color: #fff;
    border: none;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    cursor: pointer;
}

/* 购物车总计侧栏（响应式：移动端放在页面下方） */
.cart-totals-area {
    margin-top: 1rem;
    position: sticky;
    bottom: 12px;
    z-index: 30;
    background: transparent;
}

/* 视觉增强：flash message */
.cart-flash {
    position: fixed;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    top: 6%;
    padding: .55rem .9rem;
    border-radius: 10px;
    background: rgba(0,0,0,0.8);
    color: white;
    font-size: 0.95rem;
    opacity: 0;
    transition: transform .18s ease, opacity .18s ease;
    z-index: 9999;
}
.cart-flash.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.cart-flash.error { background: #d9534f; }

/* 大屏优化 */
@media (min-width: 720px) {
    .cart-page-wrapper { padding: 1.6rem; }
    .cart-item-thumb { width: 120px; height: 120px; flex-basis: 120px; }
    .cart-item.card { gap: 1rem; padding: 1rem; }
    .cart-totals-area { position: static; margin-top: 1.4rem; }
}
