/* ============================================================
   产品列表-2 (productList_2) 专属样式
   还原自 static.html .ly_product_list_2 (data-type="product_list" data-mode="mode_2")
   的 4 个公共 <style> 块; 实例级样式(颜色/字号/列数/间距/模块宽度)由模板内联输出。
   引入方: templates/sitebuilder/modules/productList_2.html
   注意: 新增本文件后需同步 SiteStaticPublishServiceImpl.CSS_FILES(发布态拷贝清单是硬编码的)。
   ============================================================ */

.ly_product_list_2 { background-color: #ffffff; }
.ly_product_list_2 a { text-decoration: none; color: inherit; }
.ly_product_list_2 img { max-width: 100%; }

/* ---------- 整体两栏布局 ---------- */
.ly_product_list_2 .prdocuts_wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
}
.ly_product_list_2 .products_category_wrapper { width: 18%; margin-right: 3%; }
.ly_product_list_2 .list_wrapper { flex: 1; width: 79%; position: relative; }
/* 关闭左侧分类时列表占满整行 */
.ly_product_list_2 .list_wrapper.full { width: 100%; }
.ly_product_list_2 .list_wrapper.full .list_box { margin-top: 40px; }

/* ---------- 标题条(分类名称 / 推荐产品标题 / 列表标题) ---------- */
.ly_product_list_2 .top_title {
    height: 56px;
    line-height: 56px;
    border-bottom: 1px solid #e8e8e8;
    font-size: 20px;
    color: #222222;
    text-transform: uppercase;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    overflow: hidden;
    word-break: break-word;
}

/* ---------- 左侧分类树 ---------- */
.ly_product_list_2 .products_category_wrapper .products_category_box { margin-bottom: 20px; }
.ly_product_list_2 .products_category_wrapper .products_category_box .cate_item {
    display: inline-block;
    position: relative;
    line-height: 32px;
    font-size: 14px;
    padding-right: 20px;
    box-sizing: border-box;
}
.ly_product_list_2 .products_category_wrapper .products_category_box .cate_item:hover { text-decoration: none; }
.ly_product_list_2 .products_category_wrapper .products_category_box .cate_item h2,
.ly_product_list_2 .products_category_wrapper .products_category_box .cate_item h3,
.ly_product_list_2 .products_category_wrapper .products_category_box .cate_item h4 {
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}
.ly_product_list_2 .products_category_wrapper .products_category_box .category_box .item_title {
    margin: 5px 0;
    position: relative;
}
/* 展开/收起图标: 收起态 +, 展开态(i.cur) -。两条 1px 细线拼出来, 不依赖 iconfont */
.ly_product_list_2 .products_category_wrapper .products_category_box .category_box i {
    width: 20px;
    height: 20px;
    position: absolute;
    top: 10px;
    right: 0;
    font-size: 14px;
    cursor: pointer;
    font-style: normal;
}
/* 横线常在 */
.ly_product_list_2 .products_category_wrapper .products_category_box .category_box i::before {
    content: '';
    position: absolute;
    top: 9px;
    left: 4px;
    width: 11px;
    height: 1px;
    background: currentColor;
}
/* 竖线只在收起态显示, 展开(i.cur)时隐藏 -> + 变 - */
.ly_product_list_2 .products_category_wrapper .products_category_box .category_box i::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 9px;
    width: 1px;
    height: 11px;
    background: currentColor;
}
.ly_product_list_2 .products_category_wrapper .products_category_box .category_box i.cur::after { display: none; }
.ly_product_list_2 .products_category_wrapper .products_category_box .category_box .next_box {
    padding-left: 25px;
    width: 100%;
    box-sizing: border-box;
}
.ly_product_list_2 .products_category_wrapper .products_category_box .category_box .sub_hide .next_box { display: none; }
/* 当前选中的分类(点击后由 JS 加 cur), 颜色由模板内联的 .cate_item.cur 规则给, 这里只加粗 */
.ly_product_list_2 .products_category_wrapper .products_category_box .category_box .cate_item.cur { font-weight: 600; }
/* 租户还没建产品分类时的占位文案 */
.ly_product_list_2 .products_category_wrapper .products_category_box .category_empty {
    padding: 10px 0;
    font-size: 14px;
    color: #999;
}

/* ---------- 左侧推荐产品 ---------- */
.ly_product_list_2 .products_category_wrapper .relate_box .pro_list { padding: 6px 0; }
.ly_product_list_2 .relate_box .pro_list .related_item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    border-bottom: 1px solid #e0e0e0;
}
.ly_product_list_2 .relate_box .pro_list .related_item .pic_box {
    flex: none;
    margin-right: 12px;
    width: 80px;
    background-color: #fff;
    position: relative;
}
.ly_product_list_2 .relate_box .pro_list .related_item .pic_box a {
    display: block;
    width: 100%;
    height: 0;
    padding-top: 100%;
    position: relative;
}
.ly_product_list_2 .relate_box .pro_list .related_item .pic_box a img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.ly_product_list_2 .relate_box .pro_list .related_item .content { width: 100%; }
.ly_product_list_2 .relate_box .pro_list .related_item .content .g_name {
    line-height: 18px;
    font-size: 14px;
    color: #1a1a1a;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-decoration: none;
}
/* 推荐产品的价格: 比网格卡片小一号, 与 g_name 同列对齐 */
.ly_product_list_2 .relate_box .pro_list .related_item .content .g_number {
    margin-top: 5px;
    line-height: 1.6;
    font-size: 14px;
    font-weight: 600;
    color: #222222;
}
/* 移动端才显示的底部推荐产品 */
.ly_product_list_2 .list_bottom_box { display: none; }

/* ---------- 分类层级路径(如 Cars - Racing Cars), 点分类后由 JS 写入 ---------- */
/* 分类详细描述: 内容是后台富文本(p/h/img 等), 首尾子元素的默认 margin 会撑出多余空白 */
.ly_product_list_2 .cate_path { margin-top: 50px; line-height: 1.8; color: #555; }
.ly_product_list_2 .cate_path > :first-child { margin-top: 0; }
.ly_product_list_2 .cate_path > :last-child { margin-bottom: 0; }
/* 未选分类 / 该分类没写描述(空富文本由 JS 归一成空串)时不占位 */
.ly_product_list_2 .cate_path:empty { display: none; }

/* JS 控制的显隐(空态、下拉加载提示), 用 class 而不是 style 便于覆盖 */
.ly_product_list_2 .pl2_hide { display: none !important; }
/* 只有一页时 JS 会清空翻页容器, 空了就别留 margin */
.ly_product_list_2 .turn_page:empty { display: none; }

/* ---------- 产品网格 ---------- */
.ly_product_list_2 .list_box {
    display: grid;
    gap: 30px;
    margin-top: 80px;
}
.ly_product_list_2 .list_box .themes_prod { margin-bottom: 77px; text-align: center; }
.ly_product_list_2 .list_box .themes_prod .pic_box { margin-bottom: 25px; overflow: hidden; }
.ly_product_list_2 .list_box .themes_prod .pic_box .compute_process_img { position: relative; width: 100%; }
.ly_product_list_2 .list_box .themes_prod .pic_box img {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    max-width: 100%;
    max-height: 100%;
    transition: transform .4s, opacity .4s;
}
.ly_product_list_2 .list_box .themes_prod .name {
    margin-bottom: 5px;
    line-height: 1.8;
    color: #222222;
    font-size: 14px;
    padding: 0 30px;
}
.ly_product_list_2 .list_box .themes_prod .name a {
    text-decoration: none;
    color: inherit;
    word-break: break-word;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}
.ly_product_list_2 .list_box .themes_prod .name h3 { margin: 0; font-size: inherit; font-weight: inherit; }
/* 价格: 左右内边距跟 .name 完全一致(移动端也一起收窄), 否则两行文字不在一条竖线上 */
.ly_product_list_2 .list_box .themes_prod .item_price {
    margin-top: 5px;
    padding: 0 30px;
    line-height: 1.6;
    font-size: 15px;
    font-weight: 600;
    color: #222222;
}

/* 图片指向: 渐变放大 / 切换第二张图 */
.ly_product_list_2 .list_box .themes_prod .pic_box img:nth-of-type(2) { opacity: 0; z-index: -1; }
.ly_product_list_2 .list_box .themes_prod .pic_box.hover_scale_img:hover img {
    transform: scale(1.05);
    -webkit-transform: scale(1.05);
}
.ly_product_list_2 .list_box .themes_prod .pic_box.switch_second_img:hover img:nth-of-type(2) { opacity: 1; z-index: 1; }
.ly_product_list_2 .list_box .themes_prod .pic_box.switch_second_img:hover img:nth-of-type(1) { opacity: 0; z-index: -1; }

/* ---------- 列表标题条 + 移动端分类触发 ---------- */
.ly_product_list_2 .list_wrapper .top_title { position: relative; }
.ly_product_list_2 .list_wrapper .top_title h1 {
    display: inline;
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}
/* 产品数量与标题(h1)同一套样式: 字号/字重/颜色/大小写全继承标题条,
   只保留与标题之间的间距 */
.ly_product_list_2 .list_wrapper .top_title .pro_count {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    text-transform: inherit;
    margin-left: 10px;
}
.ly_product_list_2 .list_wrapper .top_title i { display: none; }


/* ---------- 翻页 ---------- */
.ly_product_list_2 .turn_page { margin-bottom: 100px; text-align: center; }
.ly_product_list_2 .turn_page a,
.ly_product_list_2 .turn_page span {
    display: inline-block;
    min-width: 34px;
    height: 34px;
    line-height: 34px;
    margin: 0 4px;
    padding: 0 6px;
    border: 1px solid #e8e8e8;
    box-sizing: border-box;
    font-size: 14px;
    color: #555;
    text-align: center;
}
.ly_product_list_2 .turn_page span.cur { border-color: #222; color: #222; }
/* 下拉加载只在移动端生效(PC 一律走数字翻页), 故默认隐藏, 到移动端媒体查询里再放出 */
.ly_product_list_2 .dropdown_page { display: none; margin-bottom: 60px; text-align: center; }
.ly_product_list_2 .dropdown_loading { padding: 20px 0; font-size: 14px; color: #888; }

/* ---------- 询盘按钮容器 / 无数据 ---------- */
.ly_product_list_2 .inquiry_button_box { display: flex; justify-content: center; flex-wrap: wrap; }
.ly_product_list_2 .inquiry_button_box .global_inquiry_bat_cart { width: 100%; }
.ly_product_list_2 .search_no_data { padding: 40px 0; color: #333; text-align: center; }
.ly_product_list_2 .search_no_data .text { margin-top: 24px; font-size: 16px; color: #333; }

/* 编辑态描边(hover/选中)与 cursor 统一在 editor.css 的 .deco-module::before 覆盖层里,
   本文件不再重复一套 outline: outline 会被模块内贴边的元素盖住一段。 */

/* 编辑态左上角有模块名 label、右上角有操作条(editor.css, 都是绝对定位浮层),
   本模块默认上间距为 0、左栏 CATEGORIES 标题条紧贴模块顶边, 会被 label 压住。
   编辑态两栏一起下移一个 label 高度(只加在 .deco-edit-mode 下, 发布态与预览尺寸不受影响;
   不用 .deco-selected 限定, 免得选中/取消时内容跳动)。 */
.deco-edit-mode .ly_product_list_2 .prdocuts_wrapper { padding-top: 24px; }

/* ============================================================
   移动端
   ============================================================ */
@media screen and (max-width: 1000px) {
    .ly_product_list_2 .prdocuts_wrapper { flex-wrap: wrap; }

    /* 分类面板改为下拉浮层, 由 top_title 上的箭头触发 */
    .ly_product_list_2 .products_category_wrapper {
        display: none;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        background-color: #fff;
        z-index: 10001;
        width: 92%;
        box-shadow: 5px 5px 5px 0 rgb(0 0 0 / 30%);
    }
    .ly_product_list_2 .products_category_wrapper.show { display: block; }
    .ly_product_list_2 .products_category_wrapper .products_category_box .top_title { display: none; }
    .ly_product_list_2 .products_category_wrapper .products_category_box .category_box {
        padding: 0;
        height: 225px;
        overflow: auto;
    }
    body .ly_product_list_2 .products_category_wrapper .products_category_box .category_box .cate_item {
        display: inline-block;
        padding-right: 25px;
        line-height: 32px;
    }
    .ly_product_list_2 .products_category_wrapper .products_category_box .category_box .cate_item.cur {
        color: #1a1d22;
        background-color: #ffd101;
    }
    .ly_product_list_2 .products_category_wrapper .products_category_box .category_box i { right: 5px; }
    .ly_product_list_2 .products_category_wrapper .products_category_box .category_box .next_box { padding-left: 15px; }
    /* 左侧推荐产品在移动端隐藏, 改由 list_bottom_box 显示 */
    .ly_product_list_2 .products_category_wrapper .relate_box { display: none; }
    .ly_product_list_2 .list_bottom_box { display: block; }

    .ly_product_list_2 .list_wrapper { width: 100%; flex: auto; }
    .ly_product_list_2 .list_wrapper .top_title {
        padding: 0 35px 0 15px;
        height: 43px;
        line-height: 41px;
        border: 1px solid #e8e8e8;
        box-sizing: border-box;
        margin-top: 12px;
    }
    .ly_product_list_2 .list_wrapper .top_title i {
        display: block;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        right: 14px;
        width: 16px;
        height: 16px;
        cursor: pointer;
        font-style: normal;
    }
    .ly_product_list_2 .list_wrapper .top_title i::before,
    .ly_product_list_2 .list_wrapper .top_title i::after {
        content: '';
        position: absolute;
        background-color: currentColor;
    }
    .ly_product_list_2 .list_wrapper .top_title i::before { top: 7px; left: 2px; width: 12px; height: 2px; }
    .ly_product_list_2 .list_wrapper .top_title i::after { top: 2px; left: 7px; width: 2px; height: 12px; }
    .ly_product_list_2 .list_wrapper .top_title i.cur::after { display: none; }

    .ly_product_list_2 .list_box { margin-top: 60px; }
    .ly_product_list_2 .list_box .themes_prod { margin-bottom: 20px; }
    .ly_product_list_2 .list_box .themes_prod .name { padding: 0 5px; }
    .ly_product_list_2 .list_box .themes_prod .item_price { padding: 0 5px; }
    .ly_product_list_2 .turn_page { margin-bottom: 30px; }
    /* 移动端翻页样式选"下拉加载"时隐藏数字翻页, 放出下拉加载提示(还有下一页时 JS 去掉 pl2_hide) */
    .ly_product_list_2 .turn_page.hide_on_mobile { display: none; }
    .ly_product_list_2 .dropdown_page { display: block; }
    .ly_product_list_2 .search_no_data { padding: 20px 0; }
    .ly_product_list_2 .search_no_data .text { margin-top: 18px; font-size: 14px; }
}
