/* 富樂店車 台灣展售店 — 「夜市招牌 × 產品型錄」：暖白紙底、墨黑粗框、招牌橘紅與黃色貼紙。 */
:root {
  --paper: #f6f0e4;
  --paper-deep: #ece3d0;
  --card: #fffdf8;
  --ink: #17140f;
  --ink-soft: #5c554a;
  --line: #17140f;
  --hot: #e6401f;
  --hot-deep: #b92c11;
  --sun: #ffc93c;
  --teal: #0f5c57;
  --font-body: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  --font-num: 'Archivo Black', 'Noto Sans TC', sans-serif;
  --gutter: clamp(1rem, 4vw, 3.5rem);
  --shadow: 5px 5px 0 var(--ink);
  --fast: 160ms;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--hot); outline-offset: 3px; }

.skip { position: absolute; left: -999rem; }
.skip:focus { left: 1rem; top: 1rem; z-index: 50; background: var(--sun); padding: 0.5rem 1rem; }

/* ---------- 頂列 ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0.75rem var(--gutter);
  background: var(--ink); color: var(--paper);
}
.brand { display: flex; align-items: baseline; gap: 0.625rem; text-decoration: none; white-space: nowrap; }
.brand b { font-size: 1.375rem; font-weight: 900; letter-spacing: 0.08em; }
.brand span { font-size: 0.8125rem; padding: 0.125rem 0.5rem; background: var(--hot); border-radius: 2px; font-weight: 700; }
.nav { display: flex; gap: 1.5rem; margin-left: auto; font-size: 0.9375rem; }
.nav a { text-decoration: none; padding-block: 0.25rem; border-bottom: 2px solid transparent; transition: border-color var(--fast); }
.nav a:hover { border-color: var(--sun); }
.quote-toggle {
  border: 2px solid var(--paper); background: transparent; color: var(--paper);
  padding: 0.375rem 0.875rem; border-radius: 999px; cursor: pointer; font-weight: 700; white-space: nowrap;
  transition: background var(--fast), color var(--fast);
}
.quote-toggle:hover { background: var(--paper); color: var(--ink); }
.quote-toggle b { display: inline-block; min-width: 1.5rem; margin-left: 0.25rem; padding-inline: 0.375rem; background: var(--sun); color: var(--ink); border-radius: 999px; font-family: var(--font-num); font-weight: 400; }

/* ---------- 主視覺 ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); align-items: center; gap: 2rem;
  padding: clamp(2.5rem, 6vw, 5rem) var(--gutter) clamp(2rem, 5vw, 4rem);
  background:
    radial-gradient(circle at 78% 42%, var(--sun) 0 22rem, transparent 22.05rem),
    repeating-linear-gradient(90deg, transparent 0 3.9rem, rgb(23 20 15 / 0.05) 3.9rem 4rem),
    var(--paper);
  border-bottom: 3px solid var(--line);
  overflow: hidden;
}
.eyebrow { font-family: var(--font-num); font-size: 0.8125rem; letter-spacing: 0.14em; color: var(--hot-deep); }
.hero h1 { margin-block: 1rem 1.5rem; font-size: clamp(2.75rem, 7.2vw, 6rem); font-weight: 900; line-height: 1.08; letter-spacing: 0.01em; }
.hero h1 em { font-style: normal; color: var(--paper); background: var(--hot); padding-inline: 0.12em; box-shadow: var(--shadow); display: inline-block; transform: rotate(-2deg); }
.lead { max-width: 34rem; font-size: 1.0625rem; color: var(--ink-soft); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.875rem; margin-top: 2rem; }
.btn {
  display: inline-block; padding: 0.75rem 1.5rem; border: 2px solid var(--line); border-radius: 4px;
  background: var(--ink); color: var(--paper); font-weight: 700; text-decoration: none; cursor: pointer;
  box-shadow: 4px 4px 0 var(--hot); transition: transform var(--fast), box-shadow var(--fast);
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--hot); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--hot); }
.btn.ghost { background: var(--card); color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.btn.ghost:hover { box-shadow: 6px 6px 0 var(--ink); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.hero-stage { position: relative; aspect-ratio: 1.15; }
.hero-img { position: absolute; mix-blend-mode: multiply; }
.hero-img-1 { width: 74%; left: 2%; top: 20%; z-index: 2; }
.hero-img-2 { width: 50%; right: -4%; top: -4%; z-index: 1; }
.hero-img-3 { width: 34%; right: 4%; bottom: -2%; z-index: 3; }
.stamp {
  position: absolute; left: 0; top: 0; z-index: 4;
  display: grid; place-items: center; width: 7.5rem; aspect-ratio: 1; border-radius: 50%;
  background: var(--hot); color: var(--paper); border: 3px solid var(--line);
  font-family: var(--font-num); font-size: 2.75rem; line-height: 1; transform: rotate(-12deg); box-shadow: var(--shadow);
}
.stamp small { position: absolute; bottom: 1.1rem; font-family: var(--font-body); font-size: 0.875rem; font-weight: 900; }

/* ---------- 系列 ---------- */
.series { border-bottom: 3px solid var(--line); background: var(--ink); color: var(--paper); }
.series ul { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.series li + li { border-left: 1px solid rgb(246 240 228 / 0.2); }
.series a { display: block; height: 100%; padding: 1.5rem 1rem 1.75rem; text-decoration: none; transition: background var(--fast), color var(--fast); }
.series a:hover { background: var(--sun); color: var(--ink); }
.series-no { font-family: var(--font-num); font-size: 0.8125rem; color: var(--sun); }
.series a:hover .series-no { color: var(--hot-deep); }
.series b { display: block; margin-top: 0.25rem; font-size: 1.125rem; font-weight: 900; }
.series-count { font-size: 0.8125rem; opacity: 0.75; }
.series p { margin-top: 0.625rem; font-size: 0.8125rem; line-height: 1.6; opacity: 0.8; }

/* ---------- 區塊共用 ---------- */
section.catalog, section.specs, section.custom { padding: clamp(3rem, 7vw, 5.5rem) var(--gutter); }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 0.5rem 2rem; margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 3px solid var(--line); }
.section-head h2 { font-size: clamp(2rem, 4.5vw, 3.25rem); font-weight: 900; line-height: 1.15; }
.section-head p { color: var(--ink-soft); }

/* ---------- 篩選 ---------- */
.filters { position: sticky; top: 3.25rem; z-index: 10; margin-bottom: 2rem; padding-block: 0.75rem; background: var(--paper); }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { padding: 0.375rem 0.875rem; border: 2px solid var(--line); border-radius: 999px; background: var(--card); cursor: pointer; font-weight: 700; font-size: 0.9375rem; transition: background var(--fast), color var(--fast), transform var(--fast); }
.chip i { font-style: normal; font-family: var(--font-num); font-size: 0.75rem; font-weight: 400; opacity: 0.6; }
.chip:hover { transform: translateY(-2px); }
.chip.is-on { background: var(--ink); color: var(--paper); }
.filter-row { display: flex; flex-wrap: wrap; align-items: end; gap: 0.75rem 1rem; margin-top: 0.75rem; }
.field { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; font-weight: 700; }
.field span { white-space: nowrap; }
.field.grow { flex: 1 1 16rem; }
.field input, .field select { width: 100%; padding: 0.5rem 0.75rem; border: 2px solid var(--line); border-radius: 4px; background: var(--card); font-weight: 400; }
.result { margin-left: auto; font-size: 0.875rem; color: var(--ink-soft); }
.result b { font-family: var(--font-num); font-size: 1.5rem; font-weight: 400; color: var(--hot); }

/* ---------- 產品格 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); gap: 1.5rem; }
.card-link { display: flex; flex-direction: column; height: 100%; border: 2px solid var(--line); border-radius: 6px; background: var(--card); text-decoration: none; overflow: hidden; transition: transform var(--fast), box-shadow var(--fast); }
.card-link:hover, .card-link:focus-visible { transform: translate(-3px, -3px); box-shadow: var(--shadow); }
.card-photo { display: block; aspect-ratio: 1.15; background: #fff; border-bottom: 2px solid var(--line); overflow: hidden; }
.card-photo img { width: 100%; height: 100%; object-fit: contain; transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1); }
.card-link:hover .card-photo img { transform: scale(1.06); }
.card-body { display: flex; flex-direction: column; gap: 0.125rem; padding: 0.875rem 1rem 1rem; }
.card-code { font-family: var(--font-num); font-size: 0.75rem; letter-spacing: 0.08em; color: var(--hot-deep); }
.card-name { font-size: 1.125rem; font-weight: 900; line-height: 1.35; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.375rem; font-size: 0.8125rem; color: var(--ink-soft); }
.card-meta i { font-style: normal; padding: 0 0.5rem; background: var(--sun); color: var(--ink); border-radius: 2px; font-weight: 700; }
.empty { padding: 3rem 1rem; text-align: center; color: var(--ink-soft); border: 2px dashed var(--line); border-radius: 6px; }

/* ---------- 規格總表 ---------- */
section.specs { background: var(--paper-deep); border-block: 3px solid var(--line); }
.download { margin-left: 0.75rem; font-weight: 700; color: var(--hot-deep); }
.table-wrap { max-height: 34rem; overflow: auto; border: 2px solid var(--line); border-radius: 6px; background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th, td { padding: 0.5rem 0.875rem; text-align: left; white-space: nowrap; border-bottom: 1px solid rgb(23 20 15 / 0.12); }
th { position: sticky; top: 0; background: var(--ink); color: var(--paper); font-weight: 700; }
td.num { font-variant-numeric: tabular-nums; }
tbody tr:hover { background: rgb(255 201 60 / 0.25); }
td a { font-weight: 700; text-underline-offset: 3px; }
.equip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; margin-top: 2rem; }
.equip h3 { font-size: 1.125rem; font-weight: 900; margin-bottom: 0.625rem; }
.equip ul { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.equip li { padding: 0.25rem 0.75rem; border: 2px solid var(--line); border-radius: 999px; background: var(--card); font-size: 0.875rem; }

/* ---------- 訂製流程 ---------- */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; counter-reset: step; }
.steps li { position: relative; padding: 2.75rem 1.25rem 1.5rem; border: 2px solid var(--line); border-radius: 6px; background: var(--card); }
.steps li:nth-child(even) { transform: translateY(1.5rem); }
.steps span { position: absolute; top: -1.25rem; left: 1rem; display: grid; place-items: center; width: 3rem; aspect-ratio: 1; border: 2px solid var(--line); border-radius: 50%; background: var(--sun); font-family: var(--font-num); font-size: 1.25rem; }
.steps h3 { font-size: 1.25rem; font-weight: 900; }
.steps p { margin-top: 0.375rem; font-size: 0.9375rem; color: var(--ink-soft); }

/* ---------- 聯絡 ---------- */
.contact { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 2rem; align-items: center; padding: clamp(3rem, 7vw, 5rem) var(--gutter); background: var(--hot); color: var(--paper); border-top: 3px solid var(--line); }
.contact h2 { font-size: clamp(2rem, 4.5vw, 3.25rem); font-weight: 900; }
.contact p { margin-block: 0.75rem 1.5rem; max-width: 32rem; }
.contact .btn { box-shadow: 4px 4px 0 var(--sun); }
.contact-list { padding: 1.5rem; border: 2px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.contact-list li { display: flex; gap: 1rem; padding-block: 0.5rem; }
.contact-list li + li { border-top: 1px dashed rgb(23 20 15 / 0.3); }
.contact-list span { flex: 0 0 5rem; font-weight: 900; }
.contact-pending { margin: 0; padding: 1.5rem; border: 2px dashed var(--paper); border-radius: 6px; }

.foot { padding: 2rem var(--gutter); background: var(--ink); color: var(--paper); font-size: 0.8125rem; }
.foot p + p { margin-top: 0.375rem; opacity: 0.7; }

/* ---------- 對話框 ---------- */
dialog { padding: 0; border: 3px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); box-shadow: 10px 10px 0 var(--ink); }
dialog::backdrop { background: rgb(23 20 15 / 0.6); }
.close { position: absolute; top: 0.75rem; right: 0.75rem; z-index: 2; width: 2.5rem; aspect-ratio: 1; border: 2px solid var(--line); border-radius: 50%; background: var(--sun); font-size: 1.375rem; line-height: 1; cursor: pointer; }
.detail { width: min(68rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); }
.detail[open] { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.detail-photo { display: grid; place-items: center; background: #fff; border-right: 2px solid var(--line); }
.detail-photo img { width: 100%; max-height: calc(100dvh - 3rem); object-fit: contain; }
.detail-info { padding: 2rem 1.75rem; overflow-y: auto; max-height: calc(100dvh - 2.5rem); }
.detail-info h2 { font-size: 1.875rem; font-weight: 900; line-height: 1.25; padding-right: 2.5rem; }
.detail-cat { display: inline-block; margin-top: 0.375rem; padding: 0 0.625rem; background: var(--teal); color: var(--paper); border-radius: 2px; font-size: 0.8125rem; font-weight: 700; }
.detail-spec { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); margin: 1.25rem 0 0; border-top: 2px solid var(--line); }
.detail-spec dt, .detail-spec dd { margin: 0; padding: 0.5rem 0; border-bottom: 1px solid rgb(23 20 15 / 0.15); font-size: 0.9375rem; }
.detail-spec dt { font-weight: 900; }
.detail-plan { margin: 1.25rem 0 0; border: 2px solid var(--line); border-radius: 4px; background: #fff; }
.detail-plan figcaption { padding: 0.25rem 0.75rem; border-top: 2px solid var(--line); font-size: 0.75rem; color: var(--ink-soft); }
.detail-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.detail-actions .btn { padding: 0.5rem 1rem; font-size: 0.9375rem; }

.quote { width: min(32rem, calc(100vw - 2rem)); padding: 2rem 1.75rem; }
.quote h2 { font-size: 1.75rem; font-weight: 900; }
.quote-list { margin-top: 1rem; max-height: 45dvh; overflow-y: auto; }
.quote-list li { display: flex; align-items: center; gap: 0.75rem; padding-block: 0.5rem; border-bottom: 1px solid rgb(23 20 15 / 0.15); }
.quote-list img { width: 3.5rem; height: 3rem; object-fit: contain; background: #fff; border: 1px solid rgb(23 20 15 / 0.2); border-radius: 2px; }
.quote-list span { flex: 1; font-weight: 700; font-size: 0.9375rem; }
.quote-list button { border: 0; background: none; color: var(--hot-deep); cursor: pointer; text-decoration: underline; }
.quote-empty, .quote-note { margin-top: 1rem; font-size: 0.9375rem; color: var(--ink-soft); white-space: pre-wrap; }

/* ---------- 響應式 ---------- */
@media (max-width: 64rem) {
  .series ul { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .series li { border-top: 1px solid rgb(246 240 228 / 0.2); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 2.5rem; }
  .steps li:nth-child(even) { transform: none; }
}
@media (max-width: 48rem) {
  .top { flex-wrap: wrap; gap: 0.5rem 1rem; }
  .nav { order: 3; width: 100%; margin: 0; justify-content: space-between; gap: 0.5rem; font-size: 0.875rem; }
  .quote-toggle { margin-left: auto; }
  .hero { grid-template-columns: minmax(0, 1fr); background: radial-gradient(circle at 60% 78%, var(--sun) 0 13rem, transparent 13.05rem), var(--paper); }
  .stamp { width: 5.5rem; font-size: 2rem; }
  .stamp small { bottom: 0.7rem; }
  .series ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .series p { display: none; }
  .filters { top: 5.5rem; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.375rem; }
  .chip { white-space: nowrap; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
  .card-name { font-size: 1rem; }
  .equip, .contact { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .detail[open] { grid-template-columns: minmax(0, 1fr); overflow-y: auto; }
  .detail-photo { border-right: 0; border-bottom: 2px solid var(--line); }
  .detail-photo img { max-height: 42dvh; }
  .detail-info { max-height: none; overflow: visible; padding: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
