/* ========================================
   商品区块 — eStore 主题
   包含外壳（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 .title {
    margin: 0;
    font-size: 19px;
    font-weight: 800;
    color: #111827;
}

.product-section-footer {
    display: flex;
    justify-content: center;
    padding: 8px 16px 16px 16px;
}

.product-section-footer .main-btn.primary-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;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
}

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

.product-section > .row {
    padding: 0 16px;
    margin-left: -6px;
    margin-right: -6px;
}

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


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

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

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

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

/* 价格样式 */
.product-style-7 .product-content {
    padding: 12px;
    display: flex;
    flex-direction: column;
}

.product-style-7 .product-content h4.title {
    margin: 4px 0 4px 0;
    font-size: 14px;
}

.product-style-7 .product-content h4.title a {
    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-price-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

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

.product-special-cost {
    color: #f93716;
    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-top: 4px;
    margin-bottom: 4px;
}

.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; }

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

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

    /*
     * 覆盖主题 style.css：桌面端 .product-style-7 默认为横向 flex（图左文右）。
     * 商品区块内改为与手机端一致的上下布局。
     */
    .product-section .product-style-7 {
        display: block;
    }

    .product-section .product-style-7 .product-image {
        max-width: 100%;
    }

    .product-section .product-style-7 .product-content {
        flex: none;
        width: 100%;
    }

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