:root {
	--bg: #faf6ef;
	--paper: #fffdf9;
	--ink: #2b2420;
	--muted: #6f625a;
	--line: #e8ddcf;
	--brand: #621a22;
	--brand-2: #8a2a33;
	--brand-soft: #f6e8e6;
	--frozen: #255f8f;
	--frozen-soft: #e6f0f8;
	--chilled: #4a8a2e;
	--chilled-soft: #edf6e6;
	--danger: #b3261e;
	--radius: 14px;
	--shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 6px 20px rgba(60, 40, 20, .06);
	--sans: "Noto Sans TC", system-ui, -apple-system, "PingFang TC", "Microsoft JhengHei", sans-serif;
	--serif: "Noto Serif TC", "Noto Sans TC", serif;
	color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.7 var(--sans); overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--brand); }
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.wrap--narrow { width: min(760px, 100% - 32px); }

/* ---------- 按鈕 ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	min-height: 44px; padding: 0 22px; border: 0; border-radius: 999px;
	background: var(--brand); color: #fff; font-weight: 700; text-decoration: none; cursor: pointer;
	transition: background .15s, transform .15s;
}
.btn:hover { background: var(--brand-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { background: #c9bdb3; cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--brand); }
.btn--ghost:hover { background: var(--brand-soft); }
.btn--small { min-height: 38px; padding: 0 16px; font-size: 15px; }

/* ---------- 頁首 ---------- */
.site-header { position: sticky; top: 0; z-index: 30; background: rgba(255, 253, 249, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header__in { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { display: flex; align-items: center; text-decoration: none; color: var(--brand); flex-shrink: 0; }
.brand__img { height: 52px; width: auto; }
.brand__text { font: 700 22px/1 var(--serif); letter-spacing: .08em; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { padding: 8px 14px; border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 500; white-space: nowrap; }
.nav a:hover { background: var(--brand-soft); color: var(--brand); }
.cart-btn { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--brand); background: var(--brand-soft); }
.cart-btn svg { width: 24px; height: 24px; }
.cart-btn__count { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--brand); color: #fff; font: 700 12px/22px var(--sans); text-align: center; }

/* ---------- 主視覺 ---------- */
.hero {
	position: relative; color: #fff; text-align: center;
	background: radial-gradient(120% 90% at 20% 10%, #8a2a33 0%, #621a22 45%, #3a0d12 100%);
	padding: clamp(72px, 12vw, 150px) 0;
	overflow: hidden;
}
.hero--img { background: linear-gradient(rgba(35, 18, 10, .45), rgba(35, 18, 10, .6)), var(--hero) center / cover no-repeat; }
.hero__in { max-width: 820px; }
.hero__period { display: inline-block; margin: 0 0 18px; padding: 6px 16px; border: 1px solid rgba(255, 255, 255, .5); border-radius: 999px; font-size: 15px; letter-spacing: .05em; }
.hero__title { margin: 0; font: 700 clamp(34px, 6vw, 60px)/1.25 var(--serif); letter-spacing: .06em; text-wrap: balance; }
.hero__sub { margin: 16px 0 0; font-size: clamp(17px, 2.2vw, 21px); opacity: .92; text-wrap: balance; }
.btn--hero { margin-top: 32px; min-height: 54px; padding: 0 40px; font-size: 18px; background: #fff; color: var(--brand); }
.btn--hero:hover { background: var(--brand-soft); }
.hero__closed { display: inline-block; margin-top: 30px; padding: 10px 24px; border-radius: 999px; background: rgba(0, 0, 0, .3); font-weight: 700; }

/* ---------- 商品區 ---------- */
.shop { padding: clamp(56px, 8vw, 88px) 0; }
.shop--frozen { --t: var(--frozen); --t-soft: var(--frozen-soft); }
.shop--chilled { --t: var(--chilled); --t-soft: var(--chilled-soft); background: var(--paper); border-block: 1px solid var(--line); }
.shop__head { display: flex; align-items: center; gap: 16px; margin-bottom: 32px; }
.shop__icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--t-soft); color: var(--t); flex-shrink: 0; }
.shop__icon svg { width: 30px; height: 30px; }
.shop__title { margin: 0; font: 700 clamp(26px, 3.5vw, 34px)/1.3 var(--serif); color: var(--t); }
.shop__sub { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; }
.card { display: flex; flex-direction: column; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card__img { position: relative; aspect-ratio: 1; background: var(--t-soft); color: var(--t); display: grid; place-items: center; }
.card__img img { width: 100%; height: 100%; object-fit: cover; }
.card__img > svg { width: 38%; opacity: .45; }
.tag { position: absolute; top: 12px; left: 12px; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; color: #fff; }
.tag--frozen { background: var(--frozen); }
.tag--chilled { background: var(--chilled); }
.card__body { display: flex; flex-direction: column; flex: 1; padding: 16px 18px 18px; }
.card__name { margin: 0; font-size: 18px; line-height: 1.45; }
.card__spec { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.card__price { margin: 10px 0 14px; font-size: 21px; font-weight: 700; color: var(--brand); }
.card__soldout { margin: auto 0 0; padding: 10px; border-radius: 10px; background: #f1ece6; color: var(--muted); text-align: center; font-weight: 700; }
.card__buy { display: flex; gap: 10px; margin-top: auto; }
.btn--add { flex: 1; padding: 0 12px; background: var(--t); }
.btn--add:hover { background: var(--ink); }

.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; flex-shrink: 0; }
.qty button { width: 38px; height: 41px; border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--muted); border-radius: 999px; }
.qty button:hover { color: var(--brand); }
.qty input { width: 34px; border: 0; text-align: center; font-weight: 700; background: none; -moz-appearance: textfield; appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty--sm button { width: 32px; height: 34px; }

/* ---------- 預購說明 ---------- */
.info { padding: clamp(56px, 8vw, 88px) 0; }
.section-title { margin: 0 0 28px; font: 700 clamp(26px, 3.5vw, 34px)/1.3 var(--serif); color: var(--brand); }
.info__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.info__item { padding: 24px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.info__item svg { width: 30px; height: 30px; color: var(--brand-2); }
.info__item h3 { margin: 10px 0 6px; font-size: 18px; }
.info__item p { margin: 0; color: var(--muted); }
.info__note { margin-top: 18px; padding: 18px 22px; border-left: 4px solid var(--brand-2); background: var(--brand-soft); border-radius: 0 var(--radius) var(--radius) 0; }

/* ---------- 購物車與表單 ---------- */
.checkout { padding: clamp(56px, 8vw, 88px) 0; background: var(--paper); border-top: 1px solid var(--line); }
.checkout__head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 28px; }
.checkout__head .section-title { margin: 0; }
.temp-badge { padding: 4px 14px; border-radius: 999px; font-weight: 700; font-size: 15px; }
.temp-badge--frozen { background: var(--frozen-soft); color: var(--frozen); }
.temp-badge--chilled { background: var(--chilled-soft); color: var(--chilled); }
.checkout__grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; align-items: start; }
.cart, .form { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.cart__list { list-style: none; margin: 0; padding: 0; }
.line { display: grid; grid-template-columns: 1fr auto 88px 32px; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.line__info { display: flex; flex-direction: column; font-size: 15px; color: var(--muted); }
.line__info strong { color: var(--ink); font-size: 16px; }
.line__sub { text-align: right; font-weight: 700; }
.line__del { width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 20px; cursor: pointer; }
.line__del:hover { background: #f6e3e1; color: var(--danger); }
.cart__empty { margin: 0; padding: 28px 0; color: var(--muted); text-align: center; }
.cart__total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 16px; font-size: 18px; }
.cart__total strong { font-size: 24px; color: var(--brand); }

.form__title { margin: 0 0 16px; font-size: 19px; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; margin-bottom: 4px; font-weight: 500; font-size: 15px; }
.field small { margin-left: 8px; color: var(--muted); font-weight: 400; }
em { color: var(--danger); font-style: normal; }
.field input, .field textarea { width: 100%; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font-size: 16px; }
.field input:focus, .field textarea:focus { border-color: var(--brand-2); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
[aria-invalid="true"] { border-color: var(--danger) !important; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0 16px; font-size: 15px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--brand); flex-shrink: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__error { margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; background: #fbe9e7; color: var(--danger); font-weight: 500; }
.btn--submit { width: 100%; min-height: 52px; font-size: 17px; }
.form__hint { margin: 10px 0 0; color: var(--muted); font-size: 14px; text-align: center; }

/* ---------- 訂單完成 ---------- */
.done { max-width: 720px; margin-inline: auto; padding: 32px clamp(18px, 4vw, 40px); background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); outline: none; }
.done__head { text-align: center; }
.done__head .section-title { margin: 12px 0 18px; }
.done__head p { margin: 0; color: var(--muted); }
.done__check { display: inline-grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: var(--chilled-soft); color: var(--chilled); font-size: 30px; font-weight: 700; }
.done__no { font: 700 30px/1.4 var(--sans) !important; color: var(--brand) !important; letter-spacing: .04em; }
.done__mail { margin-top: 8px !important; font-size: 15px; }
.done__table, .done__info { width: 100%; margin-top: 24px; border-collapse: collapse; }
.done__table th, .done__table td, .done__info th, .done__info td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.done__table td:not(:first-child), .done__table th:not(:first-child), .done__table tfoot td { text-align: right; white-space: nowrap; }
.done__table small { display: block; color: var(--muted); }
.done__table tfoot th, .done__table tfoot td { font-size: 18px; font-weight: 700; border-bottom: 0; }
.done__table tfoot th { text-align: right; }
.done__info th { width: 34%; color: var(--muted); font-weight: 500; }
.done__note { margin: 16px 0 0; color: var(--muted); }
.done__actions { margin: 24px 0 0; text-align: center; }

/* ---------- 浮動元件 ---------- */
.cartbar {
	position: fixed; left: 50%; bottom: 16px; z-index: 25; transform: translateX(-50%);
	display: flex; align-items: center; gap: 14px; width: min(520px, 100% - 24px); padding: 10px 10px 10px 20px;
	background: var(--ink); color: #fff; border-radius: 999px; box-shadow: 0 8px 28px rgba(0, 0, 0, .25);
}
.cartbar span { flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cartbar .btn { background: #fff; color: var(--ink); }
.toast { border-radius: 14px !important; text-align: center;
	position: fixed; top: 80px; left: 50%; z-index: 40; transform: translate(-50%, -12px);
	max-width: calc(100% - 32px); padding: 10px 20px; border-radius: 999px; background: var(--ink); color: #fff;
	opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; font-size: 15px;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(30, 20, 15, .55); }
.modal__box { width: min(440px, 100%); padding: 28px 24px 22px; background: #fff; border-radius: 18px; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.modal__msg { margin: 0 0 22px; font-size: 18px; font-weight: 700; line-height: 1.6; }
.modal__actions { display: flex; flex-direction: column; gap: 10px; }

/* ---------- 頁尾 ---------- */
.site-footer { padding: 44px 0 36px; background: #2b2420; color: #d9cfc6; font-size: 15px; }
.site-footer__in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.site-footer__brand { color: #fff; font: 700 18px/1.5 var(--serif); margin-bottom: 8px; }
.site-footer__list { list-style: none; margin: 0; padding: 0; }
.site-footer a { color: #fff; }
.site-footer__meta { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; justify-content: flex-end; }

/* ---------- 一般頁（隱私權聲明） ---------- */
.page { padding: 56px 0 72px; }
.page__title { font: 700 32px/1.3 var(--serif); color: var(--brand); margin: 0 0 24px; }
.page__body { background: #fff; padding: clamp(20px, 4vw, 40px); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 28px; }
.page__body h2 { font-size: 20px; margin: 28px 0 8px; }
.page__body h2:first-child { margin-top: 0; }

/* ---------- 響應式 ---------- */
@media (max-width: 900px) {
	.checkout__grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
	html { scroll-padding-top: 108px; }
	.site-header__in { flex-wrap: wrap; gap: 0 12px; min-height: 0; padding-top: 10px; }
	.brand { margin-right: auto; }
	.nav { order: 3; width: 100%; margin: 6px 0 0; padding-bottom: 8px; overflow-x: auto; scrollbar-width: none; }
	.nav::-webkit-scrollbar { display: none; }
	.nav a { padding: 6px 12px; font-size: 15px; background: var(--brand-soft); }
	.cart-btn { width: 40px; height: 40px; }
	.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
	.card__body { padding: 12px; }
	.card__name { font-size: 16px; }
	.card__price { font-size: 18px; margin: 6px 0 10px; }
	.card__buy { flex-direction: column; gap: 8px; }
	.card__buy .qty { justify-content: space-between; }
	.card__buy .qty input { flex: 1; }
	.btn--add { min-height: 42px; }
	.line { grid-template-columns: 1fr auto 32px; }
	.line__sub { grid-column: 1; grid-row: 2; text-align: left; }
	.line .qty { grid-column: 2; grid-row: 1 / span 2; }
	.line__del { grid-column: 3; grid-row: 1 / span 2; }
	.cart, .form { padding: 18px 16px; }
	.site-footer__meta { align-items: flex-start; }
	body.has-cartbar { padding-bottom: 76px; }
}
@media (min-width: 721px) {
	.cartbar { display: none !important; }
}

/* ---------- 商品可點開 ---------- */
.card__img { width: 100%; padding: 0; border: 0; cursor: zoom-in; font: inherit; }
.card__img img { transition: transform .35s ease; }
.card__img:hover img { transform: scale(1.04); }
.card__img { overflow: hidden; }
.card__more {
	position: absolute; right: 12px; bottom: 12px; padding: 3px 12px; border-radius: 999px;
	background: rgba(255, 255, 255, .92); color: var(--ink); font-size: 13px; font-weight: 500;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}
.card__name button { padding: 0; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.card__name button:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 商品詳情彈跳窗 ---------- */
body.is-locked { overflow: hidden; }
.pmodal { position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; padding: 24px; background: rgba(30, 20, 15, .6); }
.pmodal__box {
	position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
	width: min(980px, 100%); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px);
	background: #fff; border-radius: 20px; overflow: hidden; box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
}
.pmodal__close {
	position: absolute; top: 12px; right: 12px; z-index: 2; width: 42px; height: 42px; border: 0; border-radius: 50%;
	background: rgba(255, 255, 255, .95); color: var(--ink); font-size: 26px; line-height: 1; cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}
.pmodal__close:hover { background: var(--brand-soft); color: var(--brand); }
.pmodal__media { position: relative; background: #f3eee8; min-height: 0; }
.pmodal__track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.pmodal__track::-webkit-scrollbar { display: none; }
.pmodal__track > * { flex: 0 0 100%; scroll-snap-align: start; aspect-ratio: 1; }
.pmodal__track img { width: 100%; height: 100%; object-fit: cover; }
.pmodal__ph { display: grid; place-items: center; color: var(--muted); }
.pmodal__ph svg { width: 30%; opacity: .4; }
.pmodal__dots { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 4px; }
.pmodal__dots button { width: 24px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer; }
.pmodal__dots button::before { content: ""; display: block; width: 8px; height: 8px; margin: auto; border-radius: 50%; background: rgba(255, 255, 255, .6); box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); }
.pmodal__dots button[aria-current]::before { background: #fff; width: 20px; border-radius: 4px; }
.pmodal__info { display: flex; flex-direction: column; padding: 32px 30px 26px; overflow-y: auto; }
.pmodal__info .tag { position: static; align-self: flex-start; }
.pmodal__name { margin: 12px 0 4px; font: 700 clamp(22px, 2.6vw, 28px)/1.4 var(--serif); padding-right: 36px; }
.pmodal__spec { margin: 0; color: var(--muted); }
.pmodal__price { margin: 10px 0 0; font-size: 26px; font-weight: 700; color: var(--brand); }
.pmodal__desc { margin: 18px 0 0; padding-top: 18px; border-top: 1px solid var(--line); color: #4a403a; font-size: 15.5px; line-height: 1.85; }
.pmodal__desc > :first-child { margin-top: 0; }
.pmodal__desc img { height: auto; border-radius: 10px; margin: 10px 0; }
.pmodal__desc ul, .pmodal__desc ol { padding-left: 1.3em; }
.pmodal__buy {
	position: sticky; bottom: -26px; display: flex; gap: 10px; margin: auto -30px -26px; padding: 16px 30px 20px;
	background: linear-gradient(rgba(255, 255, 255, 0), #fff 24%);
}
.pmodal__desc + .pmodal__buy, .pmodal__desc[hidden] + .pmodal__buy { margin-top: 22px; }
.pmodal__buy .btn--add { flex: 1; }
.pmodal .tag--frozen ~ .pmodal__buy .btn--add, .pmodal__box:has(.tag--frozen) .btn--add { background: var(--frozen); }
.pmodal__box:has(.tag--chilled) .btn--add { background: var(--chilled); }
.pmodal__box .btn--add:hover { background: var(--ink); }

@media (max-width: 720px) {
	.pmodal { padding: 0; align-items: end; }
	.pmodal__box {
		grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr);
		max-height: 92vh; max-height: 92dvh; border-radius: 20px 20px 0 0;
	}
	.pmodal__track > * { aspect-ratio: 4 / 3; }
	.pmodal__info { padding: 20px 18px 18px; }
	.pmodal__buy { bottom: -18px; margin: auto -18px -18px; padding: 14px 18px calc(16px + env(safe-area-inset-bottom)); }
}
