/* ============================================================
   牛大仙 — 簡單藝廊 × 成熟電商
   乾淨、清楚、易讀、大量留白。荒謬感留給作品跟文案，不是 UI。
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Noto+Sans+TC:wght@400;500;700;900&display=swap');

:root{
  --bg:        #FAF8F5;   /* 暖白／米白 */
  --bg-alt:    #F2EFEA;
  --card:      #FFFFFF;
  --line:      #E6E1DA;
  --ink:       #1A1A1A;   /* 黑 */
  --ink-soft:  #4A4A4A;   /* 深灰 */
  --ink-faint: #8A8580;
  --accent:    #1A1A1A;   /* 主要強調色＝黑，不用花俏顏色 */
  --price:     #1A1A1A;
  --success:   #1E8E3E;
  --line-green:#06C755;

  --font-en:   'Inter', -apple-system, Helvetica, Arial, sans-serif;
  --font-tc:   'Noto Sans TC', 'PingFang TC', -apple-system, sans-serif;

  --container: 1120px;
  --gutter: 20px;
  --radius: 10px;
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:var(--font-tc);
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
}
img,video{ max-width:100%; display:block; }
a{ color:inherit; text-decoration:none; }
button{ font-family:inherit; cursor:pointer; }
ul{ margin:0; padding:0; list-style:none; }
h1,h2,h3{ margin:0; font-weight:700; }

.wrap{ max-width:var(--container); margin:0 auto; padding:0 var(--gutter); }

.eyebrow{
  font-family:var(--font-en); font-size:12px; font-weight:600;
  letter-spacing:.04em; text-transform:uppercase; color:var(--ink-faint);
  margin:0 0 6px;
}

/* ============================================================
   簡單動畫：只用 fade-in / slide-up，不要花俏
   ============================================================ */
.reveal{ opacity:1; transform:none; transition:opacity .5s ease, transform .5s ease; }
.js-ready .reveal{ opacity:0; transform:translateY(14px); }
.js-ready .reveal.in{ opacity:1; transform:none; }
@media (prefers-reduced-motion: reduce){
  .reveal, .js-ready .reveal{ opacity:1 !important; transform:none !important; transition:none !important; }
}

/* ============================================================
   Header
   ============================================================ */
.site-header{
  position:sticky; top:0; z-index:50;
  background:rgba(250,248,245,.96);
  backdrop-filter:blur(8px);
  border-bottom:1px solid var(--line);
}
.nav{
  height:58px;
  display:grid; grid-template-columns:44px 1fr 44px;
  align-items:center;
}
.nav-hamb{
  width:44px; height:44px; display:flex; align-items:center; justify-content:center;
  background:none; border:0; justify-self:start;
}
.nav-hamb span, .nav-hamb span::before, .nav-hamb span::after{
  content:''; display:block; width:19px; height:2px; background:var(--ink); position:relative;
}
.nav-hamb span::before{ position:absolute; top:-6px; left:0; }
.nav-hamb span::after{ position:absolute; top:6px; left:0; }
.nav-brand{ justify-self:center; display:flex; align-items:center; gap:8px; }
.nav-brand .avatar{ width:26px; height:26px; border-radius:50%; background:var(--bg-alt); border:1px solid var(--line); overflow:hidden; }
.nav-brand .avatar img{ width:100%; height:100%; object-fit:cover; }
.nav-brand .name{ font-weight:700; font-size:16px; }
.nav-cart{ justify-self:end; width:44px; height:44px; display:flex; align-items:center; justify-content:center; position:relative; }
.nav-cart svg{ width:21px; height:21px; }
.nav-cart .count{
  position:absolute; top:6px; right:5px; min-width:15px; height:15px; padding:0 3px;
  border-radius:8px; background:var(--ink); color:#fff;
  font-family:var(--font-en); font-size:9px; line-height:15px; text-align:center;
}
.desktop-links{ display:none; }
@media(min-width:860px){
  .nav{ grid-template-columns:auto 1fr auto; height:64px; }
  .nav-hamb{ display:none; }
  .nav-brand{ justify-self:start; }
  .desktop-links{ display:flex; gap:28px; justify-self:center; font-size:14px; font-weight:500; }
  .desktop-links a{ opacity:.75; }
  .desktop-links a:hover{ opacity:1; }
  .nav-cart{ justify-self:end; }
}

.mobile-menu{
  position:fixed; top:58px; left:0; right:0; bottom:0; z-index:59;
  background:var(--bg); display:none; flex-direction:column; padding:6px var(--gutter) 40px; overflow-y:auto;
}
.mobile-menu.open{ display:flex; }
.mobile-menu a{ font-size:17px; font-weight:600; padding:16px 4px; border-bottom:1px solid var(--line); }

/* ============================================================
   LINE 浮動按鈕 + 彈出視窗
   ============================================================ */
.line-fab{
  position:fixed; right:18px; bottom:18px; z-index:70;
  width:54px; height:54px; border-radius:50%;
  background:var(--line-green); color:#fff;
  display:flex; align-items:center; justify-content:center;
  border:0; box-shadow:0 6px 18px rgba(0,0,0,.18);
}
.line-fab svg{ width:26px; height:26px; }

.line-popover-backdrop{
  position:fixed; inset:0; background:rgba(20,20,20,.4); z-index:80;
  display:none;
}
.line-popover-backdrop.open{ display:block; }
.line-popover{
  position:fixed; z-index:81;
  right:16px; bottom:16px; left:16px;
  max-width:340px; margin-left:auto;
  background:var(--card); border-radius:16px; padding:24px 22px;
  box-shadow:0 12px 40px rgba(0,0,0,.2);
  display:none;
}
.line-popover.open{ display:block; }
.line-popover h3{ font-size:17px; margin:0 0 8px; }
.line-popover p{ font-size:14px; color:var(--ink-soft); margin:0 0 18px; line-height:1.7; }
.line-popover .line-btn{ width:100%; }
.line-popover .close{
  position:absolute; top:14px; right:14px; width:28px; height:28px;
  border:0; background:none; font-size:18px; color:var(--ink-faint);
}
.line-popover{ position:fixed; }
@media(min-width:480px){
  .line-popover{ right:22px; bottom:86px; left:auto; width:320px; }
}

.line-btn{
  display:flex; align-items:center; justify-content:center; gap:8px;
  background:var(--line-green); color:#fff; border:0; border-radius:8px;
  padding:14px 20px; font-weight:700; font-size:15px;
}
.line-btn svg{ width:19px; height:19px; }

/* ============================================================
   Buttons
   ============================================================ */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  background:var(--ink); color:#fff; border:0; border-radius:8px;
  padding:15px 26px; font-size:15px; font-weight:600;
}
.btn:hover{ opacity:.88; }
.btn-outline{ background:transparent; color:var(--ink); border:1.5px solid var(--ink); }
.btn-block{ width:100%; box-sizing:border-box; }
.btn:disabled{ opacity:.4; cursor:not-allowed; }

/* ============================================================
   Section rhythm
   ============================================================ */
.section{ padding:44px 0; }
.section.alt{ background:var(--bg-alt); }
.section-title{ font-size:22px; margin:0 0 4px; }
.section-sub{ font-size:14px; color:var(--ink-soft); margin:0 0 24px; }

/* ============================================================
   Homepage Product Cards
   ============================================================ */
.product-grid{ display:flex; flex-direction:column; gap:20px; }
.product-card{
  background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
  overflow:hidden;
}
.product-card .ph{
  aspect-ratio:4/3; background:var(--bg-alt); display:flex; align-items:center; justify-content:center;
  border-bottom:1px solid var(--line);
}
.product-card .ph span{ font-size:13px; color:var(--ink-faint); text-align:center; padding:0 20px; }
.product-card .pc-body{ padding:20px; }
.product-card .pc-name{ font-size:19px; margin:0 0 6px; }
.product-card .pc-price{ font-family:var(--font-en); font-size:17px; font-weight:700; margin:0 0 10px; }
.product-card .pc-price .from{ font-size:12px; font-weight:500; color:var(--ink-soft); }
.product-card .pc-desc{ font-size:14px; color:var(--ink-soft); margin:0 0 18px; line-height:1.75; }

@media(min-width:760px){
  .product-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:20px; }
}

/* ============================================================
   Placeholder frame（一律用於未提供正式素材的地方）
   ============================================================ */
.ph-frame{
  background:var(--bg-alt); border:1px dashed var(--line);
  display:flex; align-items:center; justify-content:center; text-align:center;
  color:var(--ink-faint); font-size:13px; padding:12px;
}

/* ============================================================
   Carousel（圖片／影片皆適用）
   ============================================================ */
.carousel{
  display:flex; overflow-x:auto; scroll-snap-type:x mandatory;
  -webkit-overflow-scrolling:touch; scrollbar-width:none; gap:0;
}
.carousel::-webkit-scrollbar{ display:none; }
.carousel .slide{
  flex:0 0 100%; scroll-snap-align:start; aspect-ratio:4/3;
  background:var(--bg-alt); display:flex; align-items:center; justify-content:center;
}
.carousel .slide span{ font-size:13px; color:var(--ink-faint); text-align:center; padding:0 24px; }
.carousel-dots{ display:flex; justify-content:center; gap:7px; margin-top:12px; }
.carousel-dots button{ width:7px; height:7px; border-radius:50%; border:0; background:var(--line); padding:0; }
.carousel-dots button.on{ background:var(--ink); }

/* ============================================================
   Product Detail 共用
   ============================================================ */
.pd-body{ padding:22px var(--gutter) 60px; max-width:640px; margin:0 auto; }
@media(min-width:860px){
  .pd-layout{ max-width:var(--container); margin:0 auto; padding:0 var(--gutter) 60px; display:grid; grid-template-columns:1.1fr 1fr; gap:48px; }
  .pd-layout .pd-carousel-col{}
  .pd-layout .pd-body{ padding:22px 0 0; max-width:none; }
}
.pd-name{ font-size:24px; margin:10px 0 6px; }
.pd-price{ font-family:var(--font-en); font-size:22px; font-weight:700; margin:0 0 4px; }
.pd-price .unit{ font-size:13px; color:var(--ink-soft); font-weight:500; margin-left:6px; }
.pd-desc{ font-size:14.5px; color:var(--ink-soft); line-height:1.8; margin:10px 0 20px; }

.pd-features{ margin:0 0 24px; padding:0; }
.pd-features li{
  display:flex; gap:10px; align-items:flex-start; font-size:14px; color:var(--ink-soft);
  padding:8px 0; border-top:1px solid var(--line);
}
.pd-features li:last-child{ border-bottom:1px solid var(--line); }
.pd-features li::before{ content:'✓'; color:var(--ink); font-weight:700; flex:0 0 auto; }

.field{ margin-bottom:20px; }
.field label{ display:block; font-size:13.5px; font-weight:600; margin-bottom:8px; }
.field .hint{ font-size:12.5px; color:var(--ink-faint); margin-top:6px; line-height:1.7; }
.field input[type=text], .field input[type=tel], .field input[type=date], .field textarea, .field select{
  width:100%; border:1px solid var(--line); border-radius:8px; background:var(--card);
  padding:12px 14px; font-family:inherit; font-size:15px; color:var(--ink);
}
.field textarea{ min-height:96px; resize:vertical; }
.field input:focus, .field textarea:focus, .field select:focus{ outline:2px solid var(--ink); outline-offset:1px; }
.req{ color:#B23A2E; }

.upload-box{
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px;
  width:100%; box-sizing:border-box; border:1.5px dashed var(--line); border-radius:10px;
  padding:28px 16px; text-align:center; position:relative; background:var(--bg-alt);
}
.upload-box input{ position:absolute; inset:0; opacity:0; cursor:pointer; }
.upload-box b{ font-size:14px; }
.upload-box span.sub{ font-size:12.5px; color:var(--ink-faint); }
.upload-preview-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:10px; }
.upload-preview-grid .thumb{ aspect-ratio:1/1; border-radius:8px; overflow:hidden; border:1px solid var(--line); position:relative; }
.upload-preview-grid .thumb img{ width:100%; height:100%; object-fit:cover; }
.upload-preview-grid .thumb .rm{
  position:absolute; top:4px; right:4px; width:20px; height:20px; border-radius:50%;
  background:rgba(0,0,0,.55); color:#fff; border:0; font-size:12px; line-height:20px;
}

/* 尺寸選擇卡片（大型空間客製） */
.size-options{ display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-bottom:14px; }
.size-card{
  border:1.5px solid var(--line); border-radius:10px; padding:14px 10px; text-align:center;
  background:var(--card); cursor:pointer;
}
.size-card.sel{ border-color:var(--ink); background:var(--bg-alt); }
.size-card .sc-name{ font-weight:700; font-size:15px; margin-bottom:3px; }
.size-card .sc-dim{ font-size:11.5px; color:var(--ink-soft); margin-bottom:6px; }
.size-card .sc-price{ font-family:var(--font-en); font-size:12.5px; font-weight:600; }

.info-block{ border-top:1px solid var(--line); padding:16px 0; }
.info-block .k{ font-size:13px; font-weight:700; color:var(--ink-soft); margin-bottom:2px; }
.info-block .v{ font-size:14.5px; }

/* ============================================================
   成功彈窗
   ============================================================ */
.success-overlay{
  position:fixed; inset:0; background:rgba(20,20,20,.42); z-index:90;
  display:none; align-items:flex-end; justify-content:center;
}
.success-overlay.open{ display:flex; }
@media(min-width:600px){ .success-overlay{ align-items:center; } }
.success-modal{
  background:var(--card); width:100%; max-width:400px; border-radius:20px 20px 0 0;
  padding:30px 26px 26px; text-align:center;
}
@media(min-width:600px){ .success-modal{ border-radius:18px; } }
.success-modal .check{
  width:56px; height:56px; border-radius:50%; background:#E8F5EA; color:var(--success);
  display:flex; align-items:center; justify-content:center; margin:0 auto 16px; font-size:28px;
}
.success-modal h3{ font-size:18px; margin:0 0 6px; }
.success-modal p{ font-size:14px; color:var(--ink-soft); margin:0 0 18px; }
.success-modal .cross-sell{ display:flex; gap:10px; margin-bottom:18px; }
.success-modal .cross-sell a{
  flex:1; border:1px solid var(--line); border-radius:10px; padding:10px; font-size:12.5px; text-align:center;
}
.success-modal .actions{ display:flex; gap:10px; }
.success-modal .actions .btn{ flex:1; }

/* ============================================================
   推薦商品（你可能也會喜歡）
   ============================================================ */
.rec-track{ display:flex; gap:14px; overflow-x:auto; scrollbar-width:none; padding-bottom:4px; }
.rec-track::-webkit-scrollbar{ display:none; }
.rec-card{ flex:0 0 66vw; max-width:240px; border:1px solid var(--line); border-radius:10px; overflow:hidden; background:var(--card); }
@media(min-width:640px){ .rec-card{ flex-basis:240px; } }
.rec-card .ph{ aspect-ratio:4/3; background:var(--bg-alt); display:flex; align-items:center; justify-content:center; }
.rec-card .ph span{ font-size:11.5px; color:var(--ink-faint); text-align:center; padding:0 10px; }
.rec-card .rc-body{ padding:12px 14px; }
.rec-card .rc-name{ font-size:14px; font-weight:700; margin:0 0 3px; }
.rec-card .rc-price{ font-family:var(--font-en); font-size:12.5px; color:var(--ink-soft); }

/* ============================================================
   Cart + Checkout（單頁流程，避免跨頁導覽遺失狀態）
   ============================================================ */
.cart-page{ max-width:560px; margin:0 auto; padding:20px var(--gutter) 70px; }
.cart-item{ display:flex; gap:12px; padding:16px 0; border-bottom:1px solid var(--line); align-items:center; }
.cart-item .thumb{ width:66px; height:66px; flex:0 0 auto; border-radius:8px; background:var(--bg-alt); border:1px solid var(--line); display:flex;align-items:center;justify-content:center; }
.cart-item .thumb span{ font-size:9px; color:var(--ink-faint); text-align:center; }
.cart-item .ci-info{ flex:1; min-width:0; }
.cart-item .ci-name{ font-size:14.5px; font-weight:600; margin:0 0 2px; }
.cart-item .ci-meta{ font-size:12.5px; color:var(--ink-soft); }
.cart-item .ci-price{ font-family:var(--font-en); font-weight:700; font-size:14px; white-space:nowrap; }

.cart-summary{ margin-top:18px; padding-top:14px; border-top:1px solid var(--line); }
.cart-summary .row{ display:flex; justify-content:space-between; font-size:14px; padding:6px 0; color:var(--ink-soft); }
.cart-summary .row .free{ color:var(--success); font-weight:600; }
.cart-summary .row.total{ font-size:18px; color:var(--ink); font-weight:700; padding-top:12px; border-top:1px solid var(--line); margin-top:6px; }

.checkout-progress{ display:flex; gap:6px; margin:0 0 26px; }
.checkout-progress i{ flex:1; height:3px; border-radius:2px; background:var(--line); }
.checkout-progress i.active, .checkout-progress i.done{ background:var(--ink); }
.checkout-step{ display:none; }
.checkout-step.active{ display:block; }

.pay-options{ display:flex; flex-direction:column; gap:10px; }
.pay-option{ display:flex; align-items:center; gap:12px; border:1.5px solid var(--line); border-radius:10px; padding:14px; cursor:pointer; }
.pay-option.sel{ border-color:var(--ink); background:var(--bg-alt); }
.pay-option input{ margin:0; }
.pay-option .label{ font-size:14.5px; font-weight:600; }

.order-complete{ text-align:center; padding:30px 0; }
.order-complete .check{ width:60px; height:60px; border-radius:50%; background:#E8F5EA; color:var(--success); display:flex; align-items:center; justify-content:center; margin:0 auto 18px; font-size:30px; }
.order-complete h2{ font-size:22px; margin:0 0 10px; }
.order-complete .order-no{ font-family:var(--font-en); font-size:15px; font-weight:700; margin:0 0 20px; color:var(--ink-soft); }
.order-complete p{ font-size:14.5px; color:var(--ink-soft); margin:0 0 22px; }

.form-actions{ display:flex; gap:10px; margin-top:26px; }
.form-actions .back{ flex:0 0 auto; background:none; border:0; color:var(--ink-soft); font-size:14px; padding:15px 4px; }
.form-actions .btn{ flex:1; }

.sr-only{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }

/* ============================================================
   LINE 預填訊息區塊（Prototype）：顯示要傳的訊息文字＋複製按鈕，
   當作「LINE 深層連結預填」不保證成功時的保底方案。
   ============================================================ */
.line-msg-box{
  background:var(--bg-alt); border-radius:10px; padding:14px; margin:0 0 16px; text-align:left;
}
.line-msg-box .lmb-label{ font-size:11.5px; color:var(--ink-faint); margin:0 0 6px; }
.line-msg-box .lmb-text{ font-size:13.5px; margin:0 0 10px; line-height:1.6; }
.line-msg-box .lmb-copy{
  width:100%; box-sizing:border-box; padding:9px; font-size:12.5px;
  background:transparent; border:1px solid var(--line); border-radius:8px; color:var(--ink-soft);
}
.line-msg-box .lmb-copy.copied{ border-color:var(--success); color:var(--success); }
