/* =============================================
   paperdoll.css — 樂活眼鏡 客製眼鏡體驗
   --------------------------------------------
   依賴: lohas-tokens.css → lohas-base.css → lohas-components.css
   版本: v1.0 | 2026-06-29
   ============================================= */

/* ── 頁面容器 ── */
#pd-app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 90px 20px 80px; /* 90px 讓開 fixed header */
}

/* ── 品牌標語列 ── */
.pd-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 0;
}
.pd-brand-tagline {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

/* ── 步驟列 ── */
.pd-stepbar {
  display: flex;
  align-items: center;
  padding: 24px 0 28px;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 0;
}
.pd-stepbar::-webkit-scrollbar { display: none; }

.pd-step {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  cursor: pointer;
}
.pd-step-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  border: 1.5px solid var(--lohas-bd);
  background: #fff;
  color: var(--text-muted);
  transition: all .2s;
  flex-shrink: 0;
}
.pd-step-label {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  transition: all .2s;
}
.pd-step.done .pd-step-dot   { background: var(--lohas-brand); border-color: var(--lohas-brand); color: #fff; }
.pd-step.done .pd-step-label { color: var(--lohas-brand); }
.pd-step.active .pd-step-dot { background: var(--warn); border-color: var(--warn); color: #fff; }
.pd-step.active .pd-step-label { color: var(--text-main); font-weight: 500; }
.pd-step-arrow {
  width: 22px; height: 1px;
  background: var(--lohas-bd);
  flex-shrink: 0;
  margin: 0 2px;
}

/* ── 共用 Panel ── */
.pd-panel {
  background: #fff;
  border: 1px solid var(--lohas-bd);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.pd-panel-hd {
  padding: 22px 28px 18px;
  border-bottom: 1px solid var(--lohas-bd);
}
.pd-eyebrow {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--warn);
  font-weight: 700;
  margin-bottom: 5px;
}
.pd-panel-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--lohas-brand);
  margin-bottom: 4px;
}
.pd-panel-sub {
  font-size: 13px;
  color: var(--text-muted);
}
.pd-panel-body { padding: 24px 28px; }

/* ── 導航列 ── */
.pd-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  margin-top: 20px;
  border-top: 1px solid var(--lohas-bd);
}

/* ── 通用 Badge ── */
.pd-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  line-height: 1.5;
  letter-spacing: 0.5px;
}
.pd-badge-brand { background: var(--lohas-brand); color: #fff; }
.pd-badge-warn  { background: var(--warn);         color: #fff; }
.pd-badge-ok    { background: var(--ok);            color: #fff; }

/* ── 篩選 Chips ── */
.pd-filter-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.pd-chip {
  padding: 5px 14px;
  border-radius: var(--r-pill);
  font-size: 12px;
  border: 1px solid var(--lohas-bd);
  color: var(--text-sub);
  cursor: pointer;
  background: #fff;
  transition: all .18s;
  font-family: inherit;
}
.pd-chip:hover  { border-color: var(--warn); color: var(--lohas-brand); }
.pd-chip.active { background: var(--lohas-brand); color: #fff; border-color: var(--lohas-brand); }

/* ── 選項計數 ── */
.pd-count-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-soft);
  border-radius: var(--r-pill);
  padding: 4px 14px;
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 18px;
}
.pd-count-pill b { color: var(--lohas-brand); }

/* ============================================================
   STEP 1 — 問卷
   ============================================================ */
.pd-quiz-wrap {
  max-width: 620px;
  margin: 0 auto;
  padding: 52px 0;
}
.pd-quiz-progress {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 36px;
}
.pd-quiz-progress span {
  width: 36px; height: 3px;
  border-radius: 2px;
  background: var(--lohas-bd);
  transition: background .3s;
}
.pd-quiz-progress span.done { background: var(--warn); }

.pd-quiz-q {
  font-size: 22px;
  font-weight: 700;
  color: var(--lohas-brand);
  margin-bottom: 36px;
  line-height: 1.4;
  text-align: center;
}
.pd-quiz-opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.pd-quiz-opt {
  background: var(--bg-warm);
  border: 1.5px solid var(--lohas-bd);
  border-radius: var(--r-md);
  padding: 22px 16px;
  cursor: pointer;
  text-align: center;
  transition: all .18s;
  font-family: inherit;
}
.pd-quiz-opt:hover   { border-color: var(--warn); background: #fffaf3; }
.pd-quiz-opt.sel     { border-color: var(--lohas-brand); background: #fdf7f0; }
.pd-quiz-opt .oe     { font-size: 34px; display: block; margin-bottom: 10px; }
.pd-quiz-opt .ol     { font-size: 14px; font-weight: 500; color: var(--text-main); }
.pd-quiz-opt .od     { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ============================================================
   STEP 2 — 鏡框
   ============================================================ */
.pd-frames-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: start;
}
.pd-frame-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.pd-frame-card {
  background: var(--bg-warm);
  border: 1.5px solid var(--lohas-bd);
  border-radius: var(--r-md);
  padding: 16px;
  cursor: pointer;
  transition: all .18s;
  position: relative;
}
.pd-frame-card:hover  { border-color: var(--warn); }
.pd-frame-card.active { border-color: var(--lohas-brand); background: #fdf7f0; }
.pd-frame-card.rec::before {
  content: '為你推薦';
  position: absolute; top: 9px; right: 9px;
  background: var(--warn); color: #fff;
  font-size: 9px; font-weight: 700;
  padding: 2px 7px; border-radius: 3px;
}
.pd-frame-img {
  height: 70px;
  background: #fff;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 38px;
  margin-bottom: 11px;
  border: 1px solid var(--lohas-bd);
}
.pd-frame-name  { font-size: 13px; font-weight: 700; color: var(--text-main); margin-bottom: 4px; }
.pd-frame-quote { font-size: 11px; color: var(--text-sub); line-height: 1.6; margin-bottom: 7px; font-style: italic; }
.pd-frame-price { font-size: 13px; color: var(--warn); font-weight: 700; }

/* 側邊預覽 */
.pd-side-preview {
  background: var(--bg-soft);
  border: 1px solid var(--lohas-bd);
  border-radius: var(--r-md);
  padding: 24px 20px;
  text-align: center;
  position: sticky;
  top: 90px;
}
.pd-side-preview .sp-icon { font-size: 68px; display: block; margin-bottom: 12px; transition: transform .4s cubic-bezier(.34,1.56,.64,1); }
.pd-side-preview .sp-name { font-size: 14px; font-weight: 700; color: var(--lohas-brand); }
.pd-side-preview .sp-sub  { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.pd-side-preview .sp-price{ font-size: 15px; color: var(--warn); font-weight: 700; margin-top: 8px; }

/* ============================================================
   STEP 3 — 刻圖
   ============================================================ */
.pd-eng-layout {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 24px;
  align-items: start;
}
.pd-eng-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.pd-eng-card {
  background: var(--bg-warm);
  border: 1.5px solid var(--lohas-bd);
  border-radius: var(--r-md);
  padding: 14px 10px;
  cursor: pointer;
  transition: all .18s;
  text-align: center;
  position: relative;
}
.pd-eng-card:hover  { border-color: var(--warn); }
.pd-eng-card.active { border-color: var(--lohas-brand); background: #fdf7f0; }
.pd-eng-card .ec-icon   { font-size: 30px; display: block; margin-bottom: 7px; }
.pd-eng-card .ec-name   { font-size: 11px; font-weight: 700; color: var(--text-main); margin-bottom: 2px; }
.pd-eng-card .ec-author { font-size: 10px; color: var(--text-muted); }
.pd-eng-card .ec-price  { font-size: 11px; color: var(--warn); font-weight: 700; margin-top: 5px; }

.pd-eng-story {
  background: var(--bg-soft);
  border: 1px solid var(--lohas-bd);
  border-radius: var(--r-md);
  padding: 18px;
  position: sticky;
  top: 90px;
}
.pd-eng-story .es-title  { font-size: 14px; font-weight: 700; color: var(--lohas-brand); margin-bottom: 4px; }
.pd-eng-story .es-city   { font-size: 10px; color: var(--warn); margin-bottom: 12px; letter-spacing: 1px; }
.pd-eng-story .es-text   { font-size: 12px; color: var(--text-sub); line-height: 1.9; }
.pd-eng-story .es-count  { font-size: 11px; color: var(--text-muted); margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--lohas-bd); }
.pd-eng-collect {
  font-size: 11px;
  background: var(--warn-bg);
  border: 1px solid #e8d4a0;
  border-radius: var(--r-sm);
  padding: 9px 12px;
  margin-top: 12px;
  color: var(--lohas-brand);
  line-height: 1.7;
}

/* ============================================================
   STEP 4 — 細節微調
   ============================================================ */
.pd-detail-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 24px;
}
.pd-detail-group { margin-bottom: 26px; }
.pd-detail-lbl   { font-size: 12px; font-weight: 700; color: var(--lohas-brand); margin-bottom: 11px; }

.pd-color-row { display: flex; gap: 10px; flex-wrap: wrap; }
.pd-color-swatch {
  width: 34px; height: 34px;
  border-radius: 50%;
  cursor: pointer;
  border: 2.5px solid transparent;
  transition: all .18s;
  position: relative;
}
.pd-color-swatch.active    { border-color: var(--lohas-brand); }
.pd-color-swatch .sw-tip {
  position: absolute; top: 40px; left: 50%; transform: translateX(-50%);
  font-size: 9px; color: var(--text-muted); white-space: nowrap;
  background: #fff; border: 1px solid var(--lohas-bd);
  border-radius: 3px; padding: 1px 5px;
  opacity: 0; pointer-events: none;
  transition: opacity .15s;
}
.pd-color-swatch:hover .sw-tip { opacity: 1; }

.pd-radio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pd-radio-opt {
  padding: 6px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--lohas-bd);
  font-size: 12px;
  cursor: pointer;
  background: var(--bg-warm);
  color: var(--text-sub);
  transition: all .18s;
  font-family: inherit;
}
.pd-radio-opt.active { background: var(--lohas-brand); color: #fff; border-color: var(--lohas-brand); }
.pd-radio-opt:hover:not(.active) { border-color: var(--warn); }

.pd-txt-input {
  width: 100%;
  max-width: 320px;
  border: 1px solid var(--lohas-bd);
  border-radius: var(--r-sm);
  padding: 9px 14px;
  font-size: 13px;
  font-family: inherit;
  background: var(--bg-warm);
  color: var(--text-main);
  transition: border-color .18s;
}
.pd-txt-input:focus { outline: none; border-color: var(--lohas-brand); background: #fff; }

/* ============================================================
   STEP 5 — 命名
   ============================================================ */
.pd-naming-wrap {
  max-width: 540px;
  margin: 0 auto;
  padding: 52px 0;
  text-align: center;
}
.pd-naming-q   { font-size: 24px; font-weight: 700; color: var(--lohas-brand); margin-bottom: 6px; }
.pd-naming-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 36px; }
.pd-naming-input {
  width: 100%;
  border: none;
  border-bottom: 2px solid var(--lohas-bd);
  border-radius: 0;
  padding: 12px 4px;
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  background: transparent;
  color: var(--lohas-brand);
  font-family: var(--font-tc);
  transition: border-color .2s;
}
.pd-naming-input:focus { outline: none; border-bottom-color: var(--warn); }
.pd-naming-input::placeholder { color: var(--lohas-bd); font-weight: 400; }

.pd-naming-hints {
  margin-top: 22px;
  display: flex; gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.pd-naming-hint {
  font-size: 11px; padding: 4px 13px;
  border: 1px solid var(--lohas-bd);
  border-radius: var(--r-pill);
  cursor: pointer;
  color: var(--text-sub);
  background: #fff;
  transition: all .18s;
  font-family: inherit;
}
.pd-naming-hint:hover { border-color: var(--warn); color: var(--lohas-brand); }

.pd-naming-preview {
  margin-top: 32px;
  background: var(--bg-soft);
  border-radius: var(--r-md);
  padding: 18px;
}
.pd-naming-preview .np-name {
  font-size: 22px; font-weight: 700;
  color: var(--lohas-brand); margin-bottom: 5px;
}
.pd-naming-preview .np-detail {
  font-size: 12px; color: var(--text-muted);
}

/* ============================================================
   STEP 6 — 配件 Flat Lay
   ============================================================ */
.pd-acc-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 600px;
}

/* 左側 */
.pd-fl-side {
  background: #F2EDE6;
  padding: 22px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--lohas-bd);
}
.pd-fl-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}
.pd-fl-meta-lbl  { font-size: 10px; color: var(--text-muted); letter-spacing: 1px; }
.pd-fl-meta-name { font-size: 15px; font-weight: 700; color: var(--lohas-brand); margin-top: 3px; }
.pd-total-pill {
  background: var(--lohas-brand); color: #fff;
  font-size: 13px; font-weight: 700;
  padding: 5px 15px;
  border-radius: var(--r-pill);
  transition: all .2s;
}

/* Flat Lay 舞台 */
.pd-fl-stage {
  flex: 1;
  position: relative;
  background: #EDE8E0;
  border-radius: var(--r-md);
  overflow: hidden;
  min-height: 280px;
}
.pd-fl-hint {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  font-size: 12px; color: #b0a090; line-height: 2;
  pointer-events: none;
  transition: opacity .3s;
}
.pd-fl-glasses {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}
.pd-fl-glasses .flg-icon { font-size: 54px; display: block; }
.pd-fl-glasses .flg-name { font-size: 10px; color: var(--text-muted); margin-top: 5px; }

/* 四角配件 */
.pd-fl-item {
  position: absolute;
  opacity: 0;
  transform: scale(.55) translateY(-18px);
  transition: all .42s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
}
.pd-fl-item.show { opacity: 1; transform: scale(1) translateY(0); }
.pd-fl-item.tl { top: 9%;  left:  6%; }
.pd-fl-item.tr { top: 9%;  right: 6%; }
.pd-fl-item.bl { bottom: 9%; left:  6%; }
.pd-fl-item.br { bottom: 9%; right: 6%; }

.pd-fl-obj {
  background: #fff;
  border-radius: var(--r-sm);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 8px;
}
.pd-fl-obj .fo-em  { font-size: 26px; line-height: 1; }
.pd-fl-obj .fo-lbl {
  font-size: 9px; color: var(--text-muted);
  margin-top: 4px; text-align: center;
  max-width: 66px; line-height: 1.35;
}

/* 底部清單 */
.pd-fl-list {
  margin-top: 14px;
  display: flex; flex-direction: column; gap: 5px;
  max-height: 160px; overflow-y: auto;
}
.pd-fl-list::-webkit-scrollbar { width: 3px; }
.pd-fl-list::-webkit-scrollbar-thumb { background: var(--lohas-bd); border-radius: 2px; }
.pd-fl-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  background: rgba(255,255,255,.65);
  border-radius: 6px;
}
.pd-fl-row-icon  { font-size: 15px; width: 22px; text-align: center; }
.pd-fl-row-info  { flex: 1; }
.pd-fl-row-name  { font-size: 11px; font-weight: 500; color: var(--text-main); }
.pd-fl-row-cat   { font-size: 10px; color: var(--text-muted); }
.pd-fl-row-price { font-size: 11px; color: var(--warn); font-weight: 700; }
.pd-fl-row-rm    { font-size: 13px; color: var(--lohas-light); cursor: pointer; padding: 0 3px; }
.pd-fl-row-rm:hover { color: var(--err); }

/* 右側 */
.pd-acc-right {
  display: flex; flex-direction: column;
  background: #fff;
}
.pd-acc-tabs {
  display: flex;
  border-bottom: 1px solid var(--lohas-bd);
  padding: 0 16px;
}
.pd-acc-tab {
  padding: 11px 12px;
  font-size: 12px; cursor: pointer;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: all .18s;
  font-family: inherit;
  background: none; border-top: none; border-left: none; border-right: none;
}
.pd-acc-tab.active { color: var(--lohas-brand); border-bottom-color: var(--warn); font-weight: 500; }

.pd-acc-body { flex: 1; padding: 14px; overflow-y: auto; }
.pd-acc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }

.pd-acc-card {
  background: var(--bg-warm);
  border: 1px solid var(--lohas-bd);
  border-radius: var(--r-md);
  padding: 11px;
  cursor: pointer;
  transition: all .18s;
  position: relative;
}
.pd-acc-card:hover  { border-color: var(--warn); }
.pd-acc-card.active { border: 1.5px solid var(--lohas-brand); background: #fdf7f0; }
.pd-acc-card-img {
  height: 56px;
  background: #fff;
  border: 1px solid var(--lohas-bd);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; margin-bottom: 8px;
}
.pd-acc-card .ac-check {
  display: none;
  position: absolute; top: 8px; left: 8px;
  width: 17px; height: 17px;
  border-radius: 50%;
  background: var(--lohas-brand);
  align-items: center; justify-content: center;
}
.pd-acc-card.active .ac-check { display: flex; }
.ac-check svg { width: 9px; height: 9px; stroke: #fff; stroke-width: 2.5; fill: none; }
.pd-acc-card .ac-badge { position: absolute; top: 8px; right: 8px; }
.pd-acc-name  { font-size: 11px; font-weight: 700; color: var(--text-main); line-height: 1.35; margin-bottom: 2px; }
.pd-acc-desc  { font-size: 9.5px; color: var(--text-muted); line-height: 1.4; margin-bottom: 5px; }
.pd-acc-price { font-size: 11px; color: var(--warn); font-weight: 700; }

.pd-acc-foot {
  padding: 12px 16px;
  border-top: 1px solid var(--lohas-bd);
  display: flex; align-items: center; gap: 10px;
}
.pd-acc-foot-cnt { font-size: 12px; color: var(--text-muted); flex: 1; }
.pd-acc-foot-cnt b { color: var(--text-main); }

/* ============================================================
   STEP 7 — 造型卡
   ============================================================ */
.pd-card-wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 44px 0;
}
.pd-outfit-card {
  background: var(--lohas-brand);
  border-radius: var(--r-xl);
  padding: 38px 32px;
  color: #fff;
  text-align: center;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.pd-outfit-card::before {
  content: '';
  position: absolute; top: -40px; right: -40px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(181,138,66,.16);
}
.pd-oc-eb      { font-size: 9px; letter-spacing: 3px; color: var(--lohas-light); margin-bottom: 14px; }
.pd-oc-glasses { font-size: 58px; display: block; margin-bottom: 14px; }
.pd-oc-name    { font-size: 28px; font-weight: 700; margin-bottom: 7px; }
.pd-oc-items   { font-size: 12px; color: #D3D1C7; margin-bottom: 6px; }
.pd-oc-creator { font-size: 11px; color: var(--lohas-light); margin-bottom: 22px; }
.pd-oc-divider { height: 1px; background: rgba(255,255,255,.15); margin: 20px 0; }
.pd-oc-accs    { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.pd-oc-acc     { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pd-oc-acc-em  { font-size: 24px; }
.pd-oc-acc-lbl { font-size: 9px; color: var(--lohas-light); }
.pd-oc-total   { font-size: 13px; color: var(--lohas-light); margin-top: 22px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.15); }
.pd-oc-total b { font-size: 20px; color: #fff; }

.pd-card-actions {
  display: flex; gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

/* ── 加入購物車大按鈕 ── */
.pd-cart-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px;
  background: var(--warn); color: #fff;
  border: none; border-radius: var(--r-pill);
  font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: background .2s;
}
.pd-cart-btn:hover { background: #9a7234; }

/* ============================================================
   RWD
   ============================================================ */
@media (max-width: 900px) {
  .pd-frames-layout,
  .pd-eng-layout,
  .pd-detail-layout { grid-template-columns: 1fr; }
  .pd-side-preview, .pd-eng-story { position: static; }
}
@media (max-width: 768px) {
  #pd-app { padding-top: 80px; }
  .pd-acc-layout { grid-template-columns: 1fr; }
  .pd-fl-side { border-right: none; border-bottom: 1px solid var(--lohas-bd); }
  .pd-frame-grid { grid-template-columns: 1fr 1fr; }
  .pd-eng-grid   { grid-template-columns: 1fr 1fr; }
  .pd-quiz-opts  { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .pd-frame-grid { grid-template-columns: 1fr; }
  .pd-quiz-opts  { grid-template-columns: 1fr; }
  .pd-acc-grid   { grid-template-columns: 1fr 1fr; }
}
