/* HL3C 分類卡片 V5：強化分類感、減少文字感、隱藏項目數量 */

/* 隱藏所有「幾項設備」數量 */
.brand-v4-catalog-card small,
.brand-v4-photo-card small,
.home-v3-category-card small,
.home-v3-need-grid small {
  display: none !important;
}

/* 分類區背景與整體節奏 */
.brand-v4-catalog {
  background:
    radial-gradient(circle at 8% 8%, rgba(232,66,44,.06), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.brand-v4-catalog .brand-v4-section-head {
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 22px;
}

/* 分類卡片改成「圖像入口」而不是文字卡片 */
.brand-v4-catalog-grid-photo {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

.brand-v4-catalog-grid-photo .brand-v4-photo-card,
.brand-v4-catalog-card {
  position: relative;
  min-height: 250px;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(226,232,240,.95);
  background: #fff;
  box-shadow: 0 14px 42px rgba(15, 23, 42, .07);
}

/* 有照片的卡片：照片變主角 */
.brand-v4-cat-photo {
  height: 210px !important;
}

.brand-v4-cat-photo img {
  object-fit: cover;
  filter: saturate(1.05) contrast(1.02);
}

.brand-v4-cat-photo::after {
  background:
    linear-gradient(180deg, rgba(8,17,31,0) 28%, rgba(8,17,31,.74) 100%) !important;
}

/* 圖片上的分類縮寫 */
.brand-v4-cat-photo span {
  left: 20px !important;
  bottom: 18px !important;
  width: 58px !important;
  height: 58px !important;
  border-radius: 18px !important;
  background: linear-gradient(135deg, #e8422c, #b42318) !important;
  color: #fff !important;
  box-shadow: 0 18px 42px rgba(180, 35, 24, .32) !important;
}

/* 文字區縮短，凸顯分類入口 */
.brand-v4-photo-card > div:last-child {
  padding: 22px 24px 26px !important;
}

.brand-v4-catalog-card h3 {
  font-size: 25px !important;
  line-height: 1.28 !important;
  margin-bottom: 10px !important;
  letter-spacing: .01em;
}

.brand-v4-catalog-card p {
  font-size: 16px !important;
  line-height: 1.7 !important;
  color: #64748b !important;
  margin-bottom: 0 !important;

  /* 最多顯示 2 行，避免像一大堆文字 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 沒照片的卡片也改成分類入口感 */
.brand-v4-catalog-card:not(.brand-v4-photo-card) {
  display: grid !important;
  grid-template-columns: 72px 1fr;
  align-items: center;
  min-height: 210px;
  padding: 26px !important;
}

.brand-v4-catalog-card:not(.brand-v4-photo-card)::before {
  content: "設備分類";
  position: absolute;
  right: 22px;
  top: 20px;
  font-size: 13px;
  font-weight: 900;
  color: #e8422c;
  background: #fff1f2;
  padding: 6px 10px;
  border-radius: 999px;
}

.brand-v4-catalog-icon {
  width: 64px !important;
  height: 64px !important;
  border-radius: 20px !important;
  background: linear-gradient(135deg, #fff1f2, #fee2e2) !important;
  color: #d9482f !important;
  font-size: 18px;
}

/* 滑過效果更像入口按鈕 */
.brand-v4-catalog-card:hover {
  transform: translateY(-7px) !important;
  border-color: #fecaca !important;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .12) !important;
}

.brand-v4-catalog-card:hover h3 {
  color: #d9482f;
}

/* 加上右下角箭頭，強化可點擊感 */
.brand-v4-catalog-card::after {
  content: "→";
  position: absolute;
  right: 24px;
  bottom: 20px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b1220;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  opacity: 0;
  transform: translateX(-6px);
  transition: .22s ease;
}

.brand-v4-catalog-card:hover::after {
  opacity: 1;
  transform: translateX(0);
}

/* 沒照片卡片的文字避免撞箭頭 */
.brand-v4-catalog-card:not(.brand-v4-photo-card) p {
  padding-right: 38px;
}

/* 有照片卡片在手機仍好讀 */
@media (max-width: 1120px) {
  .brand-v4-catalog-grid-photo {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .brand-v4-catalog-grid-photo {
    grid-template-columns: 1fr;
  }

  .brand-v4-cat-photo {
    height: 190px !important;
  }

  .brand-v4-catalog-card h3 {
    font-size: 23px !important;
  }
}
