/* ============================================================
 * twucm YUQINGMEN custom product page styles
 * Source of truth — please edit here, not inline in product.liquid
 * Sections:
 *   :root tokens
 *   A. .ym-grid / .ym-left / .ym-right shared
 *   B. Gallery (左欄)
 *   C. Right column (1-13 區)
 *   D. Store popover (13 區)
 *   E. Lower section: tab nav + 3 panels + accordion + 組合推薦
 *   F. Responsive @media (max-width:768px)
 * ============================================================ */

:root {
  --ym-primary: #810000;       /* tab 選中 / 主色 / CTA */
  --ym-price-red: #b00000;     /* 組合推薦的「$xxx 起」紅字 */
  --ym-card-bg: #f5f5f4;       /* 卡片底灰 */
  --ym-divider: #e5e5e5;       /* 分隔線 */
  --ym-text-dark: #1f1c1a;
  --ym-text-mute: #9b938c;
  --ym-text-body: #4a443f;
  --ym-gallery-control: #4a4a4a;
}

/* ===== A. 共用 grid / sticky ===== */
/* 麵包屑（自訂版型重建，取代被隱藏的原生麵包屑）*/
.ym-bc{max-width:1200px;margin:0 auto;padding:18px 24px 0;display:flex;flex-wrap:wrap;align-items:center;gap:8px;font-size:13px;color:var(--ym-text-mute);font-family:"Noto Sans TC","PingFang TC","Microsoft JhengHei",system-ui,sans-serif;box-sizing:border-box;}
.ym-bc a{color:var(--ym-text-mute);text-decoration:none;}
.ym-bc a:hover{color:var(--ym-primary);}
.ym-bc .sep{color:#cfc8c0;}
.ym-bc .cur{color:var(--ym-text-dark);}

.ym-grid{display:grid;grid-template-columns:minmax(0,1fr) 440px;gap:56px;max-width:1200px;margin:0 auto;padding:36px 24px 72px;align-items:start;box-sizing:border-box;color:var(--ym-text-dark);font-family:"Noto Sans TC","PingFang TC","Microsoft JhengHei",system-ui,sans-serif;}
/* Cyberbiz 商品頁桌機固定頁首實測為 76px；首屏還需扣除麵包屑／grid 上距，
   讓主圖、縮圖與縮圖滑桿整組留在可視範圍內。 */
.ym-left{position:sticky;top:calc(var(--ym-header-h, 76px) + 20px);height:calc(100dvh - var(--ym-header-h, 76px) - 76px);}
/* Header 收合後維持首屏圖庫高度，不放大主圖；只將主圖＋縮圖整組移至視窗中央。
   58px = 20px 基準間距 + 76px 頁首高度的一半。 */
@media (min-width:769px){
  @supports selector(body:has(header)){
    body:has(header[style*="-100%"]) .ym-left{top:58px;}
  }
}
.ym-main-img{width:100%;display:block;height:auto;background:#f3f1ee;}
.ym-divider{border-bottom:1px solid var(--ym-divider);}

/* ===== B. Gallery 自刻 ===== */
.ym-gallery{position:relative;width:100%;height:100%;display:flex;flex-direction:column;justify-content:flex-start;gap:14px;min-height:0;}
/* 200px = 首屏上方 76px + 縮圖列、間距、滑桿與底部緩衝約 124px。
   只用寬度決定尺寸並交給 aspect-ratio 算高度，避免 max-height 單邊壓縮成長方形。 */
.ym-main{position:relative;flex:0 0 auto;min-height:0;aspect-ratio:1/1;align-self:center;width:min(calc(100% - 108px),calc(100dvh - var(--ym-header-h, 76px) - 200px));max-width:100%;background:#f3f1ee;overflow:hidden;}
.ym-main img{width:100%;height:100%;object-fit:cover;display:block;transition:opacity .2s;}
.ym-nav{position:absolute;top:50%;width:40px;height:40px;border-radius:0;background:transparent;box-shadow:none;transform:translateY(-50%);z-index:5;cursor:pointer;border:none;outline:none;display:flex;align-items:center;justify-content:center;transition:opacity .15s;font-family:inherit;padding:0;}
.ym-nav:hover{background:transparent;opacity:.65;}
.ym-nav::after{content:"";width:10px;height:10px;border-top:2px solid var(--ym-gallery-control);border-right:2px solid var(--ym-gallery-control);display:block;}
.ym-prev{left:14px;}
.ym-prev::after{transform:rotate(-135deg);margin-left:4px;}
.ym-next{right:14px;}
.ym-next::after{transform:rotate(45deg);margin-right:4px;}
.ym-thumbs{display:flex;flex-wrap:nowrap;gap:10px;list-style:none;margin:0;padding:0;overflow-x:auto;width:100%;flex:0 0 auto;}
.ym-thumbs::-webkit-scrollbar{height:6px;}
.ym-thumbs::-webkit-scrollbar-thumb{background:#cfc8c0;border-radius:3px;}
.ym-thumbs li{flex:0 0 72px;width:72px;height:72px;border:1px solid transparent;border-radius:2px;overflow:hidden;cursor:pointer;background:#f3f1ee;box-sizing:border-box;opacity:.72;transition:border-color .15s,opacity .15s;}
.ym-thumbs li:hover,.ym-thumbs li.active{border-color:var(--ym-gallery-control);opacity:1;}

.ym-thumbs li img{width:100%;height:100%;object-fit:cover;display:block;}
/* 縮圖列：限寬滾動 + 左右箭頭（圖多時 JS 注入 .ym-thumbs-wrap）*/
.ym-thumbs-wrap{display:flex;align-items:flex-start;gap:8px;width:100%;flex:0 0 auto;min-width:0;}
.ym-thumbs-wrap .ym-thumbs{flex:1 1 0;min-width:0;width:auto;}
.ym-thumbs-arrow{flex:0 0 auto;width:26px;height:72px;border:1px solid var(--ym-divider);background:#fff;border-radius:2px;cursor:pointer;display:flex;align-items:center;justify-content:center;color:#6b645d;padding:0;transition:.15s;}
.ym-thumbs-arrow:hover:not(:disabled){border-color:var(--ym-primary);color:var(--ym-primary);}
.ym-thumbs-arrow:disabled{opacity:.3;cursor:default;}
.ym-thumbs-arrow::after{content:"";width:8px;height:8px;border-top:1.7px solid currentColor;border-right:1.7px solid currentColor;display:block;}
.ym-thumbs-prev::after{transform:rotate(-135deg);margin-left:3px;}
.ym-thumbs-next::after{transform:rotate(45deg);margin-right:3px;}
@media (max-width:768px){ .ym-thumbs-arrow{display:none !important;} }
.ym-badge{position:absolute;top:14px;left:14px;z-index:6;background:var(--ym-primary);color:#fff;font-size:12.5px;padding:5px 12px;border-radius:2px;letter-spacing:1px;font-weight:500;pointer-events:none;}

/* ===== C. 右欄 ===== */
.ym-right{font-size:14px;line-height:1.7;width:440px;}

/* 1. 標題：字級、顏色與換行由 Cyberbiz 商品名稱欄位內的格式決定。 */
.ym-block{padding-bottom:24px;margin-bottom:24px;border-bottom:none;}
.ym-block[data-yuqingmen-content="title"]{padding-bottom:30px;margin-bottom:30px;}
.ym-block:not([data-yuqingmen-content="title"]) .ym-h{padding-bottom:10px;border-bottom:1px solid var(--ym-divider);}
.ym-block:last-child{border-bottom:none;}

/* 2,3. 區段 */
.ym-h{font-size:16px;font-weight:600;color:var(--ym-text-dark);margin:0 0 14px;letter-spacing:.5px;}
.ym-list{margin:0;padding:0;list-style:none;}
.ym-list li{font-size:14px;color:var(--ym-text-body);line-height:2.1;}

/* Accordion */
.ym-acc{border-bottom:1px solid var(--ym-divider);}
.ym-acc summary{list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:space-between;font-size:16px;font-weight:600;color:var(--ym-text-dark);padding:18px 2px;letter-spacing:.5px;}
.ym-acc summary::-webkit-details-marker{display:none;}
.ym-acc summary::after{content:"";width:10px;height:10px;border-right:1.8px solid var(--ym-primary);border-bottom:1.8px solid var(--ym-primary);transform:rotate(45deg);transition:transform .2s;margin-right:6px;}
.ym-acc[open] summary::after{transform:rotate(-135deg);}
.ym-acc-body{padding:6px 2px 22px;}

/* 4. 規格（左右對調：左示意圖、右規格選項；桌機與手機皆等寬等高） */
/* 預設隱藏，避免 server HTML 的假資料規格閃現；JS renderSizes 填入真資料後才顯示 */
.ym-acc[data-yuqingmen-section="spec"]{display:none;}
.ym-spec{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;align-items:stretch;}
.ym-spec-opts{display:flex;flex-direction:column;gap:10px;flex:4;min-width:0;max-height:235px;overflow-y:auto;padding-right:4px;}
.ym-spec > .ym-spec-opts{grid-column:2;grid-row:1;flex:none;height:200px;max-height:200px;box-sizing:border-box;}
.ym-spec-opts::-webkit-scrollbar{width:6px;}
.ym-spec-opts::-webkit-scrollbar-thumb{background:#cfc8c0;border-radius:3px;}
.ym-spec-opts::-webkit-scrollbar-track{background:transparent;}
.ym-opt-btn{border:1px solid #d6cfc7;background:#fff;color:#3a3531;font-size:13.5px;padding:12px 8px;cursor:pointer;border-radius:2px;text-align:center;transition:.15s;font-family:inherit;}
.ym-spec > .ym-spec-opts .ym-opt-btn{flex:0 0 auto;}
.ym-opt-btn:hover{border-color:#565656;}
.ym-opt-btn.active{background:#565656;border-color:#565656;color:#fff;}
.spec-preview-placeholder{flex:6;min-width:0;min-height:150px;max-height:200px;overflow-y:auto;border:1px solid #ece8e2;border-radius:2px;background:#f6f3ef;color:var(--ym-text-mute);font-size:12.5px;display:flex;flex-direction:column;gap:6px;align-items:center;justify-content:center;text-align:center;padding:8px;box-sizing:border-box;}
.ym-spec > .spec-preview-placeholder{grid-column:1;grid-row:1;flex:none;height:200px;min-height:200px;max-height:200px;}
.spec-preview-placeholder img{display:block;width:100%;min-height:0;object-fit:contain;}
.ym-spec-preview-dim{line-height:1.5;color:var(--ym-text-body);}

/* 皮色 tabs */
.ym-tabs{display:flex;align-items:center;gap:8px;margin:0 0 14px;}
.ym-tab{font-size:12.5px;padding:7px 16px;border:1px solid #d6cfc7;background:#fff;color:#5a534d;cursor:pointer;border-radius:2px;font-family:inherit;}
.ym-tab:hover{border-color:#565656;}
.ym-tab.active{background:#565656;border-color:#565656;color:#fff;}
.ym-count{font-size:12.5px;color:#565656;margin-left:6px;letter-spacing:.5px;}

/* 色塊網格 */
/* Desktop: two complete swatch rows (square chips and their labels) remain
   visible while longer material lists scroll inside a fixed-height panel. */
.ym-swrap{height:270px;max-height:270px;overflow-y:scroll;overflow-x:hidden;scrollbar-gutter:stable;padding-right:4px;box-sizing:border-box;}
.ym-swrap::-webkit-scrollbar{width:6px;}
.ym-swrap::-webkit-scrollbar-thumb{background:#cfc8c0;border-radius:3px;}
.ym-swgrid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px 10px;}
.ym-sw{border:none;background:none;padding:0;cursor:pointer;text-align:center;font-family:inherit;position:relative;}
.ym-sw-c{display:block;width:100%;aspect-ratio:1/1;border:1px solid transparent;box-shadow:0 0 0 1px #e0dcd5 inset;border-radius:2px;transition:border-color .15s;}
.ym-sw.active .ym-sw-c{border-color:var(--ym-text-dark);}
.ym-sw-n{display:block;font-size:11.5px;color:#7a736c;margin-top:6px;line-height:1.3;}
.ym-sw.active .ym-sw-n{color:var(--ym-text-dark);}

/* 皮色 2 hover tooltip (CSS only) */
.ym-leather-hover .ym-sw:hover .ym-tooltip{display:block;}
.ym-tooltip{display:none;position:absolute;z-index:50;top:-8px;left:110%;width:170px;background:#fff;border:1px solid #e0dcd5;border-radius:4px;box-shadow:0 8px 24px rgba(0,0,0,.18);padding:12px;pointer-events:none;}
.ym-tooltip .tc{width:100%;height:90px;border-radius:2px;box-shadow:0 0 0 1px #e0dcd5 inset;}
.ym-tooltip .tn{font-size:13.5px;color:var(--ym-text-dark);margin-top:8px;text-align:left;}
.ym-tooltip .tm{font-size:11.5px;color:var(--ym-text-mute);margin-top:2px;text-align:left;}

/* 8. 優惠活動框 */
.ym-promo{border:1px solid var(--ym-divider);border-radius:10px;padding:16px 18px;margin:0 0 22px;background:#fff;max-height:130px;overflow-y:auto;}
.ym-promo::-webkit-scrollbar{width:6px;}
.ym-promo::-webkit-scrollbar-thumb{background:#cfc8c0;border-radius:3px;}
.ym-promo b{display:block;font-size:14px;color:var(--ym-text-dark);font-weight:400;margin-bottom:8px;}
.ym-promo span{display:block;font-size:13px;color:var(--ym-primary);line-height:1.95;}

/* 9. 價格 */
.ym-price-row{display:flex;align-items:baseline;gap:14px;margin:0 0 22px;}
.ym-price{font-size:30px;font-weight:700;color:var(--ym-primary);letter-spacing:.5px;}
.ym-price-old{font-size:15px;color:#D8D8D8;text-decoration:line-through;}

/* 10. 數量 */
.ym-qty{display:flex;align-items:center;border:1px solid #d6cfc7;border-radius:2px;height:50px;margin:0 0 16px;overflow:hidden;}
.ym-qbtn{flex:0 0 56px;height:100%;border:none;background:#fff;font-size:22px;color:#5a534d;cursor:pointer;line-height:1;font-family:inherit;}
.ym-qbtn:hover{background:#faf8f5;}
.ym-qbtn:first-child{border-right:1px solid var(--ym-divider);}
.ym-qbtn:last-child{border-left:1px solid var(--ym-divider);}
.ym-qval{flex:1;text-align:center;border:none;font-size:17px;color:var(--ym-text-dark);background:#fff;width:100%;font-family:inherit;}

/* 11. 主按鈕 */
.ym-cta{display:flex;gap:12px;margin:0 0 14px;}
.ym-cta button{flex:1;height:52px;font-size:15px;letter-spacing:2px;cursor:pointer;border-radius:2px;font-family:inherit;transition:.15s;}
.ym-cart{background:#fff;border:1px solid var(--ym-text-dark);color:var(--ym-text-dark);}
.ym-cart:hover{background:var(--ym-text-dark);color:#fff;}
.ym-buy{background:var(--ym-primary);border:1px solid var(--ym-primary);color:#fff;}
.ym-buy:hover{background:#660000;}
/* 規格未選齊 / 無對應款式(variant_id=null) → 停用 */
.ym-cta button.is-disabled,.ym-cta button:disabled{opacity:.45;cursor:not-allowed;pointer-events:none;}
.ym-cta .ym-cart.is-disabled:hover{background:#fff;color:var(--ym-text-dark);}
.ym-cta .ym-buy.is-disabled:hover{background:var(--ym-primary);}
/* 門市限定只由 /price.purchase_channel=in_store 啟用；價格仍保留在上方。 */
.ym-store-only-cta{display:none;flex:1;width:100%;height:52px;align-items:center;justify-content:center;gap:12px;background:var(--ym-primary);color:#fff;border-radius:6px;font-size:15px;letter-spacing:1px;text-decoration:none;cursor:pointer;transition:.15s;}
.ym-store-only-cta:link,.ym-store-only-cta:visited,.ym-store-only-cta:hover,.ym-store-only-cta:focus,.ym-store-only-cta:active{color:#fff;text-decoration:none;}
.ym-store-only-cta:hover{background:#660000;}
.ym-store-only-cta:focus-visible{outline:2px solid var(--ym-primary);outline-offset:3px;}
.ym-store-only-sep{opacity:.55;}
.ym-store-only-more{text-decoration:underline;text-underline-offset:3px;}
.ym-cta.is-in-store>.ym-cart,.ym-cta.is-in-store>.ym-buy{display:none;}
.ym-cta.is-in-store>.ym-store-only-cta{display:flex;}

/* 12. 次要按鈕 — 靠右、總寬＝立即購買（在立即購買正下方），兩顆較小各佔一半 */
.ym-row2{display:grid;grid-template-columns:1fr 1fr;gap:8px;width:calc((100% - 12px) / 2);margin-left:auto;}
/* 只針對兩顆動作鈕（加入最愛/展示門市），不要波及 popover 內的關閉鈕 .ym-pop-x */
.ym-row2>.ym-fav,.ym-row2 .ym-store-wrap>.ym-store{width:100%;height:46px;padding:0 6px;font-size:13px;cursor:pointer;border-radius:2px;font-family:inherit;background:#fff;border:1px solid #d6cfc7;color:var(--ym-text-dark);display:flex;align-items:center;justify-content:center;gap:5px;transition:.15s;letter-spacing:0;}
.ym-row2>.ym-fav:hover,.ym-row2 .ym-store-wrap>.ym-store:hover{border-color:var(--ym-primary);color:var(--ym-primary);}
.ym-fav-icon{width:18px!important;height:18px!important;flex:0 0 18px;display:inline-block;vertical-align:middle;}
/* 已收藏狀態（鏡射原生收藏）：填滿愛心 + 主色 */
.ym-row2 .ym-fav.is-loved{border-color:var(--ym-primary);color:var(--ym-primary);}
.ym-fav.is-loved .ym-fav-icon{fill:var(--ym-primary);stroke:var(--ym-primary);}
/* 展示門市：深灰底白字 + 房子 icon */
.ym-row2 .ym-store{background:#4a4a4a;border-color:#4a4a4a;color:#fff;}
.ym-row2 .ym-store:hover{background:#333;border-color:#333;color:#fff;}
.ym-store-icon{width:18px!important;height:18px!important;flex:0 0 18px;display:inline-block;vertical-align:middle;}

/* ===== D. 13. 展示門市 Popover ===== */
.ym-store-wrap{position:relative;display:flex;}
.ym-store-wrap .ym-store{width:100%;}
.ym-store-popover{position:absolute;bottom:100%;right:0;margin-bottom:8px;width:260px;background:#fff;border-radius:14px;box-shadow:0 4px 16px rgba(0,0,0,.12);padding:20px 22px;z-index:1000;display:none;box-sizing:border-box;}
.ym-store-popover.is-open{display:block;}
.ym-pop-hd{display:flex;align-items:center;justify-content:space-between;padding-bottom:12px;border-bottom:1px solid var(--ym-divider);margin-bottom:14px;}
.ym-pop-hd h3{margin:0;font-size:15px;font-weight:600;color:var(--ym-text-dark);letter-spacing:.5px;}
.ym-pop-x{background:none;border:none;font-size:18px;color:#b8b3ad;cursor:pointer;line-height:1;padding:0 4px;font-family:inherit;transition:color .15s;}
.ym-pop-x:hover{color:var(--ym-text-dark);}
.ym-pop-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:14px;max-height:280px;overflow-y:auto;}
.ym-pop-list li{font-size:14px;color:var(--ym-text-body);display:flex;align-items:center;gap:10px;}
.ym-pop-list li::before{content:"";width:6px;height:6px;border-radius:50%;background:var(--ym-primary);flex:0 0 auto;}
.ym-pop-list a,.ym-store-modal .ym-m-store-list a{color:inherit;text-decoration:none;transition:color .15s;}
.ym-pop-list a:hover,.ym-store-modal .ym-m-store-list a:hover{color:var(--ym-primary);text-decoration:underline;}

/* 隱藏原生 */
.yuqingmen-native-hidden{display:none !important;}

/* 加入購物車 toast 提示 */
.ym-toast{position:fixed;left:50%;bottom:40px;transform:translateX(-50%) translateY(10px);background:rgba(40,36,33,.95);color:#fff;padding:12px 24px;border-radius:4px;font-size:14px;letter-spacing:1px;z-index:99999;opacity:0;transition:opacity .25s,transform .25s;pointer-events:none;box-shadow:0 6px 20px rgba(0,0,0,.2);}
.ym-toast.show{opacity:1;transform:translateX(-50%) translateY(0);}

/* ===========================================================
 * E. LOWER SECTION (v9) — tab nav + 3 panels + 組合推薦
 * 範圍：商品介紹 / 商品規格 / 訂購須知 panel + 組合推薦
 * 資料來源：3 panel 內容由 JS 從原生 #desc_section_1/2/3 搬入；
 *           組合推薦走 window.CYBERBIZ_RELATED 或靜態 fallback
 * =========================================================== */
.ym-lower{max-width:1200px;margin:0 auto;padding:24px 24px 80px;color:var(--ym-text-dark);font-family:"Noto Sans TC","PingFang TC","Microsoft JhengHei",system-ui,sans-serif;}

/* Tab Nav */
.ym-tabnav{display:flex;width:100%;border:1px solid var(--ym-divider);border-radius:2px;overflow:hidden;margin:0 0 36px;}
.ym-tabnav-btn{flex:1;border:none;background:#fff;color:var(--ym-text-dark);font-size:15px;font-weight:500;letter-spacing:1.5px;padding:18px 12px;cursor:pointer;font-family:inherit;transition:.15s;border-right:1px solid var(--ym-divider);}
.ym-tabnav-btn:last-child{border-right:none;}
.ym-tabnav-btn:hover{background:#faf8f5;}
.ym-tabnav-btn.active{background:var(--ym-primary);color:#fff;}

/* Panels */
.ym-panel{display:none;}
.ym-panel.active{display:block;}

/* ----- 商品介紹 panel ----- */
.ym-intro-sec{margin:0 0 48px;}
.ym-intro-h{font-size:24px;font-weight:600;letter-spacing:1.5px;margin:0 0 12px;color:var(--ym-text-dark);}
.ym-intro-sub{font-size:14px;color:var(--ym-text-mute);margin:0 0 28px;line-height:1.8;}
.ym-hero{width:100%;aspect-ratio:16/9;background:#f3f1ee;margin:0 0 36px;display:flex;align-items:center;justify-content:center;color:var(--ym-text-mute);font-size:13px;}
.ym-hero img{width:100%;height:100%;object-fit:cover;display:block;}

.ym-feat-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:20px;margin:0 0 48px;}
.ym-feat-card{background:var(--ym-card-bg);padding:24px 22px;border-radius:4px;}
.ym-feat-card h4{font-size:15px;font-weight:600;color:var(--ym-text-dark);margin:0 0 12px;letter-spacing:.5px;}
.ym-feat-card p{font-size:13px;color:var(--ym-text-body);margin:0;line-height:1.85;}

.ym-detail-h{font-size:18px;font-weight:600;color:var(--ym-text-dark);margin:0 0 14px;letter-spacing:1px;padding-bottom:10px;border-bottom:1px solid var(--ym-divider);}
.ym-detail-hero{width:100%;aspect-ratio:16/9;background:#f3f1ee;margin:0 0 12px;}
.ym-detail-hero img{width:100%;height:100%;object-fit:cover;display:block;}
.ym-detail-cap{font-size:12.5px;color:var(--ym-text-mute);text-align:center;margin:0 0 36px;letter-spacing:.5px;}

.ym-detail-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:24px;}
.ym-detail-item{display:flex;flex-direction:column;gap:10px;}
.ym-detail-item .img{width:100%;aspect-ratio:4/3;background:#f3f1ee;}
.ym-detail-item .img img{width:100%;height:100%;object-fit:cover;display:block;}
.ym-detail-item .cap{font-size:12.5px;color:var(--ym-text-mute);text-align:center;letter-spacing:.5px;}

/* ----- 商品規格 panel ----- */
.ym-spec-h{font-size:24px;font-weight:600;letter-spacing:1.5px;margin:0 0 28px;color:var(--ym-text-dark);text-align:center;}
.ym-spec-main{display:flex;justify-content:center;margin:0 0 48px;}
.ym-spec-line{max-width:680px;width:100%;aspect-ratio:16/9;background:#fff;border:1px solid var(--ym-divider);display:flex;align-items:center;justify-content:center;color:var(--ym-text-mute);font-size:13px;}
.ym-spec-line img,.ym-spec-line svg{width:100%;height:100%;object-fit:contain;display:block;}

.ym-spec-sub-h{font-size:18px;font-weight:600;color:var(--ym-text-dark);text-align:center;margin:0 0 24px;letter-spacing:1px;}
.ym-spec-variants{display:grid;grid-template-columns:repeat(3,1fr);gap:24px;margin:0 0 60px;}
.ym-spec-variant{background:var(--ym-card-bg);padding:24px 20px;text-align:center;border-radius:4px;}
.ym-spec-variant .img{width:100%;aspect-ratio:4/3;background:#fff;margin:0 0 14px;display:flex;align-items:center;justify-content:center;color:var(--ym-text-mute);font-size:12px;}
.ym-spec-variant .img img,.ym-spec-variant .img svg{width:100%;height:100%;object-fit:contain;}
.ym-spec-variant .name{font-size:15px;font-weight:600;color:var(--ym-text-dark);margin:0 0 6px;}
.ym-spec-variant .dim{font-size:12.5px;color:var(--ym-text-body);letter-spacing:.5px;}

.ym-mat-h{font-size:20px;font-weight:600;color:var(--ym-text-dark);margin:0 0 14px;letter-spacing:1px;}
.ym-mat-intro{font-size:14px;color:var(--ym-text-body);line-height:1.9;margin:0 0 28px;}
.ym-mat-list{display:flex;flex-direction:column;gap:20px;}
.ym-mat-card{display:grid;grid-template-columns:200px 1fr;gap:24px;background:var(--ym-card-bg);padding:24px;border-radius:4px;align-items:start;}
.ym-mat-card .img{width:100%;aspect-ratio:1/1;background:#fff;}
.ym-mat-card .img img{width:100%;height:100%;object-fit:cover;display:block;}
.ym-mat-card h5{font-size:16px;font-weight:600;color:var(--ym-text-dark);margin:0 0 10px;letter-spacing:.5px;}
.ym-mat-card p{font-size:13px;color:var(--ym-text-body);line-height:1.9;margin:0 0 6px;}

/* ----- 訂購須知 panel (accordion) ----- */
.ym-order-accs{display:flex;flex-direction:column;border-top:1px solid var(--ym-divider);}
.ym-order-acc{border-bottom:1px solid var(--ym-divider);}
.ym-order-acc summary{list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:space-between;font-size:16px;font-weight:500;color:var(--ym-text-dark);padding:20px 6px;letter-spacing:.5px;}
.ym-order-acc summary::-webkit-details-marker{display:none;}
.ym-order-acc summary::after{content:"";width:9px;height:9px;border-right:1.8px solid var(--ym-text-dark);border-bottom:1.8px solid var(--ym-text-dark);transform:rotate(45deg);transition:transform .2s;margin-right:8px;}
.ym-order-acc[open] summary::after{transform:rotate(-135deg);}
.ym-order-acc-body{padding:4px 6px 22px;font-size:14px;color:var(--ym-text-body);line-height:1.9;}

/* ----- 組合推薦 ----- */
.ym-recos{margin:64px 0 0;}
.ym-recos-h{font-size:22px;font-weight:600;color:var(--ym-text-dark);margin:0 0 24px;letter-spacing:1.5px;text-align:center;}
.ym-recos-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:20px;}
.ym-reco-card{display:flex;flex-direction:column;gap:8px;color:inherit;text-decoration:none;transition:transform .2s;}
.ym-reco-card:hover{transform:translateY(-2px);}
.ym-reco-card .img{width:100%;aspect-ratio:1/1;background:#fff;border:1px solid var(--ym-divider);overflow:hidden;border-radius:2px;display:flex;align-items:center;justify-content:center;color:var(--ym-text-mute);font-size:12px;}
.ym-reco-card .img img{width:100%;height:100%;object-fit:cover;display:block;}
.ym-reco-card .name{font-size:14.5px;font-weight:600;color:var(--ym-text-dark);margin:6px 0 2px;line-height:1.4;}
.ym-reco-card .mat{font-size:12px;color:var(--ym-text-mute);letter-spacing:.5px;}
.ym-reco-card .swatches{display:flex;align-items:center;gap:6px;margin:4px 0;min-height:18px;}
.ym-reco-card .swatch{width:14px;height:14px;border-radius:50%;box-shadow:0 0 0 1px #e0dcd5 inset;flex:0 0 auto;}
.ym-reco-card .more{font-size:11px;color:var(--ym-text-mute);}
.ym-reco-card .price{font-size:14px;font-weight:600;color:var(--ym-price-red);margin-top:4px;letter-spacing:.5px;}

/* ===== F. Responsive ===== */
@media (max-width:768px){
  .ym-grid{grid-template-columns:minmax(0,1fr);gap:24px;padding:16px 16px 40px;}  /* minmax(0,..) 讓單欄能縮到視窗寬，避免縮圖列撐爆整頁 */
  .ym-bc{padding:14px 16px 0;}
  .ym-left{position:static;height:auto;min-width:0;}
  .ym-right{width:100%;min-width:0;}
  .ym-tooltip{display:none !important;}
  .ym-gallery{height:auto;}
  .ym-main{flex:0 0 auto;align-self:stretch;width:100%;max-height:none;}

  /* Lower section RWD */
  .ym-lower{padding:16px 16px 60px;}
  .ym-tabnav-btn{font-size:13px;letter-spacing:.5px;padding:14px 6px;}
  .ym-feat-grid{grid-template-columns:1fr;}
  .ym-detail-grid{grid-template-columns:1fr;}
  .ym-spec-variants{grid-template-columns:1fr;}
  .ym-mat-card{grid-template-columns:1fr;}
  .ym-recos-grid{grid-template-columns:1fr;}

  /* =================================================================
   * v11：手機版上半部 ([YQM-PDP-MOBILE v1])
   * 僅動圖庫→規格→CTA。下半部 3-tab 區照舊。
   * ================================================================= */

  /* B. 縮圖下方進度軸（JS 注入 .ym-thumbs-progress） */
  .ym-thumbs-progress{width:100%;height:3px;background:var(--ym-divider);border-radius:2px;margin-top:6px;position:relative;overflow:hidden;}
  .ym-thumbs-progress-fill{position:absolute;left:0;top:0;height:100%;background:var(--ym-primary);border-radius:2px;width:25%;transition:width .25s;}

  /* C 區 .ym-h 標題 + 細分隔線（區段標題下方加灰線） */
  .ym-h{padding-bottom:8px;border-bottom:1px solid var(--ym-divider);margin-bottom:14px;}

  /* D 規格 accordion：手機版沿用左右等寬等高，只縮小欄距與按鈕。 */
  .ym-spec{gap:12px;}
  .ym-spec-opts{gap:8px;}
  .ym-opt-btn{padding:10px 6px;font-size:13px;}

  /* E/F 木色 / 皮色：橫向滑動列（一次 4 個） + 下方 scrollbar */
  .ym-swrap{height:auto;max-height:none;overflow:visible;scrollbar-gutter:auto;padding-right:0;}
  .ym-swgrid{
    display:grid;
    grid-template-columns:none;
    grid-auto-flow:column;
    grid-auto-columns:calc((100% - 30px) / 4);
    gap:10px;
    overflow-x:auto;
    overflow-y:hidden;
    padding:0 0 8px;
    scroll-snap-type:x mandatory;
    -webkit-overflow-scrolling:touch;
  }
  .ym-swgrid > .ym-sw{scroll-snap-align:start;}
  .ym-swgrid::-webkit-scrollbar{height:4px;}
  .ym-swgrid::-webkit-scrollbar-track{background:var(--ym-divider);border-radius:2px;}
  .ym-swgrid::-webkit-scrollbar-thumb{background:#9b938c;border-radius:2px;}
  /* 選中：細黑框 + 深色標籤，與桌機一致。 */
  .ym-sw.active .ym-sw-c{border:1px solid var(--ym-text-dark);}
  .ym-sw.active .ym-sw-n{color:var(--ym-text-dark);font-weight:600;}

  /* F 布款 Tab：保持紅底白字、計數靠右 */
  .ym-tabs{flex-wrap:wrap;gap:6px;}
  .ym-tab{padding:6px 14px;font-size:12px;}
  .ym-count{margin-left:auto;font-size:12px;}

  /* G 數量、CTA、按鈕：滿版直向堆疊
     手機隱藏「加入購物車」，保留「立即購買」與次要動作。 */
  .ym-qty{width:100%;height:46px;}
  .ym-right{display:flex;flex-direction:column;}
  /* CTA：DOM 是 [加入購物車, 立即購買]；手機只顯示立即購買。 */
  .ym-cta{order:1;flex-direction:column-reverse;gap:10px;}
  .ym-cta .ym-cart{display:block;flex:none;width:100%;height:48px;font-size:15px;letter-spacing:2px;}
  .ym-cta .ym-buy{flex:none;width:100%;height:48px;font-size:15px;letter-spacing:2px;}
  /* row2：加入最愛 + 展示門市 兩欄，排在 CTA 下方 */
  .ym-row2{order:2;display:grid;grid-template-columns:1fr 1fr;gap:10px;width:auto;margin:10px 0 0;}
  .ym-row2>.ym-fav{display:flex;}                       /* 取消先前隱藏 */
  .ym-row2 .ym-store-wrap{flex:none;width:100%;display:block;}
  .ym-row2 .ym-store-wrap>.ym-store,
  #ym-store-btn{width:100%;height:46px;}                /* 只設尺寸，配色沿用桌機 row2 樣式 */
  /* desktop popover 在 mobile 一律不顯示（由 .ym-m-modal 取代） */
  .ym-store-popover{display:none !important;}
}

/* =================================================================
 * Mobile Modals — swatch 預覽 / 展示門市
 * 不寫進 product.liquid；DOM 由 custom_product.js 動態 inject。
 * 只有 .is-open（JS 在 mobile 才會加）時才顯示，於任何寬度都安全。
 * ================================================================= */
.ym-m-modal{position:fixed;inset:0;z-index:9999;display:none;align-items:center;justify-content:center;}
.ym-m-modal.is-open{display:flex;}
.ym-m-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.5);}
.ym-m-card{position:relative;z-index:1;background:#fff;border-radius:14px;box-shadow:0 8px 32px rgba(0,0,0,.25);width:calc(100% - 48px);max-width:340px;max-height:80vh;overflow-y:auto;}

/* swatch modal */
.ym-swatch-modal .ym-m-card{padding:20px;}
.ym-swatch-modal .ym-swatch-close{position:absolute;top:8px;right:8px;z-index:2;width:40px;height:40px;display:flex;align-items:center;justify-content:center;padding:0;border:1px solid rgba(31,28,26,.12);border-radius:50%;background:rgba(255,255,255,.92);color:var(--ym-text-dark);font:400 26px/1 Arial,sans-serif;cursor:pointer;box-shadow:0 2px 8px rgba(0,0,0,.12);}
.ym-swatch-modal .ym-swatch-close:hover{background:#fff;color:var(--ym-primary);}
.ym-swatch-modal .ym-swatch-close:focus-visible{outline:2px solid var(--ym-primary);outline-offset:2px;}
.ym-swatch-modal .ym-m-img{width:100%;aspect-ratio:1/1;border-radius:8px;background:#f5f5f4;display:block;}
.ym-swatch-modal .ym-m-name{font-size:17px;font-weight:600;color:var(--ym-text-dark);margin-top:16px;text-align:center;letter-spacing:.5px;}
.ym-swatch-modal .ym-m-meta{font-size:13px;color:var(--ym-text-mute);margin-top:4px;text-align:center;}

/* store modal */
.ym-store-modal .ym-m-hd{display:flex;align-items:center;justify-content:space-between;padding:18px 22px 14px;border-bottom:1px solid var(--ym-divider);}
.ym-store-modal .ym-m-hd h3{margin:0;font-size:16px;font-weight:600;color:var(--ym-text-dark);letter-spacing:.5px;}
.ym-store-modal .ym-m-x{background:none;border:none;font-size:22px;color:#b8b3ad;cursor:pointer;padding:0 4px;line-height:1;font-family:inherit;transition:color .15s;}
.ym-store-modal .ym-m-x:hover{color:var(--ym-text-dark);}
.ym-store-modal .ym-m-store-list{list-style:none;margin:0;padding:14px 22px 22px;display:flex;flex-direction:column;gap:14px;}
.ym-store-modal .ym-m-store-list li{font-size:14px;color:var(--ym-text-body);display:flex;align-items:center;gap:10px;}
.ym-store-modal .ym-m-store-list li::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--ym-primary);flex:0 0 auto;}
@media (min-width:769px) and (max-width:1024px){
  .ym-grid{grid-template-columns:minmax(0,1fr);gap:32px;}
  .ym-left{position:static;height:auto;min-width:0;}
  .ym-gallery{height:auto;}
  .ym-main{max-height:none;}
  .ym-right{width:100%;max-width:440px;justify-self:center;}
  .ym-feat-grid{grid-template-columns:repeat(2,1fr);}
  .ym-recos-grid{grid-template-columns:repeat(2,1fr);}
}

/* Keyboard focus (accessibility) */
.ym-tabnav-btn:focus-visible,
.ym-reco-card:focus-visible,
.ym-order-acc summary:focus-visible{outline:2px solid var(--ym-primary);outline-offset:2px;}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  *{transition:none !important;}
  .ym-reco-card:hover{transform:none;}
}


/* ===== v12: 商品介紹/規格/訂購須知 改回原生樣式時，只顯示原生描述區，隱藏重複的購買區/麵包屑/圖庫 (YQM_NATIVE_DESC_ONLY) ===== */
#product.product .qk-container > *:not(#product_description){display:none !important;}
#product.product{max-width:1200px;margin:8px auto 40px;padding:0 24px;}
#product.product #product_description{display:block !important;}
/* 自訂商品頁已在上方提供購買流程；原生描述頁籤的缺貨按鈕不可覆蓋內文。 */
#product.product #product_description .add-to-cart-container{display:none !important;}

/* [issue #227] 規格示意圖（款式線稿）：原圖 400×400，顯示 ≤200px 以免上採樣糊；容器 max-height:200px + contain 自動降尺寸=清晰 */
.spec-preview-placeholder.has-img{padding:0;background:#fff;overflow:hidden;}
.spec-preview-placeholder.has-img .ym-spec-preview-dim{padding:4px 8px;}
.spec-preview-placeholder img.ym-spec-img{max-height:200px;max-width:100%;height:auto;object-fit:contain;display:block;}

/* [0904 P6] 縮小「上半自訂區 → 原生商品介紹 tab」的過大間距（原本 .ym-grid pb72 + #product mt8 + #product_description pt40 ≈ 120px） */
@media (min-width:769px){ .ym-grid{padding-bottom:28px;} }
#product.product{margin-top:0;}
#product.product #product_description{padding-top:16px;}

/* [0904 ③ / #136] 色塊：未選不要外框；選中使用細黑框與深色文字。 */
.ym-sw-c{box-shadow:none;}
.ym-sw.active .ym-sw-c{border-color:var(--ym-text-dark);}
.ym-sw.active .ym-sw-n{color:var(--ym-text-dark);}

/* [0904 ⑤] 購買區按鈕統一同首頁：圓角 6px、未選白底黑字細框、hover 紅底白字無框 */
.ym-cta button,.ym-row2>.ym-fav,.ym-row2 .ym-store-wrap>.ym-store,#ym-store-btn{border-radius:6px;}
.ym-cart{background:#fff;border:1px solid #d6cfc7;color:var(--ym-text-dark);}
.ym-cart:hover{background:var(--ym-primary);border-color:var(--ym-primary);color:#fff;}
.ym-row2 .ym-store{background:#fff;border-color:#d6cfc7;color:var(--ym-text-dark);}
.ym-row2>.ym-fav:hover,.ym-row2 .ym-store-wrap>.ym-store:hover{background:var(--ym-primary);border-color:var(--ym-primary);color:#fff;}

/* [0904 ①-a] 主圖左右箭頭移到圖片兩側(不疊圖) + 手機隱藏箭頭 + 移除「限10間」角標 */
.ym-badge{display:none !important;}                              /* 限10間 角標移除(電腦+手機) */
@media (min-width:769px){
  .ym-main{overflow:visible;max-width:calc(100% - 108px);}       /* 兩側各留 54px 讓箭頭在圖外 */
  .ym-prev{left:-50px;}                                          /* 箭頭移到主圖左側外 */
  .ym-next{right:-50px;}                                         /* 箭頭移到主圖右側外 */
}
@media (max-width:768px){ .ym-nav{display:none !important;} }    /* 手機版主圖箭頭移除 */

/* [0904 ①-b] 縮圖列與底部卷軸(滑桿)之間留一點間隔(原本卷軸貼著縮圖) */
.ym-thumbs{padding-bottom:7px;}

/* [0904 ②] 分隔線移到小標「下面」(原本是 .ym-block 區塊底線，落在下一個小標上方) */
.ym-block{border-bottom:none;}
.ym-h{padding-bottom:8px;border-bottom:1px solid var(--ym-divider);margin-bottom:14px;}

/* [0904 縮圖卷軸調整] 灰卷軸改成像手機紅條：細(3px)+紅色；拿掉手機紅條(.ym-thumbs-progress)；縮圖與卷軸間距加大 */
.ym-thumbs{padding-bottom:14px;}
.ym-thumbs::-webkit-scrollbar{height:3px;}
.ym-thumbs::-webkit-scrollbar-track{background:var(--ym-divider);border-radius:2px;}
.ym-thumbs::-webkit-scrollbar-thumb{background:var(--ym-primary);border-radius:2px;}
.ym-thumbs-progress{display:none !important;}

/* [0904 優惠框上多一條灰線] 移除規格 accordion(.ym-acc) 的底線(疊在優惠框上緣) */
.ym-acc{border-bottom:none;}

/* [0904 立即購買維持紅底白字] 覆寫 disabled 淡化：立即購買一律同首頁紅色按鈕(紅底白字/ hover 深紅/可點) */
.ym-cta .ym-buy.is-disabled,.ym-cta .ym-buy:disabled{opacity:1;cursor:pointer;pointer-events:auto;background:var(--ym-primary);border-color:var(--ym-primary);color:#fff;}
.ym-cta .ym-buy.is-disabled:hover,.ym-cta .ym-buy:disabled:hover{background:#660000;}

/* [0904 縮圖滑條:桌機恢復+改灰] 移除 scrollbar-width(它讓 Chrome 用會自動隱藏的標準卷軸→桌機不見)；卷軸改灰參考 swatch #9b938c */
.ym-thumbs::-webkit-scrollbar{height:4px;}
.ym-thumbs::-webkit-scrollbar-track{background:var(--ym-divider);}
.ym-thumbs::-webkit-scrollbar-thumb{background:#9b938c;}

/* 商品介紹／商品規格／運送方式標題 */
#ckeditor h5.section-heading {
  font-size: 23px;
  line-height: 1.4;
}

/* [0904 庫存0→門市限定] 缺貨時隱藏購買鈕、改顯示滿版「門市限定 ｜ 了解更多」(JS 注入 #ym-instore-cta)；寬度=兩鈕總寬(滿版) */
.ym-instore-cta{display:none;align-items:center;justify-content:center;width:100%;box-sizing:border-box;height:52px;margin:0 0 14px;background:var(--ym-primary);border:1px solid var(--ym-primary);color:#fff;border-radius:6px;font-size:15px;letter-spacing:2px;text-decoration:none;font-family:inherit;cursor:pointer;transition:.15s;}
/* 字色鎖白：蓋掉商店全域 a:hover 變藍；in/out 各狀態一律白字 */
.ym-instore-cta,.ym-instore-cta:link,.ym-instore-cta:visited,.ym-instore-cta:hover,.ym-instore-cta:focus,.ym-instore-cta:active{color:#fff !important;text-decoration:none;}
.ym-instore-cta:hover{background:#660000;}
@media (max-width:768px){
  .ym-instore-cta,.ym-cta.is-in-store>.ym-store-only-cta{height:56px!important;min-height:56px;}
}
/* [0904 優惠活動框先隱藏] */
.ym-promo{display:none !important;}
/* Refs #155: copy review has its own content surface; native purchasing stays hidden. */
.yqm-content-review[hidden]{display:none!important;}
.yqm-content-review{max-width:1280px;margin:24px auto;padding:0 24px;}
.yqm-review-notice{padding:16px 20px;background:#f6f4ef;color:#4d463b;line-height:1.7;}
.yqm-review-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:40px;margin:32px 0;align-items:start;}
.yqm-review-main{width:100%;aspect-ratio:1;object-fit:contain;}
.yqm-review-thumbs{display:flex;gap:8px;overflow-x:auto;margin-top:12px;}
.yqm-review-thumbs button{flex:0 0 72px;padding:0;border:1px solid #ddd;background:transparent;cursor:pointer;}
.yqm-review-thumbs img{display:block;width:72px;height:72px;object-fit:cover;}
.yqm-review-title{font-size:28px;line-height:1.5;overflow-wrap:anywhere;}
.yqm-review-description{min-width:0;}
.yqm-review-description .desc_sections,
.yqm-review-description .add-to-cart-container,
.yqm-review-description #product-recommendation{display:none!important;}
@media(max-width:767px){
  .yqm-content-review{padding:0 16px;}
  .yqm-review-grid{grid-template-columns:minmax(0,1fr);gap:24px;}
  .yqm-review-title{font-size:24px;}
}
