/* X50 Shop：外觀全部沿用 X50Pay 前台 (style.css 的 glass / basicglass / shopsel / globalmenu / x50-sel-glow)，
   這裡只放商城自己的版面與桌面版 RWD。顏色一律用 Tocas token 與 --x50-accent，不自訂色。 */

body { overflow-y: scroll; overflow-x: hidden; max-width: 767px; margin: 0 auto; background: var(--ts-gray-50); }

/* ---- 上方工具列 (同 X50Pay：左邊 Logo / 返回圓鈕，右邊玻璃膠囊) ---- */
.ec-topbar { z-index: 100; position: fixed; top: 5px; width: 100%; max-width: 767px; padding: 5px 16px 8px 16px; }
.ec-topin { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.ec-logo { border-radius: 50px; padding: 2.5px 2px 1.5px 2.5px; display: inline-flex; }
.ec-logo .ts-avatar { width: 34px; height: 34px; border: 0; margin: 0; }
.ec-round { border-radius: 50px; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; color: var(--ts-gray-900); font-size: 17.5px; }
.ec-navgroup { display: flex; align-items: center; border-radius: 50px; padding: 5px 5px 4px 6px; gap: 6px; }
.ec-navtext { color: var(--ts-gray-900) !important; padding: 0 14px !important; height: 28px; gap: 6px; display: inline-flex !important; align-items: center; line-height: 1 !important; }
.ec-navtext b { color: var(--x50-accent); font-weight: 700; }
.ec-navico { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; color: var(--ts-gray-900); font-size: 18px; }
.ec-dnav { display: none; }

/* ---- 下方 Global Menu (同 X50Pay) ---- */
.ec-menubar { z-index: 99; position: fixed; width: 100%; max-width: 767px; bottom: 0; padding: 16px; }
.ec-menubar #globalmenu .item { color: inherit; text-decoration: none; }

.ec-main { padding-bottom: 110px; min-height: 100vh; }
.ec-pad { padding: 18px 20px; }
.ec-hero.is-short { height: 197px; }
.ec-hero .ts-blankslate .ts-icon { font-size: 2.2rem; }
.ec-filter { position: absolute !important; left: 12px; right: 12px; bottom: 18px; width: auto !important; }

/* ---- 商品格 ---- */
.ec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ec-card { display: block; overflow: hidden; color: inherit; text-decoration: none; margin: 0 !important; }
.ec-cimg { aspect-ratio: 1; overflow: hidden; border-radius: 1.1rem 1.1rem 0 0; }
.ec-cimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ec-soldout { position: absolute; right: 8px; bottom: 8px; }
.ec-cbody { padding: 8px 12px 12px; }
.ec-ctitle { font-size: .95rem; line-height: 1.4; min-height: 2.8em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ec-price { color: var(--x50-accent); font-weight: 700; margin-top: 2px; }
.ec-price.is-big { font-size: 1.4rem; }
.ec-card.is-hidden { display: none; }

/* ---- 商品頁 ---- */
.ec-phero { height: 300px; background-size: cover; background-position: center; display: flex; align-items: flex-end; }
.ec-phead { padding: 0 8px 4px; }
.ec-phead .header { font-size: 1.45rem; font-weight: 700; line-height: 1.3; }
.ec-dtitle { display: none; }
.ec-sec { padding: 16px 18px; margin-bottom: 14px; }
.ec-stitle { font-weight: 600; color: var(--ts-gray-700); margin-bottom: 8px; }
.ec-mt { margin-top: 14px; }
.ec-label { font-size: .85rem; color: var(--ts-gray-600); margin: 12px 0 6px; }
.ec-label:first-child { margin-top: 0; }
.ec-qty { display: flex; align-items: center; gap: .8rem; }
.ec-qty #qVal { min-width: 1.6rem; text-align: center; font-weight: 700; font-size: 1.15rem; }
.ec-stock { color: var(--ts-gray-600); font-size: .85rem; margin-left: auto; }
.ec-main-btn { margin-top: 16px; font-weight: 600; gap: .4rem; }
.ec-desc { white-space: pre-wrap; color: var(--ts-gray-700); line-height: 1.75; }
.ec-note { color: var(--ts-gray-600); font-size: .85rem; margin-top: 8px; }
.ec-toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); padding: 10px 20px; border-radius: 99rem !important; z-index: 120; white-space: nowrap; }

/* ---- 購物車 / 結帳 / 訂單 ---- */
.ec-empty { padding: 32px 18px; text-align: center; color: var(--ts-gray-600); }
.ec-line { display: grid; grid-template-columns: 72px 1fr auto; gap: 12px; align-items: center; padding: 10px; margin-bottom: 12px; }
.ec-line .ts-image img { width: 72px; height: 72px; object-fit: cover; border-radius: .9rem; display: block; }
.ec-line small, .ec-mrow small { display: block; color: var(--ts-gray-600); font-size: .8rem; }
.ec-line .r { text-align: right; }
.ec-lq { display: flex; gap: .45rem; align-items: center; justify-content: flex-end; margin-top: 6px; }
.ec-lq .ts-button { width: 28px; height: 28px; padding: 0 !important; font-size: 12px; }
.ec-row { display: flex; justify-content: space-between; align-items: baseline; padding: 3px 0; }
.ec-row span { color: var(--ts-gray-600); }
.ec-row.is-total { font-size: 1.1rem; border-top: 1px dashed var(--ts-gray-300); margin-top: 6px; padding-top: 8px; }
.ec-row.is-total b { color: var(--x50-accent); }
.ec-problems { color: var(--ts-negative-500); font-size: .85rem; }
.ec-mini { margin-bottom: 8px; }
.ec-mrow { display: grid; grid-template-columns: 40px 1fr auto auto; gap: 10px; align-items: center; padding: 5px 0; font-size: .92rem; }
.ec-mrow img { width: 40px; height: 40px; object-fit: cover; border-radius: .6rem; display: block; }
.ec-mrow em { font-style: normal; color: var(--ts-gray-600); }
.ec-fields { display: grid; gap: 10px; }
.ec-field label { display: block; font-size: .85rem; color: var(--ts-gray-600); margin-bottom: 4px; }
.ec-pay .item { display: flex; gap: .75rem; align-items: center; padding: 10px 6px; cursor: pointer; }
.ec-pay .item input { accent-color: var(--x50-accent); width: 18px; height: 18px; flex: none; }
.ec-pay .item .ts-icon { font-size: 1.15rem; color: var(--ts-gray-700); width: 1.4rem; text-align: center; }
.ec-pay .item b { display: block; font-weight: 600; }
.ec-pay .item small { display: block; color: var(--ts-gray-600); font-size: .8rem; }
.ec-pay .item.is-disabled { opacity: .45; cursor: default; }
.ec-code { text-align: center; }
.ec-cno { color: var(--ts-gray-600); font-size: .9rem; margin-bottom: 6px; }
.ec-qr { width: 200px; height: 200px; margin: 14px auto 6px; background: #fff; border-radius: 1.2rem; padding: 10px; }
.ec-qr img { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.ec-clabel { color: var(--ts-gray-600); font-size: .85rem; margin-top: 6px; }
.ec-cval { font-size: 2.4rem; font-weight: 800; letter-spacing: .35rem; line-height: 1.2; padding-left: .35rem; }
.ec-cancel { color: var(--ts-negative-500) !important; }
.ec-narrow { max-width: 520px; margin: 0 auto; }

/* ---- 平板 ---- */
@media (min-width: 600px) {
  body, .ec-topbar, .ec-menubar { max-width: none; }
  .ec-menubar { left: 0; display: flex; justify-content: center; }
  .ec-menubar .globalmenu { width: min(100%, 420px); }
  .ec-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ec-fields { grid-template-columns: 1fr 1fr; }
  .ec-field.is-wide { grid-column: 1 / -1; }
}

/* ---- 桌面版：上方導覽列取代 Global Menu；內容置中 1200px；商品頁 / 購物車 / 結帳兩欄 ---- */
@media (min-width: 1024px) {
  .ec-menubar { display: none; }
  .ec-topbar { left: 0; right: 0; top: 0; padding: 12px 24px; }
  .ec-topin { max-width: 1200px; margin: 0 auto; }
  .ec-dnav { display: flex; gap: 6px; margin-right: auto; margin-left: 10px; }
  .ec-dnav a { padding: 6px 16px; border-radius: 99rem; color: var(--ts-gray-800); text-decoration: none; font-weight: 500; }
  .ec-dnav a.is-active { background: color-mix(in srgb, var(--c-glass) 22%, transparent); color: var(--ts-gray-900); }
  .ec-dnav a:hover { background: color-mix(in srgb, var(--c-glass) 14%, transparent); }
  .ec-main { max-width: 1200px; margin: 0 auto; padding: 76px 24px 48px; }
  .ec-hero, .ec-phero { border-radius: 1.8rem !important; overflow: hidden; }
  .ec-hero { height: 300px; }
  .ec-hero.is-short { height: 180px; }
  .ec-filter { left: auto; right: 24px; width: 320px !important; }
  .ec-pad { padding: 24px 0; }
  .ec-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
  .ec-pwrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; align-items: start; padding-top: 8px; }
  .ec-pmedia { position: sticky; top: 84px; }
  .ec-phero { height: auto; aspect-ratio: 1; }
  .ec-phead { display: none; }
  .ec-pinfo { padding: 0; }
  .ec-dtitle { display: block; margin-bottom: 6px; }
  .ec-cols { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
  .ec-colside { position: sticky; top: 84px; }
  .ec-toast { bottom: 32px; }
}

/* 主視覺：官方全圖 lekafull (花凜-25情人節)；同 X50Pay 首頁的位置 */
.ec-hero { background-position: right 18% !important; background-size: cover; }
/* 內容區 (非圖片上) 的分段選擇：文字用系統色 (同 X50Pay 介面設定的 segmented) */
.ec-sec .ts-selection.glass .text { color: var(--ts-gray-900) !important; text-shadow: none !important; }
.ec-sec .ts-selection.glass input:disabled + .text { color: var(--ts-gray-500) !important; }
.ec-pay .item > div { line-height: 1.45; }
.ec-pay .item small { margin-top: 1px; }
@media (min-width: 1024px) { .ec-hero { background-position: center 40% !important; } }

/* ---- 首頁 Banner 輪播 (後台管理；沒有生效中的 Banner 時用上面的官方主視覺) ---- */
.ec-banner { padding: 0 !important; overflow: hidden; height: 320px; }
.ec-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease; pointer-events: none; color: #fff; text-decoration: none; display: block; }
.ec-slide.is-on { opacity: 1; pointer-events: auto; }
.ec-slide picture, .ec-slide img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ec-slide img { object-fit: cover; }
.ec-slide::after { content: ''; position: absolute; inset: 0; background: linear-gradient(360deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 55%); pointer-events: none; }
.ec-stext { position: absolute; left: 20px; right: 20px; bottom: 34px; z-index: 2; }
.ec-stext .header { font-size: 1.4rem; font-weight: 700; line-height: 1.3; }
.ec-sgo { margin-top: 8px; color: rgba(255,255,255,.92) !important; gap: .25rem; }
.ec-dots { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 7px; z-index: 3; }
.ec-dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 99rem; background: rgba(255,255,255,.55); cursor: pointer; transition: width .3s ease, background .3s ease; }
.ec-dots button.is-on { width: 20px; background: #fff; }
.ec-filterbar { padding-bottom: 0 !important; }
.ec-filterbar .ts-selection .text { color: var(--ts-gray-900) !important; text-shadow: none !important; }
@media (min-width: 1024px) {
  .ec-banner { height: 380px; }
  .ec-stext { left: 40px; bottom: 44px; max-width: 560px; }
  .ec-stext .header { font-size: 2rem; }
  .ec-filterbar { display: flex; justify-content: flex-end; padding-top: 20px !important; }
  .ec-filterbar .ts-selection { width: 320px; }
}
