/* ============================================
   紙盒盒型 box-styles.css（瑋崧企業社）
   由 Locofy 電腦版匯出「轉寫」而非重新設計：
   色彩／間距／圓角／字級／行高皆沿用 Locofy 原值，
   僅將絕對定位版面重構為正常流 + RWD（clamp() 慣例）。
   桌機（≥1280px）忠實重現 Locofy 量測值。
   BEM 前綴：.bxs-
   ============================================ */

/* ===================================================
   2. 盒型總覽 Showcase（bxs-showcase）
   每個盒型為獨立 section，上下 padding 取代原本盒型間距。
   =================================================== */
.bxs-showcase {
  padding: 48px 0 138px;
}
/* 單一盒型區塊：大數字浮水印 + 標頭 + 三欄 + 裝飾圖 */
.bxs-type {
  position: relative;
  overflow: hidden; /* 裁切超出 section 的角落裝飾 */
}
/* 頁尾 CTA：縮減上方 padding（緊接最後盒型） */
.bxs-showcase--cta {
  padding-top: 0;
}

/* ---- 盒型裝飾圖 bxs-decor（絕對定位，不擋內容互動） ---- */
.bxs-decor {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  background-repeat: no-repeat;
}
/* 淡滿版背景：鋪整個 section、低透明度、置中 cover */
.bxs-decor--bg-soft {
  inset: 0;
  background-position: center;
  background-size: cover;
}
/* 右下角去背圖塊（原比例貼右下） */
.bxs-decor--corner-br {
  right: 0;
  bottom: 0;
  width: 1240px;
  height: 789px;
  background-position: right bottom;
  background-size: contain;
}
/* 跨 4／5 區塊裝飾：放在第 5 區塊、左上角，用負 top 讓上半溢出進第 4 區，
   下半覆蓋第 5 區左上角。需配合所在 section overflow: visible（見下方 :has 規則）。 */
.bxs-decor--cross-tl {
  left: 0;
  top: clamp(-131px, -14vw, -120px);
  width: clamp(240px, 28vw, 338px);
  height: clamp(220px, 26vw, 420px);
  background-position: left top;
  background-size: contain;
  opacity: 0.95;
}
/* 含跨區裝飾的盒型 section（區塊 5）需放開 overflow，裝飾才能往上溢出；
   並加大下方留白容納右下角瓦楞箱背景。 */
.bxs-type:has(.bxs-decor--cross-tl) {
  overflow: visible;
  padding-bottom: 330px;
}
/* 巨型背景數字 1–5：放在三欄區左側、垂直置中於 .bxs-cols。
   漸層 #ffe9ce→#ab7a44、透明度 0.3。
   置中用負 margin 而非 transform（transform 會破壞 background-clip:text 渲染）。 */
.bxs-type__num {
  position: absolute;
  top: 50%;
  left: -204px;
  margin-top: -0.5em;
  z-index: -1;
  width: auto;
  font-family: "Inter", var(--font-sans);
  font-size: clamp(280px, 42vw, 600px);
  line-height: 1;
  font-weight: 900;
  background: linear-gradient(180.23deg, #ffe9ce, #ab7a44);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  opacity: 0.3;
  pointer-events: none;
  user-select: none;
}

/* 盒型標頭：膠囊標籤（疊在米色前言上）+ 米色前言 bar */
.bxs-type__head {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 800px;
  margin: 0 auto clamp(32px, 4vw, 48px);
}
/* 盒型標籤膠囊（原稿 Union 票根造型 SVG，236×51） */
/* H2 票根標籤已統一至共用 .page-tab（5-components.css）；背景 SVG 由 PHP inline style 指定。 */
/* 米色前言 bar 已統一至共用 .page-sec-lead（5-components.css） */

/* 三欄資訊卡 */
.bxs-cols {
  position: relative;
  z-index: 1;
  list-style: none;
  margin: 0 auto;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 46px;
  max-width: 1238px;
}
/* 白底 + 牛皮邊框方框 #cfb18d，置中內容 */
.bxs-col {
  position: relative;
  min-height: 346px;
  background-color: #fff;
  border: 2px solid #cfb18d;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 32px 24px;
}
/* 欄內裝飾圖：黏在欄容器右下角（原比例 contain） */
.bxs-col__decor {
  position: absolute;
  right: -261px;
  bottom: -120px;
  z-index: 0;
  width: 393px;
  height: 299px;
  background: right bottom / contain no-repeat;
  pointer-events: none;
}
.bxs-col__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 307px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
/* 欄標題：橘色 20px */
.bxs-col__title {
  margin: 0;
  align-self: stretch;
  font-size: 20px;
  font-weight: 500;
  color: #ee6e00;
  text-align: center;
}
/* 欄內文：黑 16px 行高 20 */
.bxs-col__text {
  margin: 0;
  align-self: stretch;
  font-size: 16px;
  line-height: 20px;
  color: #000;
}

/* 規格對照列：膠囊標籤｜值 */
.bxs-specs {
  margin: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.bxs-spec {
  display: flex;
  align-items: center;
  gap: 12px;
}
/* 膠囊標籤：預設灰底 #d9d9d9（卡1 用） */
.bxs-spec__key {
  margin: 0;
  flex-shrink: 0;
  min-height: 28px;
  width: 90px;
  border-radius: 28px;
  background-color: #d9d9d9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  box-sizing: border-box;
  font-size: 16px;
  color: #000;
  text-align: center;
}
.bxs-spec__val {
  margin: 0;
  font-size: 16px;
  line-height: 20px;
  color: #000;
  text-align: left;
}

/* 米色強調區塊（原稿 .box-card-group21/69/92：#f4eddd 內含規格） */
.bxs-emph {
  align-self: stretch;
  background-color: #f4eddd;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 18px;
  box-sizing: border-box;
}
/* 米色區內膠囊：棕底 #ab7a44（窄 90 / 寬 137） */
.bxs-emph .bxs-spec__key {
  min-height: 20px;
  background-color: #ab7a44;
  color: #fff;
  white-space: nowrap;
}
.bxs-spec__key--wide {
  width: 137px;
}
/* 米色區結語：預設橘字無底，位於 .bxs-emph 淺棕容器內最下方 */
.bxs-emph__note {
  margin: 0;
  font-size: 16px;
  line-height: 20px;
  color: #ee6e00;
  text-align: center;
}
/* 例外：瓦楞盒（第5區）結語改橘底白字 bar，撐滿 emph 寬、貼最下方 */
.bxs-showcase[aria-labelledby="bxs-type-5"] .bxs-emph__note {
  align-self: stretch;
  margin-top: 6px;
  background-color: #ee6e00;
  padding: 8px 13px;
  color: #fff;
}

/* 項目符號清單（漸層小圓點 bullet） */
.bxs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  width: fit-content;
  display: flex;
  flex-direction: column;
  gap: 13px;
  text-align: left;
}
.bxs-list__item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  line-height: 20px;
  color: #000;
}
.bxs-list__dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(180.23deg, #ffe9ce, #ab7a44);
}
/* 欄結語：#aa560e */
.bxs-col__note {
  margin: 0;
  align-self: center;
  font-size: 16px;
  line-height: 20px;
  color: #aa560e;
}

.bxs-em {
  /* 規格內強調（楞型名稱） */
}
.bxs-mm {
  font-size: 14px;
}
/* 本頁 .page-components 上內距：改數字即可，只影響本頁（未設則沿用共用預設 30px） */
.page-components { margin-top: -215px; }


/* ===================================================
   3. RWD（斷點 1280 / 1024 / 768 / 640）
   =================================================== */
@media (max-width: 1024px) {
  /* 三欄 → 直向堆疊 */
  .bxs-cols {
    grid-template-columns: 1fr;
    gap: 28px;
    max-width: 540px;
  }
  .bxs-type__num {
    font-size: clamp(220px, 30vw, 360px);
  }
  /* 右下角瓦楞箱：桌機 1240×789 太大，縮成隨視口流體（保持比例 ≈1.57） */
  .bxs-decor--corner-br {
    width: clamp(280px, 60vw, 620px);
    height: clamp(178px, 38vw, 394px);
    opacity: 0.8;
  }
  /* 區塊 5 加大的下方留白：堆疊後縮減 */
  .bxs-type:has(.bxs-decor--cross-tl) {
    padding-bottom: clamp(200px, 30vw, 300px);
  }
}

@media (max-width: 640px) {
  /* ============================================
     ≤640 手機版：依 Figma 手機畫布（375 寬）逐區塊重排，像素級對齊
     只新增手機規則、不改桌機。設計稿：figma-export/box-type-page/mobile
     ============================================ */
  .bxs-showcase {
    padding: 48px 0;
  }

  /* 大數字水印：180px、置中、突出在欄組上方（騎在第一張卡頂端） */
  .bxs-cols {
    grid-template-columns: 1fr;
    gap: 28px;
    max-width: 268px;
    margin-top: 126px;
  }
  /* 第1區（飛機盒）欄組上距較小 */
  .bxs-showcase[aria-labelledby="bxs-type-1"] .bxs-cols {
    margin-top: 82px;
  }
  .bxs-type__num {
    top: -15px;
    left: 50%;
    transform: translate(-50%, -55%);
    margin-top: 0;
    font-size: 180px;
    line-height: 165.22px;
    opacity: 0.3;
  }
  /* 第1區（飛機盒）數字 1 位置微調 */
  .bxs-showcase[aria-labelledby="bxs-type-1"] .bxs-type__num {
    top: 14px;
  }

  /* 欄卡：白底牛皮框、置中、內距收斂 */
  .bxs-col {
    overflow: visible;
    min-height: 206px;
    padding: 26px 16px;
    gap: 12px;
  }
  .bxs-col__decor {
    display: none;
  }
  .bxs-col__inner {
    max-width: 236px;
    gap: 12px;
  }
  /* 欄標題 13px 600 橘、置中 */
  .bxs-col__title {
    font-size: 13px;
    font-weight: var(--fw-semibold);
  }
  /* 欄內文 13px / 22px、置中 */
  .bxs-col__text {
    font-size: 13px;
    line-height: 22px;
    text-align: center;
  }

  /* 規格列：膠囊 chip 13px，整組靠左對齊（不置中） */
  .bxs-specs {
    gap: 8px;
    width: fit-content;
  }
  .bxs-spec {
    gap: 12px;
  }
  .bxs-spec__key {
    min-height: 0;
    width: 70px;
    padding: 2px;
    font-size: 13px;
  }
  .bxs-spec__val {
    font-size: 13px;
    line-height: 22px;
    white-space: nowrap;
  }
  .bxs-spec__key--wide {
    width: 111px;
  }

  /* 米色強調區 13px */
  .bxs-emph {
    gap: 10px;
    padding: 16px;
  }
  /* 米色區結語：橘字無底（emph 內），手機僅縮字級 */
  .bxs-emph__note {
    font-size: 13px;
    line-height: 22px;
  }

  /* 圓點清單 13px / 22px，靠左對齊 */
  .bxs-list {
    gap: 13px;
  }
  .bxs-list__item {
    font-size: 13px;
    line-height: 22px;
  }
  .bxs-col__note {
    font-size: 13px;
    line-height: 22px;
  }
  .bxs-mm {
    font-size: 12px;
  }

  /* 手機：瓦楞箱再縮、更淡，僅作角落點綴避免擋內容 */
  .bxs-decor--corner-br {
    display: none;
  }
  .bxs-type:has(.bxs-decor--cross-tl) {
    padding-bottom: clamp(150px, 45vw, 200px);
  }
  /* 手機版隱藏跨區大盒裝飾圖（左下角，精裝盒↔瓦楞盒之間） */
  .bxs-decor--cross-tl {
    display: none;
  }

  /* 天地盒（第2區）第一張卡「結構」右上角加疊紙盒裝飾圖（僅手機）。
     注意：.bxs-cols 第一個 child 是 .bxs-type__num（span），故用 :first-of-type
     才能命中第一個 li.bxs-col。卡片 overflow:hidden，圖貼右上角內緣。 */
  .bxs-showcase[aria-labelledby="bxs-type-2"] .bxs-col:first-of-type {
    position: relative;
  }
  .bxs-showcase[aria-labelledby="bxs-type-2"] .bxs-col:first-of-type::after {
    content: "";
    position: absolute;
    top: -66px;
    right: -24px;
    z-index: 0;
    width: 116px;
    height: 88px;
    background: url("../../images/box-styles/bxs-type-1-deco.webp") right top /
      contain no-repeat;
    pointer-events: none;
  }

  /* 天地盒（2）／精裝盒（4）／瓦楞紙盒（5）手機版整區淡底背景圖（鋪滿 section）。
     用 ::before 置於內容之下，不擋互動。 */
  .bxs-showcase[aria-labelledby="bxs-type-2"]::before,
  .bxs-showcase[aria-labelledby="bxs-type-4"]::before,
  .bxs-showcase[aria-labelledby="bxs-type-5"]::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    pointer-events: none;
  }
  .bxs-showcase[aria-labelledby="bxs-type-2"]::before {
    background-image: url("../../images/box-type-page/box-type__image-461-5652.webp");
  }
  .bxs-showcase[aria-labelledby="bxs-type-4"]::before {
    background-image: url("../../images/box-type-page/box-type__image-461-5651.webp");
  }
  .bxs-showcase[aria-labelledby="bxs-type-5"]::before {
    background-image: url("../../images/box-type-page/hero__image-461-5649.webp");
    background-position: bottom;
    background-size: contain;
    bottom: -85px;
  }

  /* 精裝盒（第4區）第3張卡「紙盒客製方式」右下角疊盒裝飾圖（突出框外右下） */
  .bxs-showcase[aria-labelledby="bxs-type-4"] .bxs-col:nth-of-type(3) {
    position: relative;
    overflow: visible; /* 讓裝飾圖突出卡框 */
  }
  .bxs-showcase[aria-labelledby="bxs-type-4"] .bxs-col:nth-of-type(3)::after {
    content: "";
    position: absolute;
    right: -59px;
    bottom: -45px;
    z-index: 1;
    width: 166px;
    height: 95px;
    background: url("../../images/box-type-page/box-card__photo-461-5939.webp")
      right bottom / contain no-repeat;
    pointer-events: none;
  }

  .page-components { margin-top: -145px; }
}

