/* =========================================================================
 * Vanma 产品中心样式表
 * 视觉沿用 V1 风格（小米 .xm-plain-box 框架）：
 *   - 容器最大宽度 1200px，页面底色 #f5f5f5
 *   - 强调色统一 #ff6700
 *   - 产品网格固定 5 列，列/行间距约 14px
 *   - 首位为深色封面卡，其余为白底产品卡
 * 本文件被插件通过 wp_enqueue_scripts 引入，前后台视觉保持一致。
 * ========================================================================= */

/* ---------- 页面容器 ---------- */
.vm-product-center {
    background: #f5f5f5;
    min-height: 100vh;
    padding: 30px 0;
}

.vm-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ---------- 分类区块 ---------- */
.vm-cat-block {
    margin-bottom: 36px;
}

.vm-cat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.vm-cat-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

/* 「查看全部 ›」小圆箭头，hover 变 #ff6700 */
.vm-view-all {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.vm-view-all .vm-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ddd;
    color: #333;
    font-size: 13px;
    line-height: 1;
    transition: background 0.2s ease, color 0.2s ease;
}

.vm-view-all:hover {
    color: #ff6700;
}

.vm-view-all:hover .vm-arrow {
    background: #ff6700;
    color: #fff;
}

/* ---------- 5 列产品网格 ---------- */
.vm-product-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

/* ---------- 首位封面广告卡（深色） ---------- */
.vm-cover-card {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 220px;
    border-radius: 2px;
    overflow: hidden;
    text-decoration: none;
    background: linear-gradient(135deg, #ff6700 0%, #ff9248 100%);
    color: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.vm-cover-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.vm-cover-card .vm-cover-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vm-cover-tag {
    position: relative;
    z-index: 2;
    display: inline-block;
    margin: 12px;
    padding: 4px 10px;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 2px;
}

/* ---------- 普通产品卡（白底） ---------- */
.vm-product-card {
    display: block;
    background: #fff;
    border-radius: 2px;
    padding: 10px;
    text-decoration: none;
    color: #333;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.vm-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.vm-card-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    margin-bottom: 8px;
    overflow: hidden;
    background: #fafafa;
}

.vm-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 无特色图片时的占位（浅灰锁形色块，避免裂图） */
.vm-card-placeholder {
    width: 60%;
    height: 60%;
    background: #eee;
    border-radius: 4px;
}

.vm-card-title {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 500;
    color: #333;
}

.vm-card-desc {
    margin: 0 0 6px;
    font-size: 12px;
    line-height: 1.4;
    color: #9d9b9b;
    /* 截断为 2 行 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.vm-card-model {
    font-size: 12px;
    color: #ff6700;
}

/* ---------- 商品详情页（single-product.php） ---------- */
.vm-single-card {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    background: #fff;
    border-radius: 2px;
    padding: 24px;
}

.vm-single-gallery {
    flex: 1 1 360px;
    min-width: 280px;
}

.vm-single-gallery img {
    width: 100%;
    border-radius: 2px;
}

.vm-single-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #eee;
    border-radius: 2px;
}

.vm-single-info {
    flex: 1 1 360px;
    min-width: 280px;
}

.vm-single-title {
    margin: 0 0 12px;
    font-size: 24px;
    color: #333;
}

.vm-single-model {
    margin-bottom: 8px;
    font-size: 15px;
    color: #ff6700;
}

.vm-single-spec {
    margin-bottom: 16px;
    font-size: 14px;
    color: #666;
}

.vm-single-content {
    font-size: 14px;
    line-height: 1.7;
    color: #555;
}

/* ---------- 响应式断点 ---------- */
@media (max-width: 1100px) {
    .vm-product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 900px) {
    .vm-product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .vm-product-grid {
        grid-template-columns: 1fr;
    }
}
