/* Jolly Jade — shop styles. Premium beauty look, phone-first, no framework,
   no external fonts or assets. */

:root {
  --ink: #232323;
  --soft: #6f6a63;
  --line: #e7e1d8;
  --bg: #ffffff;
  --wash: #faf7f2;
  --card: #fffdf9;
  --accent: #1f3d2b;
  --accent-hover: #2a5240;
  --gold: #b08d57;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}

h1, h2, .logo { font-family: Georgia, "Times New Roman", serif; }
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; }

/* Top strip */
.top-strip {
  background: var(--accent);
  color: #f3ede2;
  text-align: center;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  padding: 0.45rem 1rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.8rem 1rem 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}
.logo {
  font-size: 1.45rem;
  letter-spacing: 0.22em;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}
/* Chinese name beside the English wordmark — smaller, gold, quieter. */
.logo-zh {
  font-size: 1.05rem;
  letter-spacing: 0.3em;
  font-weight: 400;
  color: var(--gold);
  margin-left: 0.35rem;
}
.search-box {
  flex: 1 1 220px;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  color: var(--soft);
}
.search-box svg { width: 17px; height: 17px; flex: none; }
.search-box input {
  border: 0;
  background: transparent;
  outline: none;
  font-size: 0.95rem;
  width: 100%;
  color: var(--ink);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--ink);
  white-space: nowrap;
}
.basket-count {
  background: var(--gold);
  color: #fff;
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
}
.main-nav {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.2rem 1rem 0.65rem;
  display: flex;
  gap: 1.4rem;
  font-size: 0.92rem;
}
.main-nav a { color: var(--ink); }
.main-nav a:hover { color: var(--gold); }

/* Hero */
.hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 1rem 1.6rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.4rem;
  align-items: center;
}
.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.75rem;
  color: var(--gold);
  font-weight: 700;
  margin: 0 0 0.6rem;
}
.hero h1 {
  font-size: 2.1rem;
  line-height: 1.15;
  margin: 0 0 0.8rem;
  font-weight: 600;
}
.hero-text p { color: var(--soft); margin: 0 0 1.1rem; max-width: 34rem; }
.cta {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.8rem 1.7rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
}
.cta:hover { background: var(--accent-hover); text-decoration: none; }
.country-note { font-size: 0.88rem; margin-top: 1rem !important; }
.hero-photo {
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem;
}
.hero-photo img {
  /* Full square scrubbed image shown whole (contain, never cover-crop),
     so its gold frame stays fully visible top and bottom. */
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  display: block;
  cursor: zoom-in;
}
.hero-photo-cap {
  text-align: center;
  color: var(--soft);
  font-size: 0.88rem;
  margin: 0.65rem 0 0.1rem;
}

/* Trust strip */
.trust-strip {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1rem 0.4rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
}
.trust-item {
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  display: flex;
  flex-direction: column;
}
.trust-item strong { font-size: 0.95rem; }
.trust-item span { color: var(--soft); font-size: 0.85rem; }

/* Shop section */
.section { max-width: 1120px; margin: 0 auto; padding: 1.8rem 1rem 2.4rem; }
.shop-head h2 { font-size: 1.6rem; margin: 0 0 0.2rem; font-weight: 600; }
.sub { color: var(--soft); margin: 0; font-size: 0.92rem; }

/* Static filter bar: sticks under the header while the grid scrolls
   (--header-h is measured from the real header by the page script, as
   the header wraps taller on narrow phones). Chips wrap onto a second
   line instead of swiping sideways, so every range is visible at once
   and the page never gains sideways overflow from the bar. */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.9rem 0 1rem;
  position: sticky;
  top: var(--header-h, 0px);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  z-index: 15;
}
.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-size: 0.88rem;
  cursor: pointer;
}
.chip:hover { border-color: var(--gold); }
.chip-active { background: var(--accent); border-color: var(--accent); color: #fff; }
/* While ranges are selected, the All chip becomes the clear reset. */
.chip-clear {
  background: var(--wash);
  border-color: var(--gold);
  color: var(--accent);
  font-weight: 600;
}

.grid {
  display: grid;
  /* minmax(0, 1fr): a column may never be forced wider than its share
     by unbreakable content inside a card. */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}
.product-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.product-card img {
  /* Square scrubbed image shown whole (contain) with a small inset, so
     its gold frame stays fully visible — never cropped. */
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: var(--card);
  padding: 0.4rem;
  display: block;
  cursor: zoom-in;
}
.card-body { padding: 0.2rem 0.9rem 1rem; display: flex; flex-direction: column; flex: 1; }
.card-range {
  margin: 0.3rem 0 0.25rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--gold);
  font-weight: 700;
}
.card-name { margin: 0; font-size: 0.97rem; line-height: 1.35; font-weight: 600; }
.card-size { margin: 0.15rem 0 0; color: var(--soft); font-size: 0.85rem; }
.card-price { margin: 0.55rem 0 0.7rem; font-size: 1.08rem; font-weight: 700; }

/* Grouped cards — one card per product; sizes fold into the card behind
   a "Sizes" toggle (single-size products show their one row directly). */
.sizes-toggle {
  margin-top: auto;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}
.sizes-toggle:hover { border-color: var(--gold); }
.size-list { margin-top: 0.6rem; border-top: 1px solid var(--line); }
.size-list[hidden] { display: none; }
.size-list-open { margin-top: auto; }
.size-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
}
.size-row:last-child { border-bottom: 0; }
.size-label { font-size: 0.9rem; }
.size-price { margin-left: auto; font-weight: 700; font-size: 0.95rem; white-space: nowrap; }
.size-add {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 0.38rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.size-add:hover { background: var(--accent-hover); }

/* Narrow phones: a size row (label + price + Add) is wider than a
   two-across card, and none of its parts may shrink — left on one line
   it spilled past the card edge and the card clipped the Add button.
   Below 500px the row wraps instead: label and price share the first
   line, the Add button takes its own full-width line under them, so
   everything stays inside the card with room to spare. */
@media (max-width: 499px) {
  /* Compact chips on phones: with 13 ranges to show, tighter chips
     mean fewer wrapped rows in the sticky filter bar. */
  .chips { gap: 0.4rem; padding: 0.7rem 0 0.8rem; }
  .chip { font-size: 0.8rem; padding: 0.35rem 0.75rem; }
  .size-row { flex-wrap: wrap; row-gap: 0.4rem; }
  .size-label { min-width: 0; }
  .size-add { flex: 1 1 100%; text-align: center; padding: 0.45rem 0.95rem; }
}
.add-btn {
  margin-top: auto;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}
.add-btn:hover { background: var(--accent-hover); }
.empty-note { color: var(--soft); padding: 1rem 0; }

/* Lightbox — click-to-expand photo view (same concept as the Vanity
   Pantry site): dimmed overlay, full scrubbed photo, x to close. */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(35, 32, 28, 0.93);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 22px;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: min(700px, 94vw);
  max-height: 80vh;
  background: #fff;
  border: 3px solid var(--gold);
  border-radius: 12px;
}
.lb-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 2.3rem;
  line-height: 1;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
}
.lb-cap { color: #f3ede2; margin-top: 0.9rem; font-size: 0.95rem; text-align: center; }

/* Why */
.why { background: var(--wash); border-top: 1px solid var(--line); }
.why-inner { max-width: 1120px; margin: 0 auto; padding: 2.2rem 1rem 2.6rem; }
.why h2 { font-size: 1.5rem; margin: 0 0 1.2rem; font-weight: 600; }
.why-row { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.why-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}
.why-title { font-weight: 700; margin: 0 0 0.35rem; }
.why-item p { margin: 0; color: var(--soft); font-size: 0.93rem; }
.why-item .why-title { color: var(--ink); }

/* Footer */
.site-footer { background: var(--accent); color: #e9e2d4; }
.footer-inner { max-width: 1120px; margin: 0 auto; padding: 2.2rem 1rem 2.4rem; }
.site-footer h3 { margin: 0 0 0.9rem; font-size: 1.05rem; color: #fff; }
.country-list { list-style: none; margin: 0 0 1.4rem; padding: 0; columns: 2; }
.country-list li { padding: 0.28rem 0; break-inside: avoid; }
.country-list .current { font-weight: 700; color: #fff; }
.country-list .soon { color: #b9c4ba; }
.country-list .tag {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid #5a7263;
  border-radius: 999px;
  padding: 0.08rem 0.5rem;
  margin-left: 0.5rem;
  vertical-align: middle;
}
.footer-note { color: #b9c4ba; font-size: 0.88rem; margin: 0.3rem 0; }

/* Supplied-by block (footer) — the Vanity Pantry link-back. The logo sits
   on a light plate so the gold-and-ink lockup reads cleanly on the dark
   green footer. */
.supplied-by {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  border-top: 1px solid #3a5a48;
  padding-top: 1.3rem;
  margin: 0 0 1.4rem;
}
.supplied-logo {
  background: var(--wash);
  border-radius: 10px;
  padding: 0.45rem 0.8rem;
  display: inline-flex;
  flex: none;
}
.supplied-logo img { height: 32px; width: auto; display: block; }
.supplied-text { margin: 0; font-size: 0.9rem; color: #d8dfd2; max-width: 36rem; }
.supplied-text a { color: #dcb87e; white-space: nowrap; }
.supplied-text a:hover { text-decoration: underline; }

/* Guidance Part 1 — concern tiles: start from the buyer's problem,
   not our range names. */
.concerns { max-width: 1120px; margin: 0 auto; padding: 0.6rem 1rem 0.2rem; }
.concerns h2 { font-size: 1.3rem; margin: 0 0 0.7rem; font-weight: 600; }
.concern-tiles { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.concern-tile {
  border: 1px solid var(--line);
  background: var(--wash);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}
.concern-tile:hover { border-color: var(--gold); }
.concern-tile.concern-active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Guidance Part 2 — "most popular" strip + photo corner tag */
.start-here { max-width: 1120px; margin: 0 auto; padding: 0.8rem 1rem 0.4rem; }
.start-here h2 { font-size: 1.3rem; margin: 0 0 0.4rem; font-weight: 600; }
.start-here p { color: var(--soft); margin: 0; max-width: 44rem; }
.start-link {
  background: none; border: 0; padding: 0;
  color: var(--accent); font: inherit; font-weight: 700;
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.start-link:hover { color: var(--gold); }
/* The photo wrapper lets the tag sit on the photo itself. The tag is
   a label like a "Sale" tag: pointer-events off, so it can never be
   mistaken for — or act as — a button, and photo clicks (lightbox)
   pass straight through it. */
.card-photo { position: relative; }
.popular-tag {
  position: absolute; top: 0; left: 0; z-index: 1;
  background: var(--gold); color: #fff;
  font-size: 0.66rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.09em;
  padding: 0.32rem 0.65rem;
  border-radius: 0 0 0.55rem 0;
  pointer-events: none;
}

/* Guidance Part 3 — plain words on the card + the size guide line */
.card-what { margin: 0.35rem 0 0; font-size: 0.88rem; line-height: 1.4; }
.card-bestfor { margin: 0.15rem 0 0; font-size: 0.8rem; color: var(--soft); line-height: 1.4; }
.size-guide {
  margin: 0; padding: 0.5rem 0;
  font-size: 0.78rem; color: var(--soft); line-height: 1.45;
  border-bottom: 1px solid var(--line);
}

/* Shopping-comfort batch — how-to-use line, pairs line, mini note,
   favourites heart. */
/* The use line sits with the other plain words, a touch quieter. */
.card-use { margin: 0.15rem 0 0; font-size: 0.8rem; color: var(--soft); line-height: 1.4; }
/* "Pairs well with" — one quiet line; the partner name is a text
   link (same treatment as the start-here strip links), never a
   button-shaped element. */
.card-pairs { margin: 0.35rem 0 0; font-size: 0.82rem; color: var(--soft); line-height: 1.4; }
.pair-link {
  background: none; border: 0; padding: 0;
  color: var(--accent); font: inherit; font-weight: 600;
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.pair-link:hover { color: var(--gold); }
/* "Try the mini first" — a helpful note inside the Sizes list, next
   to the size guide; plain text on a soft wash, not a button. */
.mini-note {
  margin: 0; padding: 0.5rem 0;
  font-size: 0.8rem; color: var(--accent); line-height: 1.45;
  border-bottom: 1px solid var(--line);
}
/* The favourites heart: a small round button on the photo's
   top-right corner (the "Most popular" tag owns the top-left). It is
   a real button and stops its own click; the rest of the photo
   still opens the lightbox. */
.fav-btn {
  position: absolute; top: 0.45rem; right: 0.45rem; z-index: 2;
  width: 2rem; height: 2rem;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line); border-radius: 999px;
  color: var(--soft); font-size: 1.05rem; line-height: 1;
  cursor: pointer; padding: 0;
}
.fav-btn:hover { border-color: var(--gold); color: var(--gold); }
.fav-btn.fav-on { color: #b3402e; border-color: #b3402e; background: #fff; }
/* Brief outline flash on the card a "Pairs well with" / start-here
   jump lands on, so the eye finds the exact product. */
.card-flash { outline: 3px solid var(--gold); outline-offset: -3px; }

/* Guidance Part 4 — product guide chat (preview form) */
.guide-fab {
  position: fixed; right: 16px; bottom: 16px; z-index: 55;
  background: var(--accent); color: #fff;
  border: 0; border-radius: 999px;
  padding: 0.8rem 1.3rem; font-size: 0.95rem; font-weight: 700;
  box-shadow: 0 6px 22px rgba(31, 61, 43, 0.35);
  cursor: pointer;
}
.guide-fab:hover { background: var(--accent-hover); }
.guide-fab-open { background: var(--gold); }
.guide-panel {
  position: fixed; right: 16px; bottom: 76px; z-index: 56;
  width: min(380px, calc(100vw - 24px));
  height: min(540px, calc(100dvh - 110px));
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 14px 44px rgba(35, 32, 28, 0.28);
  display: flex; flex-direction: column; overflow: hidden;
}
.guide-panel[hidden] { display: none; }
.guide-head {
  display: flex; align-items: flex-start; gap: 0.6rem;
  background: var(--accent); color: #fff; padding: 0.8rem 1rem;
}
.guide-head-text { display: flex; flex-direction: column; flex: 1; }
.guide-head-text strong { font-size: 1rem; }
.guide-head-text span { font-size: 0.76rem; color: #cfd8cc; }
.guide-close {
  background: transparent; border: 0; color: inherit;
  font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 0 0.2rem;
}
.guide-msgs {
  flex: 1; overflow-y: auto; padding: 0.9rem;
  display: flex; flex-direction: column; gap: 0.6rem;
  background: var(--wash);
}
.guide-msg {
  max-width: 88%; padding: 0.6rem 0.8rem; border-radius: 12px;
  font-size: 0.9rem; line-height: 1.45; white-space: normal;
}
.guide-msg-guide { background: #fff; border: 1px solid var(--line); align-self: flex-start; }
.guide-msg-user { background: var(--accent); color: #fff; align-self: flex-end; }
.guide-msg a { color: var(--accent); text-decoration: underline; }
.guide-shop-btn {
  margin-top: 0.55rem;
  background: var(--accent); color: #fff; border: 0; border-radius: 999px;
  padding: 0.45rem 1rem; font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.guide-shop-btn:hover { background: var(--accent-hover); }
.guide-form {
  display: flex; gap: 0.5rem; padding: 0.7rem;
  border-top: 1px solid var(--line); background: #fff;
}
.guide-form input {
  flex: 1; min-width: 0;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0.55rem 0.9rem; font-size: 0.92rem; outline: none; color: var(--ink);
}
.guide-form input:focus { border-color: var(--gold); }
.guide-send {
  background: var(--accent); color: #fff; border: 0; border-radius: 999px;
  padding: 0.55rem 1.1rem; font-weight: 700; cursor: pointer;
}
.guide-send:hover { background: var(--accent-hover); }

/* Captured guide questions (preview-only overlay from the footer) */
.guide-questions {
  position: fixed; inset: 0; z-index: 58;
  background: rgba(35, 32, 28, 0.6);
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.guide-questions[hidden] { display: none; }
.guide-questions-box {
  background: #fff; border-radius: 14px; max-width: 560px; width: 100%;
  max-height: 84vh; overflow-y: auto; padding: 1.1rem 1.2rem 1.2rem;
}
.guide-questions-head { display: flex; align-items: center; justify-content: space-between; color: var(--ink); }
.guide-questions-note { color: var(--soft); font-size: 0.88rem; }
.guide-questions-list { margin: 0.6rem 0; padding-left: 1.2rem; color: var(--ink); font-size: 0.92rem; }
.guide-questions-list li { padding: 0.25rem 0; }
.guide-questions-actions { display: flex; gap: 0.5rem; }
.guide-questions-actions button {
  border: 1px solid var(--line); background: var(--wash); color: var(--accent);
  border-radius: 999px; padding: 0.45rem 1rem; font-weight: 600; cursor: pointer;
}
.site-footer a#guide-questions-link { color: #dcb87e; }
.site-footer a#guide-questions-link:hover { text-decoration: underline; }

@media (max-width: 499px) {
  .guide-panel { right: 12px; bottom: 70px; }
  .guide-fab { right: 12px; bottom: 12px; }
}

/* Wider screens */
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .trust-strip { grid-template-columns: repeat(3, 1fr); }
  .why-row { grid-template-columns: repeat(3, 1fr); }
  .country-list { columns: 3; }
}
@media (min-width: 900px) {
  .hero { grid-template-columns: 1.05fr 0.95fr; padding-top: 2.8rem; }
  .hero h1 { font-size: 2.7rem; }
}
@media (min-width: 1024px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
