/**
 * Gosmooth - Shared Product Card Styles
 * 共用於：產品詳情頁「相關產品」+ 首頁「人氣建材」
 * ⚠ 不要在此文件以外重複定義 .gs-related-product-* 樣式
 */

/* ── Section ── */
.gs-related-products-section {
  background: #ffffff;
  padding: 64px 0 72px;
}

.gs-related-products-inner {
  width: min(1680px, calc(100% - 64px));
  margin: 0 auto;
}

.gs-related-products-title {
  margin: 0 0 42px;
  text-align: center;
  font-family: "Noto Serif TC", "Microsoft JhengHei", "PingFang TC", serif;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.25;
  color: #222222;
  letter-spacing: 0.03em;
}

/* ── Grid ── */
.gs-related-products-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
}

/* ── Card ── */
.gs-related-product-card {
  position: relative;
  background: #ffffff;
  border: 1px solid #eaeaea;
  border-radius: 6px;
  padding: 15px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  text-align: center;
  min-width: 0;
  transition: box-shadow 0.28s ease, transform 0.28s ease, border-color 0.28s ease;
}

.gs-related-product-card:hover {
  transform: translateY(-3px);
  border-color: #e2e2e2;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

/* ── Image Wrap ── */
.gs-related-product-image-wrap {
  position: relative;
  width: 100%;
  max-width: 230px;
  aspect-ratio: 1 / 1;
  margin: 0 auto 14px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
  border-radius: 4px;
  text-decoration: none;
}

.gs-related-product-image-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center center;
  transition: transform 0.42s cubic-bezier(0.25, 1, 0.5, 1);
}

.gs-related-product-card:hover .gs-related-product-image-wrap img {
  transform: scale(1.06);
}

.gs-related-product-image-placeholder {
  color: #9ca3af;
  font-size: 14px;
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif;
}

/* ── Badge ── */
.gs-related-product-badge {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  min-width: 48px;
  height: 34px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eeb21b;
  color: #ffffff;
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

/* ── Title ── */
.gs-related-product-title {
  margin: 8px 0 8px;
  min-height: 44px;
  font-family: "Noto Serif TC", "Microsoft JhengHei", "PingFang TC", serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.gs-related-product-title a {
  color: #333333;
  text-decoration: none !important;
  transition: color 0.2s ease;
}

.gs-related-product-title a:hover {
  color: #eeb21b;
  text-decoration: none !important;
}

/* ── Category ── */
.gs-related-product-category {
  margin: 0 0 14px;
  min-height: 20px;
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #eeb21b;
}

/* ── Button ── */
.gs-related-product-btn {
  display: block;
  width: 100%;
  margin-top: auto;
  padding: 11px 0;
  border-radius: 4px;
  background: linear-gradient(180deg, #fdd24a 0%, #fca428 100%);
  color: #ffffff;
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none !important;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.16);
  box-shadow: 0 2px 5px rgba(252, 164, 40, 0.22);
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.gs-related-product-btn:hover,
.gs-related-product-btn:focus,
.gs-related-product-btn:active {
  background: linear-gradient(180deg, #ffe066 0%, #fdbc3f 100%);
  color: #ffffff;
  text-decoration: none !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(252, 164, 40, 0.34);
}

/* ── RWD ── */
@media (max-width: 1440px) {
  .gs-related-products-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .gs-related-products-section {
    padding: 54px 0 62px;
  }

  .gs-related-products-inner {
    width: min(100% - 40px, 1100px);
  }

  .gs-related-products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (max-width: 768px) {
  .gs-related-products-section {
    padding: 44px 0 54px;
  }

  .gs-related-products-inner {
    width: min(100% - 24px, 720px);
  }

  .gs-related-products-title {
    margin-bottom: 28px;
    font-size: 24px;
  }

  .gs-related-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .gs-related-product-card {
    padding: 10px;
  }

  .gs-related-product-image-wrap {
    max-width: 100%;
    margin-bottom: 10px;
  }

  .gs-related-product-badge {
    min-width: 44px;
    height: 30px;
    padding: 0 10px;
    font-size: 13px;
  }

  .gs-related-product-title {
    min-height: 38px;
    font-size: 14px;
    line-height: 1.35;
  }

  .gs-related-product-category {
    margin-bottom: 10px;
    font-size: 13px;
  }

  .gs-related-product-btn {
    padding: 10px 0;
    font-size: 14px;
  }
}