/* ==========================================
   CLAMP KING WEBSITE CSS
   Products Menu + Catalogue Optimization
   Final Version: 2026-10-08
   ========================================== */


/* ==========================================
   PART 1: PRODUCTS 下拉菜单优化
   ========================================== */

@media (min-width: 1200px) {

  #header27512 #parent_2.model5 > .sub {
    box-sizing: border-box;
    width: 880px !important;
    max-width: calc(100vw - 48px);
    height: auto !important;
    min-height: 0 !important;
    padding: 16px !important;
  }

  #header27512 #parent_2.model5 > .sub > .nav02_ulSub {
    width: 46% !important;
    max-height: none !important;
    overflow: visible !important;
  }

  #header27512 #parent_2.model5 .nav02_liSub {
    height: auto !important;
    min-height: 72px;
  }

  #header27512 #parent_2.model5 .nav02_liSub > a {
    box-sizing: border-box;
    height: auto !important;
    min-height: 72px;
    white-space: normal !important;
    text-overflow: clip !important;
    overflow: visible !important;
    line-height: 1.5 !important;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
  }

  #header27512 #parent_2.model5 .sub3 {
    box-sizing: border-box;
    left: 46% !important;
    top: 0 !important;
    width: 54% !important;
    height: 100% !important;
    padding: 16px !important;
    overflow-y: auto;
    overflow-x: hidden;
  }

  #header27512 #parent_2.model5 .nav03_ulSub {
    max-height: none !important;
    overflow: visible !important;
  }

  #header27512 #parent_2.model5 .nav03_liSub {
    height: auto !important;
    min-height: 64px;
    width: 100% !important;
  }

  #header27512 #parent_2.model5 .nav03_liSub > a {
    box-sizing: border-box;
    width: calc(100% - 24px) !important;
    height: auto !important;
    min-height: 64px;
    white-space: normal !important;
    line-height: 1.5 !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }

  #header27512 #parent_2.model5 .nav03_liSub > a span {
    display: block !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    -webkit-line-clamp: unset !important;
    overflow-wrap: break-word;
  }

  #header27512 #parent_2.model5 .nav03_imgBox,
  #header27512 #parent_2.model5 .nav02_productCate {
    display: none !important;
  }
}


/* ==========================================
   PART 2: 产品分类默认布局
   默认每行2个产品
   ========================================== */

@media (min-width: 768px) {

  #component_tCUuQLJtjYvO .sitewidget-bd > ul {
    display: grid !important;
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
    gap: 28px 24px;
    width: 100% !important;
    max-width: 780px !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
  }

  #component_tCUuQLJtjYvO .sitewidget-bd > ul::before,
  #component_tCUuQLJtjYvO .sitewidget-bd > ul::after {
    display: none !important;
  }

  #component_tCUuQLJtjYvO li.prodli {
    width: 100% !important;
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    box-sizing: border-box;
  }

  #component_tCUuQLJtjYvO li.prodli > .inner {
    margin: 0 !important;
  }

  #component_tCUuQLJtjYvO .prodGrouppic {
    height: 360px !important;
    margin: 0 0 12px !important;
  }

  #component_tCUuQLJtjYvO .prodGrouppic > a {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    height: 100% !important;
  }

  #component_tCUuQLJtjYvO .prodGrouppic img {
    display: block;
    width: 360px !important;
    height: 360px !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain;
  }

  #component_tCUuQLJtjYvO .prodGroupName {
    margin: 0 !important;
  }

  #component_tCUuQLJtjYvO .prodGroupName,
  #component_tCUuQLJtjYvO .prodGroupName a {
    font-size: 18px !important;
    line-height: 1.5 !important;
    text-align: center;
    white-space: normal !important;
  }
}


/* ==========================================
   PART 3: 3个产品显示3列
   ========================================== */

@media (min-width: 768px) {

  #component_tCUuQLJtjYvO
  .sitewidget-bd > ul:has(
    > li.prodli:first-child:nth-last-child(3)
  ) {
    grid-template-columns:
      repeat(3, minmax(0, 1fr)) !important;
    max-width: 1180px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}


/* ==========================================
   PART 4: 4大产品分类显示3+1
   第一行3个
   第二行1个（修模设备）
   左对齐 Product Catalogue
   ========================================== */

@media (min-width: 768px) {

  #component_tCUuQLJtjYvO
  .sitewidget-bd > ul:has(
    > li.prodli:first-child:nth-last-child(4)
  ) {
    display: grid !important;
    grid-template-columns:
      repeat(3, minmax(0, 1fr)) !important;
    width: 100% !important;
    max-width: 1180px !important;
    gap: 28px 24px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
  }

  /* 第4个分类放在第二行第一列 */
  #component_tCUuQLJtjYvO
  .sitewidget-bd > ul:has(
    > li.prodli:first-child:nth-last-child(4)
  ) > li.prodli:nth-child(4) {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }
}


/* ==========================================
   PART 5: 5个产品显示3+2
   ========================================== */

@media (min-width: 768px) {

  #component_tCUuQLJtjYvO
  .sitewidget-bd > ul:has(
    > li.prodli:first-child:nth-last-child(5)
  ) {
    grid-template-columns:
      repeat(3, minmax(0, 1fr)) !important;
    max-width: 1180px !important;
    gap: 28px 24px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}


/* ==========================================
   PART 6: 3/4/5个产品统一图片尺寸
   三列布局使用300×300
   ========================================== */

@media (min-width: 768px) {

  #component_tCUuQLJtjYvO:has(
    .sitewidget-bd > ul >
    li.prodli:first-child:nth-last-child(3)
  ) .prodGrouppic,

  #component_tCUuQLJtjYvO:has(
    .sitewidget-bd > ul >
    li.prodli:first-child:nth-last-child(4)
  ) .prodGrouppic,

  #component_tCUuQLJtjYvO:has(
    .sitewidget-bd > ul >
    li.prodli:first-child:nth-last-child(5)
  ) .prodGrouppic {
    height: 300px !important;
  }

  #component_tCUuQLJtjYvO:has(
    .sitewidget-bd > ul >
    li.prodli:first-child:nth-last-child(3)
  ) .prodGrouppic img,

  #component_tCUuQLJtjYvO:has(
    .sitewidget-bd > ul >
    li.prodli:first-child:nth-last-child(4)
  ) .prodGrouppic img,

  #component_tCUuQLJtjYvO:has(
    .sitewidget-bd > ul >
    li.prodli:first-child:nth-last-child(5)
  ) .prodGrouppic img {
    width: 300px !important;
    height: 300px !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain;
  }
}


/* ==========================================
   PART 7: 产品分类页面标题优化

   4大分类总目录：
   保留 Product Catalogue

   其他具体产品分类：
   隐藏 Product Catalogue
   ========================================== */

/* 非4个产品时隐藏H2标题 */
#component_tCUuQLJtjYvO:not(
  :has(
    .sitewidget-bd > ul >
    li.prodli:first-child:nth-last-child(4)
  )
) h2 {
  display: none !important;
}

/* 非4个产品时隐藏标题容器 */
#component_tCUuQLJtjYvO:not(
  :has(
    .sitewidget-bd > ul >
    li.prodli:first-child:nth-last-child(4)
  )
) .sitewidget-hd {
  display: none !important;
}




/* ==========================================
   PART 8: PRODUCTS 菜单宽度智能切换
   修复初次展开时文字挤压问题
   ========================================== */

@media (min-width: 1200px) {

  /* 1. 默认保持完整双栏宽度 */
  #header27512 #parent_2.model5 > .sub {
    width: 880px !important;
  }

  /* 2. 默认左侧分类占46% */
  #header27512 #parent_2.model5 > .sub > .nav02_ulSub {
    width: 46% !important;
  }

  /* 3. 鼠标移到第3、4、5个分类时才收缩 */
  #header27512 #parent_2.model5 > .sub:has(
    .nav02_ulSub > .nav02_liSub:nth-child(n+3):hover
  ) {
    width: 420px !important;
  }

  /* 4. 收缩时左侧分类占满整个菜单 */
  #header27512 #parent_2.model5 > .sub:has(
    .nav02_ulSub > .nav02_liSub:nth-child(n+3):hover
  ) > .nav02_ulSub {
    width: 100% !important;
  }

  /* 5. 收缩时隐藏右侧三级分类 */
  #header27512 #parent_2.model5 > .sub:has(
    .nav02_ulSub > .nav02_liSub:nth-child(n+3):hover
  ) .sub3 {
    display: none !important;
  }

}


/* ==========================================
   END OF CLAMP KING WEBSITE CSS
   ========================================== */