:root {
  --bg: #fff4f0;
  --bg-2: #ffeef5;
  --card: #ffffff;
  --ink: #5a4450;
  --ink-soft: #8d6f7a;
  --pink: #ff8fab;
  --pink-d: #ef6b8d;
  --peach: #ffd5c6;
  --mint: #c8ece3;
  --lav: #e6d7f8;
  --butter: #ffe9a8;
  --cream: #fff7f2;
  --line: #f4d4ce;
  --shadow: 0 10px 28px rgba(232, 140, 160, 0.16);
  --radius: 22px;
  --font-cute: "ZCOOL KuaiLe", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", "Heiti SC", sans-serif;
}

@font-face {
  font-family: "ZCOOL KuaiLe";
  src: url("../fonts/ZCOOLKuaiLe.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse at 0% -10%, #ffe0ec 0%, transparent 50%),
    radial-gradient(ellipse at 100% 0%, #ffe9c8 0%, transparent 46%),
    radial-gradient(ellipse at 100% 80%, #d9f3ee 0%, transparent 40%),
    radial-gradient(ellipse at 0% 100%, #ead9f8 0%, transparent 36%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100%;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80'><g fill='%23f3b2c0' opacity='0.35'><circle cx='12' cy='18' r='1.6'/><circle cx='58' cy='44' r='1.3'/><path d='M28 58c0-2 1.6-3.4 3.2-3.4S34.4 56 34.4 58c0 2.4-3.2 4.4-3.2 4.4S28 60.4 28 58z'/></g></svg>");
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 540px;
  margin: 0 auto;
  padding: 0 14px 120px;
}

/* Shared bits still used by /admin */
.logo {
  font-family: var(--font-cute);
  font-size: 34px;
  margin: 0;
  letter-spacing: 1px;
  color: var(--ink);
  text-shadow: 2px 3px 0 rgba(255, 182, 196, 0.45);
}
.logo span { color: var(--pink-d); }
.sub {
  margin: 8px 18px 0;
  color: var(--ink-soft);
  font-size: 13.5px;
}
.sub em {
  font-style: normal;
  color: var(--pink-d);
  font-weight: 600;
}

.search {
  margin: 16px 2px 10px;
  position: relative;
}
.search input {
  width: 100%;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 12px 16px 12px 42px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  box-shadow: var(--shadow);
}
.search input::placeholder { color: #c9a8b0; }
.search input:focus { border-color: var(--pink); }
.search .ico {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
}

.count-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 2px 6px 10px;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.count-line b { color: var(--pink-d); font-weight: 600; }

.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 16px;
  color: var(--ink-soft);
  background: #fff;
  border-radius: var(--radius);
  border: 1.5px dashed var(--line);
}
.empty b { display: block; font-family: var(--font-cute); font-size: 20px; color: var(--ink); margin-bottom: 6px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  background: #5a4450;
  color: #fff;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: .25s ease;
  box-shadow: 0 10px 24px rgba(90, 68, 80, 0.28);
  max-width: 86%;
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast.up { bottom: 92px; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(50, 30, 40, 0.55);
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.show { display: flex; }
.modal .box {
  background: #fff;
  border-radius: 24px;
  padding: 22px 18px 16px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  box-shadow: var(--shadow);
}
.modal h3 { font-family: var(--font-cute); margin: 0 0 8px; font-size: 20px; }
.modal p { margin: 0 0 12px; color: var(--ink-soft); font-size: 13px; }
.modal textarea {
  width: 100%;
  min-height: 90px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  padding: 10px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
}
.modal button {
  margin-top: 12px;
  border: 0;
  background: var(--pink-d);
  color: #fff;
  font-family: var(--font-cute);
  border-radius: 999px;
  padding: 9px 22px;
  font-size: 15px;
  cursor: pointer;
}

/* ============================================================
   Shop storefront (body.shop) — does not change /admin look
   ============================================================ */
body.shop {
  --shop-bg: #f4f4f4;
  --shop-card: #ffffff;
  --shop-ink: #222222;
  --shop-muted: #8a8a8a;
  --shop-line: #e8e8e8;
  --shop-accent: #c8161d;
  --shop-accent-d: #a51218;
  --shop-header: #ffffff;
  --shop-max: 1240px;
  --shop-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shop-shadow-h: 0 8px 24px rgba(0, 0, 0, 0.1);
  color: var(--shop-ink);
  background: var(--shop-bg);
  background-attachment: scroll;
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  line-height: 1.55;
}
body.shop::before { display: none; }
body.shop.detail-open { overflow: hidden; }

.shop-stick {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--shop-header);
}
.topbar {
  background: var(--shop-header);
}
.topbar-inner {
  max-width: var(--shop-max);
  margin: 0 auto;
  padding: 12px 20px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "brand search want";
  align-items: center;
  gap: 20px;
}
.brand { grid-area: brand; }
.shop-search { grid-area: search; }
.want-entry { grid-area: want; }
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
  flex: none;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  object-position: center;
  background: #000;
  display: block;
  flex: none;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 18px; font-weight: 650; letter-spacing: 0.04em; }
.brand-tag { font-size: 11px; color: var(--shop-muted); margin-top: 3px; letter-spacing: 0.06em; }

.shop-search {
  position: relative;
  width: 100%;
  max-width: 720px;
  justify-self: stretch;
}
.shop-search-ico {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  pointer-events: none;
}
.shop-search input {
  width: 100%;
  height: 40px;
  border: 2px solid var(--shop-accent);
  border-radius: 2px;
  padding: 0 14px 0 38px;
  font-size: 14px;
  font-family: inherit;
  color: var(--shop-ink);
  background: #fff;
  outline: none;
}
.shop-search input::placeholder { color: #b0b0b0; }
.shop-search input:focus { box-shadow: 0 0 0 3px rgba(200, 22, 29, 0.08); }

.want-entry {
  height: 40px;
  border: 1px solid var(--shop-line);
  background: #fff;
  color: var(--shop-ink);
  border-radius: 2px;
  padding: 0 14px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.want-entry b { color: var(--shop-accent); font-size: 15px; margin-left: 2px; }
.want-entry.has { border-color: var(--shop-accent); color: var(--shop-accent); }

.catbar {
  background: #fff;
  border-bottom: 1px solid var(--shop-line);
  box-shadow: 0 1px 0 rgba(0,0,0,0.03);
}
.catbar-inner {
  max-width: var(--shop-max);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.catbar-inner::-webkit-scrollbar { display: none; }
.shop .cat {
  flex: none;
  border: 0;
  background: transparent;
  color: #555;
  font-family: inherit;
  font-size: 14px;
  padding: 12px 18px;
  margin: 0;
  cursor: pointer;
  position: relative;
  letter-spacing: 0.04em;
}
.shop .cat:hover { color: var(--shop-accent); }
.shop .cat.on {
  color: var(--shop-accent);
  font-weight: 650;
}
.shop .cat.on::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 0;
  height: 2px;
  background: var(--shop-accent);
}
.page {
  max-width: var(--shop-max);
  margin: 0 auto;
  padding: 16px 20px 80px;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(220px, 0.7fr);
  gap: 10px;
  margin-bottom: 18px;
  height: 400px;
}
.hero-main {
  position: relative;
  background: #1c1c1c;
  overflow: hidden;
  border-radius: 4px;
  height: 100%;
  min-height: 0;
}
.hero-track { position: relative; width: 100%; height: 100%; min-height: 0; }
.hero-slide {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: #1c1c1c;
  cursor: pointer;
  opacity: 0;
  transition: opacity .45s ease;
  display: block;
  width: 100%;
  height: 100%;
}
.hero-slide.on { opacity: 1; z-index: 1; }
.hero-fill {
  position: absolute;
  inset: -28px;
  background-color: #2a2926;
  background-size: cover;
  background-position: center;
  filter: blur(28px) saturate(1.05);
  transform: scale(1.12);
  opacity: 0.55;
  pointer-events: none;
}
.hero-slide img,
.hero-side img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  pointer-events: none;
}
.hero-slide.is-pack img,
.hero-side.is-pack img {
  box-sizing: border-box;
  padding: 12px 16px 78px;
  object-fit: contain;
}
.hero-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 28px 16px 14px;
  background: linear-gradient(transparent, rgba(0,0,0,0.62));
  color: #fff;
  text-align: left;
  font-size: 16px;
  font-weight: 550;
  letter-spacing: 0.02em;
}
.hero-cap em {
  display: block;
  font-style: normal;
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.12em;
  opacity: 0.85;
  margin-bottom: 4px;
}
.hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 36px;
  height: 52px;
  border: 0;
  background: rgba(0,0,0,0.35);
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  line-height: 1;
}
.hero-nav:hover { background: rgba(0,0,0,0.55); }
.hero-nav.prev { left: 0; border-radius: 0 2px 2px 0; }
.hero-nav.next { right: 0; border-radius: 2px 0 0 2px; }
.hero-dots {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  display: flex;
  gap: 6px;
}
.hero-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: rgba(255,255,255,0.45);
  cursor: pointer;
}
.hero-dot.on { background: #fff; }
.hero-sides {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
  min-height: 0;
  height: 100%;
}
.hero-side {
  position: relative;
  border: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 4px;
  background: #1c1c1c;
  cursor: pointer;
  min-height: 0;
  height: auto;
}
.hero-side .hero-cap { font-size: 14px; padding: 20px 12px 10px; }

.shop-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.shop .count-line {
  padding: 0;
  font-size: 13px;
  color: #666;
}
.shop .count-line b { color: var(--shop-ink); font-weight: 650; }
.filters {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: #555;
}
.toggle { display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.toggle input { accent-color: var(--shop-accent); }
.sort-label { display: flex; align-items: center; gap: 6px; }
.sort-label select {
  border: 1px solid var(--shop-line);
  background: #fff;
  border-radius: 2px;
  padding: 5px 8px;
  font-size: 13px;
  font-family: inherit;
  color: var(--shop-ink);
}

/* Product grid */
.shop .grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.shop .card {
  background: var(--shop-card);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shop-shadow);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}
.shop .card:hover { transform: translateY(-2px); box-shadow: var(--shop-shadow-h); }
.shop .pic {
  position: relative;
  background: #f7f7f7;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.shop .pic img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.shop .info {
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.shop .name-block { min-height: 2.8em; }
.shop .name {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  max-height: 2.8em;
  overflow: hidden;
  color: var(--shop-ink);
}
.shop .name-alt {
  font-size: 11px;
  color: var(--shop-muted);
  line-height: 1.35;
  margin-top: 2px;
  max-height: 2.7em;
  overflow: hidden;
  font-weight: 400;
}
.detail-name-alt {
  font-size: 13px;
  color: var(--shop-muted);
  margin: 4px 0 0;
  font-weight: 400;
  line-height: 1.4;
}
.hero-cap .name-alt {
  display: block;
  font-size: 11px;
  font-weight: 400;
  opacity: 0.8;
  margin-top: 2px;
}
.shop .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 11px;
  color: var(--shop-muted);
}
.shop .meta .code { letter-spacing: 0.04em; }
.shop .price {
  font-size: 18px;
  font-weight: 650;
  color: var(--shop-accent);
  letter-spacing: 0.02em;
  margin-top: 4px;
  min-height: 26px;
  display: flex;
  align-items: center;
  font-family: inherit;
}
.shop .price.ask {
  font-size: 12px;
  font-weight: 600;
  color: var(--shop-accent);
  background: #fff5f5;
  border: 1px solid #f0c9c9;
  display: inline-flex;
  align-items: center;
  height: 22px;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 2px;
  letter-spacing: 0.08em;
  width: fit-content;
}
.shop .want {
  margin-top: 6px;
  width: 100%;
  border: 1px solid var(--shop-accent);
  background: var(--shop-accent);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.06em;
  border-radius: 2px;
  padding: 7px 0;
  cursor: pointer;
}
.shop .want:hover { background: var(--shop-accent-d); border-color: var(--shop-accent-d); }
.shop .want.added {
  background: #fff;
  color: var(--shop-accent);
}
.shop .want.sold,
.shop .want:disabled {
  background: #c8c8c8;
  border-color: #c8c8c8;
  color: #fff;
  cursor: not-allowed;
}
.badge-sold {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  margin: 0 auto;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  justify-content: center;
}
.shop .card.sold .pic img { filter: grayscale(0.35) brightness(0.95); opacity: 0.9; }

.shop .empty {
  border-radius: 4px;
  border: 1px dashed var(--shop-line);
  color: var(--shop-muted);
}
.shop .empty b {
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: var(--shop-ink);
}

.more-wrap { text-align: center; padding: 24px 0 8px; }
.more-btn {
  border: 1px solid var(--shop-line);
  background: #fff;
  color: #555;
  border-radius: 2px;
  padding: 10px 28px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.more-btn:hover { border-color: #ccc; color: var(--shop-ink); }

.shop .foot-brand {
  font-weight: 650;
  color: var(--shop-ink);
  letter-spacing: 0.04em;
  margin: 0 0 8px;
}
.foot {
  text-align: center;
  padding: 40px 12px 20px;
  margin-top: 12px;
  color: #999;
  font-size: 12px;
  border-top: 1px solid var(--shop-line);
}
.shop .foot p { margin: 0 0 6px; }
.foot-note { color: #b0b0b0; }

/* Wishlist bar */
.shop .bar {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%) translateY(120%);
  width: calc(100% - 32px);
  max-width: 560px;
  background: #fff;
  border: 1px solid var(--shop-line);
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.14);
  z-index: 20;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform .28s ease;
}
.shop .bar { visibility: hidden; opacity: 0; pointer-events: none; }
.shop .bar.show { transform: translateX(-50%) translateY(0); visibility: visible; opacity: 1; pointer-events: auto; }
.shop .bar .txt { flex: 1; font-size: 13px; color: #666; min-width: 0; }
.shop .bar .txt b { color: var(--shop-accent); font-size: 15px; }
.shop .bar button {
  flex: none;
  border: 0;
  background: var(--shop-accent);
  color: #fff;
  font-family: inherit;
  border-radius: 2px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}
.shop .bar .clear {
  background: #fff;
  color: #666;
  border: 1px solid var(--shop-line);
}

/* Product detail */
.detail {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.detail[hidden] { display: none !important; }
.detail-panel {
  position: relative;
  background: #fff;
  width: min(960px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: 4px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.detail-x {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #f2f2f2;
  color: #333;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.detail-media {
  background: #f7f7f7;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.detail-media img {
  max-width: 100%;
  max-height: min(72vh, 640px);
  object-fit: contain;
  display: block;
}
.detail-info { padding: 28px 28px 32px; }
.detail-cat {
  font-size: 12px;
  color: var(--shop-muted);
  letter-spacing: 0.12em;
  margin-bottom: 8px;
}
.detail-name {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: 0.02em;
}
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 13px;
  color: #666;
  margin-bottom: 16px;
}
.detail-price {
  font-size: 28px;
  font-weight: 700;
  color: var(--shop-accent);
  margin-bottom: 6px;
}
.detail-price.ask {
  font-size: 13px;
  font-weight: 600;
  color: var(--shop-accent);
  background: #fff5f5;
  border: 1px solid #f0c9c9;
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 2px;
  letter-spacing: 0.08em;
  width: fit-content;
}
.detail-stock { font-size: 13px; color: #3a7d4a; margin-bottom: 20px; }
.detail-stock.out { color: #999; }
.detail-how {
  background: #fafafa;
  border: 1px solid var(--shop-line);
  border-radius: 4px;
  padding: 14px 14px 12px;
  margin-bottom: 18px;
}
.detail-how h3 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 650;
  color: var(--shop-ink);
}
.detail-how p { margin: 0; font-size: 13px; color: #666; line-height: 1.6; }
.detail-info .want { width: 100%; padding: 11px 0; font-size: 15px; }

.shop .toast {
  background: #222;
  border-radius: 4px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.25);
}
.shop .modal { background: rgba(0,0,0,0.5); }
.shop .modal .box {
  border-radius: 4px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.18);
  text-align: left;
}
.shop .modal h3 { font-family: inherit; font-size: 18px; }
.shop .modal button {
  font-family: inherit;
  background: var(--shop-accent);
  border-radius: 2px;
}

@media (max-width: 1100px) {
  .shop .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shop .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; height: 320px; }
  .hero-sides { display: none; }
  .hero-slide.is-pack img { padding: 10px 12px 70px; }
  .hero-main, .hero-track { height: 100%; }
  .detail-panel { grid-template-columns: 1fr; max-height: calc(100vh - 24px); }
  .detail-media { min-height: 240px; padding: 8px; }
  .detail-media img { max-height: 48vh; }
  .detail-info { padding: 18px 16px 24px; }
}
@media (max-width: 640px) {
  .topbar-inner {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand want"
      "search search";
    gap: 10px 12px;
    padding: 10px 12px 12px;
  }
  .brand-name { font-size: 16px; }
  .brand-tag { font-size: 10px; }
  .shop-search { max-width: none; }
  .want-entry { padding: 0 10px; height: 36px; font-size: 12px; }
  .lang-toggle { height: 36px; }
  .lang-toggle button { min-width: 28px; padding: 0 6px; font-size: 11px; }
  .catbar-inner { padding: 0 8px; }
  .shop .cat { padding: 10px 12px; font-size: 13px; }
  .shop .cat.on::after { left: 12px; right: 12px; }
  .page { padding: 12px 10px 96px; }
  .shop .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .shop .price { font-size: 16px; }
  .hero { height: 280px; }
  .hero-cap { font-size: 14px; }
  .hero-slide.is-pack img { padding: 8px 10px 62px; }
}

@media (min-width: 861px) and (max-width: 1100px) {
  /* tablet: 4 columns already set; keep hero side-by-side if space */
  .hero { grid-template-columns: minmax(0, 1.6fr) minmax(180px, 0.7fr); height: 360px; }
}


/* ============================================================
   Cart, account, checkout
   ============================================================ */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  grid-area: want;
  justify-self: end;
  flex-wrap: wrap;
}
.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--shop-line);
  border-radius: 2px;
  overflow: hidden;
  height: 40px;
  flex: none;
  background: #fff;
}
.lang-toggle button {
  border: 0;
  background: transparent;
  color: #666;
  font-family: inherit;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  padding: 0 9px;
  min-width: 32px;
  cursor: pointer;
  line-height: 1;
}
.lang-toggle button[aria-pressed="true"] {
  background: var(--shop-ink);
  color: #fff;
}
.lang-toggle button:focus-visible {
  outline: 2px solid var(--shop-accent);
  outline-offset: -2px;
}
.topbar-actions .want-entry,
.topbar-actions .cart-entry,
.topbar-actions .account-entry { grid-area: auto; }
.account-entry {
  height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--shop-line);
  border-radius: 2px;
  color: var(--shop-ink);
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
  background: #fff;
}
.account-entry:hover { border-color: #ccc; }
.cart-entry,
.want-entry {
  height: 40px;
}
.cart-entry {
  border: 1px solid var(--shop-line);
  background: #fff;
  color: var(--shop-ink);
  border-radius: 2px;
  padding: 0 14px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.cart-entry b { color: var(--shop-accent); font-size: 15px; margin-left: 2px; }
.cart-entry.has { border-color: var(--shop-accent); color: var(--shop-accent); }
.shop .want.cart-btn { letter-spacing: 0.04em; }

.cart-drawer[hidden] { display: none !important; }
.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 55;
  visibility: hidden;
}
.cart-drawer.show { visibility: visible; }
.cart-mask {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  transition: opacity .2s ease;
}
.cart-drawer.show .cart-mask { opacity: 1; }
.cart-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(400px, 100%);
  height: 100%;
  background: #fff;
  box-shadow: -8px 0 30px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .22s ease;
}
.cart-drawer.show .cart-panel { transform: translateX(0); }
.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--shop-line);
}
.cart-head h2 { margin: 0; font-size: 16px; font-weight: 650; }
.cart-head button {
  border: 0;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  color: #333;
  width: 36px;
  height: 36px;
}
.cart-lines { flex: 1; overflow: auto; padding: 8px 12px; }
.cart-empty { text-align: center; color: var(--shop-muted); padding: 48px 12px; }
.cart-line {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px 4px;
  border-bottom: 1px solid #f2f2f2;
}
.cart-line img {
  width: 64px; height: 64px; object-fit: contain; background: #f7f7f7; border-radius: 2px;
}
.cart-line-name { font-size: 13px; font-weight: 550; line-height: 1.35; }
.cart-line-meta { font-size: 12px; color: var(--shop-muted); margin: 3px 0 8px; }
.cart-line-qty { display: inline-flex; align-items: center; border: 1px solid var(--shop-line); border-radius: 2px; }
.cart-line-qty button, .cart-line-qty input {
  border: 0; background: #fff; height: 28px; font-family: inherit; color: var(--shop-ink);
}
.cart-line-qty button { width: 28px; cursor: pointer; }
.cart-line-qty input { width: 36px; text-align: center; font-size: 13px; }
.cart-line-side { text-align: right; }
.cart-line-amt { font-weight: 650; color: var(--shop-accent); font-size: 14px; }
.cart-line-del { border: 0; background: none; color: #999; font-size: 12px; cursor: pointer; margin-top: 8px; }
.cart-foot {
  border-top: 1px solid var(--shop-line);
  padding: 12px 16px 16px;
}
.cart-foot-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.cart-foot-row b { color: var(--shop-accent); font-size: 18px; }
.cart-foot .want { width: 100%; padding: 10px 0; font-size: 15px; }
.cart-foot .want:disabled { background: #c8c8c8; border-color: #c8c8c8; cursor: not-allowed; }

.shop-page { max-width: 960px; margin: 0 auto; padding: 24px 20px 80px; }
.shop-page h1 { margin: 0 0 6px; font-size: 22px; font-weight: 650; }
.shop-lead { margin: 0 0 20px; color: #666; font-size: 13px; }
.checkout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.8fr);
  gap: 20px;
  align-items: start;
}
.checkout-card, .account-card {
  background: #fff;
  border: 1px solid var(--shop-line);
  border-radius: 4px;
  padding: 18px 18px 20px;
  box-shadow: var(--shop-shadow);
}
.checkout-card h2, .account-card h2 { margin: 0 0 14px; font-size: 15px; font-weight: 650; }
.shop-field { margin-bottom: 12px; }
.shop-field label { display: block; font-size: 12px; color: #666; margin-bottom: 4px; }
.shop-field input, .shop-field textarea, .shop-field select {
  width: 100%;
  height: 38px;
  border: 1px solid #d8d8d8;
  border-radius: 2px;
  padding: 0 10px;
  font-size: 14px;
  font-family: inherit;
}
.shop-field textarea { height: 80px; padding: 8px 10px; resize: vertical; }
.shop-field input:focus, .shop-field textarea:focus, .shop-field select:focus {
  outline: none;
  border-color: var(--shop-accent);
  box-shadow: 0 0 0 3px rgba(200, 22, 29, 0.1);
}
.ship-options { display: flex; gap: 10px; margin-bottom: 12px; }
.ship-options label {
  flex: 1;
  border: 1px solid var(--shop-line);
  border-radius: 2px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13px;
}
.ship-options label.on { border-color: var(--shop-accent); background: #fff7f7; }
.checkout-summary-line { display: flex; justify-content: space-between; margin: 6px 0; font-size: 13px; }
.checkout-summary-line.total { font-size: 16px; font-weight: 700; color: var(--shop-accent); margin-top: 10px; }
.checkout-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f3f3f3; font-size: 13px; }
.checkout-item img { width: 52px; height: 52px; object-fit: contain; background: #f7f7f7; }
.checkout-item .amt { margin-left: auto; font-weight: 650; }
.form-error { color: var(--shop-accent); font-size: 13px; min-height: 1.2em; margin: 0 0 8px; }

.account-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.account-tabs { display: flex; gap: 0; margin-bottom: 14px; }
.account-tabs button {
  flex: 1;
  border: 1px solid var(--shop-line);
  background: #fff;
  height: 36px;
  font-family: inherit;
  cursor: pointer;
}
.account-tabs button.on { border-color: var(--shop-accent); color: var(--shop-accent); font-weight: 650; }
.order-row {
  display: grid;
  gap: 6px;
  padding: 14px 0;
  border-bottom: 1px solid #f0f0f0;
}
.order-row-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.order-id { font-weight: 650; }
.order-status { color: var(--shop-accent); font-weight: 650; }
.order-status.done { color: #3a7d4a; }
.order-status.cancel { color: #999; }
.order-meta { font-size: 12px; color: #777; }
.auth-note { font-size: 12px; color: #888; margin-top: 10px; }

.pay-box {
  background: #fffaf6;
  border: 1px solid #f0e0d0;
  border-radius: 4px;
  padding: 14px;
  margin: 16px 0;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.65;
}
.pay-box.empty { color: #888; background: #fafafa; border-color: var(--shop-line); }

@media (max-width: 860px) {
  .topbar-inner {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand want"
      "search search";
  }
  .checkout-grid, .account-layout { grid-template-columns: 1fr; }
  .account-entry { padding: 0 8px; height: 36px; font-size: 12px; }
  .cart-entry, .want-entry { height: 36px; padding: 0 10px; font-size: 12px; }
  .lang-toggle { height: 36px; }
  .lang-toggle button { min-width: 28px; padding: 0 6px; font-size: 11px; }
}

#snow-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 80;
}
@media (prefers-reduced-motion: reduce) {
  #snow-canvas { display: none !important; }
}

/* ----- Customer chat + legal footer ----- */
.foot-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: center;
  margin: 14px 0 0;
  font-size: 13px;
}
.foot-legal a { color: var(--ink-soft, #6a5a60); text-decoration: none; }
.foot-legal a:hover { color: var(--shop-accent, #c8161d); text-decoration: underline; }

#chat-widget { position: static; }
.chat-launch {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 70;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #c8161d;
  color: #fff;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(200, 22, 29, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-launch:hover { background: #a51218; }
.chat-launch.is-open { display: none; }
.chat-launch-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.chat-launch-ico { display: block; }
.chat-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: #fff;
  color: #c8161d;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  font-weight: 700;
  box-shadow: 0 0 0 2px #c8161d;
}
#chat-widget [hidden] { display: none !important; }
.chat-panel {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 71;
  width: 340px;
  height: 460px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #eadfe3;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(60, 30, 40, 0.2);
  overflow: hidden;
}
.chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #c8161d;
  color: #fff;
  flex: 0 0 auto;
}
.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  flex: 0 0 auto;
}
.chat-head-text { flex: 1; min-width: 0; }
.chat-head h2 { margin: 0; font-size: 15px; font-weight: 650; line-height: 1.2; color: #fff; }
.chat-status { margin: 2px 0 0; font-size: 11px; opacity: 0.9; line-height: 1.3; }
.chat-x {
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
}
.chat-x:hover { background: rgba(255,255,255,0.15); }
.chat-thread {
  flex: 1 1 auto;
  overflow: auto;
  padding: 12px 12px 8px;
  background: #f7f3f4;
  min-height: 0;
}
.chat-hint { margin: 0 0 8px; font-size: 12.5px; color: #6a5a60; }
.chat-err { color: #c8161d; font-size: 13px; margin: 8px 0 0; }
.chat-id-card {
  background: #fff;
  border: 1px solid #eadfe3;
  border-radius: 12px;
  padding: 10px;
  margin: 0 0 10px;
}
.chat-field { display: block; margin: 0 0 8px; font-size: 12px; color: #6a5a60; }
.chat-field:last-child { margin-bottom: 0; }
.chat-field input {
  display: block;
  width: 100%;
  margin-top: 3px;
  padding: 7px 9px;
  border: 1px solid #eadfe3;
  border-radius: 8px;
  font: inherit;
  box-sizing: border-box;
}
.chat-msg { margin: 0 0 10px; max-width: 82%; display: flex; flex-direction: column; align-items: flex-start; }
.chat-msg.mine { margin-left: auto; align-items: flex-end; }
.chat-bubble {
  display: inline-block;
  padding: 8px 11px;
  border-radius: 16px 16px 16px 4px;
  background: #fff;
  font-size: 13.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(60,30,40,0.06);
  color: #2b2226;
}
.chat-msg.mine .chat-bubble {
  background: #c8161d;
  color: #fff;
  border-radius: 16px 16px 4px 16px;
}
.chat-meta { font-size: 10.5px; color: #8a7a80; margin-top: 3px; padding: 0 2px; }
.chat-faq-dock {
  flex: 0 0 auto;
  border-top: 1px solid #f0e4e6;
  background: #fff;
  padding: 6px 10px 0;
}
.chat-faq-toggle {
  border: 1px solid #eadfe3;
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  color: #5a4a50;
}
.chat-faq-toggle.on, .chat-faq-toggle:hover { border-color: #c8161d; color: #c8161d; }
.chat-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 0 6px;
  scrollbar-width: thin;
}
.chat-chip {
  flex: 0 0 auto;
  border: 1px solid #eadfe3;
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.chat-chip:hover { border-color: #c8161d; color: #c8161d; }
.chat-compose {
  display: flex;
  gap: 8px;
  padding: 8px 10px 10px;
  border-top: 0;
  background: #fff;
  flex: 0 0 auto;
}
.chat-compose textarea {
  flex: 1;
  resize: none;
  border: 1px solid #eadfe3;
  border-radius: 18px;
  padding: 8px 12px;
  font: inherit;
  min-height: 38px;
  max-height: 80px;
  line-height: 1.4;
}
.chat-compose button {
  border: 0;
  border-radius: 18px;
  background: #c8161d;
  color: #fff;
  padding: 0 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  min-width: 52px;
}
.chat-compose button:disabled { opacity: 0.55; cursor: default; }

@media (max-width: 640px) {
  .chat-launch { width: 52px; height: 52px; bottom: 12px; right: 12px; }
  .chat-panel {
    inset: 0;
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;
  }
  body.chat-open { overflow: hidden; }
}

.legal-page { max-width: 720px; margin: 0 auto; padding: 24px 16px 80px; }
.legal-page h1 { font-size: 28px; margin: 0 0 8px; }
.legal-page .lead { color: #6a5a60; margin: 0 0 20px; }
.legal-page h2 { font-size: 18px; margin: 24px 0 8px; }
.legal-page p, .legal-page li { font-size: 15px; line-height: 1.65; }
.legal-page a { color: #c8161d; }

@media (max-width: 720px) {
  .chat-launch { height: 40px; padding: 0 12px; font-size: 13px; bottom: 12px; right: 12px; }
  .chat-panel { right: 8px; left: 8px; width: auto; bottom: 60px; }
}

/* legal + shipping + admin chat */
.legal-page { max-width: 720px; }
.legal-body { white-space: pre-wrap; line-height: 1.65; margin: 16px 0 24px; }
.ship-fee-note { margin: 8px 0 12px; }
.order-banner { padding: 10px 12px; background: #fff6e8; border-radius: 8px; }
.tab-badge { display: inline-block; min-width: 1.15em; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: #c43; color: #fff; font-size: 11px; line-height: 1.5; font-style: normal; vertical-align: middle; }
.admin-chat { display: grid; grid-template-columns: 260px 1fr; gap: 16px; min-height: 480px; }
.admin-chat-threads { display: flex; flex-direction: column; gap: 6px; max-height: 70vh; overflow: auto; }
.admin-chat-item { text-align: left; border: 1px solid #eadfce; background: #fff; border-radius: 8px; padding: 8px 10px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.admin-chat-item.on { border-color: #8a5a2b; background: #fff8ee; }
.admin-chat-msgs { min-height: 280px; max-height: 60vh; overflow: auto; padding: 12px; background: #f7f3f4; border-radius: 8px; display: flex; flex-direction: column; }
.admin-chat-msg { margin: 0 0 10px; max-width: 78%; display: flex; flex-direction: column; align-items: flex-start; }
.admin-chat-msg.them { align-self: flex-start; }
.admin-chat-msg.me { align-self: flex-end; align-items: flex-end; margin-left: auto; }
.admin-bubble { display: inline-block; padding: 8px 11px; border-radius: 16px 16px 16px 4px; background: #fff; font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; box-shadow: 0 1px 2px rgba(60,30,40,0.06); }
.admin-chat-msg.me .admin-bubble { background: #c8161d; color: #fff; border-radius: 16px 16px 4px 16px; }
.admin-chat-time { font-size: 10.5px; color: #8a7a80; margin-top: 3px; }
.admin-chat-reply { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.faq-edit { border: 1px solid #eadfce; border-radius: 8px; padding: 12px; margin: 12px 0; }
@media (max-width: 800px) { .admin-chat { grid-template-columns: 1fr; } }

/* reviews + auth links */
button.linkish, a.linkish { background: none; border: 0; padding: 0; color: #8a5a2b; cursor: pointer; font: inherit; text-decoration: underline; }
.reviews { margin: 36px auto 8px; max-width: 1100px; padding: 0 16px 8px; }
.reviews h2 { font-size: 20px; margin: 0 0 16px; }
.reviews-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.review-card { background: #fff; border: 1px solid #eadfce; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.review-photo img { display: block; width: 100%; height: 180px; object-fit: cover; }
.review-body { padding: 12px 14px 14px; }
.review-text { margin: 0 0 8px; line-height: 1.55; white-space: pre-wrap; }
.review-name { margin: 0; color: #7a6a58; font-size: 13px; }

.card-desc { margin: 6px 0 0; font-size: 12px; line-height: 1.45; color: #6b5e4e; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.detail-desc { margin: 10px 0 0; font-size: 14px; line-height: 1.6; white-space: pre-wrap; color: #3f3429; }
.col-stock .cell-input[data-k="reserved"] { margin-top: 4px; }
.avail-note { display: block; font-size: 11px; color: #7a6a58; margin-top: 2px; }
