/* =====================================================================
   商品內頁（Figma v2：2_Products Template）
   沿用 main.css 的 token：字型 Plus Jakarta Sans、文字 #181a1b、
   次文字 #4c5152／#656b6e、邊線 #ebecec、容器 1152px、按鈕 .button 系列。
   ===================================================================== */

/* Figma Product Details → Container：頂欄 80 + 上留白 48、下留白 120，區塊（主圖／圖庫／其他工法）間距 120 */
.product-detail {
  padding: 128px 24px 120px;
  background: #ffffff;
  color: #181a1b;
}
@media (max-width: 767px) {
  .product-detail {
    padding: 104px 20px 64px;
  }
}

.product-detail__container {
  max-width: 1152px;
  margin: 0 auto;
}

/* ── 麵包屑 ─────────────────────────────────────────────── */
.product-detail__breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: #656b6e;
  margin-bottom: 24px;
}
.product-detail__breadcrumb a {
  color: inherit;
  transition: color 0.2s ease;
}
.product-detail__breadcrumb a:hover {
  color: #181a1b;
}
.product-detail__breadcrumb a[aria-current="page"] {
  color: #181a1b;
  font-weight: 500;
}
.product-detail__breadcrumb-sep {
  color: #b5b9ba;
}
@media (max-width: 767px) {
  .product-detail__breadcrumb {
    margin-bottom: 20px;
  }
}

/* ── 主圖 + 商品資訊（Figma：主圖 600、間距 64、資訊欄 488） ────── */
.product-hero {
  display: grid;
  grid-template-columns: minmax(0, 600fr) minmax(0, 488fr);
  gap: 64px;
  align-items: start;
}
@media (max-width: 1023px) {
  .product-hero {
    gap: 32px;
  }
}
@media (max-width: 767px) {
  .product-hero {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

.product-hero__cover {
  display: block;
  width: 100%;
  aspect-ratio: 1200 / 1040;   /* 後台建議尺寸 1200x1040 */
  border-radius: 20px;
  overflow: hidden;
  background: #ebebeb;         /* 設計稿主圖為淺灰底圓角卡 */
  cursor: zoom-in;
}
.product-hero__cover img {
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.product-hero__cover:hover img {
  transform: scale(1.03);
}
.product-hero__cover--empty {
  cursor: default;
  background: linear-gradient(135deg, #f6f8fa 0%, #ebecec 100%);
}

/* 資訊欄（Figma Info：標題＋說明 → 規格表 → 按鈕，間距 32） */
.product-hero__info {
  padding-top: 0;
}

/* 標題：Figma Headline/Small 500（32/40） */
.product-hero__title {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 32px;
  font-weight: 500;
  line-height: 40px;
  letter-spacing: -0.3px;
  color: #181a1b;
  margin-bottom: 16px;
}
@media (max-width: 767px) {
  .product-hero__title {
    font-size: 28px;
    line-height: 1.25;
  }
}

.product-hero__desc {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: #4c5152;
  margin-bottom: 32px;
  white-space: pre-line;
}

/* 規格表（Figma Items：每列 52 高、只有底線，標籤靠左、數值靠右粗體） */
.product-spec {
  margin: 0 0 32px;
}
.product-spec__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid #ebecec;
}
.product-spec__label {
  flex: 0 0 auto;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: #656b6e;
}
.product-spec__value {
  flex: 1 1 auto;
  min-width: 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  text-align: right;
  color: #181a1b;
  margin: 0;
}
@media (max-width: 767px) {
  .product-spec__row {
    gap: 12px;
    padding: 12px 0;
  }
}

/* 兩顆按鈕平分資訊欄寬度（Figma Buttons：488 內各 236，間距 16） */
.product-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.product-hero__actions .button {
  flex: 1 1 0;
  min-width: 0;
  padding-left: 16px;
  padding-right: 16px;
  white-space: nowrap;
}
/* Figma Product Details mobile：兩顆按鈕改為上下堆疊、滿版，Get a Quote 在上 */
@media (max-width: 767px) {
  .product-hero__actions {
    flex-direction: column-reverse;
    gap: 12px;
  }
  .product-hero__actions .button {
    flex: 1 1 auto;
    width: 100%;
  }
}

/* ── 圖庫：左大圖（900x1110）＋右兩張（828x555）無間距拼接成一個圓角區塊（Figma Gallery 600＋552） ── */
.product-gallery {
  display: grid;
  grid-template-columns: minmax(0, 600fr) minmax(0, 552fr);
  grid-template-rows: auto auto;
  gap: 0;
  margin-top: 120px;
  border-radius: 20px;
  overflow: hidden;
  background: #f6f8fa;
}
.product-gallery__item {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #f6f8fa;
  cursor: zoom-in;
}
.product-gallery__item img {
  display: block;
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.product-gallery__item:hover img {
  transform: scale(1.03);
}
/* 左大圖佔兩列、高度由右側兩張決定（552×(555/828)×2 = 740，與 600×(1110/900) 相同） */
.product-gallery__item--main {
  grid-column: 1;
  grid-row: 1 / span 2;
}
.product-gallery__item--side {
  grid-column: 2;
  aspect-ratio: 828 / 555;
}
/* 只有 1 或 2 張時的退化版面 */
.product-gallery--count-1 {
  grid-template-columns: 1fr;
  grid-template-rows: auto;
}
.product-gallery--count-1 .product-gallery__item--main {
  grid-row: auto;
  aspect-ratio: 1152 / 740;
}
.product-gallery--count-2 {
  grid-template-rows: auto;
  align-items: stretch;
}
.product-gallery--count-2 .product-gallery__item--main {
  grid-row: auto;
  aspect-ratio: 900 / 1110;
}
.product-gallery--count-2 .product-gallery__item--side {
  aspect-ratio: auto;
  min-height: 0;
}
@media (max-width: 767px) {
  .product-gallery,
  .product-gallery--count-2 {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    margin-top: 48px;
    border-radius: 16px;
  }
  .product-gallery__item--main,
  .product-gallery__item--side,
  .product-gallery--count-2 .product-gallery__item--side {
    grid-column: 1;
    grid-row: auto;
  }
  .product-gallery__item--main,
  .product-gallery--count-1 .product-gallery__item--main {
    aspect-ratio: 4 / 5;
  }
  .product-gallery__item--side,
  .product-gallery--count-2 .product-gallery__item--side {
    aspect-ratio: 3 / 2;
  }
}

/* ── Crafted in Different Ways ──────────────────────────── */
.product-crafted {
  margin-top: 120px;
}
@media (max-width: 767px) {
  .product-crafted {
    margin-top: 72px;
  }
}

/* 區塊標題與主圖標題同為 Headline/Small 500（32/40），標題與卡片間距 32 */
.product-crafted__title {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 32px;
  font-weight: 500;
  line-height: 40px;
  letter-spacing: -0.3px;
  color: #181a1b;
  margin-bottom: 32px;
}
@media (max-width: 767px) {
  .product-crafted__title {
    font-size: 24px;
    line-height: 1.25;
    margin-bottom: 24px;
    text-align: center;      /* Figma mobile：標題置中 */
  }
}

.product-crafted__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 40px 24px;
}
@media (max-width: 1023px) {
  .product-crafted__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* Figma Product Details mobile：卡片改為橫向滑動列（卡寬 226、間距 16、右側露出下一張） */
@media (max-width: 767px) {
  .product-crafted__grid {
    display: flex;
    gap: 16px;
    margin: 0 -20px;
    padding: 0 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .product-crafted__grid::-webkit-scrollbar {
    display: none;
  }
  .product-crafted__card {
    flex: 0 0 226px;
    scroll-snap-align: start;
  }
}

.product-crafted__card {
  display: flex;
  flex-direction: column;
}

.product-crafted__media {
  display: block;
  aspect-ratio: 1 / 1;           /* 示意圖 560x560 */
  border-radius: 16px;
  overflow: hidden;
  background: #f6f8fa;
  margin-bottom: 16px;
}
.product-crafted__media img {
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.product-crafted__card:hover .product-crafted__media img {
  transform: scale(1.05);
}

.product-crafted__name {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #181a1b;
  margin-bottom: 8px;
}

.product-crafted__desc {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  color: #4c5152;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-crafted__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #181a1b;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: #b5b9ba;
  transition: text-decoration-color 0.2s ease;
}
.product-crafted__link svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}
.product-crafted__link:hover {
  text-decoration-color: #181a1b;
}
.product-crafted__link:hover svg {
  transform: translateX(3px);
}
