/* web/storefront/src/theme.css
 *
 * Nordic Home buyer-storefront theme — the shared visual language for all 12
 * buyer screens (A2). This is the STORE identity: warm paper + forest green +
 * Fraunces serif display + Figtree body, strictly distinct from the enterprise
 * console (cool grey + blue + Plus Jakarta). Tokens mirror the design system
 * base (DesignSystem board, "店铺主题 Token · 用户端身份") so a store theme can
 * later be re-skinned from /api/storefront/context by overriding --bo-* on :root.
 *
 * Page-specific layout lives inline in each page; this file carries only the
 * tokens, reset, and the chrome shared verbatim across pages (header, footer,
 * product card, buttons, chips, account nav).
 */

:root {
  --brand: #35654d;        /* forest green — store brand */
  --brand-d: #2a4f3c;      /* darker green for text-on-tint */
  --brand-tint: #f1f6f2;   /* selected / active wash */
  --brand-soft: #e7efe9;   /* badge / pill tint */
  --ink: #221f1a;          /* body text */
  --muted: #6f665a;        /* secondary text */
  --faint: #b3a98c;        /* placeholder / disabled */
  --paper: #f3efe6;        /* warm paper surface */
  --site: #fbfaf6;         /* page background */
  --ground: #e3e0d7;       /* outermost backdrop */
  --soft: #efeadf;         /* soft chip / control bg */
  --line: #e7e0d4;         /* hairline borders */
  --field: #f7f4ed;        /* input fill */
  --field-line: #e5decf;   /* input border */
  --shadow: 0 2px 6px rgba(34, 31, 26, .05), 0 20px 50px rgba(34, 31, 26, .09);
  --rad-sm: 10px;
  --rad: 12px;
  --rad-md: 14px;
  --rad-lg: 18px;
  --rad-xl: 24px;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Figtree', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--site);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; line-height: 1.14; font-family: var(--serif); font-weight: 600; }
a { color: inherit; }
img { max-width: 100%; display: block; }

.mono { font-family: var(--mono); }
.serif { font-family: var(--serif); }
.tnum { font-variant-numeric: tabular-nums; }

/* line icons — 1.7px stroke, currentColor (design system) */
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* keyboard focus — visible across the warm palette */
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible,
[tabindex]:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* ---- page shell ---- */
.site { background: var(--site); min-height: 100vh; }
.wrapmax { max-width: 1200px; margin: 0 auto; }

/* ---- announcement bar ---- */
.announce {
  background: var(--ink); color: var(--paper); text-align: center;
  font-size: 12.5px; font-weight: 600; padding: 9px 16px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.announce .ic { width: 15px; height: 15px; }

/* ---- header ---- */
.hd { display: flex; align-items: center; gap: 24px; padding: 18px 40px; border-bottom: 1px solid var(--line); background: var(--site); position: relative; }
.hd .logo { font-family: var(--serif); font-weight: 600; font-size: 22px; letter-spacing: -.01em; text-decoration: none; color: var(--ink); }
.hd nav { display: flex; gap: 22px; }
.hd nav a { font-size: 14px; color: #4a4238; text-decoration: none; font-weight: 600; }
.hd nav a:hover { color: var(--brand); }
.hd nav a.on { color: var(--brand); }
.hd .acts { margin-left: auto; display: flex; align-items: center; gap: 18px; color: #4a4238; }
.hd .acts > a { color: inherit; display: inline-flex; }
.cart-btn { position: relative; display: inline-flex; align-items: center; gap: 8px; background: var(--brand); color: #fff; border-radius: 999px; padding: 10px 18px; font-weight: 700; font-size: 13.5px; text-decoration: none; }
.cart-btn:hover { background: var(--brand-d); }
.cart-btn .ic { width: 17px; height: 17px; }
.cart-btn .cnt { background: #fff; color: var(--brand); border-radius: 999px; font-size: 11px; font-weight: 800; padding: 0 6px; }

/* ---- footer ---- */
.ft { background: var(--ink); color: #b6ab9b; padding: 40px; display: flex; justify-content: space-between; font-size: 12.5px; gap: 16px; flex-wrap: wrap; }
.ft b { color: var(--paper); }
.ft .lg { font-family: var(--serif); font-size: 18px; color: var(--paper); }

/* ---- product card (home / category / search) ---- */
.pc { border-radius: var(--rad-md); overflow: hidden; background: #fff; border: 1px solid var(--line); position: relative; transition: box-shadow .15s ease; }
.pc:hover { box-shadow: 0 8px 24px rgba(34, 31, 26, .08); }
.pc .fav { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%; background: rgba(251, 250, 246, .9); display: grid; place-items: center; color: #8a8070; z-index: 1; border: 0; cursor: pointer; }
.pc .fav .ic { width: 17px; height: 17px; }
.pc .fav.on { color: #c0623f; }
.pc .im { height: 170px; background: var(--paper); display: grid; place-items: center; color: var(--faint); }
.pc .im .ic { width: 42px; height: 42px; stroke-width: 1.2; }
.pc .pb { padding: 15px 16px 18px; }
.pc .pn { font-family: var(--serif); font-weight: 600; font-size: 16.5px; }
.pc .pn b { background: #f3eccf; font-weight: 600; border-radius: 3px; padding: 0 2px; }
.pc .pd { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.pc .pr { font-size: 16px; font-weight: 700; margin-top: 9px; font-variant-numeric: tabular-nums; }
.pc .buy { display: block; text-align: center; margin-top: 11px; background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 10px; font-weight: 700; font-size: 12.5px; text-decoration: none; cursor: pointer; }
.pc .buy:hover { background: var(--soft); }

.grid { display: grid; gap: 22px; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; padding: 13px 22px; font-weight: 700; font-size: 14px; cursor: pointer; font-family: inherit; text-decoration: none; border: 1px solid transparent; }
.btn .ic { width: 17px; height: 17px; }
.btn-brand { background: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-d); }
.btn-ink { background: var(--ink); color: #fff; }
.btn-paper { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn-out { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-out:hover, .btn-paper:hover { background: var(--soft); }

/* ---- chips / pills ---- */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--soft); color: var(--muted); }
.chip.go { background: var(--brand-soft); color: var(--brand-d); }
.chip.amber { background: #f5ead0; color: #8a5a12; }
.chip.after { background: #f6e3dc; color: #a4532f; }

/* ---- generic white card ---- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--rad-lg); padding: 22px; }

/* ---- account layout (BuyerAccount / OrderCenter) ---- */
.acct { display: grid; grid-template-columns: 250px 1fr; gap: 28px; padding: 28px 40px 44px; }
.anav { align-self: start; }
.prof { display: flex; align-items: center; gap: 13px; padding: 18px; background: var(--paper); border-radius: var(--rad-md); margin-bottom: 14px; }
.prof .av { width: 48px; height: 48px; border-radius: var(--rad-md); background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 17px; flex: none; }
.prof .nm { font-family: var(--serif); font-weight: 600; font-size: 16px; }
.prof .em { font-size: 11.5px; color: var(--muted); }
.anav .ni { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: var(--rad); color: #4a4238; font-weight: 600; font-size: 14px; text-decoration: none; }
.anav .ni:hover { background: var(--soft); }
.anav .ni .ic { width: 18px; height: 18px; color: #8a8070; }
.anav .ni.on { background: var(--brand-tint); color: var(--brand-d); }
.anav .ni.on .ic { color: var(--brand); }
.anav .ni .badge { margin-left: auto; background: var(--brand); color: #fff; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 0 7px; }

/* ---- site-wide cart drawer (hosts <bo-cart>, opened by the cart button) ---- */
.cart-drawer { position: fixed; inset: 0; z-index: 60; }
.cart-drawer[hidden] { display: none; }
.cart-overlay { position: absolute; inset: 0; background: rgba(34, 31, 26, .4); opacity: 0; transition: opacity .25s ease; }
.cart-panel { position: absolute; top: 0; right: 0; width: min(412px, 92vw); height: 100%; background: var(--site); box-shadow: -12px 0 40px rgba(34, 31, 26, .22); transform: translateX(100%); transition: transform .28s cubic-bezier(.22, .61, .36, 1); }
.cart-drawer.open .cart-overlay { opacity: 1; }
.cart-drawer.open .cart-panel { transform: translateX(0); }
@media (prefers-reduced-motion: reduce) {
  .cart-overlay, .cart-panel { transition: none; }
}

/* ---- responsive ---- */
@media (max-width: 900px) {
  .hd { padding: 14px 18px; gap: 14px; flex-wrap: wrap; }
  .hd nav { order: 3; width: 100%; gap: 16px; overflow-x: auto; }
  .ft { padding: 28px 18px; }
  .acct { grid-template-columns: 1fr; padding: 20px 18px 36px; gap: 20px; }
}
@media (max-width: 640px) {
  .hd nav a:nth-child(n+4) { display: none; }
}
