/* 聖誕限定（只給首頁用）。節後刪掉本檔，並移除 index.html 裡所有 .xmas 標記即可。 */
/* 截止日文案由 assets/js/xmas-home.js 的 XSP_XMAS.deadlineLabel 填入 [data-xmas-deadline]。 */

:root{
  --xmas-banner-h:34px;
  --xmas-gold:#C2A36B;
}

@media (max-width:640px){
  :root{ --xmas-banner-h:40px; }
}

body{padding-top:calc(var(--topbar-h) + var(--xmas-banner-h)) !important}
.topbar{top:var(--xmas-banner-h)}
html{scroll-padding-top:calc(var(--topbar-h) + var(--xmas-banner-h))}
#top,#write,#service,#order,#plans,#plan-xmas,.block{
  scroll-margin-top:calc(var(--topbar-h) + var(--xmas-banner-h));
}

.xmas-banner{
  position:fixed;
  top:0;left:0;right:0;
  z-index:80;
  height:var(--xmas-banner-h);
  display:flex;
  align-items:center;
  justify-content:center;
  background:#602836;
  color:#F7F1E3;
  font:500 13px/1 var(--sans);
  letter-spacing:.08em;
  box-shadow:0 1px 0 rgba(194,163,107,.5);
}
.xmas-banner a{
  color:inherit;
  text-decoration:none;
  padding:0 16px;
  line-height:var(--xmas-banner-h);
}
.xmas-banner a:hover{color:#F0D9B5}

.hero__text{position:relative}
.xmas-flakes{
  position:absolute;
  inset:-18px -8px auto auto;
  width:150px;
  height:130px;
  pointer-events:none;
  z-index:1;
}
.xmas-flake{
  position:absolute;
  color:var(--xmas-gold);
  opacity:.58;
  animation:xmas-drift 7s ease-in-out infinite;
}
.xmas-flake--a{width:16px;top:8px;right:18px;animation-delay:0s}
.xmas-flake--b{width:11px;top:48px;right:4px;opacity:.4;animation-delay:1.4s;animation-duration:8.5s}
.xmas-flake--c{width:13px;top:86px;right:42px;opacity:.48;animation-delay:2.2s;animation-duration:9s}
.xmas-flake--d{width:9px;top:22px;right:70px;opacity:.35;animation-delay:.8s}

@keyframes xmas-drift{
  0%,100%{transform:translateY(0) rotate(0deg)}
  50%{transform:translateY(6px) rotate(14deg)}
}

.xmas-plan .polaroid__photo{position:relative}
.xmas-price-old{
  font:400 16px/1.2 var(--sans);
  color:var(--bronze);
  text-decoration:line-through;
  letter-spacing:0;
  margin-right:.2em;
}
.xmas-badge{
  position:absolute;
  z-index:2;
  top:10px;right:10px;
  font:700 11px/1 var(--sans);
  letter-spacing:.08em;
  color:#fff;
  background:#602836;
  padding:5px 8px;
  border-radius:3px;
  box-shadow:0 1px 3px rgba(59,47,40,.25);
}
.xmas-plan .polaroid__desc{min-height:0}

.xmas-opts{
  max-width:520px;
  margin:22px auto 0;
  padding:16px 18px 14px;
  border:1px solid rgba(194,163,107,.45);
  background:rgba(255,253,248,.55);
  text-align:left;
  color:#3B2F28;
}
.xmas-opts fieldset{border:0;padding:0;margin:0 0 14px}
.xmas-opts legend,
.xmas-opts .xmas-opts__label{
  font:700 14px/1.4 var(--sans);
  margin:0 0 8px;
  letter-spacing:.04em;
}
.xmas-env{display:flex;gap:18px;flex-wrap:wrap}
.xmas-env label{display:flex;align-items:center;gap:8px;cursor:pointer;font-size:15px}
.xmas-env input{accent-color:#602836}
.xmas-env__swatch{
  width:20px;height:20px;border-radius:50%;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.18),0 1px 2px rgba(59,47,40,.15);
}
.xmas-env__swatch--wine{background:#602836}
.xmas-env__swatch--forest{background:#1F3D2A}
.xmas-opts__note{margin:0 0 14px;font-size:13px;line-height:1.6;color:var(--bronze)}
.xmas-opts .field{margin:0}
.xmas-opts .field small{font-weight:400;color:var(--bronze)}
.xmas-opts input[type="date"]{
  display:block;
  width:100%;
  max-width:240px;
  margin-top:6px;
  padding:8px 10px;
  border:1px solid rgba(117,91,51,.35);
  background:#fff;
  font:inherit;
  color:inherit;
}

.preview__paper[data-paper="snowflake"]{
  --pc:#F7F3EA;
  background-image:
    radial-gradient(circle at 8% 6%,rgba(194,163,107,.35) 0 1.2px,transparent 1.6px),
    radial-gradient(circle at 92% 7%,rgba(194,163,107,.3) 0 1px,transparent 1.4px),
    radial-gradient(circle at 7% 94%,rgba(194,163,107,.28) 0 1.1px,transparent 1.5px),
    var(--noise);
}

.envelope[data-env="forest"],
.envback[data-env="forest"]{
  --ec:#1F3D2A;
  --eink:#FFF6E8;
  --reg:#E8D5A8;
  background:#1F3D2A;
  box-shadow:0 10px 22px rgba(10,20,14,.4),inset 0 0 0 1px rgba(255,255,255,.07);
}
.envelope[data-env="forest"]::before{
  content:"";
  position:absolute;inset:0;pointer-events:none;z-index:0;opacity:.22;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='d'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .5 0'/></filter><rect width='100%' height='100%' filter='url(%23d)'/></svg>");
}
.envelope[data-env="forest"]::after{background:linear-gradient(160deg,rgba(255,255,255,.1),transparent 42%,rgba(0,0,0,.18))}
.envelope[data-env="forest"] .postmark--env{color:rgba(244,233,214,.4)}

@media (max-width:640px){
  .xmas-banner{font-size:12px;letter-spacing:.04em}
  .xmas-flakes{width:86px;height:64px;inset:-10px -2px auto auto}
  .xmas-flake--c,.xmas-flake--d{display:none}
  .xmas-flake{opacity:.42}
}

@media (prefers-reduced-motion:reduce){
  .xmas-flake{animation:none !important}
}

/* ===================================================================
   裝飾圖（行銷 Nano Banana 透明 PNG → webp，檔在 assets/img/xmas/d-*.webp）
   原則：每張圖都 position:absolute，放在它裝飾的那個元素裡面（該元素由 JS 補
   position:relative），用 %／em／該元素自己的尺寸變數對齊；不用整頁座標、不用 fixed；
   一律 pointer-events:none。節後刪本檔與 xmas-home.js 即可整塊拿掉。
   =================================================================== */
.xmas-host{position:relative}
img.xmas-d{
  position:absolute;display:block;max-width:none;height:auto;
  pointer-events:none;user-select:none;-webkit-user-select:none;
  z-index:3;
}
/* 暖白雪花在米白底偏淡：加深一點、帶點金棕邊 */
img.xmas-d[src*="flake-w"]{
  filter:brightness(.92) sepia(.25) drop-shadow(0 0 .4px #7a5a28) drop-shadow(0 0 .8px #7a5a28) drop-shadow(0 1px 1px rgba(138,106,50,.4));
}

/* ---- 頂端橫幅：鈴鐺從橫幅下緣垂下，不蓋住橫幅文字，也不超過頂欄高度 ---- */
.xmas-banner img.xmas-bells{
  top:calc(100% - 3px);
  height:78px;width:auto;
  margin-left:-12px;
  transform-origin:50% 0;
  animation:xmas-swing 5s ease-in-out infinite;
  z-index:1;
}
.xmas-bells--a{left:27%}
.xmas-bells--b{left:60%;animation-delay:1.3s}
@keyframes xmas-swing{0%,100%{transform:rotate(2.5deg)}50%{transform:rotate(-2.5deg)}}

/* ---- 頂欄 logo：帽子相對於 .brand 左側的圖（高 52px，手機 28px）---- */
.brand{--m:52px}
@media (max-width:640px){.brand{--m:28px}}
img.xmas-d.xmas-hat--brand{
  width:calc(var(--m)*.62);
  left:calc(var(--m)*.34);
  top:calc(var(--m)*-.15);
  transform:rotate(6deg);
  filter:drop-shadow(0 1px 1px rgba(59,47,40,.22));
}

/* ---- 主視覺 logo：全部相對於 h1（logo 寬度＝--w，左緣＝--x0）---- */
.hero__brand{--w:min(280px,72%);--x0:-8px}
@media (max-width:900px){.hero__brand{--w:min(220px,58%);--x0:calc((100% - var(--w)) / 2)}}
@media (max-width:640px){.hero__brand{--w:min(158px,48%)}}
img.xmas-d.xmas-wreath{
  width:calc(var(--w)*.42);
  left:calc(var(--x0) - var(--w)*.17);
  top:calc(var(--w)*-.04);
  z-index:1;
  filter:drop-shadow(0 3px 5px rgba(36,69,47,.18));
}
img.xmas-d.xmas-hat--hero{
  width:calc(var(--w)*.30);
  left:calc(var(--x0) + var(--w)*.46);
  top:calc(var(--w)*.01);
  transform:rotate(8deg);
  filter:drop-shadow(0 2px 2px rgba(59,47,40,.25));
}
img.xmas-d.xmas-holly{
  width:calc(var(--w)*.40);
  left:calc(var(--x0) + var(--w)*.99);
  top:calc(var(--w)*1.02);
  filter:drop-shadow(0 2px 3px rgba(59,47,40,.18));
}

/* ---- 主視覺右上雪花：換成素材雪花（舊 SVG 雪花隱藏）---- */
.xmas-flakes--img>svg{display:none}
.xmas-flakes--img .xmas-flake{opacity:.95;right:auto;top:auto}
.xmas-flakes--img .xmas-flake--a{width:30px;left:62%;top:6%}
.xmas-flakes--img .xmas-flake--b{width:20px;left:28%;top:30%;opacity:.9}
.xmas-flakes--img .xmas-flake--c{width:24px;left:80%;top:52%}
.xmas-flakes--img .xmas-flake--d{width:16px;left:46%;top:68%;opacity:.85}

/* ---- 主視覺拍立得（本身 relative、已轉 -3 度；裝飾跟著一起轉）---- */
img.xmas-d.xmas-bow{
  width:21%;
  left:-7%;top:-6%;
  transform:rotate(-14deg);
  filter:drop-shadow(0 2px 3px rgba(59,47,40,.22));
  z-index:4;
}
img.xmas-d.xmas-corner--pola{width:40%;left:-10%;bottom:-6%}

/* ---- 流程小圖示戴帽（每步 li 本身 relative）---- */
.journey__step{--ico:116px;--cx:50%}
@media (max-width:900px){.journey__step{--ico:96px;--cx:58px}}
img.xmas-d.xmas-hat--ico{
  width:calc(var(--ico)*.52);
  left:calc(var(--cx) - var(--ico)*.62);
  top:calc(var(--ico)*-.17);
  transform:rotate(-10deg);
  filter:drop-shadow(0 1px 2px rgba(59,47,40,.22));
}

/* ---- 卡片角落 ---- */
.xmas-corner{filter:drop-shadow(0 2px 3px rgba(59,47,40,.16))}
img.xmas-d.xmas-corner--story{width:min(180px,32%);right:-14px;bottom:-30px}
img.xmas-d.xmas-corner--preview{width:min(150px,30%);right:-18px;bottom:-22px}
img.xmas-d.xmas-corner--book{width:min(170px,26%);left:-16px;bottom:-26px}
img.xmas-d.xmas-corner--faq{width:min(150px,36%);right:0;bottom:-82px}

/* ---- 訂單摘要（.leather 皮夾）：三顆聖誕球掛在上緣 ---- */
img.xmas-d.xmas-bauble{
  width:38px;top:-8px;
  transform-origin:50% 0;
  animation:xmas-swing 4.6s ease-in-out infinite;
  filter:drop-shadow(0 2px 2px rgba(0,0,0,.28));
  z-index:4;
}
.xmas-bauble--a{left:50%}
.xmas-bauble--b{left:60%;animation-delay:.7s}
.xmas-bauble--c{left:70%;animation-delay:1.4s}

/* ---- 頁尾：帽子＋上方一排雪花（相對 .footer）---- */
img.xmas-d.xmas-hat--foot{
  width:calc(72px*.62);
  left:calc(50% - 72px*.02);
  top:calc(24px - 72px*.20);
  transform:rotate(6deg);
  filter:drop-shadow(0 1px 2px rgba(59,47,40,.22));
}
.xmas-snowrow{position:absolute;left:0;right:0;top:-14px;height:28px;pointer-events:none;z-index:3}
.xmas-snowrow img.xmas-d{position:absolute;width:24px;transform:translateX(-50%)}
.xmas-sn--1{left:6%}.xmas-sn--2{left:17%;width:19px!important}
.xmas-sn--3{left:28%}.xmas-sn--4{left:38%;width:18px!important}
.xmas-sn--5{left:62%;width:18px!important}.xmas-sn--6{left:72%}
.xmas-sn--7{left:83%;width:19px!important}.xmas-sn--8{left:94%}

/* ---- 手機：少而小，不擋標題與「開始寫信」---- */
@media (max-width:900px){
  img.xmas-d.xmas-corner--preview{display:none}
}

@media (max-width:640px){
  .xmas-banner img.xmas-bells{height:54px;margin-left:-8px}
  .xmas-bells--a{left:31%}.xmas-bells--b{left:64%}
  img.xmas-d.xmas-wreath{width:calc(var(--w)*.34);left:calc(var(--x0) - var(--w)*.20)}
  img.xmas-d.xmas-holly{width:calc(var(--w)*.28);left:calc(var(--x0) + var(--w)*.99)}
  .xmas-flakes--img .xmas-flake--b,.xmas-flakes--img .xmas-flake--d{display:none}
  img.xmas-d.xmas-bow{width:19%;left:-6%;top:-5%}
  img.xmas-d.xmas-corner--pola{width:34%;left:-8%}
  img.xmas-d.xmas-corner--story{width:96px;right:-8px;bottom:-22px}
  img.xmas-d.xmas-corner--preview{width:92px;right:-8px;bottom:-16px}
  img.xmas-d.xmas-corner--book{width:100px;left:-8px;bottom:-18px}
  img.xmas-d.xmas-corner--faq{width:100px;right:0;bottom:-54px}
  img.xmas-d.xmas-bauble{width:30px;top:-6px}
  .xmas-snowrow img.xmas-d{width:22px}
  .xmas-snowrow img.xmas-sn--2,.xmas-snowrow img.xmas-sn--4,.xmas-snowrow img.xmas-sn--5,.xmas-snowrow img.xmas-sn--7{display:none}
}

/* ---- 拍立得輪播：蝴蝶結與角飾只在聖誕照片出現（類別由 xmas-home.js 切換）---- */
img.xmas-d.xmas-bow,img.xmas-d.xmas-corner--pola{transition:opacity .7s ease}
.hero-pola.xmas-pola--plain img.xmas-d.xmas-bow,
.hero-pola.xmas-pola--plain img.xmas-d.xmas-corner--pola{opacity:0}

/* ---- 手機補充（2026-11-28）：橫幅整條可點、裝飾再少一點 ---- */
@media (max-width:640px){
  .xmas-banner a{flex:1;display:block;text-align:center;height:100%;padding:0 8px;font-size:13px}
  .xmas-flakes{inset:-6px 10px auto auto}
  .xmas-env{gap:10px 18px}
  .xmas-env label{min-height:44px;font-size:16px}
  .xmas-env input{width:20px;height:20px}
  .xmas-opts input[type="date"]{font-size:16px;min-height:48px}
  .xmas-opts__note{font-size:13.5px}
  .xmas-flakes--img .xmas-flake--c{display:none}
  img.xmas-d.xmas-corner--faq{width:84px;bottom:-46px}
}

@media (prefers-reduced-motion:reduce){
  .xmas-bells,img.xmas-d.xmas-bauble{animation:none !important}
  img.xmas-d.xmas-bow,img.xmas-d.xmas-corner--pola{transition:none}
}
