/* LOVEFU大島樂眠 預約系統 */
:root {
  --bg: #faf6f0;
  --card: #ffffff;
  --ink: #3d3229;
  --ink-soft: #8a7f72;
  --brand: #8a6d4e;
  --brand-deep: #6b5238;
  --accent: #e8ddcf;
  --ok: #4a7c59;
  --radius: 16px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang TC", "Noto Sans TC", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 560px; margin: 0 auto; padding: 20px 16px 60px; }
header.site {
  text-align: center;
  padding: 28px 0 8px;
}
header.site .logo { font-weight: 800; letter-spacing: 0.18em; color: var(--brand-deep); font-size: 20px; }
header.site .sub { color: var(--ink-soft); font-size: 14px; margin-top: 2px; }
h1 { font-size: 22px; margin: 18px 0 4px; }
p.lead { color: var(--ink-soft); font-size: 15px; margin-bottom: 18px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(61, 50, 41, 0.08);
  border: 1px solid rgba(138, 109, 78, 0.1);
}
a.store-card { display: block; text-decoration: none; color: inherit; transition: transform 0.1s; }
a.store-card:active { transform: scale(0.98); }
.store-card h2 { font-size: 18px; color: var(--brand-deep); }
.store-card .addr { color: var(--ink-soft); font-size: 14px; }
.store-card .cta { color: var(--brand); font-weight: 700; font-size: 14px; margin-top: 6px; display: inline-block; }

.daybar { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; -webkit-overflow-scrolling: touch; }
.daybar button {
  flex: 0 0 auto; min-width: 64px; padding: 10px 8px;
  border-radius: 12px; border: 1px solid var(--accent); background: var(--card);
  font-size: 14px; color: var(--ink); cursor: pointer;
}
.daybar button.sel { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 700; }
.daybar .wd { display: block; font-size: 12px; opacity: 0.75; }

.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.slots button {
  padding: 12px 0; border-radius: 12px; border: 1px solid var(--accent);
  background: var(--card); font-size: 16px; cursor: pointer; color: var(--ink);
}
.slots button.sel { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 700; }
.slots .left1 { font-size: 11px; color: var(--brand); display: block; }
.slots button.sel .left1 { color: #f5e9da; }

form label { display: block; font-size: 14px; font-weight: 700; margin: 14px 0 4px; }
form label .opt { font-weight: 400; color: var(--ink-soft); }
input, select, textarea {
  width: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--accent);
  font-size: 16px; background: #fff; color: var(--ink); font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); border-color: transparent; }

.btn {
  display: block; width: 100%; padding: 14px; margin-top: 20px;
  background: var(--brand); color: #fff; border: 0; border-radius: 12px;
  font-size: 17px; font-weight: 700; cursor: pointer; text-align: center; text-decoration: none;
}
.btn:disabled { opacity: 0.5; }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--brand); }

.summary { background: var(--accent); border-radius: 12px; padding: 12px 16px; margin-top: 16px; font-size: 15px; }
.err { color: #b0413e; font-size: 14px; margin-top: 10px; min-height: 20px; }
.muted { color: var(--ink-soft); font-size: 13px; }
.center { text-align: center; }
.big-ok { font-size: 48px; margin: 10px 0; }
.hidden { display: none; }
.backlink { color: var(--brand); text-decoration: none; font-size: 14px; }
.spin { text-align: center; color: var(--ink-soft); padding: 30px 0; }

/* ===== v2 前台改版（精簡俐落＋官網視覺）===== */
.wrap-wide { max-width: 640px; }

/* 品牌 hero */
.hero { position: relative; border-radius: 20px; overflow: hidden; margin-bottom: 22px; }
.hero img { display: block; width: 100%; height: auto; }
.hero .overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(61,50,41,.12) 0%, rgba(61,50,41,.55) 100%);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 20px;
}
.hero .logo { color: #fff; font-weight: 800; letter-spacing: .16em; font-size: 19px; }
.hero .tag { color: #f3ece1; font-size: 14px; margin-top: 3px; }

.section-title { font-size: 19px; margin: 6px 0 2px; }
.section-sub { color: var(--ink-soft); font-size: 14px; margin-bottom: 16px; }

/* 店家卡片 v2：橫向，左圖右資訊 */
a.storecard {
  display: flex; align-items: stretch; text-decoration: none; color: inherit;
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 2px 10px rgba(61,50,41,.07); border: 1px solid rgba(138,109,78,.1);
  margin-bottom: 14px; transition: transform .1s, box-shadow .2s;
}
a.storecard:active { transform: scale(.99); }
/* 門市照放文字左側（圖文橫式）。電腦版：橫式原圖不裁切；手機版：裁成方形填滿放大 */
.storecard .thumb {
  flex: 0 0 44%; display: flex; align-items: center; justify-content: center;
  padding: 10px; background: transparent; line-height: 0;
}
.storecard .thumb img { width: 100%; height: auto; object-fit: cover; display: block; border-radius: 12px; }
.storecard .thumb .ph {
  display: flex; align-items: center; justify-content: center; min-height: 88px;
  color: var(--brand-deep); font-size: 22px; opacity: .55;
}
.storecard .body { flex: 1; padding: 14px 16px 14px 6px; min-width: 0; align-self: center; }
.storecard .name { font-weight: 700; font-size: 17px; color: var(--brand-deep); margin-bottom: 6px; }
.storecard .info { color: var(--ink-soft); font-size: 13px; margin-top: 3px; line-height: 1.5; }
.storecard .info .k { color: var(--brand-deep); font-weight: 600; margin-right: 6px; }
.storecard .info .nb { white-space: nowrap; }
.storecard .meta { color: var(--ink-soft); font-size: 13px; margin-top: 4px; line-height: 1.5; }
.storecard .go {
  display: inline-block; margin-top: 11px;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 14px;
  padding: 7px 18px; border-radius: 999px;
}
.storecard .closed-day { color: #b0764e; white-space: nowrap; }

/* 手機版：門市照裁成方形填滿放大（取照片中央） */
@media (max-width: 600px) {
  .storecard .thumb img { aspect-ratio: 1; height: auto; object-fit: cover; }
}

/* 電腦版（≥760px）：三張店卡左右並排（3 欄），每張改成「圖在上、文字在下」直式卡 */
@media (min-width: 760px) {
  .wrap-wide { max-width: 1040px; }
  .storegrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
  a.storecard { flex-direction: column; margin-bottom: 0; height: 100%; }
  .storecard .thumb { flex: none; width: 100%; padding: 0; }
  /* 上方圖滿版、接近原比例（2:1）裁齊讓三欄對齊，卡片圓角自動裁上緣 */
  .storecard .thumb img { width: 100%; aspect-ratio: 2 / 1; height: auto; object-fit: cover; border-radius: 0; }
  .storecard .body { align-self: stretch; display: flex; flex-direction: column; padding: 16px 18px 18px; }
  .storecard .name { font-size: 18px; margin-bottom: 8px; }
  .storecard .go { margin-top: auto; align-self: flex-start; } /* CTA 推到卡片底部，三欄按鈕對齊 */
}

/* 到店體驗 feature 區 */
.feature { background: var(--card); border-radius: var(--radius); overflow: hidden; margin: 20px 0 8px; border: 1px solid rgba(138,109,78,.1); }
.feature > img { width: 100%; height: 168px; object-fit: cover; display: block; }
.feature .fbody { padding: 16px 18px; }
.feature h3 { font-size: 16px; color: var(--brand-deep); }
.feature p { color: var(--ink-soft); font-size: 14px; margin-top: 4px; }
.chips { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; }
.chips .chip { flex: 0 0 auto; border-radius: 12px; overflow: hidden; width: 92px; text-align: center; }
.chips .chip img { width: 92px; height: 66px; object-fit: cover; display: block; }
.chips .chip span { font-size: 12px; color: var(--ink-soft); display: block; padding: 4px 2px; }

/* 步驟指示 */
.steps { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft); margin-bottom: 14px; }
.steps b { color: var(--brand-deep); }
.steps .on { color: #fff; background: var(--brand); border-radius: 20px; padding: 2px 10px; font-weight: 700; }
.steps .step { padding: 2px 4px; }
.steps .arrow { opacity: .5; }

/* 店家小標頭（選時段/完成頁共用） */
.storehead { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.storehead .avatar { flex: 0 0 52px; height: 52px; border-radius: 14px; object-fit: cover; }
.storehead .n { font-weight: 700; font-size: 18px; color: var(--brand-deep); }
.storehead .a { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }

.notice-hint { color: var(--ink-soft); font-size: 13px; text-align: center; margin-top: 22px; line-height: 1.7; }

/* ===== 月曆式日期選擇 ===== */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-head .m { font-weight: 700; font-size: 16px; color: var(--brand-deep); }
.calnav {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--accent);
  background: var(--card); color: var(--brand); font-size: 20px; line-height: 1; cursor: pointer;
}
.calnav:disabled { opacity: .3; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-grid .wdh { text-align: center; font-size: 12px; color: var(--ink-soft); padding: 2px 0 4px; }
.cal-grid .cell {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; font-size: 15px;
}
.cal-grid .cell.empty { visibility: hidden; }
.cal-grid .cell.dim { color: #ccc4b8; }
.cal-grid .cell.avail {
  background: var(--card); border: 1px solid var(--accent); color: var(--ink);
  cursor: pointer; font-weight: 600; transition: transform .08s;
}
.cal-grid .cell.avail::after {
  content: ""; position: absolute; margin-top: 26px; width: 4px; height: 4px;
  border-radius: 50%; background: var(--brand);
}
.cal-grid .cell.avail { position: relative; }
.cal-grid .cell.avail:active { transform: scale(.92); }
.cal-grid .cell.sel { background: var(--brand); border-color: var(--brand); color: #fff; }
.cal-grid .cell.sel::after { background: #fff; }

.slotwrap { margin-top: 18px; border-top: 1px dashed var(--accent); padding-top: 16px; }
.slothint { font-size: 14px; color: var(--brand-deep); font-weight: 700; margin-bottom: 12px; }

/* ===== 各店歡迎語／須知（store.intro）===== */
.intro {
  white-space: pre-wrap; color: var(--ink); font-size: 14px; line-height: 1.7;
  background: var(--card); border: 1px solid rgba(138, 109, 78, 0.14); border-radius: 12px;
  padding: 12px 14px; margin: 4px 0 14px;
}

/* ===== 後台前台預覽：可編輯文案標示（COPY_SPEC §3 §5）===== */
/* 多行文案以 \n 換行呈現（footer／note） */
.lfb-pre { white-space: pre-wrap; }
/* preview（?preview=1）時每個 [data-copy] 元素套此 class：虛線框、hover 變色、可點 */
.lfb-editable {
  outline: 1px dashed var(--brand); outline-offset: 3px; border-radius: 4px;
  cursor: pointer; min-height: 1em; transition: background 0.12s, outline-color 0.12s;
}
.lfb-editable:hover { background: rgba(138, 109, 78, 0.1); outline-color: var(--brand-deep); }
/* 空元素（如尚未填寫的 intro）給提示字，避免點不到 */
.lfb-editable:empty::before { content: "（點此新增文字）"; color: var(--ink-soft); }

/* ── 嵌入模式（?embed=1，iframe 置入官網）：融入母站、去掉自家外框 ── */
html.lfb-embed, html.lfb-embed body { background: transparent; }
html.lfb-embed .site, html.lfb-embed .backlink { display: none; }
html.lfb-embed .wrap { max-width: 680px; padding: 4px 14px 18px; }
html.lfb-embed #storeName { margin-top: 4px; }

html.lfb-embed a.btn.ghost { display: none; } /* 嵌入時「回官網」鈕多餘（客人已在官網）*/

/* 嵌入選店頁（?embed=1）：只留三張店卡，隱藏 banner 與標題 */
html.lfb-embed .hero, html.lfb-embed .section-title, html.lfb-embed .section-sub { display: none; }
/* 嵌入選店頁在寬版位要排三欄，放寬寬度（覆蓋上面單店表單用的 680）*/
html.lfb-embed .wrap-wide { max-width: 1040px; }
/* 從嵌入店選單點進店家（?pick=1）：顯示「選擇其他門市」回選單鈕（覆蓋上面的隱藏）*/
html.lfb-pick .backlink { display: block; margin: 2px 0 10px; }
