/* ========================================
   商品区块 — Default 主题
   包含外壳（section）与单卡片（card）样式
   ======================================== */

/* ---- 区块外壳 ---- */

.product-section {
    background-color: #ffffff;
    border-radius: 16px;
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.03);
}

.product-section-banner {
    margin-bottom: 0;
}

.product-section-banner img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0;
}

.product-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 16px 12px 16px;
}

.product-section-header h3 {
    margin: 0;
    font-size: 19px;
    font-weight: 800;
    color: #111827;
}

.product-section-more {
    display: inline-flex;
    align-items: center;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
}

.product-section-more svg {
    margin-left: 2px;
    transition: transform 0.3s ease;
}

.product-section-more:hover {
    color: #111827;
}

.product-section-more:hover svg {
    transform: translateX(4px);
}

.product-section-footer {
    padding: 12px 16px 16px 16px;
}

.product-section-footer-btn {
    background-color: #f9fafb;
    color: #111827;
    border: 1px solid #e5e7eb;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 0;
    border-radius: 100px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.product-section-footer-btn:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

/* 列表内卡片间距（覆盖 Bootstrap 栅格默认 gutter） */
.product-section > .row {
    padding: 0 16px;
    margin-left: -6px;
    margin-right: -6px;
    margin-top: 8px;
}

.product-section > .row > [class*="col-"].product-grid {
    padding-left: 6px;
    padding-right: 6px;
    margin-top: 0;
    margin-bottom: 12px;
}

@media screen and (max-width: 600px) {
    .product-section-banner img {
        border-radius: 0;
    }
    .product-section-header h3 {
        font-size: 16px;
    }
}

/* ---- 卡片 ---- */

.product-card {
    background-color: #ffffff;
    border-radius: 8px;
    border: 1px solid #f3f4f6;
    transition: transform 0.2s ease, border-color 0.2s ease;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-2px);
    border-color: #e5e7eb;
}

.product-price-box {
    padding: 8px;
    display: flex;
    flex-direction: column;
}

.product-price-box h3 {
    margin: 0 0 4px 0;
    font-size: 14px;
}

.product-price-box h3 a.fsl {
    color: #1a1a1a;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    max-height: 2.6em;
}

/* 售罄章缩放（已由内部百分比自适应，这里移除强制缩放） */
.product-img {
    position: relative;
}

/* 角标（折扣 / tag） */
.favorites-save {
    width: 90px;
    height: 40px;
    position: absolute;
    background: #fff0;
    top: -10px;
    right: -30px;
    transform: rotate(45deg);
    color: #fff;
    z-index: 80;
    font-weight: 600;
    font-style: oblique;
}

.fava {
    position: absolute;
    bottom: 0;
    display: block;
    width: 100px;
    text-align: center;
    background: #ef0f0f;
    font-size: 10px;
    font-weight: bolder;
}

/* 品牌 logo */
.product-card .logo {
    position: absolute;
    top: 0;
    left: 15px;
    width: 60px;
    height: 60px;
    object-fit: contain;
    transform: translateZ(0);
    z-index: 98;
}

/* 元素行：榜单/星级 */
.product-meta-row {
    display: flex;
    align-items: center;
    margin-top: 2px;
    margin-bottom: 2px;
    min-height: 18px;
}

.product-meta-left {
    display: flex;
    align-items: center;
}

.product-stars {
    display: flex;
    align-items: center;
    gap: 2px;
}

.star-icon {
    display: block;
}

.product-meta-right {
    display: flex;
    align-items: center;
}

/* 价格与收藏按钮 */
.product-price-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.product-special-offer {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin: 0;
}

.product-special-cost {
    color: #F97316;
    font-weight: 800;
    font-size: 16px;
}

.product-original-cost {
    color: #94a3b8;
    text-decoration: line-through;
    font-size: 12px;
}

/* 排名文字 */
.product-ranking-text {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 800;
    margin: 0;
}

.product-ranking-text.rank-1 { color: #d4af37; }
.product-ranking-text.rank-2 { color: #9e9e9e; }
.product-ranking-text.rank-3 { color: #cd7f32; }
.product-ranking-text.rank-4 { color: #607d8b; }
.product-ranking-text.rank-5 { color: #78909c; }

/* 移动端卡片排版压缩 */
@media screen and (max-width: 600px) {
    .product-price-box {
        padding: 6px 8px;
    }
    .product-price-box h3 {
        margin-bottom: 2px;
    }
    .product-meta-row {
        margin-top: 2px;
        margin-bottom: 2px;
        min-height: 16px;
    }
    .product-special-cost {
        font-size: 15px;
    }
    .product-ranking-text {
        font-size: 13px;
        font-weight: 900;
    }
}

/* ---- PC 端适配 (min-width: 768px) ---- */
@media screen and (min-width: 768px) {
    /* 增加整个区块左右的外边距 */
    .product-section {
        margin: auto;
        max-width: 1500px;
    }

    /* 限制卡片最大宽度，自动在列内居中产生间距 */
    .product-card {
        margin-left: auto;
        margin-right: auto;
        padding: 0px;
    }

    /* 标题放大 */
    .product-section-header h3 {
        font-size: 24px;
    }
    
    /* 卡片悬浮交互增强 */
    .product-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.1);
    }
    
    /* 增加内边距 */
    .product-price-box {
        padding: 16px;
    }
    
    /* 字体放大 */
    .product-price-box h3 {
        font-size: 15px;
        margin-bottom: 8px;
    }
    
    .product-special-cost {
        font-size: 20px;
    }
    
    .product-original-cost {
        font-size: 14px;
    }
    
    /* 底部按钮防变形居中 */
    .product-section-footer-btn {
        width: auto;
        min-width: 240px;
        margin: 0 auto;
    }
}
