.wrapper {
  width: 100%;
  background: url(../../images/bg_01.jpg?20260306) top center no-repeat #0e1730;
  background-size: auto;
}
@media (max-width: 1240px) {
  .wrapper {
    background: url(../../images/bg_02.jpg?20260306) top center no-repeat #0e1730;
    background-size: contain;
  }
}
@media (max-width: 767px) {
  .wrapper {
    background: #0e1730;
  }

}
.main {
  max-width: 1240px;
  margin: 0 auto;
}

.kv {
  position: relative;
  width: 100%; /* 寬度撐滿 */
  max-width: 1240px; /* 根據你的設計設定最大寬度 */
  height: auto; /* 讓高度隨比例縮放 */
  aspect-ratio: 1240 / 770; /* 重要：保持原圖比例，避免容器塌陷 */
  margin: 0 auto;
  pointer-events: auto;
}
.kv > div {
  position: absolute;
}
.kv img {
  width: 100%;
  height: auto;
  display: block;
}
.kv_w1 {
  top: 0;
  left: 0;
  width: 100%;
}
#pdsection {
  /* 利用上方外距把標題區塊往下推，避開上方浮空的卡片 */
  margin-top: 150px; 
  position: relative; /* 確保層級正常 */
  z-index: 20;
}
/* --- 1. 外層大箱子：改成上下排列 --- */
.cards-wrapper {
  /* position: absolute;  這行依然保持刪除狀態 */
  /* top: ...;           這行依然保持刪除狀態 */
  
  width: 100%;
  display: flex;
  flex-direction: column; 
  align-items: center;    
  gap: 20px;
  
  /* 🟢 新增這個：手動把它往下推，越過主視覺圖 */
  margin-top: 50%;  /* 👈 這裡的數字你可以根據主圖的高度微調，例如改成 50%、60% 或是具體的像素如 600px */
  
  position: relative; /* 加上這行，確保 z-index 能生效 */
  z-index: 10;        /* 確保卡片不會被其他圖層蓋住 */
}

/* --- 2. 第一排容器：負責橫排前三個卡片 --- */
.cards-row {
  display: flex;
  flex-direction: row;    /* 橫向排列 */
  justify-content: center;
  align-items: stretch;
  gap: 2%;                /* 左右間距 */
  width: 100%;            /* 佔滿外層空間 */
}

/* --- 3. 第一排的小卡片寬度 --- */
.kv_w2, 
.kv_w3, 
.kv_w4 {
  width: 25%;
}

/* --- 4. 第二排的長卡片寬度 --- */
.kv_w5 {
  width: 79%;             /* 完美切齊上方三個卡片的總寬度 */
}

/* --- 5. 確保結構填滿與圖片處理 --- */
.cards-row > div > div, 
.cards-row a,
.kv_w5 > div,
.kv_w5 a {
  display: block;
  height: 100%;
}

.cards-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;      /* 圖片防變形 */
  /* border-radius: 8px; */ /* 如果想要圓角把這行註解打開 */
}

@media (max-width: 767px) {
  .kv {
    background: url(../../images/bg_m_01.jpg?20260306) top center no-repeat #0e1730;
    background-size: 100% auto;
    height: 140vw;
    pointer-events: auto;
  }
  .kv > div {
    position: relative;
  }
}

/* =========================================
   1. 佈局工具類 (Layout Utilities)
   ========================================= */
.grid-layout {
  display: grid;
  gap: 15px;
  grid-template-columns: repeat(1, 1fr); /* 預設手機 1 欄 */
  padding: 10px;
  margin: 0 10px;
}
/* 針對 grid 容器內的空 a 標籤 */
.grid-layout > a:empty {
  display: none;
}
.full-row {
  grid-column: 1 / -1;
  /* "1 / -1" 代表從第一格寬度跨越到最後一格，不管你原本是幾欄都會自動滿版 */
}
.full-row:hover img {
  transform: none;
}
/* 桌機版欄位控制 (768px 以上) */
@media (min-width: 768px) {
  .pc-col-1 {
    grid-template-columns: repeat(1, 1fr);
  }
  .pc-col-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .pc-col-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .pc-col-4 {
    grid-template-columns: repeat(4, 1fr);
  }
  .pc-col-5 {
    grid-template-columns: repeat(5, 1fr);
  }
  .pc-col-6 {
    grid-template-columns: repeat(6, 1fr);
  }
  .pc_show.grid-layout {
    display: grid !important;
  }
}

/* 手機版欄位控制 (767px 以下) */
@media (max-width: 767px) {
  .grid-layout {
    margin: 0 3vw 3vw 3vw;
    padding: 10px 0;
  }
  .mb-col-1 {
    grid-template-columns: repeat(1, 1fr);
  }
  .mb-col-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .mb-col-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .mb-gap-sm {
    gap: 5px;
  } /* 手機縮小間距用 */
}

/* =========================================
   2. 主題系統 (Theme System)
   ========================================= */

/* 主題 A：一番賞 */
.theme-ichi {
  --card-bg: #fff;
  --card-border: #fff;
  --card-borderPx: 2px;
  --name-color: #000;
  --price-label: #000;
  --price-num: #ff3b3b;
}

/* 主題 B：競標 */
.theme-bidding {
  --card-bg: #311e17;
  --card-border: #ffa33d;
  --card-borderPx: 2px;
  --name-color: #fff;
  --price-label: #ffc329;
  --price-num: #ffc329;
}

/* 主題 C：一般商品卡 */
.theme-pd {
  --card-bg: #fff;
  --card-border: #05a8f9;
  --card-borderPx: 6px;
  --name-color: #111;
  --price-label: #FF0000;
  --price-num: #FF0000;
}

.theme-ichi .grid-item:hover,
.theme-bidding .grid-item:hover,
.theme-pd .grid-item:hover {
  transform: translateY(-5px);
}

@media (max-width: 767px) {
  .theme-pd {
    --card-borderPx: 3px;
  }
}

/* =========================================
   3. 商品卡結構 (Component)
   ========================================= */
.grid-item {
  background: var(--card-bg);
  border: var(--card-borderPx) ;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  padding: 0;
}
/* --- 1. 保持原樣 (不需要寫 hover，或者強制重設) --- */
.hvr-none:hover {
  transform: none !important;
  box-shadow: none !important;
  cursor: default;
}

/* --- 2. 放大 --- */
.hvr-grow:hover {
  transform: scale(1.05);
  /*box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15); */
}

/* --- 3. 往上移動  --- */
.hvr-up:hover {
  /* 注意：通常上移是負值，translateY(-4px) 才是往上 */
  transform: translateY(-4px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.grid-item img {
  width: 100%;
  height: auto;
  display: block;
  max-width: 100%;
  transition: all 0.5s ease-out;
}

.imgbox {
  width: 100%;
  aspect-ratio: 1 / 1; /* 固定比例 */
  overflow: hidden; /* 超出部分隱藏 */
  display: flex; /* 讓圖片置中 */
  align-items: center;
  justify-content: center;
  background-color: #fff;
}
.imgbox img {
  max-width: 100%; /* 寬度最多 100% */
  max-height: 100%; /* 高度最多 100% */
  object-fit: contain; /* 確保整張圖都看得到，不被裁切 */
}

/* 內容區 */
.pd-content {
  padding: 12px 5px;
  display: flex;
  flex-direction: column;
}

.name {
  color: var(--name-color);
  font-size: 18px;
  height: 2.8em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.price {
  color: var(--price-label);
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 2px;
}
.price b {
  color: var(--price-num);
  font-size: 30px;
  line-height: 1;
  display: inline-block;
  letter-spacing: 0.05rem;
}

/* 額外元件：競標橫條 & 副標題 */
aside {
  display: flex;
  justify-content: space-between;
  background-color: #e27c37;
}
.rt-auction-time {
  text-align: right;
  flex: 1; /* 讓這個區塊佔滿剩下的空間，文字才能在裡面靠右 */
}
.rt-auction-text,
.rt-auction-time {
  word-break: break-all;
  color: #fff !important;
  font-size: 15px !important;
  padding: 2px 5px;
}

.promo-tag {
  /* 三色漸層：紫色 -> 亮紫 -> 深藍 */
  /* 三色漸層：紫色 -> 亮紫 -> 深藍 */
  background: linear-gradient(to right, #5b05f9 0%, #0594f9 100%);
  color: #fff;
  text-align: center;
  padding: 4px;
  font-size: 15px;
  font-weight: 900;
}

@media (max-width: 767px) {
  .grid-item span {
    line-height: 14px;
  }
  .name,
  .promo-tag,
  .price {
    font-size: 12px;
  }
  .rt-auction-text,
  .rt-auction-time {
    font-size: 10px !important;
  }
  .price b {
    font-size: 20px;
    transform: translateY(4px);
  }
}

.month {
  margin: 0 40px;
  padding: 20px;
  background: #fffcdb;
}
@media (max-width: 767px) {
  .month {
    margin: 0 8px;
    padding: 0px;
  }
  .month > .sticker-grid {
    gap: 5px;
  }
	#pdsection {
    margin-top: -10%;  /* Feel free to adjust this % */
    position: relative;
    z-index: 3;
  }	
}

.bank {
  clear: both;
  padding: 30px 0 50px 0;
}
