/* Wan Da Wholesale Foods storefront — light-green "fresh market" edition.
 * Mobile-first, fresh-produce-market aesthetic.
 * One stylesheet, no dependencies, no external assets. */

:root {
  --red: #2e7d32;
  --red-deep: #1b5e20;
  --red-ink: #14501c;
  --red-soft: #e8f5e9;
  --gold: #aed581;
  --gold-deep: #7cb342;
  --price: #d9232e;
  --ink: #1e2b1e;
  --muted: #5f6f60;
  --faint: #9aa39a;
  --line: #e2ece2;
  --bg: #f4faf4;
  --card: #ffffff;
  --green: #1e8e4e;
  --green-soft: #e3f3e8;
  --amber: #a86a00;
  --amber-soft: #fdf3e0;
  --gray-soft: #eef2ee;
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 560px;
  --shadow: 0 1px 2px rgba(30, 70, 40, .06), 0 4px 14px rgba(30, 70, 40, .07);
  --shadow-lg: 0 2px 6px rgba(30, 70, 40, .08), 0 10px 30px rgba(30, 70, 40, .12);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  padding-bottom: 76px; /* bottom nav */
  overflow-x: clip;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
input, textarea {
  font: inherit; width: 100%; padding: 13px 14px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink);
}
input:focus, textarea:focus {
  outline: none; border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, .14);
}
::placeholder { color: var(--faint); }

/* ================= header ================= */
#hdr {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(135deg, var(--red) 0%, var(--red-deep) 100%);
  color: #fff;
  box-shadow: 0 2px 12px rgba(27, 94, 32, .35);
}
#hdr::after {
  content: ""; display: block; height: 3px;
  background: linear-gradient(90deg, var(--gold), #dcedc8 50%, var(--gold));
}
.hdr-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 16px;
}
.logo { display: flex; align-items: center; gap: 10px; color: #fff; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 34px;
  background: linear-gradient(135deg, #fff 0%, #e8f5e9 100%);
  color: var(--red-deep); font-weight: 900; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
/* Classic WD card logo in the header (owner 2026-11-14) — transparent, no badge */
.logo-mark-img {
  height: 40px; width: auto; flex: 0 0 auto;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.3));
}
.logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.logo-name { font-weight: 800; font-size: 16.5px; letter-spacing: .2px; }
.logo-sub { font-size: 10.5px; opacity: .85; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; }
.hdr-actions { display: flex; gap: 8px; align-items: center; }
.lang-toggle {
  background: rgba(255,255,255,.16); color: #fff;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 20px; padding: 6px 14px; font-size: 13px; font-weight: 700;
  backdrop-filter: blur(4px);
}
.lang-toggle:active { background: rgba(255,255,255,.3); }
.ws-badge {
  background: linear-gradient(135deg, var(--gold), #dcedc8);
  color: #33691e; font-weight: 800; font-size: 11.5px;
  border-radius: 8px; padding: 5px 10px; text-transform: uppercase; letter-spacing: .5px;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.sync-banner {
  background: #f1f8e9; color: #33691e; font-size: 13px; font-weight: 600;
  text-align: center; padding: 9px 14px;
}

/* Header search pill (T&T-style): tap to jump into the shop search. */
.hdr-search { max-width: var(--maxw); margin: 0 auto; padding: 1px 16px 9px; }
.hdr-search-pill {
  width: 100%; border: none; border-radius: 24px; text-align: left;
  padding: 11px 16px 11px 42px; font-size: 14px; color: var(--faint);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%239aa39a' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 14px center;
  box-shadow: 0 3px 10px rgba(0,0,0,.18);
}
/* The header pill is a real input now — the site's only search box
   (the search page's duplicate input was removed, user 2026-10-28). */
.hdr-search-input {
  width: 100%; border: none; background: transparent; padding: 0;
  font: inherit; color: var(--ink); outline: none; box-shadow: none;
}
.hdr-search-input:focus { border: none; box-shadow: none; outline: none; }
/* Delivery / Pickup pill toggle + store line, like the big chains. */
.hdr-fulfill {
  max-width: var(--maxw); margin: 0 auto; padding: 0 16px 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.ff-toggle { display: flex; background: rgba(0,0,0,.25); border-radius: 20px; padding: 3px; }
.ff-toggle button {
  border: none; background: transparent; color: #fff;
  padding: 6px 16px; border-radius: 16px; font-weight: 700; font-size: 13px;
}
.ff-toggle button.active { background: #fff; color: var(--red-deep); font-weight: 800; }
.ff-store { font-size: 12px; font-weight: 600; opacity: .92; white-space: nowrap; }
/* Header cart shortcut (replaces the address line, owner 2026-10-29). */
.ff-cart {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,.25); color: #fff; text-decoration: none;
  padding: 6px 14px; border-radius: 20px; font-weight: 700; font-size: 13px;
  white-space: nowrap;
}
.ff-cart svg { width: 18px; height: 18px; }
/* Categories toggle button (owner 2026-11-06): left of the cart; the
   category strip below stays hidden on phones until it is tapped, so
   the products are visible without scrolling past four rows of pills. */
.ff-cat-btn {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,.25); color: #fff; border: none; cursor: pointer;
  padding: 6px 14px; border-radius: 20px; font-weight: 700; font-size: 13px;
  font-family: inherit; white-space: nowrap;
}
.ff-cat-btn.open { background: #fff; color: var(--red-deep); }
.ff-cat-ico { font-size: 14px; line-height: 1; }
.cat-nav.collapsed { display: none; }
/* Slim one-row header for the product page (owner 2026-11-06): just the
   magnifier, categories and cart — no logo row, no language button. */
.hdr-fulfill.slim { padding-top: 10px; }
.ff-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(0,0,0,.25); color: #fff; flex: 0 0 auto;
}
.ff-icon-btn svg { width: 19px; height: 19px; }
.hdr-search[hidden] { display: none; }
.ff-cart-count {
  position: absolute; top: -7px; right: -5px;
  background: linear-gradient(135deg, var(--red), var(--red-deep)); color: #fff;
  font-size: 10px; font-weight: 800;
  min-width: 19px; height: 19px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 5px;
  border: 2px solid #fff; box-shadow: 0 2px 6px rgba(46,125,50,.4);
}
/* Category nav strip inside the green header. */
/* Category bar fits the screen on phone and PC alike: chips wrap onto as
   many centered rows as needed — no sideways scrolling, every category
   visible at once. (User, 2026-10-24: "that bar could fit for phones and pc".) */
.cat-nav {
  max-width: var(--maxw); margin: 0 auto; padding: 0 12px 11px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 5px;
}
.cat-nav a {
  flex: 0 1 auto; text-align: center; color: #fff; font-size: 13.5px; font-weight: 600;
  padding: 6px 13px; border-radius: 16px; background: rgba(255,255,255,.15);
}
@media (max-width: 640px) {
  .cat-nav { gap: 4px; padding: 0 8px 10px; }
  .cat-nav a { font-size: 12.5px; padding: 5px 10px; }
}
.cat-nav a.active { background: #fff; color: var(--red-deep); font-weight: 800; }

/* ================= main ================= */
#app { max-width: var(--maxw); margin: 0 auto; min-height: 60vh; }
.section { padding: 18px 16px 6px; }
.section-head {
  display: flex; align-items: center; gap: 10px;
  margin: 2px 0 14px;
}
.section-head::before {
  content: ""; width: 5px; height: 22px; border-radius: 3px; flex: 0 0 5px;
  background: linear-gradient(180deg, var(--red), var(--red-deep));
}
.section-head h2, .section h2 {
  font-size: 19px; margin: 0; font-weight: 800; letter-spacing: .2px;
}
.section-red .section-head::before { background: linear-gradient(180deg, var(--gold), var(--gold-deep)); }
.center { text-align: center; }
.muted { color: var(--muted); }
.loading, .error-box { padding: 40px 16px; text-align: center; color: var(--muted); }
.error-box {
  margin: 16px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.clamp1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clamp2 {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 2.9em;
}

/* ================= hero banner carousel ================= */
.banner-carousel {
  position: relative;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  display: grid;
}
/* All slides stack in the same grid cell so the carousel is always as
   tall as its tallest slide — switching banners never shifts the page
   (owner 2026-11-10). Inactive slides are visibility:hidden (they still
   size the cell) and non-interactive. */
.banner-carousel > * { grid-area: 1 / 1; }
.banner-carousel > a { display: block; height: 100%; text-decoration: none; }
.banner-slide {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  visibility: hidden;
  height: 100%; box-sizing: border-box;
  position: relative; overflow: hidden;
  background:
    radial-gradient(520px 260px at 85% -40px, rgba(220, 237, 200, .4), transparent 60%),
    radial-gradient(420px 300px at 8% 120%, rgba(255, 255, 255, .14), transparent 55%),
    linear-gradient(115deg, var(--red-deep) 0%, var(--red) 55%, #43a047 100%);
  color: #fff; padding: 44px 24px 52px; text-align: center;
}
.banner-slide.active { visibility: visible; animation: fadeUp .45s ease; }
.banner-slide::before, .banner-slide::after {
  content: ""; position: absolute; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .16);
}
.banner-slide::before { width: 190px; height: 190px; right: -60px; top: -70px; }
.banner-slide::after { width: 120px; height: 120px; left: -40px; bottom: -50px; border-color: rgba(220,237,200,.45); }
.banner-kicker {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--gold);
  border: 1px solid rgba(220, 237, 200, .6); border-radius: 20px;
  padding: 4px 14px; margin-bottom: 12px;
  background: rgba(0, 0, 0, .12);
}
.banner-title {
  position: relative; z-index: 1;
  font-size: 27px; font-weight: 900; letter-spacing: .3px; line-height: 1.25;
  text-shadow: 0 2px 10px rgba(0,0,0,.25);
  max-width: 640px; margin: 0 auto;
}
.banner-sub {
  position: relative; z-index: 1;
  font-size: 14.5px; opacity: .94; margin-top: 8px; font-weight: 500;
  max-width: 520px; margin-left: auto; margin-right: auto;
}
.banner-cta {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 14px; font-size: 14px; font-weight: 800;
  background: #fff; color: var(--red-deep);
  padding: 9px 20px; border-radius: 24px;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.banner-flex {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  gap: 34px; max-width: 980px; margin: 0 auto; text-align: left;
}
.banner-flex .banner-title, .banner-flex .banner-sub { margin-left: 0; margin-right: 0; }
.banner-flex .banner-text { flex: 1 1 auto; min-width: 0; }
.banner-img {
  flex: 0 0 auto; height: 236px; width: auto;
  border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
/* Rotating photo stack inside one banner slide (owner 2026-11-14) */
.banner-img-rotator {
  display: block; position: relative; flex: 0 0 auto; width: 300px; height: 236px;
  border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.35);
  overflow: hidden; background: #fff;
}
.banner-img-rotator img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; opacity: 0; transition: opacity .6s ease;
}
.banner-img-rotator img.on { opacity: 1; }
@media (max-width: 640px) {
  .banner-flex { flex-direction: column; gap: 16px; text-align: center; }
  .banner-flex .banner-title, .banner-flex .banner-sub { margin-left: auto; margin-right: auto; }
  .banner-img { height: 190px; }
  .banner-img-rotator { width: 250px; height: 190px; }
}
.banner-dots { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; z-index: 2; }
.banner-dots .dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 5px;
  background: rgba(255,255,255,.4); margin: 0 4px; transition: all .3s; cursor: pointer;
}
.banner-dots .dot.active { background: #fff; width: 26px; }
.delivery-map { width: 100%; height: auto; display: block; border-radius: 12px; border: 1px solid #e2e8f0; }
/* Delivery page two-column layout (owner 2026-11-10): text on the left,
   zone map in a sticky right column sized to fit one screen. */
.delivery-wrap { max-width: 1160px; margin: 0 auto; }
.delivery-layout { display: flex; gap: 20px; align-items: flex-start; }
.delivery-main { flex: 1 1 auto; min-width: 0; }
.delivery-side { flex: 0 0 400px; position: sticky; top: calc(var(--hdrh, 230px) + 10px); }
.delivery-side .contact-card { margin-bottom: 0; }
.delivery-side .delivery-map { max-height: calc(100vh - var(--hdrh, 230px) - 110px); object-fit: contain; }
.delivery-map-hint { text-align: center; color: var(--muted); font-size: 12.5px; margin: 8px 0 0; }
.cart-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cart-clear-btn { padding: 6px 16px; font-size: 14px; border-radius: 999px; white-space: nowrap; }
.cart-portion-note { background: #fff7e0; border: 1.5px solid #f2b705; border-radius: 10px; padding: 10px 12px; font-weight: 700; font-size: 14.5px; line-height: 1.5; margin: 10px 0 4px; }
.detail-portion-hint { margin: 8px 0 0; font-size: 14px; }
.delivery-bigtitle {
  font-size: 25px; font-weight: 900; color: #1a5632;
  background: #e8f5e9; border-radius: 12px;
  padding: 13px 18px; margin: 2px 0 14px;
}
@media (max-width: 900px) {
  .delivery-layout { flex-direction: column; }
  .delivery-side { position: static; flex: none; width: 100%; order: -1; }
  .delivery-side .delivery-map { max-height: 75vh; }
}
.delivery-notice {
  background: #fff7e0; border: 2px solid #f2b705; color: #7a5200;
  border-radius: 12px; padding: 16px 18px; margin-top: 18px;
  font-size: 16px; font-weight: 700; line-height: 1.65;
}
.fee-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 8px 0; border-bottom: 1px dashed #e5e7eb; font-size: 15px; }
.fee-row:last-child { border-bottom: none; }
.fee-row b { color: var(--red-deep); white-space: nowrap; }
.banner-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255, 255, 255, .13); color: #fff;
  font-size: 38px; line-height: 1; padding: 0 0 5px;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.banner-arrow:hover { background: rgba(255, 255, 255, .28); }
.banner-arrow.prev { left: 48px; }
.banner-arrow.next { right: 48px; }
@media (max-width: 640px) {
  .banner-arrow { width: 44px; height: 44px; font-size: 30px; }
  .banner-arrow.prev { left: 12px; }
  .banner-arrow.next { right: 12px; }
}
@keyframes fadeUp { from { opacity: .3; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ================= category tiles ================= */
.cat-grid {
  /* minmax(0, 1fr): equal columns, always. With plain 1fr a tile's
     min-content (its nowrap label — "Chicken · Duck · Goose") forces
     that column wider and shoves the last column off the screen, so
     the circles lined up unevenly on phones (owner 2026-11-06). */
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
}
.cat-tile {
  background: transparent; border-radius: var(--radius); box-shadow: none;
  padding: 10px 4px 8px; text-align: center; display: flex;
  flex-direction: column; align-items: center; gap: 8px;
  border: none; min-width: 0;
  transition: transform .15s ease;
}
.cat-tile:active { transform: scale(.96); }
.cat-initial {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--red-soft), #c8e6c9); color: var(--red);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 21px;
  box-shadow: inset 0 0 0 1px rgba(46, 125, 50, .1);
}
.cat-tile:nth-child(4n+2) .cat-initial { background: linear-gradient(135deg, #f1f8e9, #dcedc8); color: #558b2f; box-shadow: inset 0 0 0 1px rgba(124,179,66,.18); }
.cat-tile:nth-child(4n+3) .cat-initial { background: linear-gradient(135deg, #e5f4ec, #c4e9d4); color: #0f6e3c; box-shadow: inset 0 0 0 1px rgba(23,138,76,.12); }
.cat-tile:nth-child(4n+4) .cat-initial { background: linear-gradient(135deg, #e0f2f1, #b2dfdb); color: #00796b; box-shadow: inset 0 0 0 1px rgba(0,121,107,.12); }
.cat-name { font-size: 12px; font-weight: 600; color: var(--ink); max-width: 100%; }
.cat-all .cat-initial { background: linear-gradient(135deg, var(--red), var(--red-deep)); color: #fff; box-shadow: 0 4px 10px rgba(46,125,50,.35); }

/* ================= product cards ================= */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
  border: 1px solid rgba(236, 229, 224, .7);
  transition: transform .15s ease, box-shadow .15s ease;
  cursor: pointer;
}
.card:active { transform: scale(.98); }
/* Edit-mode drag reorder (owner 2026-11-03): the photo/name area is the
   drag surface while the grid is armed; the dragged card ghosts while
   the others shift around it (insert, never swap). */
#search-grid.drag-armed .card-tile, #search-grid.drag-armed .card-name { touch-action: none; cursor: grab; }
#search-grid .card.drag-src { opacity: .45; outline: 2px dashed var(--red, #c8102e); outline-offset: -2px; cursor: grabbing; }
.card-tile {
  position: relative; aspect-ratio: 1 / .82;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.card-tile::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.5) 1.2px, transparent 1.2px);
  background-size: 18px 18px; opacity: .35; pointer-events: none;
}
/* Product photo overlay: covers the gradient tile; tiles keep the gradient
 * as the fallback underneath (img removes itself onerror if missing). */
.tile-photo {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%; object-fit: contain; background: #fff;
  /* No pointer-events:none here (owner 2026-11-04): the owner right-clicks
   * product photos to copy them; a click-transparent img makes the browser
   * show the page/link menu instead of the image menu. Clicks still bubble
   * to the card, so navigation is unaffected. */
}
/* Product detail hero (owner 2026-11-07): show the WHOLE photo at its
 * natural ratio — no fill/crop. Photos are stored trimmed (no white
 * border, 2026-11-19), and the hero background goes white when a photo
 * exists (see the detail markup), so the contained photo blends in
 * seamlessly. */
.detail-tile .tile-photo { object-fit: contain; background: #fff; }
.card-initial {
  font-size: 46px; font-weight: 900; color: rgba(255,255,255,.92);
  text-shadow: 0 2px 12px rgba(0,0,0,.18);
  width: 84px; height: 84px; border-radius: 50%;
  background: rgba(255,255,255,.22);
  display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(255,255,255,.5);
  backdrop-filter: blur(2px);
}
.sale-badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: linear-gradient(135deg, #e60012, #c4000f);
  color: #fff; font-size: 13px; font-weight: 900;
  padding: 3px 9px; border-radius: 7px;
  letter-spacing: .2px;
  box-shadow: 0 3px 8px rgba(196,0,15,.4);
}
/* 惊爆价 starburst sticker (owner 2026-11-13): red-orange burst, tilted,
 * gently pulsing so specials jump off the grid. Top-right of the tile;
 * the -% pill keeps the top-left. */
.boom-badge {
  position: absolute; top: 4px; right: 4px; z-index: 3;
  width: 66px; height: 66px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #ff7a18, #e60012 62%);
  clip-path: polygon(50% 0%, 60.09% 12.33%, 75% 6.7%, 77.58% 22.42%, 93.3% 25%, 87.67% 39.91%, 100% 50%, 87.67% 60.09%, 93.3% 75%, 77.58% 77.58%, 75% 93.3%, 60.09% 87.67%, 50% 100%, 39.91% 87.67%, 25% 93.3%, 22.42% 77.58%, 6.7% 75%, 12.33% 60.09%, 0% 50%, 12.33% 39.91%, 6.7% 25%, 22.42% 22.42%, 25% 6.7%, 39.91% 12.33%);
  transform: rotate(-10deg);
  filter: drop-shadow(0 3px 5px rgba(196,0,15,.35));
  animation: boom-pulse 1.8s ease-in-out infinite;
  pointer-events: none;
}
.boom-badge > span {
  color: #fff; font-weight: 900; font-size: 14px; letter-spacing: .5px;
  text-shadow: 0 1px 3px rgba(0,0,0,.35); white-space: nowrap;
}
.boom-badge.boom-en > span { font-size: 10.5px; letter-spacing: .3px; }
.boom-badge.boom-standing > span { font-size: 16px; letter-spacing: 2px; }
.boom-badge.boom-en.boom-standing > span { font-size: 10.5px; letter-spacing: .3px; }
.boom-badge.boom-weekly > span { font-size: 12.5px; letter-spacing: 0; }
.tile-sm .boom-badge { width: 54px; height: 54px; }
.tile-sm .boom-badge > span { font-size: 11px; }
.tile-sm .boom-badge.boom-standing > span { font-size: 13px; letter-spacing: 1px; }
.tile-sm .boom-badge.boom-weekly > span { font-size: 10px; }
.tile-sm .boom-badge.boom-en > span { font-size: 8.5px; }
.detail-tile .boom-badge.boom-standing > span { font-size: 20px; }
.boom-badge.boom-en.boom-weekly > span { font-size: 9.5px; line-height: 1.2; letter-spacing: .2px; text-align: center; }
.detail-tile .boom-badge { width: 84px; height: 84px; top: 10px; right: 10px; }
.detail-tile .boom-badge > span { font-size: 18px; }
.detail-tile .boom-badge.boom-en > span { font-size: 13px; }
.detail-tile .boom-badge.boom-weekly > span { font-size: 15px; }
.detail-tile .boom-badge.boom-en.boom-weekly > span { font-size: 11px; }
@keyframes boom-pulse {
  0%, 100% { transform: rotate(-10deg) scale(1); }
  50% { transform: rotate(-10deg) scale(1.07); }
}
@media (prefers-reduced-motion: reduce) {
  .boom-badge { animation: none; }
}
.card-body { padding: 12px 12px 14px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.card-name { font-size: 13.5px; font-weight: 700; line-height: 1.35; }
.card-unit { font-size: 12px; color: var(--muted); }
.price-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price-now { color: var(--price); font-weight: 900; font-size: 19px; letter-spacing: -.2px; }
.price-unit { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-left: -4px; }
.price-now.big { font-size: 24px; }
.price-was { color: var(--faint); text-decoration: line-through; font-size: 13px; font-weight: 500; }
.stock-badge {
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; align-self: flex-start;
  display: inline-flex; align-items: center; gap: 5px;
}
.stock-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
/* In admin edit mode the badge is a link to the ERP stock-adjust page
   (owner 2026-11-04): keep the pill look, signal clickability on hover. */
a.stock-badge.stock-link { text-decoration: none; cursor: pointer; }
a.stock-badge.stock-link:hover { text-decoration: underline; filter: brightness(0.96); }
/* Admin-only pill linking to the product's ERP edit page (owner
   2026-11-04): same pill shape as the stock badge, blue, no dot. */
a.stock-badge.erp-edit-link { background: #dbeafe; color: #1d4ed8; text-decoration: none; cursor: pointer; }
a.stock-badge.erp-edit-link::before { content: none; }
a.stock-badge.erp-edit-link:hover { text-decoration: underline; filter: brightness(0.97); }
.stock-in { background: var(--green-soft); color: var(--green); }
.stock-low { background: var(--amber-soft); color: var(--amber); }
.stock-out { background: var(--gray-soft); color: var(--faint); }
.card-badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.storage-badge {
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; align-self: flex-start;
  display: inline-flex; align-items: center; gap: 5px;
}
.storage-badge.st-F { background: #dbeafe; color: #1d4ed8; }
.storage-badge.st-D { background: #fef3c7; color: #92400e; }
.storage-badge.st-C { background: #dcfce7; color: #15803d; }
.storage-badge.st-R { background: #e0e7ff; color: #4338ca; }
.storage-badge.st-W {
  background: #dc2626; color: #fff; font-size: 13px; font-weight: 800;
  padding: 5px 12px; border: 1px solid #b91c1c; box-shadow: 0 1px 3px rgba(185, 28, 28, .45);
}
/* Full-width sold-by-weight strip on product cards: unmissable. */
.weight-strip {
  background: #dc2626; color: #fff; font-size: 13.5px; font-weight: 800;
  text-align: center; border-radius: 8px; padding: 6px 8px; letter-spacing: .2px;
}
.price-scale { font-size: 17px; margin-left: 2px; }
.btn-add { margin-top: auto; }
/* T&T-style card foot: price on the left, round green + button on the right. */
.card-foot {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 8px; margin-top: auto; padding-top: 2px;
}
.add-circle {
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%;
  border: none; color: #fff; font-size: 27px; font-weight: 700; line-height: 1;
  background: linear-gradient(135deg, #43a047, var(--red-deep));
  box-shadow: 0 4px 10px rgba(46,125,50,.35);
  display: flex; align-items: center; justify-content: center;
  transition: transform .12s ease;
}
.add-circle:active { transform: scale(.9); }
.add-circle:disabled { background: #cfd8cf; box-shadow: none; cursor: not-allowed; }

/* ================= horizontal promo rows ================= */
.hrow {
  display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 10px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.hrow::-webkit-scrollbar { display: none; }
/* Desktop (owner 2026-11-19: 网页版没办法查看右边的东西): a mouse has no
   swipe and the hidden scrollbar gave no hint the row continues, so on
   hover devices show a slim scrollbar and a grab cursor; app.js adds
   wheel-to-horizontal and drag scrolling on top. */
@media (hover: hover) and (pointer: fine) {
  .hrow, .chip-row { scrollbar-width: thin; cursor: grab; }
  .hrow::-webkit-scrollbar { display: block; height: 8px; }
  .hrow::-webkit-scrollbar-thumb { background: #c9d4c9; border-radius: 4px; }
  .hrow.dragging { cursor: grabbing; }
}
.promo-card {
  flex: 0 0 168px; background: var(--card); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); padding-bottom: 10px;
  border: 1px solid rgba(236, 229, 224, .7);
  border-top: 3px solid var(--gold);
  cursor: pointer;
}
.promo-card .card-name { font-size: 12.5px; padding: 8px 10px 0; font-weight: 700; }
.promo-card .price-row { padding: 2px 10px 0; }
.promo-card .price-now { font-size: 17px; }
.tile-sm { aspect-ratio: 1 / .72; }
.tile-sm .card-initial { font-size: 30px; width: 62px; height: 62px; }
.promo-note { font-size: 11px; color: var(--muted); padding: 4px 10px 0; line-height: 1.4; }
.min-qty {
  display: inline-block; margin: 6px 10px 0; font-size: 11px; font-weight: 800;
  color: var(--red-deep); background: var(--red-soft);
  border: 1px dashed rgba(46,125,50,.4); border-radius: 8px; padding: 2px 9px;
}

/* ================= buttons ================= */
.btn {
  border: none; border-radius: 12px; padding: 13px 18px;
  font-weight: 800; font-size: 15px; letter-spacing: .2px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn-primary {
  background: linear-gradient(135deg, #43a047, var(--red-deep));
  color: #fff; box-shadow: 0 4px 12px rgba(46,125,50,.32);
}
.btn-primary:active { transform: scale(.98); box-shadow: 0 2px 6px rgba(46,125,50,.3); }
.btn-primary:disabled { background: #d5dbd5; color: #fff; box-shadow: none; cursor: not-allowed; }
.btn-outline { background: #fff; border: 1.5px solid var(--red); color: var(--red); }
.btn-block { width: 100%; display: block; }
.btn-lg { padding: 15px 18px; font-size: 16px; border-radius: 14px; }
.link-danger { background: none; border: none; color: var(--red); font-size: 13px; font-weight: 600; padding: 6px; }

/* ================= search ================= */
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; display: flex; gap: 7px; align-items: center; }
.crumbs a { color: var(--red); font-weight: 700; }
.crumb-sep { color: var(--faint); }
.search-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.search-head h2 { font-size: 21px; }
/* Browse layout: sort rail on the left, products on the right; the
   rail sticks under the sticky header while scrolling (--hdrh is
   measured from the live header by renderChrome). */
.browse-body { display: flex; gap: 14px; align-items: flex-start; }
.browse-main { flex: 1; min-width: 0; }
.sort-rail {
  position: sticky; top: calc(var(--hdrh, 230px) + 10px);
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; font-weight: 700; color: var(--muted);
  /* The rail can be taller than the viewport (filter panel with many
     subcategories): cap it and let it scroll internally, or its lower
     entries are unreachable (owner 2026-11-11, admin edit mode). */
  max-height: calc(100vh - var(--hdrh, 230px) - 20px);
  overflow-y: auto;
  scrollbar-width: thin;
  padding-right: 4px;
}
@media (max-width: 720px) {
  .browse-body { flex-direction: column; }
  .browse-main { width: 100%; }
  .sort-rail {
    order: -1; align-self: flex-start; flex-direction: row; align-items: center;
    top: calc(var(--hdrh, 230px) + 4px); z-index: 5;
    background: var(--bg); padding: 4px 0;
  }
}
/* Filter panel (owner 2026-11-07): the left rail on browse pages —
 * 筛选 head + 重置， 优惠 toggle, 排序， 价格， 分类 (subcategory
 * checkboxes with counts). Desktop: always open, sticky. Phones: the
 * body collapses until the head row is tapped (.open). */
.filter-panel { width: 178px; flex: 0 0 auto; gap: 0; }
.fp-head {
  display: flex; align-items: center; gap: 8px;
  padding: 2px 0 8px; border-bottom: 1.5px solid var(--line);
}
.fp-title { font-size: 15px; font-weight: 800; color: var(--ink); }
.fp-reset {
  margin-left: auto; background: none; border: none; cursor: pointer;
  font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 2px 4px;
}
.fp-reset:hover { color: var(--red); }
.fp-toggle {
  display: none; background: none; border: none; cursor: pointer;
  font-size: 15px; color: var(--muted); padding: 2px 6px;
}
.fp-sec { padding: 9px 0 3px; border-bottom: 1px solid var(--line); }
.fp-sec:last-child { border-bottom: none; }
.fp-sec-title { font-size: 13.5px; font-weight: 800; color: var(--ink); margin-bottom: 6px; }
.fp-deal-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13.5px; font-weight: 700; color: var(--ink); cursor: pointer; padding-bottom: 5px;
}
.fp-switch { width: 17px; height: 17px; accent-color: var(--red); cursor: pointer; }
.filter-panel .sort-sel { width: 100%; }
.fp-check {
  display: flex; align-items: center; gap: 7px; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--ink); padding: 3.5px 0;
}
.fp-check input { width: 15px; height: 15px; accent-color: var(--red); cursor: pointer; flex: 0 0 auto; }
.fp-check-name { flex: 1; min-width: 0; }
.fp-count { color: var(--muted); font-size: 12px; }
@media (max-width: 720px) {
  .filter-panel { width: 100%; position: static; }
  .fp-toggle { display: block; }
  .filter-panel .fp-body { display: none; }
  .filter-panel.open .fp-body { display: block; }
  .filter-panel.open .fp-toggle { transform: rotate(180deg); }
}
.sort-row { display: flex; align-items: center; gap: 9px; margin: 2px 0 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.sort-sel {
  width: auto; padding: 8px 12px; border-radius: 12px; font-size: 13.5px; font-weight: 600;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
}
.search-wrap { position: relative; margin-bottom: 12px; }
.search-input {
  margin-bottom: 0; padding-left: 42px; border-radius: 24px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%239aa39a' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 14px center;
  box-shadow: var(--shadow);
}
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding: 12px 2px 12px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; background: #fff; border: 1.5px solid var(--line);
  border-radius: 20px; padding: 8px 16px; font-size: 13px; font-weight: 600; color: var(--muted);
}
.chip.active {
  background: linear-gradient(135deg, var(--red), var(--red-deep));
  border-color: transparent; color: #fff; font-weight: 800;
  box-shadow: 0 3px 8px rgba(46,125,50,.3);
}

/* ================= steppers ================= */
.stepper {
  display: inline-flex; align-items: center; border: 1.5px solid var(--line);
  border-radius: 12px; overflow: hidden; background: #fff;
}
.stepper-btn {
  background: var(--red-soft); border: none; width: 42px; height: 42px;
  font-size: 20px; font-weight: 800; color: var(--red);
}
.stepper-btn:active { background: #c8e6c9; }
.stepper-input {
  width: 58px; text-align: center; border: none; border-left: 1px solid var(--line);
  border-right: 1px solid var(--line); border-radius: 0; padding: 8px 4px; font-weight: 800;
}
.stepper-val { min-width: 46px; text-align: center; font-weight: 800; font-size: 16px; }
.stepper-sm .stepper-btn { width: 34px; height: 34px; font-size: 18px; }

/* ================= product detail ================= */
.detail { background: #fff; }
.detail-hero { position: relative; }
.back-btn {
  position: absolute; top: 14px; left: 14px; z-index: 3;
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.92); color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(0,0,0,.2);
}
.back-btn svg { width: 20px; height: 20px; }
.detail-tile {
  position: relative; height: 340px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
/* Multi-photo gallery inside the product hero (owner 2026-11-14) */
.detail-gallery { position: absolute; inset: 0; z-index: 1; }
.detail-gallery .dg-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; background: #fff;
  /* No crossfade (owner screenshot 2026-11-14): two white-background
     photos fading through each other read as a double exposure. */
  opacity: 0;
}
.detail-gallery .dg-img.on { opacity: 1; }
.dg-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 36px; height: 36px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,.92); color: var(--ink); font-size: 22px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.dg-arrow.prev { left: 12px; }
.dg-arrow.next { right: 12px; }
.dg-dots { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; z-index: 2; }
.dg-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: rgba(0,0,0,.22); margin: 0 3px; cursor: pointer; transition: all .25s;
}
.dg-dot.active { background: var(--red); width: 22px; border-radius: 5px; }
/* Long-form product description under the detail gallery (owner 2026-11-14) */
.detail-desc {
  margin-top: 18px; padding: 16px 18px; border-radius: 12px;
  background: #f4f9f1; border: 1px solid #dfeccf;
  white-space: pre-line; line-height: 1.75; font-size: 15px;
}
.detail-tile::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.5) 1.4px, transparent 1.4px);
  background-size: 22px 22px; opacity: .3; pointer-events: none;
}
.detail-initial {
  font-size: 110px; font-weight: 900; color: rgba(255,255,255,.95);
  width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255,255,255,.2); border: 3px solid rgba(255,255,255,.5);
  display: flex; align-items: center; justify-content: center;
  text-shadow: 0 4px 18px rgba(0,0,0,.2);
}
.detail-tile .sale-badge { top: 16px; left: 0; font-size: 13px; }
.detail-body { padding: 20px 18px 26px; background: #fff; border-radius: 22px 22px 0 0; margin-top: -22px; position: relative; z-index: 2; }
.detail-name { font-size: 19px; margin: 8px 0 10px; font-weight: 800; line-height: 1.35; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.detail-prices {
  display: flex; gap: 16px; margin: 14px 0;
  background: var(--bg); border-radius: var(--radius); padding: 14px 16px;
}
.dprice { display: flex; flex-direction: column; gap: 3px; }
.dlabel { font-size: 11.5px; color: var(--muted); text-transform: uppercase; font-weight: 800; letter-spacing: 1px; }
.detail-buy { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 8px; }
.detail-buy label { font-weight: 800; display: block; margin-bottom: 10px; font-size: 14px; }
.buy-row { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.unit-toggle { display: flex; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg); padding: 3px; gap: 3px; }
.unit-btn { background: transparent; border: none; padding: 9px 20px; font-weight: 700; color: var(--muted); border-radius: 9px; }
.unit-btn.active { background: #fff; color: var(--red); box-shadow: var(--shadow); }

/* ================= cart ================= */
.cart-lines { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.cart-line {
  display: flex; gap: 12px; background: #fff; border-radius: var(--radius);
  padding: 12px; box-shadow: var(--shadow); align-items: center;
  border: 1px solid rgba(236, 229, 224, .7);
}
.tile-cart { width: 66px; height: 66px; border-radius: 12px; flex: 0 0 66px; overflow: hidden; }
.tile-cart .card-initial { font-size: 26px; width: 44px; height: 44px; border-width: 1.5px; }
.cart-info { flex: 1; min-width: 0; }
.cart-info .card-name { font-size: 13px; }
.cart-unit { font-size: 12px; color: var(--muted); margin: 3px 0 8px; }
.cart-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cart-line-total { font-weight: 900; color: var(--price); white-space: nowrap; font-size: 16px; }
.cart-summary {
  background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
  border: 1px solid rgba(236, 229, 224, .7);
}
.sum-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 14.5px; }
.sum-row.fee-sub { font-size: 12.5px; color: #8a8a8a; padding: 1px 0 1px 14px; }
.sum-row.grand { font-weight: 900; font-size: 19px; border-top: 1.5px dashed var(--line); margin-top: 10px; padding-top: 12px; }
.sum-row.grand span:last-child { color: var(--price); }
.sum-row.grand.inline { border-top: none; margin-top: 0; }
.cart-summary .btn { margin-top: 12px; }
.empty { padding: 48px 20px; }
.empty-icon { margin-bottom: 10px; display: flex; justify-content: center; }
.empty h2 { font-size: 20px; margin: 0 0 8px; }

/* ================= checkout ================= */
.fulfill-toggle {
  display: flex; border: 1.5px solid var(--line); border-radius: 16px; overflow: hidden;
  margin-bottom: 16px; background: #fff; padding: 4px; gap: 4px; box-shadow: var(--shadow);
}
.ft-btn {
  flex: 1; background: transparent; border: none; padding: 13px 8px;
  font-weight: 800; color: var(--muted); border-radius: 12px;
  display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14.5px;
}
.ft-btn svg { width: 19px; height: 19px; }
.ft-btn.active {
  background: linear-gradient(135deg, var(--red), var(--red-deep)); color: #fff;
  box-shadow: 0 4px 10px rgba(46,125,50,.35);
}
.field { margin-bottom: 14px; }
.field-hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
/* Checkout fulfillment-date picker: Sundays greyed out for delivery. */
.date-display {
  width: 100%; padding: 13px 14px; text-align: left; background: #fff; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); cursor: pointer;
}
.slot-select {
  width: 100%; padding: 13px 14px; background: #fff; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); font-size: 15px;
}
.date-cal {
  background: #fff; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 12px; margin-top: 6px; box-shadow: var(--shadow);
}
.dc-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dc-nav button {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: #fff; font-size: 19px; line-height: 1; color: var(--ink);
}
.dc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dc-head { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.dc-day {
  padding: 9px 0; border: none; border-radius: 9px; background: transparent;
  font-size: 14px; color: var(--ink); cursor: pointer;
}
.dc-day.today { box-shadow: inset 0 0 0 1.5px var(--green); font-weight: 800; }
.dc-day.sel { background: var(--green); color: #fff; font-weight: 800; }
.dc-day.disabled { background: #f1f4f1; color: #bfc8bf; cursor: not-allowed; }
.field label { display: block; font-weight: 800; margin-bottom: 7px; font-size: 14px; }
.section h3 { font-size: 16px; margin: 20px 0 10px; font-weight: 800; }
.summary-lines {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 6px; box-shadow: var(--shadow);
}
.pay-note {
  background: linear-gradient(135deg, #f1f8e9, #dcedc8);
  color: #33691e; border-radius: var(--radius-sm); padding: 12px 14px;
  font-size: 13.5px; font-weight: 700; border: 1px solid #c5e1a5;
  display: flex; align-items: center; gap: 10px;
}
.pay-note svg { flex: 0 0 22px; width: 22px; height: 22px; }
.weigh-note {
  background: #fff8e1; color: #6d4c00; border-radius: var(--radius-sm); padding: 12px 14px;
  font-size: 13.5px; font-weight: 700; border: 1px solid #ffe082; margin-top: 10px;
  text-align: left;
}
.pay-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pay-opt {
  border: 1.5px solid #d7dee2; border-radius: var(--radius-sm); padding: 10px 12px;
  font-size: 14px; font-weight: 600; cursor: pointer; background: #fff;
  display: flex; align-items: center; gap: 7px;
}
.pay-opt input { accent-color: #dc2626; width: 17px; height: 17px; margin: 0; }
.pay-opt.sel { border-color: #dc2626; background: #fef2f2; }
.min-warn {
  background: #fef2f2; color: #991b1b; border-radius: var(--radius-sm); padding: 12px 14px;
  font-size: 13.5px; font-weight: 700; border: 1px solid #fca5a5; margin-top: 10px;
  text-align: left;
}

/* ================= confirmation / wholesale ================= */
.confirm { padding-top: 36px; }
.confirm-check {
  width: 78px; height: 78px; border-radius: 50%;
  background: linear-gradient(135deg, #1ea34f, #0f6e3c); color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px; box-shadow: 0 8px 22px rgba(23,138,76,.4);
  animation: pop .45s cubic-bezier(.2, 1.4, .4, 1);
}
.confirm-check svg { width: 38px; height: 38px; }
.confirm-check.ws { background: linear-gradient(135deg, var(--red), var(--red-deep)); box-shadow: 0 8px 22px rgba(46,125,50,.4); }
@keyframes pop { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.confirm-num {
  background: #fff; border: 1.5px dashed var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin: 14px 0; display: flex; justify-content: space-between; align-items: center;
  box-shadow: var(--shadow);
}
.ws-panel {
  background:
    radial-gradient(300px 160px at 90% -30px, rgba(220,237,200,.3), transparent 60%),
    linear-gradient(135deg, var(--red-deep), var(--red) 70%);
  color: #fff; border-radius: 20px; padding: 26px 20px; margin-bottom: 16px;
  box-shadow: var(--shadow-lg); text-align: center; position: relative; overflow: hidden;
}
.ws-panel::before {
  content: ""; position: absolute; width: 170px; height: 170px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.15); right: -55px; top: -60px;
}
.ws-panel h2 { margin: 0 0 6px; font-size: 20px; }
.ws-panel p { margin: 6px 0; opacity: .92; font-size: 14px; }
.ws-form .btn { margin-top: 8px; }
.ws-card {
  background: #fff; border-radius: 20px; padding: 22px 18px; box-shadow: var(--shadow-lg);
  border-top: 4px solid var(--gold);
}

/* ================= bottom nav ================= */
#bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: rgba(255,255,255,.96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 18px rgba(30, 70, 40, .06);
}
.nav-inner { max-width: var(--maxw); margin: 0 auto; display: flex; }
.nav-item {
  flex: 1; text-align: center; padding: 9px 4px 7px; font-size: 11.5px; font-weight: 700;
  color: var(--faint); position: relative; display: flex; flex-direction: column;
  align-items: center; gap: 3px;
}
.nav-item svg { width: 23px; height: 23px; }
.nav-item.active { color: var(--red); }
.nav-count {
  position: absolute; top: 2px; right: calc(50% - 26px);
  background: linear-gradient(135deg, var(--red), var(--red-deep)); color: #fff;
  font-size: 10px; font-weight: 800;
  min-width: 19px; height: 19px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 5px;
  border: 2px solid #fff; box-shadow: 0 2px 6px rgba(46,125,50,.4);
}

/* ============ confirmation page: items + highlighted notice ============ */
.confirm-items { text-align: left; margin: 14px 0 4px; }
.confirm-items h3 { font-size: 15.5px; font-weight: 800; margin: 0 0 6px; }
.confirm-notice {
  text-align: left; background: #fff7dd; border: 2px solid #f0b429; border-radius: 12px;
  padding: 14px 16px; margin: 16px 0; font-size: 14.5px; line-height: 1.65; color: #5c4300;
}
.confirm-notice p { margin: 6px 0; }
.confirm-notice .cn-title { font-size: 17px; font-weight: 900; color: #92600a; margin-bottom: 6px; }
.confirm-notice .cn-strong { font-weight: 800; font-size: 15.5px; }
.confirm-notice.flat { margin: 0 0 12px; }
.notice-overlay {
  position: fixed; inset: 0; z-index: 200; background: rgba(20, 35, 20, .55);
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.notice-modal {
  background: #fff; border-radius: 16px; padding: 18px; max-width: 480px; width: 100%;
  max-height: 86vh; overflow-y: auto; box-shadow: 0 18px 50px rgba(0,0,0,.35);
}

/* ================= contact page ================= */
.contact-wrap { max-width: 560px; margin: 0 auto; }
.contact-title { font-size: 22px; font-weight: 800; margin: 6px 0 14px; }
.contact-card {
  background: #fff; border-radius: 14px; padding: 18px;
  box-shadow: 0 2px 10px rgba(27,94,32,.08); margin-bottom: 14px;
}
.contact-card h3 { font-size: 16px; font-weight: 800; margin: 0 0 10px; }
.contact-addr { font-size: 15px; line-height: 1.55; margin: 0 0 10px; }
.contact-hours { font-size: 14px; line-height: 1.6; color: var(--muted); margin: 0 0 12px; }
.contact-map { display: inline-block; text-decoration: none; }
.contact-row { padding: 10px 0; border-bottom: 1px solid #eef3ee; }
.contact-row:last-child { border-bottom: none; }
.contact-label { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 3px; }
.contact-value { font-size: 16px; font-weight: 700; word-break: break-all; }
.contact-value a { color: var(--green-dark, #1b5e20); text-decoration: none; }
.contact-ws { text-align: center; margin: 4px 0 10px; }
.contact-ws a { color: var(--muted); font-size: 13.5px; }

/* ================= site footer ================= */
#site-footer {
  max-width: var(--maxw); margin: 26px auto 0; padding: 22px 18px 10px;
  text-align: center; color: var(--muted); font-size: 12.5px;
}
#site-footer .f-name { font-weight: 800; color: var(--ink); font-size: 14px; margin-bottom: 4px; }
#site-footer .to-top {
  display: inline-block; margin-bottom: 14px; cursor: pointer;
  padding: 8px 20px; border-radius: 20px; font: inherit; font-size: 13.5px; font-weight: 700;
  color: var(--green); background: #fff; border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(27,94,32,.08);
}
#site-footer .to-top:active { background: var(--green-soft); }
#site-footer .f-addr { margin-bottom: 8px; }
#site-footer .f-note {
  display: inline-block; background: var(--red-soft); color: var(--red-deep);
  border-radius: 20px; padding: 5px 14px; font-weight: 700; font-size: 12px;
}

/* ================= toast ================= */
#toast {
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%) translateY(20px);
  background: rgba(28, 20, 20, .92); color: #fff; padding: 12px 22px; border-radius: 28px;
  font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none;
  transition: all .25s; z-index: 100; max-width: 90vw; text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ================= wider screens ================= */
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .cat-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .banner-title { font-size: 34px; }
  .banner-slide { padding: 56px 24px 64px; }
}
@media (min-width: 960px) {
  :root { --maxw: 1060px; }
  body { font-size: 15.5px; }
  .grid { grid-template-columns: repeat(4, 1fr); gap: 18px; }
  .section { padding: 24px 20px 8px; }
  .card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
  .cat-tile:hover { transform: translateY(-3px); }
  .detail { border-radius: 20px; overflow: hidden; margin: 18px 0; box-shadow: var(--shadow-lg); }
}
@media (min-width: 1200px) {
  :root { --maxw: 1180px; }
  .grid { grid-template-columns: repeat(5, 1fr); }
}

/* ================= admin edit mode (2026-10-24) ================= */
.admin-entry {
  background: rgba(255,255,255,.16); color: #fff;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 20px; padding: 6px 12px; font-size: 13px; font-weight: 700;
  backdrop-filter: blur(4px); cursor: pointer; white-space: nowrap;
}
.admin-entry.on { background: var(--gold, #ffc72c); color: #5d4037; border-color: transparent; }
.edit-banner {
  background: #fff8e1; color: #6d4c00; font-size: 13px; font-weight: 700;
  text-align: center; padding: 8px 14px; border-bottom: 1px solid #ffe082;
}
.edit-banner a { color: #b26a00; text-decoration: underline; }
.shelf-chips { display: inline-flex; gap: 6px; margin: 0 6px; vertical-align: middle; }
.shelf-chips button {
  border: 1.5px solid #d8a000; background: #fff; color: #6d4c00; border-radius: 999px;
  padding: 2px 12px; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.shelf-chips button.on { background: #d8a000; color: #fff; }
.card.is-hidden .card-tile, .card.is-hidden .card-name { opacity: .45; }
.admin-edit {
  margin-top: 10px; padding: 10px; border: 1.5px dashed #d8a000; border-radius: 10px;
  background: #fffdf4; text-align: left;
}
.detail .admin-edit { margin-top: 14px; }
.ae-status { font-size: 12px; font-weight: 800; margin-bottom: 4px; }
.ae-on { color: #1e7e34; }
.ae-off { color: #b3261e; }
.ae-mod { color: #8a6d00; }
.ae-label { display: block; font-size: 11.5px; font-weight: 700; color: #6d5c00; margin-top: 6px; }
.ae-label input, .ae-label select {
  width: 100%; margin-top: 3px; padding: 7px 9px; font-size: 14px;
  border: 1.5px solid #e3d9ae; border-radius: 8px; background: #fff; color: var(--ink, #2b2320);
}
.ae-row { display: flex; gap: 8px; }
.ae-grow { flex: 1 1 auto; min-width: 0; }
.ae-price { flex: 0 0 92px; }
.ae-base { font-weight: 600; color: #98a2ad; }
.ae-btns { margin-top: 10px; flex-wrap: wrap; }
.ae-btn {
  border: 1.5px solid #b26a00; background: #fff; color: #8a5200; border-radius: 8px;
  padding: 7px 12px; font-size: 13px; font-weight: 800; cursor: pointer;
}
.ae-btn.ae-save { background: #b26a00; color: #fff; }
.ae-btn.ae-photo-del { border-color: #d8a49e; color: #b3261e; }
.ae-btn.ae-zero-delist { border-color: #d8a49e; color: #b3261e; }
.ae-btn.ae-on-btn { background: #1e7e34; border-color: #1e7e34; color: #fff; }
.ae-msg { font-size: 12px; min-height: 15px; margin-top: 5px; }
.detail-edit-wrap { margin-top: 4px; }
.admin-modal {
  position: fixed; inset: 0; z-index: 200; display: flex;
  align-items: center; justify-content: center;
}
.admin-modal.hidden { display: none; }
.am-backdrop { position: absolute; inset: 0; background: rgba(20, 10, 0, .55); }
.am-card {
  position: relative; background: #fff; border-radius: 16px; padding: 22px 20px 18px;
  width: min(92vw, 360px); box-shadow: 0 18px 50px rgba(0,0,0,.35);
}
.am-title { margin: 0 0 8px; font-size: 19px; }
.am-close {
  position: absolute; right: 10px; top: 8px; border: none; background: none;
  font-size: 26px; line-height: 1; cursor: pointer; color: #999;
}
.am-err { color: #b3261e; font-size: 13px; min-height: 18px; margin-top: 8px; }
.am-hint { color: #8a7f78; font-size: 12.5px; line-height: 1.5; margin: 10px 0 0; }
.am-card .ae-btn { margin-top: 10px; padding: 11px; font-size: 15px; }

/* Batch shelf selection (edit mode) */
.ae-pick {
  display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 800;
  color: #6d5c00; margin-bottom: 6px; cursor: pointer;
}
.ae-pick input { width: 18px; height: 18px; accent-color: #b26a00; }
#batch-bar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--navh, 60px) + 10px); z-index: 90;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center;
  background: #33302a; color: #fff; border-radius: 999px; padding: 8px 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35); max-width: 94vw;
}
.bb-count { font-size: 13px; font-weight: 800; white-space: nowrap; }
.bb-btn {
  border: 1px solid rgba(255,255,255,.5); background: transparent; color: #fff;
  border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 800; cursor: pointer;
  white-space: nowrap;
}
.bb-btn:disabled { opacity: .4; }
.bb-btn.bb-off { background: #b3261e; border-color: #b3261e; }
.bb-btn.bb-on { background: #1e7e34; border-color: #1e7e34; }
.bb-btn.bb-saveall { background: #b26a00; border-color: #b26a00; }
.bb-catwrap { display: inline-flex; align-items: center; gap: 6px; }
.bb-sel {
  width: auto; border-radius: 999px; padding: 6px 10px; font-size: 13px; font-weight: 700;
  border: 1px solid rgba(255,255,255,.5); background: #44413a; color: #fff;
}

/* ---------- membership (2026-11-17) ---------- */
.member-btn {
  display: inline-flex; align-items: center; gap: 5px;
  color: #fff; font-weight: 700; font-size: 14px; text-decoration: none;
  padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,.14);
  white-space: nowrap;
}
.member-btn svg { width: 19px; height: 19px; }
.hdr-fulfill .member-btn { background: var(--green-soft); color: var(--green); margin-left: auto; }
.hdr-fulfill .member-btn + .ff-cart { margin-left: 0; }
.member-card { max-width: 460px; margin: 0 auto; }
.m-tabs { display: flex; gap: 6px; margin: 10px 0 16px; }
.m-tab {
  flex: 1; padding: 9px 4px; border-radius: 10px; border: 1.5px solid #d8d8d8;
  background: #fff; font-weight: 700; font-size: 14px; cursor: pointer;
}
.m-tab.on { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.m-code-row { display: flex; gap: 8px; }
.m-code-row input { flex: 1; }
.m-code-row .btn { white-space: nowrap; }
.m-hint { margin-top: 12px; font-size: 13px; }
.member-profile .m-phone { font-size: 17px; font-weight: 700; margin: 4px 0 8px; }
.m-points { margin: 6px 0; font-size: 15px; }
.m-qr { text-align: center; margin: 14px 0; }
.m-qr img { width: 220px; height: 220px; }
.m-sec { margin: 20px 0 8px; font-size: 16px; }
.m-order {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: #fff; border: 1px solid #e4e4e4; border-radius: 12px;
  padding: 12px 14px; margin-bottom: 8px; text-decoration: none; color: inherit;
}
.m-order-main { display: flex; flex-direction: column; gap: 2px; }
.m-status {
  flex: none; font-size: 13px; font-weight: 700; color: var(--green);
  background: var(--green-soft); border-radius: 999px; padding: 4px 10px;
}
.m-back { display: inline-block; margin-bottom: 10px; font-weight: 700; color: var(--green); text-decoration: none; }
.m-steps { list-style: none; display: flex; margin: 16px 0 6px; padding: 0; }
.m-steps li {
  flex: 1; text-align: center; font-size: 12.5px; color: #999;
  display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative;
}
.m-steps li::before {
  content: ''; position: absolute; top: 6px; left: -50%; width: 100%; height: 2.5px; background: #e2e2e2;
}
.m-steps li:first-child::before { display: none; }
.m-steps li .m-dot {
  width: 14px; height: 14px; border-radius: 50%; background: #e2e2e2; z-index: 1;
}
.m-steps li.done { color: var(--green); font-weight: 700; }
.m-steps li.done .m-dot { background: var(--green); }
.m-steps li.done::before { background: var(--green); }
.m-steps li.now { color: var(--green); font-weight: 700; }
.m-steps li.now .m-dot { background: #fff; border: 3.5px solid var(--green); width: 16px; height: 16px; }
.m-cancelled {
  margin: 12px 0; padding: 10px 12px; border-radius: 10px;
  background: #fdecec; color: #b3261e; font-weight: 700; text-align: center;
}
.m-note {
  margin: 10px 0 2px; padding: 9px 12px; border-radius: 10px;
  background: var(--green-soft); color: #14532d; font-size: 13.5px;
}
.m-addr { margin-top: 10px; font-size: 14px; }
.m-line {
  display: flex; align-items: baseline; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid #f0f0f0; font-size: 14.5px;
}
.m-line-name { flex: 1; }
.m-line-qty { color: #666; white-space: nowrap; }
.m-line-total { font-weight: 700; white-space: nowrap; }
.m-totals { margin-top: 10px; }
.m-totals > div { display: flex; justify-content: space-between; padding: 3px 0; font-size: 14.5px; }
.m-totals .m-grand { font-size: 16.5px; font-weight: 800; border-top: 1.5px solid #e4e4e4; margin-top: 5px; padding-top: 8px; }

/* Account page: member ID card (Costco-style design B, owner
   2026-11-21) + saved profile form */
.member-account { max-width: 560px; margin: 0 auto; }
.m-idcard {
  background: linear-gradient(135deg, var(--red-deep) 0%, var(--green) 95%);
  color: #fff; border-radius: 20px; padding: 18px 18px 14px;
  box-shadow: 0 10px 26px rgba(20,80,28,.35); margin-bottom: 14px;
}
.m-idcard-head { display: flex; align-items: flex-start; }
.m-idcard-brand .b1 { font-size: 19px; font-weight: 800; line-height: 1.25; }
.m-idcard-brand .b2 { font-size: 10.5px; opacity: .8; letter-spacing: .8px; margin-top: 1px; }
.m-idcard-type {
  margin-left: auto; flex: none; font-size: 12.5px; font-weight: 700;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.45);
  border-radius: 999px; padding: 5px 11px;
}
.m-idcard-body { display: flex; padding-top: 16px; }
.m-idcard-info { flex: 1; min-width: 0; padding-right: 10px; }
.m-idcard-name { font-size: 25px; font-weight: 800; line-height: 1.25; margin-bottom: 4px; }
.m-idcard-row { margin-top: 9px; }
.m-idcard-row span { display: block; font-size: 11px; opacity: .75; }
.m-idcard-row strong { display: block; font-size: 14.5px; font-weight: 700; margin-top: 1px; }
.m-idcard-qr { width: 118px; flex: none; text-align: center; }
.m-idcard-qrframe { background: #fff; border-radius: 12px; padding: 6px; }
.m-idcard-qrframe img { width: 100%; height: auto; display: block; }
.m-idcard-qr p { font-size: 11px; line-height: 1.45; opacity: .9; margin-top: 6px; }
.m-card { margin-bottom: 14px; }
.m-profile-card { margin-top: 14px; }
.m-collapse-head {
  display: flex; align-items: flex-start; width: 100%;
  background: none; border: none; padding: 0; cursor: pointer;
  font: inherit; color: inherit; text-align: left;
}
.m-collapse-head .m-card-title { margin: 0; flex: 1; }
.m-chev {
  flex: none; font-size: 17px; color: var(--muted); margin-left: 10px;
  line-height: 1.5; transition: transform .2s;
}
.m-chev.open { transform: rotate(180deg); }
.m-collapse-body { margin-top: 14px; }
.m-kind {
  font-size: 11px; font-weight: 700; color: #1e8e4e; background: #e3f3e8;
  border-radius: 6px; padding: 1px 6px; vertical-align: 2px; white-space: nowrap;
}
/* Folded order sections: 查看全部 toggle (owner 2026-11-21) */
.m-more {
  display: block; width: 100%; background: none; border: none; cursor: pointer;
  font: inherit; font-size: 13.5px; font-weight: 700; color: var(--brand-dark, #1e8e4e);
  padding: 8px 0 2px; text-align: center;
}
/* 消息中心 / 积分商城 entry rows above 我的资料 (owner 2026-11-21) */
.m-entry {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid #e4e4e4; border-radius: 12px;
  padding: 13px 14px; margin-top: 10px; text-decoration: none; color: inherit;
}
.m-entry-ic { flex: none; width: 24px; height: 24px; color: var(--brand-dark, #1e8e4e); }
.m-entry-ic svg { width: 24px; height: 24px; }
.m-entry-tx { flex: 1; display: flex; flex-direction: column; }
.m-entry-tx strong { font-size: 15px; }
.m-entry-tx small { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.m-entry-badge {
  flex: none; font-size: 12.5px; font-weight: 700; color: #fff;
  background: #d32f2f; border-radius: 999px; padding: 3px 10px;
}
.m-entry-chev { flex: none; font-size: 20px; color: var(--muted); line-height: 1; }
/* Inbox + points pages */
.m-page-title { font-size: 19px; margin: 10px 0 12px; }
.m-msg { padding: 14px 16px; margin-bottom: 10px; }
.m-msg.unread { border-left: 4px solid #d32f2f; }
.m-msg-head { display: flex; align-items: center; gap: 8px; }
.m-msg-head strong { font-size: 15px; }
.m-msg-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #d32f2f; }
.m-msg-date { margin-left: auto; flex: none; font-size: 12.5px; color: var(--muted); }
.m-msg-body { margin-top: 6px; font-size: 14px; line-height: 1.55; color: #37474f; white-space: pre-wrap; }
.m-card-title { font-size: 16.5px; margin: 0 0 14px; }
.m-card-sub { display: block; font-size: 12.5px; font-weight: 400; color: var(--muted); margin-top: 3px; }
.m-card .field:last-of-type { margin-bottom: 16px; }
.m-sec-count {
  display: inline-block; background: var(--green); color: #fff; border-radius: 999px;
  font-size: 12px; padding: 1px 8px; vertical-align: 2px; margin-left: 2px;
}
.m-empty {
  background: #fff; border: 1px dashed var(--line); border-radius: 12px;
  padding: 16px 14px; color: var(--muted); font-size: 14px; text-align: center;
}
.m-logout { margin-top: 22px; }
