/* =========================================
   Charging Module Solutions
   - 充電模組解決方案分類頁專屬樣式
   - 延續既有 Product Category 視覺系統
   - Featured 主視覺改為較扁的橫幅比例
   - 下方三款模組：桌機三欄／平板兩欄／手機單欄
   ========================================= */

/* =========================================
   Category Header
   ========================================= */

.charging-category-header {
  padding-bottom: 64px;
}

/* =========================================
   Featured Solution｜40kW Mobile Charger
   ========================================= */

.charging-featured {
  padding: 68px 0;
  background: #f4f6f9;
}

.charging-featured-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, 0.88fr);
  gap: 56px;
  align-items: center;
}

.charging-featured-visual {
  overflow: hidden;
  border-radius: 24px;
  background: #18223d;
  box-shadow: 0 26px 60px rgba(24, 34, 61, 0.14);
}

.charging-featured-visual img {
  display: block;
  width: 100%;
  /* 原本接近 1600×900，改為約 1600×640 的橫幅比例 */
  aspect-ratio: 5 / 2;
  object-fit: cover;
}

.charging-featured-content h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.08;
}

.charging-featured-content > p:not(.eyebrow) {
  color: var(--color-text-muted);
  line-height: 1.85;
}

.charging-featured-lead {
  margin: 24px 0 12px;
  color: var(--color-text) !important;
  font-size: clamp(1.08rem, 1.7vw, 1.35rem);
  font-weight: 700;
  line-height: 1.65 !important;
}

.charging-featured-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 22px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.charging-featured-points li {
  position: relative;
  padding: 12px 0 12px 18px;
  border-top: 1px solid var(--color-border);
  font-size: 0.94rem;
  font-weight: 700;
}

.charging-featured-points li::before {
  position: absolute;
  top: 20px;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
  content: "";
}

/* =========================================
   Charging Module Specs
   ========================================= */

.charging-modules {
  padding: 84px 0 96px;
  background: var(--color-white);
}

.charging-modules-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 48px;
  align-items: end;
  margin-bottom: 44px;
}

.charging-modules-heading h2 {
  margin: 0;
  font-size: clamp(1.9rem, 3vw, 2.8rem);
}

.charging-modules-heading > p {
  margin: 0;
  color: var(--color-text-muted);
  line-height: 1.85;
}

/* 桌機版：三款產品由左至右排列 */
.charging-module-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  align-items: stretch;
}

.charging-module-card {
  display: flex;
  overflow: hidden;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: 22px;
  background: var(--color-white);
}

/* 產品照片區
   目前先保留圖片位置，之後放入三張實際產品照即可。 */
.charging-module-media {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-bottom: 1px solid var(--color-border);
  background: #f3f5f8;
}

.charging-module-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.charging-module-media-placeholder {
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(36, 59, 120, 0.035), rgba(36, 59, 120, 0.08)),
    #f5f7fa;
}

.charging-module-media-placeholder span {
  color: rgba(36, 59, 120, 0.34);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.charging-module-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  min-height: 156px;
  padding: 24px 24px 22px;
  border-bottom: 1px solid var(--color-border);
}

.charging-module-header > div {
  min-width: 0;
}

.charging-module-header h3 {
  margin: 8px 0 0;
  font-size: clamp(1.08rem, 1.55vw, 1.35rem);
  line-height: 1.45;
}

.charging-module-header .category-product-type {
  overflow-wrap: anywhere;
}

.charging-module-number {
  flex: 0 0 auto;
  color: rgba(36, 59, 120, 0.2);
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1;
}

.charging-spec-heading {
  padding: 18px 24px 0;
  color: var(--color-primary);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* 三欄卡片內的規格改為單欄，避免每個欄位過窄 */
.charging-spec-grid {
  display: grid;
  grid-template-columns: 1fr;
  margin: 0;
  padding: 10px 24px 26px;
}

.charging-spec-item {
  display: grid;
  grid-template-columns: minmax(88px, 0.42fr) minmax(0, 0.58fr);
  gap: 12px;
  min-width: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}

.charging-spec-item:last-child {
  border-bottom: 0;
}

.charging-spec-item dt {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.charging-spec-item dd {
  margin: 0;
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* =========================================
   Responsive
   ========================================= */

@media (max-width: 1080px) {
  .charging-module-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .charging-featured-grid,
  .charging-modules-heading {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .charging-featured-visual img {
    aspect-ratio: 16 / 7;
  }
}

@media (max-width: 700px) {
  .charging-module-list {
    grid-template-columns: 1fr;
  }

  .charging-module-header {
    min-height: auto;
  }
}

@media (max-width: 640px) {
  .charging-featured,
  .charging-modules {
    padding: 56px 0;
  }

  .charging-featured-grid {
    gap: 32px;
  }

  .charging-featured-visual {
    border-radius: 18px;
  }

  .charging-featured-visual img {
    aspect-ratio: 16 / 8;
  }

  .charging-featured-points {
    grid-template-columns: 1fr;
  }

  .charging-module-header {
    padding: 22px 20px 20px;
  }

  .charging-spec-heading {
    padding: 16px 20px 0;
  }

  .charging-spec-grid {
    padding: 8px 20px 22px;
  }

  .charging-spec-item {
    grid-template-columns: minmax(82px, 0.38fr) minmax(0, 0.62fr);
  }

  .charging-module-number {
    font-size: 2rem;
  }
}

/* =========================================================
   Charging Module — Product Overview
   - Keep product copy concise so Spec remains the visual focus.
   ========================================================= */
.charging-module-overview {
  margin: 0 0 24px;
}

.charging-module-overview-label {
  margin: 0 0 8px;
  color: var(--color-text, #111827);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.charging-module-overview > p:last-child {
  margin: 0;
  color: var(--color-text-muted, #667085);
  font-size: 0.9rem;
  line-height: 1.75;
}

/* =========================================================
   Charging Module Product Layout — Vertical Product Rows
   - Desktop: each product is one horizontal row.
   - Image on the left, overview + specifications on the right.
   - Tablet/mobile: image moves above content.
   ========================================================= */

.charging-module-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

.charging-module-card {
  display: grid;
  grid-template-columns: minmax(300px, 40%) minmax(0, 60%);
  overflow: hidden;
  min-width: 0;
}

/* 左側產品圖片 */
.charging-module-media {
  grid-column: 1;
  grid-row: 1 / span 4;
  min-height: 100%;
  border-right: 1px solid var(--color-border);
  border-bottom: 0;
}

.charging-module-media img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: contain;
}

.charging-module-media-placeholder {
  min-height: 420px;
}

/* 右側產品內容 */
.charging-module-header,
.charging-module-overview,
.charging-spec-heading,
.charging-spec-grid {
  grid-column: 2;
}

.charging-module-header {
  padding: 30px 36px 24px;
}

/* 商品介紹增加左右內距，避免文字貼邊 */
.charging-module-overview {
  margin: 0;
  padding: 24px 36px 8px;
}

.charging-module-overview > p:last-child {
  max-width: 760px;
  margin-bottom: 0;
  line-height: 1.8;
}

.charging-spec-heading {
  padding: 22px 36px 0;
}

/* 桌機規格雙欄，降低單張產品卡高度 */
.charging-spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 30px;
  margin: 0;
  padding: 10px 36px 30px;
}

.charging-spec-item {
  min-width: 0;
}

/* 平板：改成上圖下文 */
@media (max-width: 960px) {
  .charging-module-card {
    grid-template-columns: 1fr;
  }

  .charging-module-media {
    grid-column: 1;
    grid-row: auto;
    min-height: auto;
    aspect-ratio: 16 / 7;
    border-right: 0;
    border-bottom: 1px solid var(--color-border);
  }

  .charging-module-media img,
  .charging-module-media-placeholder {
    min-height: 0;
  }

  .charging-module-header,
  .charging-module-overview,
  .charging-spec-heading,
  .charging-spec-grid {
    grid-column: 1;
  }
}

/* 窄平板：規格恢復單欄 */
@media (max-width: 700px) {
  .charging-spec-grid {
    grid-template-columns: 1fr;
  }
}

/* 手機版間距 */
@media (max-width: 640px) {
  .charging-module-list {
    gap: 22px;
  }

  .charging-module-media {
    aspect-ratio: 4 / 3;
  }

  .charging-module-header {
    padding: 22px 20px 20px;
  }

  .charging-module-overview {
    padding: 20px 20px 4px;
  }

  .charging-spec-heading {
    padding: 18px 20px 0;
  }

  .charging-spec-grid {
    padding: 8px 20px 22px;
  }
}

/* =========================================================
   Featured 40kW Mobile Charger — 40 / 60 Layout
   - Desktop: image 40%, content 60%.
   - Tablet and mobile: stack vertically for readability.
   ========================================================= */

.charging-featured-grid {
  grid-template-columns: minmax(0, 40%) minmax(0, 60%);
}

@media (max-width: 960px) {
  .charging-featured-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   Charging Category Header Summary + Featured Image Ratio
   - Replaces the plain paragraph + solid CTA with a lighter
     editorial summary treatment.
   - Featured 40kW image uses the same 4:3 ratio as product media.
   ========================================================= */

/* 右側改為「小標 / 核心句 / 簡述 / 文字 CTA」的資訊層級 */
.charging-category-summary {
  position: relative;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px 0 4px 28px;
  border-left: 2px solid rgba(46, 67, 144, 0.16);
}

.charging-category-summary-label {
  margin: 0 0 10px;
  color: var(--color-primary);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.charging-category-summary-title {
  margin: 0 0 12px;
  color: var(--color-text);
  font-size: clamp(1.18rem, 1.8vw, 1.5rem);
  font-weight: 800;
  line-height: 1.45;
}

.charging-category-summary-text {
  max-width: 580px;
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.98rem;
  line-height: 1.8;
}

.charging-category-summary-link {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  width: fit-content;
  margin-top: 20px;
  color: var(--color-primary);
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
}

.charging-category-summary-link span {
  transition: transform 0.2s ease;
}

.charging-category-summary-link:hover span {
  transform: translateX(4px);
}

/* 40kW 主打商品：
   保留左圖 40% / 右文 60%，圖片比例改成與下方商品圖一致的 4:3。 */
.charging-featured-visual {
  align-self: start;
  background: #f3f5f8;
  box-shadow: 0 18px 42px rgba(24, 34, 61, 0.10);
}

.charging-featured-visual img {
  aspect-ratio: 4 / 3;
  object-fit: contain;
}

/* 平板以下改回一般堆疊，右側摘要取消左邊線與額外縮排。 */
@media (max-width: 960px) {
  .charging-category-summary {
    padding: 4px 0 0;
    border-left: 0;
  }

  .charging-featured-visual {
    width: 100%;
    max-width: 620px;
  }

  .charging-featured-visual img {
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 640px) {
  .charging-category-summary-title {
    font-size: 1.15rem;
  }

  .charging-category-summary-text {
    font-size: 0.94rem;
  }
}

/* =========================================================
   Featured 40kW Visual Frame — Unified 4:3 Ratio
   - The outer frame itself is now 4:3, not only the image.
   - Removes the awkward extra vertical space around the image.
   - Keeps the visual language consistent with the product media below.
   ========================================================= */

.charging-featured-visual {
  aspect-ratio: 4 / 3;
  align-self: start;
  overflow: hidden;
  min-height: 0;
}

.charging-featured-visual img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
  object-fit: contain;
}

/* Tablet / mobile: keep the same 4:3 frame when stacked. */
@media (max-width: 960px) {
  .charging-featured-visual {
    aspect-ratio: 4 / 3;
  }

  .charging-featured-visual img {
    aspect-ratio: auto;
  }
}

