/* categories.blade.php —— 数据库驱动的产品分类页样式（自包含，不依赖遗留页级 CSS） */

/* 吸顶（#comm_layout_header 固定 + 下推补偿）已统一收口到全站 css/site.css，本页不再重复。 */

.cat-page {
    width: 100%;
    padding: 0 0 48px;
}

/* 正文区（Banner 之外的内容）保持 1200px 栅格 */
.cat-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ── 顶部 Banner ─────*/
.cat-banner {
    width: 100%;
    height: 460px;
    overflow: hidden;
    background: #f2f2f4;
    line-height: 0;
}
.cat-banner-img {
    width: 100%;
    height: 100%;
    overflow: hidden;
    box-sizing: border-box;
}
.cat-banner img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    box-sizing: border-box;
}

@media screen and (min-width: 641px) and (max-width: 1200px) {
    .cat-banner { height: 340px; }
}
@media screen and (max-width: 640px) {
    .cat-banner { height: 140px; }
}

/* ── 标题区（仿 jmdzjs layout_1566441926563：居中文字块） ── */
.cat-head {
    padding: 40px 20px 36px;
    text-align: center;
}
.cat-head-inner {
    display: inline-block;
    max-width: 680px;
}
.cat-kicker {
    font-size: 14px;
    letter-spacing: 2px;
    color: var(--primary, #a32c30);
    margin-bottom: 12px;
    font-weight: 600;
    text-transform: uppercase;
}
.cat-title {
    font-size: 28px;
    color: #333;
    margin: 0 0 8px;
}
.cat-sub {
    font-size: 15px;
    color: #888;
    margin: 0 0 20px;
}
.cat-desc {
    font-size: 15px;
    color: #777;
    margin: 0 0 14px;
    line-height: 1.6;
}
.cat-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
}
.cat-tag {
    display: inline-block;
    padding: 5px 16px;
    border-radius: 20px;
    background: #f2e7e7;
    color: #7e2125;
    font-size: 13px;
    font-weight: 600;
}

/* ── 视频区 ── */
.cat-video {
    margin: 0 0 32px;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
}
.cat-video video {
    width: 100%;
    height: auto;
    display: block;
}

/* ── 区块通用 ── */
.cat-section {
    /*margin-top: 36px;*/
}

/* ── 合并列表（产品 + 子分类） ── */
.cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}
.cat-item {
    background: #fff;
    border: 1px solid #ececef;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
}
.cat-item:hover {
    box-shadow: 0 6px 18px rgba(0,0,0,.08);
    transform: translateY(-2px);
}
.cat-item a {
    display: flex;
    flex-direction: column;
    color: inherit;
    text-decoration: none;
}

/* 产品项：图片 + 名称 */
.cat-item-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    overflow: hidden;
}
.cat-item-img img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}
.cat-item-name {
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.5;
    color: #2c2c31;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /*min-height: 44px;*/
}

/* 子分类项微调：名称稍大、加粗 */
.cat-item-sub .cat-item-name {
    font-size: 15px;
    font-weight: 600;
    text-align: center;
}
.cat-item-sub .cat-item-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    overflow: hidden;
}
.cat-item-sub .cat-item-img img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* 外链卡片（虚拟产品）：按需求「表现如真实产品」，因此不做任何视觉区分，
   完全沿用 .cat-item / .cat-item-img / .cat-item-name 的产品卡片样式。
   这里只补两点：
     1) 未上传图片时给个占位底色，避免卡片塌陷成只有文字；
     2) 保留 .cat-item-link 这个钩子，将来若要加「外链」角标可直接在此扩展。 */
.cat-item-link .cat-item-img {
    background: #fafafa;
}

/* ── 响应式 ── */
@media (max-width: 980px) {
    .cat-list { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
    .cat-list { grid-template-columns: repeat(2, 1fr); }
    .cat-title { font-size: 26px; }
    .cat-head { padding: 28px 16px 24px; }
}
@media (max-width: 420px) {
    .cat-list { grid-template-columns: 1fr; }
}
