﻿:root {
    --primary-dark: #212529;
    --gray-light: #f8f9fa;
}

.product-card {
    transition: transform .2s ease, box-shadow .2s ease;
    border: none;
    border-radius: 8px;
    overflow: hidden;
}

.product-title {
    font-size: .90rem;
    font-weight: 700;
    margin-bottom: .5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4em;
    min-height: 2.8em;
    word-break: break-all;
}

.product-desc {
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4em;
    max-height: 2.8em;
    white-space: normal; /* 允许正常换行 */
    word-break: keep-all; /* 确保单词不会在中间被切断 */
    overflow-wrap: break-word; /* 只在必要时换行 */
}

.custom-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* 列表模式 */
.list-view .product-item {
    width: 100% !important;
}

.list-view .product-title {
    min-height: 1.5em;
}

.list-view .card {
    flex-direction: row;
}

.list-view .img-container {
    width: 150px;
    height: 150px;
    flex-shrink: 0;
}
/* 价格样式 */
.price-wrapper {
    min-height: 45px;
    display: flex;
    align-items: center;
}

.product-price-now {
    font-weight: 800;
    color: #dc3545;
    font-size: 1.1rem;
}

.product-price-old {
    text-decoration: line-through;
    color: #6c757d;
    font-size: .6rem;
    margin-left: 4px;
}

/* 防止卡片内的文字受链接影响变色 */
.product-card a.stretched-link {
    color: inherit;
    text-decoration: none;
}

/* 移除链接点击时的蓝色轮廓 */
.product-card a.stretched-link:focus {
    outline: none;
    box-shadow: none;
}

/* 悬停效果优化 */
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
}

.discount-badge {
    font-size: .7rem;
    padding: 2px 5px;
    background-color: #FFE3F0;
    color: #dc3545;
    border-radius: 3px;
    font-weight: 700;
    margin-left: 5px;
}

/* 只有在 Grid 模式下显示多个，List 模式可以考虑缩小 */
.list-view .badge {
    font-size: 0.65rem;
    padding: 2px 4px;
}

/* 确保标签不会被 stretched-link 盖住 */
.badge {
    position: relative;
    z-index: 12;
}

/* 移动端优化 */
@media (max-width: 576px) {
    h5.header-title {
        font-size: .95rem !important;
        max-width: 40%;
    }

    .btn-group-sm > .btn, .btn-sm {
        padding: .25rem .4rem !important;
        font-size: .8rem;
    }

    #product-container:not(.list-view) .product-item {
        padding-left: 6px;
        padding-right: 6px;
    }

    #product-container:not(.list-view) .card-body {
        padding: 8px;
    }

    #product-container:not(.list-view) .product-price-now {
        font-size: .95rem;
    }
}

@media (min-width: 768px) {
    .list-view .img-container {
        width: 260px;
        height: auto;
    }
}

/* 基础 Badge 升级：定义极具国际范的年轻化排版 */
.badge.rounded-pill {
    font-weight: 700 !important;
    font-size: 0.7rem !important;
    letter-spacing: 0.8px; /* 字母微扩，营造高级电商感 */
    padding: 6px 14px !important; /* 加宽左右内边距，呈现完美的胶囊状 */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05); /* 极淡阴影让它浮起来 */
    border: 1px solid transparent;
}

/* 1. Bestseller:  */
.badge-bestseller {
    background-color: #F5D018 !important;
    color: #000 !important;
    border: 1px solid rgba(46, 105, 48, 0.15) !important;
}

/* 2. New:  */
.badge-new {
    background-color: #E6F0FF !important;
    color: #000 !important;
    border: 1px solid rgba(0, 82, 255, 0.15) !important;
}

/* 3. Sale: */
.badge-sale {
    background-color: #FFEBEB !important;
    color: #000 !important;
    border: 1px solid rgba(255, 59, 48, 0.15) !important;
}

/* 4. Promo: 拒绝黄底黑字，采用极具亲和力的温和轻芒果黄 */
.badge-promo {
    background-color: #FFF6E0 !important;
    color: #000 !important;
    border: 1px solid rgba(217, 130, 0, 0.15) !important;
}

/* 5. 其他自定义未定义标签：使用高级中性暖灰 */
.badge-custom-default {
    background-color: #F4F4F6 !important;
    color: #000 !important;
}

/* Product Type Floating Image */
.viewbx img {
    max-width: 60px !important;
    height: auto !important;
}

/* Quick Buttons */
.product-action-container {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    gap: 8px !important;
}

.product-action-container .btn {
    box-sizing: border-box !important;
    flex: 1 1 0% !important; /* 强制两个按钮无条件绝对等宽平分 */
    min-width: 0 !important; /* 防止文字过长时撑爆 */

    font-size: 0.78rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px;
    padding: 10px 2px !important;
    border-radius: 12px !important; /* Q弹圆角 */
    text-transform: uppercase;
    box-shadow: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 2px solid transparent;
    height: 42px !important; /* 完美高度 */
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* 🛒 按钮 A：ADD CART */
.btn-cart-outline {
    background: rgba(255, 107, 53, 0.06) !important;
    color: #FF6B35 !important;
    border-color: rgba(255, 107, 53, 0.3) !important;
}

    .btn-cart-outline:hover {
        background: rgba(255, 107, 53, 0.12) !important;
        border-color: #FF6B35 !important;
        transform: translateY(-2px);
    }

/* ⚡ 按钮 B：BUY NOW */
.btn-cart-solid {
    background: linear-gradient(135deg, #FF6B35 0%, #ff8552 100%) !important;
    color: #ffffff !important;
}

    .btn-cart-solid:hover {
        background: linear-gradient(135deg, #e55a23 0%, #FF6B35 100%) !important;
        box-shadow: 0 6px 20px rgba(255, 107, 53, 0.25);
        transform: translateY(-2px);
    }

/* 点击时的反馈 */
.product-action-container .btn:active {
    transform: translateY(1px) scale(0.98);
}
@media (max-width: 576px) { /* 扩大覆盖范围到标准手机端 */
    .product-action-container {
        flex-direction: column !important; /* 核心：开启上下堆叠 */
        gap: 6px !important; /* 按钮上下的缝隙 */
    }

        .product-action-container .btn {
            width: 100% !important; /* 宽度直接撑满卡片 */
            flex: none !important;
            font-size: 0.75rem !important;
            height: 38px !important; /* 稍微降低高度，防止垂直方向占太多地方 */
            padding: 0 !important;
        }
}

/* Atome 分期样式 */
.atome-installment-box {
    font-size: 0.75rem; /* 12px */
    line-height: 1.2;
    color: #333333;
}

.atome-installment-box strong {
    font-weight: 700;
    color: #000000;
}

.atome-brand {
    font-weight: 800;
    font-style: italic;
    color: #000000;
    text-transform: lowercase;
}

.atome-icon {
    vertical-align: text-bottom;
    background-color: #E8F952; /* Atome 标志性黄色 */
    border-radius: 2px;
    padding: 1px;
}