/* 列表页商品卡片：收藏 + 快捷加购 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.product-card {
    position: relative;
}

.product-card .product-info {
    position: relative;
    padding-bottom: 42px;
}

.product-card-actions {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 2;
}

.pa-icon-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #888;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 16px;
    line-height: 1;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.pa-ico {
    display: inline-block;
    width: 18px;
    height: 18px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    flex-shrink: 0;
}

.pa-ico-star {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/%3E%3C/svg%3E");
}

.pa-fav-btn.is-active .pa-ico-star,
.pa-fav-btn:hover .pa-ico-star {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f5a623' stroke='%23f5a623' stroke-width='1'%3E%3Cpolygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/%3E%3C/svg%3E");
}

.pa-cart-btn {
    position: relative;
    color: #888;
    border-color: #ddd;
}

.pa-cart-badge {
    display: none;
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-sizing: border-box;
    pointer-events: none;
}

.pa-cart-btn.is-active .pa-cart-badge {
    display: block;
}

.pa-ico-cart {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6'/%3E%3C/svg%3E");
}

.pa-cart-btn.is-active .pa-ico-cart,
.pa-cart-btn:hover .pa-ico-cart,
.pa-cart-btn.is-open .pa-ico-cart {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e74c3c' stroke-width='2'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6'/%3E%3C/svg%3E");
}

.pa-cart-btn.is-active,
.pa-cart-btn.is-open,
.pa-cart-btn:hover {
    color: #e74c3c;
    border-color: #e74c3c;
    background: #fff5f5;
}

.pa-quick-cart {
    display: none;
    align-items: center;
    gap: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.pa-quick-cart.is-open {
    display: inline-flex;
}

.pa-qty-btn {
    width: 28px;
    height: 32px;
    border: none;
    background: #f5f5f5;
    color: #333;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0;
}

.pa-qty-btn:hover {
    background: #ebebeb;
}

.pa-qty-input {
    width: 36px;
    height: 32px;
    border: none;
    border-left: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    text-align: center;
    font-size: 14px;
    padding: 0;
    -moz-appearance: textfield;
}

.pa-qty-input::-webkit-outer-spin-button,
.pa-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pa-confirm-btn {
    height: 32px;
    padding: 0 12px;
    border: none;
    background: #ff7a00;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.pa-confirm-btn:hover {
    background: #e56d00;
}

/* 详情页收藏星标 */
.product-actions .pa-fav-btn-detail {
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #888;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.product-actions .pa-fav-btn-detail .pa-ico {
    width: 20px;
    height: 20px;
}

.product-actions .pa-fav-btn-detail.is-active {
    color: #f5a623;
    border-color: #f5a623;
}

.pa-fav-btn.is-active,
.pa-fav-btn.is-active:hover {
    color: #f5a623;
    border-color: #f5a623;
}

.pa-icon-btn:hover {
    border-color: #bbb;
}

.product-actions .pa-fav-btn-detail:hover {
    border-color: #f5a623;
    color: #f5a623;
}
