@charset "utf-8";
/* 主會場 v1.2 */

/* ===== pub-loader 基本樣式（照抄技能包，勿改） ===== */
[hidden] { display: none !important; }

/* 上稿的換行照原樣顯示 */
[data-field="description"], [data-field="content"] { white-space: pre-line; }

/* 完售遮罩：卡片有 .is-soldout 才顯示 */
[data-pub-soldout] { display: none; }
.is-soldout [data-pub-soldout] { display: flex; }

/* 骨架屏 */
.pub-skeleton { pointer-events: none; }
.pub-skeleton .sk-img { aspect-ratio: 1 / 1; }
.pub-skeleton .sk-line { height: 14px; margin: 10px 8px 0; border-radius: 4px; }
.pub-skeleton .sk-line.short { width: 50%; margin-bottom: 12px; }
.pub-skeleton .sk-img,
.pub-skeleton .sk-line { background: linear-gradient(90deg, #eee 25%, #f6f6f6 50%, #eee 75%); background-size: 200% 100%; animation: pub-shimmer 1.2s infinite; }
@keyframes pub-shimmer { to { background-position: -200% 0; } }

/* 沒有資料或讀取失敗：收起容器 */
[data-pub-state="empty"],
[data-pub-state="error"] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .pub-skeleton .sk-img, .pub-skeleton .sk-line { animation: none; }
}

/* ===== 本活動補充（只補設計稿沒有的規則） ===== */

/* 價格包成 span 後沿用父層字級，避免被 .grid-item span（手機 13px）蓋掉 */
.price-group span[data-field] { font-size: inherit; }

/* 商品卡等高：品名固定兩行高、價格貼底（直播卡、競標卡不套用） */
[data-pub-section] > .grid-item:not(.live-card) > a { display: flex; flex: 1; flex-direction: column; }
[data-pub-section] > .grid-item:not(.live-card) .pd-content { flex: 1; }
[data-pub-section] > .grid-item:not(.live-card) .name { min-height: 2.8em; }
[data-pub-section] > .grid-item:not(.live-card) .price-group { margin-top: auto; }

/* 完售遮罩外觀（設計稿未提供）；.imgbox 已是 position: relative */
.pub-soldout {
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  background: rgb(0 0 0 / 55%);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

/* ---------- 直播卡 ---------- */
/* 依 data-live-status（live／waiting）切換顯示 */
#live-products > .live-card:not([data-live-status="live"]) [data-live-only],
#live-products > .live-card[data-live-status="live"] [data-waiting-only] { display: none; }

/* 提醒鈴鐺：位置尺寸沿用設計稿 .live-status，這裡只清掉按鈕預設外觀 */
#live-products > .live-card { position: relative; }
#live-products .live-remind {
  z-index: 1;
  padding: 0;
  border: 0;
  background: none;
  line-height: 0;
  cursor: pointer;
}
/* 圖示撐滿按鈕（圖檔 width 屬性為 50，不加的話 PC 會停在 50px） */
#live-products .live-remind img { width: 100%; height: auto; }
#live-products .live-remind:focus-visible { outline: 2px solid #1928a2; outline-offset: 2px; }
/* 已開／未開提醒圖示 */
#live-products > .live-card[data-live-watching="true"] .live-remind-off,
#live-products > .live-card:not([data-live-watching="true"]) .live-remind-on { display: none; }

/* ---------- 競標卡 ---------- */
/* 查不到商品時狀態被隱藏，整條收起 */
#live-products > [data-pub-type="bid"] .live-card-time:has(> [data-field="auctionStatus"][hidden]) { display: none; }
/* 手機寬度放不下倒數時換到第二行 */
#live-products > [data-pub-type="bid"] .live-card-time { flex-wrap: wrap; row-gap: 0; background: #7f0fe9; }
/* 倒數是空的（未開始／已結束）：收起、不換行 */
#live-products > [data-pub-type="bid"] [data-field="auctionTime"]:empty { display: none; }
#live-products > [data-pub-type="bid"] .live-card-time:has(> [data-field="auctionTime"]:empty) { flex-wrap: nowrap; }

/* 骨架屏比例同直播卡圖片（190 / 248） */
#live-products .pub-skeleton .sk-img { aspect-ratio: 190 / 248; }

/* 開播提醒結果提示（page-data-index.js 建立） */
.pub-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 10002;   /* 高於手機版固定選單 .side-menu（10001） */
  max-width: calc(100% - 32px);
  padding: 10px 20px;
  border-radius: 8px;
  background: rgb(0 0 0 / 75%);
  color: #fff;
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s ease;
}
.pub-toast.is-visible { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .pub-toast { transition: none; }
}

/* ---------- 整點下殺 ---------- */
/* 場次容器不產生方塊，卡片直接用 .flash-products 的 grid */
.flash-products > [data-pub-section] { display: contents; }

/* 錨點 #sale：保留固定選單高度（與 main.js 點選單的位置一致） */
#sale { scroll-margin-top: 20px; }
@media (max-width: 1024px) {
  #sale { scroll-margin-top: 48px; }
}

/* ---------- 活動辦法頁 ---------- */
/* 讀取失敗時顯示提示（基本樣式會收起 error 容器） */
.terms [data-pub-terms][data-pub-state="error"] { display: block; }
.terms [data-pub-terms][data-pub-state="error"]::before { content: "活動辦法載入失敗，請稍後再試。"; }
