/* 薇爾娜 Veirna — 化妝品演示站 */
:root {
  --bg: #fdf9f7;
  --surface: #ffffff;
  --ink: #3d2b2f;
  --ink-soft: #8a6f74;
  --primary: #c96f7e;
  --primary-dark: #a8505f;
  --accent: #f3e3e0;
  --border: #ead9d5;
  --success: #2e8b57;
  --error: #c0392b;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(61, 43, 47, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

/* ---------- 頂部導航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(253, 249, 247, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1120px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; gap: 24px;
}
.brand { font-size: 20px; font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: 1px; }
.brand span { font-size: 12px; color: var(--primary); font-weight: 600; letter-spacing: 3px; }
.nav-links { display: flex; gap: 20px; margin-left: auto; }
.nav-links a { color: var(--ink-soft); text-decoration: none; font-size: 14px; transition: color .2s; }
.nav-links a:hover { color: var(--primary); }
.header-actions { display: flex; gap: 8px; align-items: center; }

.icon-btn {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 12px; font-size: 16px;
  position: relative; transition: border-color .2s;
}
.icon-btn:hover { border-color: var(--primary); }
.cart-count {
  position: absolute; top: -6px; right: -6px;
  background: var(--primary); color: #fff;
  font-size: 11px; min-width: 18px; height: 18px; line-height: 18px;
  border-radius: 9px; text-align: center; padding: 0 4px;
}

/* ---------- Hero ---------- */
.hero {
  max-width: 1120px; margin: 0 auto; padding: 56px 20px 40px;
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 40px; align-items: center;
}
.hero-eyebrow { color: var(--primary); font-size: 13px; letter-spacing: 4px; margin-bottom: 12px; }
.hero h1 { font-size: 44px; line-height: 1.25; margin-bottom: 16px; }
.hero-sub { color: var(--ink-soft); margin-bottom: 28px; max-width: 420px; }
.hero-img img { border-radius: 20px; box-shadow: var(--shadow); }

/* ---------- 賣點 ---------- */
.perks {
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.perks { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 40px; padding: 16px 20px; }
.perk { font-size: 14px; color: var(--ink-soft); display: flex; align-items: center; gap: 8px; }
.perk span { color: var(--primary); font-weight: 700; }

/* ---------- 商品 ---------- */
.products, .story, .faq { max-width: 1120px; margin: 0 auto; padding: 64px 20px 0; }
.section-title { text-align: center; font-size: 28px; margin-bottom: 6px; }
.section-sub { text-align: center; color: var(--ink-soft); margin-bottom: 36px; }
.product-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px;
}
.product-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .25s, box-shadow .25s;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.product-card img { aspect-ratio: 1; object-fit: cover; }
.product-info { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-tag { font-size: 12px; color: var(--primary); letter-spacing: 2px; }
.product-name { font-size: 16px; font-weight: 600; }
.product-desc { font-size: 13px; color: var(--ink-soft); flex: 1; }
.product-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.product-price { font-size: 18px; font-weight: 700; color: var(--primary-dark); }
.add-btn {
  background: var(--primary); color: #fff; border: none;
  border-radius: 10px; padding: 8px 16px; font-size: 14px;
  transition: background .2s;
}
.add-btn:hover { background: var(--primary-dark); }

/* ---------- 品牌故事 / FAQ ---------- */
.story p { max-width: 640px; margin: 12px auto 0; text-align: center; color: var(--ink-soft); }
.faq-list { max-width: 680px; margin: 0 auto; display: grid; gap: 12px; }
.faq details {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
}
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { color: var(--ink-soft); margin-top: 8px; font-size: 14px; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 64px; padding: 24px 20px; text-align: center;
  border-top: 1px solid var(--border); color: var(--ink-soft); font-size: 13px;
}

/* ---------- 按鈕 ---------- */
.btn {
  display: inline-block; border: none; border-radius: 12px;
  padding: 12px 28px; font-size: 15px; font-weight: 600;
  text-decoration: none; text-align: center;
  transition: background .2s, transform .15s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { background: var(--border); cursor: not-allowed; }
.btn-secondary { background: var(--accent); color: var(--primary-dark); }
.btn-block { width: 100%; }

/* ---------- 購物車側欄 ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(61,43,47,.4);
  opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 90;
}
.overlay.show { opacity: 1; pointer-events: auto; }
.cart-drawer {
  position: fixed; top: 0; right: 0; height: 100dvh; width: min(400px, 92vw);
  background: var(--surface); z-index: 100;
  transform: translateX(100%); transition: transform .3s;
  display: flex; flex-direction: column; box-shadow: -8px 0 32px rgba(61,43,47,.12);
}
.cart-drawer.open { transform: translateX(0); }
.cart-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.cart-items { flex: 1; overflow-y: auto; padding: 12px 20px; }
.cart-empty { text-align: center; color: var(--ink-soft); padding: 48px 0; }
.cart-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.cart-item img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
.cart-item-info { flex: 1; }
.cart-item-name { font-size: 14px; font-weight: 600; }
.cart-item-price { font-size: 13px; color: var(--ink-soft); }
.qty-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.qty-btn {
  width: 26px; height: 26px; border: 1px solid var(--border); background: var(--surface);
  border-radius: 8px; font-size: 14px; line-height: 1;
}
.qty-num { min-width: 24px; text-align: center; font-size: 14px; }
.cart-item-remove { background: none; border: none; color: var(--ink-soft); font-size: 12px; text-decoration: underline; }
.cart-item-remove:hover { color: var(--error); }
.cart-foot { padding: 16px 20px 20px; border-top: 1px solid var(--border); display: grid; gap: 8px; }
.cart-total-row { display: flex; justify-content: space-between; font-size: 15px; }
.cart-total-row.muted { color: var(--ink-soft); font-size: 13px; }

/* ---------- 彈窗 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 110;
  display: none; align-items: center; justify-content: center; padding: 20px;
  background: rgba(61,43,47,.45);
}
.modal.show { display: flex; }
.modal-box {
  background: var(--surface); border-radius: 18px;
  width: min(480px, 100%); max-height: 88dvh; overflow-y: auto;
  padding: 28px; position: relative; box-shadow: var(--shadow);
}
.modal-close { position: absolute; top: 14px; right: 14px; }
.modal-box h3 { margin-bottom: 16px; font-size: 20px; }

.checkout-summary {
  background: var(--bg); border-radius: 12px; padding: 14px 16px;
  margin-bottom: 18px; font-size: 14px;
}
.checkout-summary .row { display: flex; justify-content: space-between; padding: 4px 0; }
.checkout-summary .row.total { border-top: 1px dashed var(--border); margin-top: 8px; padding-top: 10px; font-weight: 700; font-size: 16px; }

.paypal-hint { text-align: center; color: var(--ink-soft); font-size: 14px; display: grid; gap: 12px; justify-items: center; }
#paypal-buttons { min-height: 10px; }

.field { display: grid; gap: 6px; margin-bottom: 16px; font-size: 14px; }
.field input, .field select {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; font-size: 14px; font-family: inherit; background: var(--bg);
}
.field input:focus, .field select:focus { outline: 2px solid var(--accent); border-color: var(--primary); }
.settings-note { font-size: 13px; color: var(--ink-soft); margin-bottom: 16px; }

/* ---------- 結果彈窗 ---------- */
.result-box { text-align: center; display: grid; gap: 12px; justify-items: center; }
.result-icon { font-size: 44px; }
#result-detail { color: var(--ink-soft); font-size: 14px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 10px 22px; border-radius: 24px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
  z-index: 120;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 響應式 ---------- */
@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; padding-top: 32px; text-align: center; }
  .hero-sub { margin-inline: auto; }
  .hero h1 { font-size: 32px; }
  .nav-links { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- 商品卡链接 ---------- */
.product-card > a { display: block; }
.product-name a { color: inherit; text-decoration: none; }
.product-name a:hover { color: var(--primary); }
.product-card img { transition: transform .3s; }
.product-card:hover img { transform: scale(1.03); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
