/* ============================================================
   Ronica Mart — theme
   Warm cream design system built on the brand palette:
     #240C00 ink · #F18500 orange · #FFCA01 gold
     #648D00 olive · #005200 deep green
   Every colour below is a token — nothing downstream hard-codes one.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* brand — gold ramp from #FFCA01 */
  --gold-100: #fff8dd;
  --gold-200: #ffefae;
  --gold-300: #ffe165;
  --gold-400: #ffd52e;
  --gold-500: #ffca01;

  /* brand — orange ramp from #F18500 */
  --amber-500: #f18500;
  --amber-600: #cc6f00;
  --amber-700: #9e5500;

  /* surfaces */
  --cream:      #fdf7e7;
  --cream-2:    #f9efd8;
  --cream-3:    #f3e5c6;
  --card:       #f7efdd;
  --white:      #ffffff;

  /* ink — ramp from #240C00 */
  --ink:        #240c00;
  --ink-2:      #5c4033;
  --ink-3:      #8b7568;
  --line:       #e7d9c4;

  /* text tones that sit on the dark ink surfaces (footer, admin sidebar) */
  --on-ink:   #ffffff;
  --on-ink-2: #d9c5a8;
  --on-ink-3: #c9b394;
  --on-ink-4: #9d8a6e;
  --on-ink-5: #7a6a52;

  /* accents */
  --leaf:       #648d00;
  --berry:      #c0392b;
  --sky:        #2f7fa8;

  /* system */
  --ok:   #005200;
  --warn: #9e5500;
  --bad:  #c0392b;
  --info: #2f7fa8;

  /* tinted pairs for badges and alerts — background / text / hairline */
  --ok-bg:   #d9ecd9;  --ok-ink:   #005200;  --ok-line:   #b4d6b4;
  --warn-bg: #ffeccc;  --warn-ink: #9e5500;  --warn-line: #f3d9a8;
  --bad-bg:  #fbe1de;  --bad-ink:  #a4291c;  --bad-line:  #f2c2bd;
  --info-bg: #dceefa;  --info-ink: #1c5c7c;  --info-line: #bcdcf0;
  --leaf-bg: #eaf2d5;  --leaf-ink: #3f5a00;

  /* coloured glows */
  --glow-primary:   rgba(241, 133, 0, .32);
  --glow-primary-2: rgba(241, 133, 0, .42);
  --glow-gold:      rgba(255, 202, 1, .35);
  --ring-primary:   rgba(241, 133, 0, .16);

  /* shape */
  --r-sm: 10px;
  --r:    16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --pill: 999px;

  --sh-1: 0 2px 8px rgba(36, 12, 0, .06);
  --sh-2: 0 8px 24px rgba(36, 12, 0, .10);
  --sh-3: 0 18px 48px rgba(36, 12, 0, .14);

  --wrap: 1200px;
  --nav-h: 76px;

  --ff-display: "Fraunces", "Playfair Display", Georgia, "Times New Roman", serif;
  --ff-body: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--ff-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  overflow-x: hidden;
}
img, svg, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, h5 { margin: 0 0 .5em; font-family: var(--ff-display); font-weight: 700; line-height: 1.15; letter-spacing: -.02em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.45rem); }
p  { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.2em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.wrap-sm { max-width: 760px; }
.section { padding: clamp(48px, 7vw, 92px) 0; position: relative; }
.section--cream { background: var(--cream); }
.section--cream2 { background: var(--cream-2); }
.section--white { background: var(--white); }
.grid { display: grid; gap: 24px; }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-6 { grid-template-columns: repeat(6, 1fr); }
.flex { display: flex; }
.between { justify-content: space-between; }
.center { align-items: center; }
.wrapf { flex-wrap: wrap; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.text-center { text-align: center; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.tiny  { font-size: .78rem; }

/* ---------- Eyebrow / section head ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .78rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--amber-700);
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--amber-500); border-radius: 2px; }
.section-head { max-width: 680px; margin-bottom: 40px; }
.section-head.center-x { margin-inline: auto; text-align: center; }
.section-head.center-x .eyebrow::before { display: none; }
.section-head p { color: var(--ink-2); font-size: 1.05rem; margin-bottom: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 28px; border-radius: var(--pill); border: 0; cursor: pointer;
  font-weight: 700; font-size: .95rem; letter-spacing: .01em;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(135deg, var(--gold-500), var(--amber-500)); color: var(--ink); box-shadow: 0 8px 20px var(--glow-primary); }
.btn-primary:hover { box-shadow: 0 12px 26px var(--glow-primary-2); }
.btn-gold { background: linear-gradient(135deg, var(--gold-200), var(--gold-400)); color: var(--ink); box-shadow: 0 8px 20px var(--glow-gold); }
.btn-dark { background: var(--ink); color: var(--gold-200); }
.btn-ghost { background: rgba(255, 255, 255, .7); color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { background: var(--white); border-color: var(--amber-500); }
.btn-sm { padding: 9px 18px; font-size: .85rem; }
.btn-lg { padding: 16px 36px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .55; pointer-events: none; }

/* ---------- Chips & badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--pill);
  background: var(--white); border: 1px solid var(--line);
  font-size: .8rem; font-weight: 600; color: var(--ink-2);
}
.chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--gold-200); }
/* category chip with its artwork; category_img() supplies the fallback */
.chip--img { padding-left: 5px; }
.chip--img img {
  width: 26px; height: 26px; border-radius: 50%; object-fit: cover;
  background: var(--white); flex: 0 0 26px;
}
.chip.is-active img { box-shadow: 0 0 0 2px var(--gold-400); }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: var(--pill);
  font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
}
.badge-gold  { background: var(--gold-200); color: var(--amber-700); }
.badge-leaf  { background: var(--leaf-bg); color: var(--leaf-ink); }
.badge-berry { background: var(--bad-bg); color: var(--bad-ink); }
.badge-ok    { background: var(--ok-bg); color: var(--ok-ink); }
.badge-warn  { background: var(--warn-bg); color: var(--warn-ink); }
.badge-bad   { background: var(--bad-bg); color: var(--bad-ink); }
.badge-info  { background: var(--info-bg); color: var(--info-ink); }

/* ---------- Torn / wave dividers ---------- */
.torn { position: relative; line-height: 0; }
.torn svg { width: 100%; height: clamp(28px, 4vw, 64px); display: block; }

/* ============================================================
   HEADER
   ============================================================ */
.topbar {
  background: var(--ink); color: var(--gold-200);
  font-size: .8rem; letter-spacing: .01em;
}
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 40px; }
.topbar a { color: var(--gold-200); opacity: .9; }
.topbar a:hover { opacity: 1; }
.topbar-links { display: flex; gap: 18px; }

.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(253, 247, 231, .88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: box-shadow .25s ease, border-color .25s ease, background .25s ease;
}
.site-header.is-stuck { box-shadow: var(--sh-2); border-color: var(--line); background: rgba(253, 247, 231, .96); }
.nav { display: flex; align-items: center; gap: 20px; min-height: var(--nav-h); }

.logo { display: flex; align-items: center; gap: 11px; font-family: var(--ff-display); font-weight: 700; font-size: 1.3rem; }
.logo-mark {
  width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--gold-300), var(--amber-500));
  color: var(--ink); font-size: 1.05rem; box-shadow: 0 6px 14px var(--glow-primary);
}
.logo small { display: block; font-family: var(--ff-body); font-size: .62rem; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase; color: var(--ink-3); line-height: 1; }

.nav-menu { display: flex; align-items: center; gap: 4px; margin-inline: auto; }
.nav-menu a {
  padding: 9px 15px; border-radius: var(--pill); font-size: .93rem; font-weight: 600;
  color: var(--ink-2); transition: background .18s ease, color .18s ease;
}
.nav-menu a:hover { background: var(--cream-3); color: var(--ink); }
.nav-menu a.is-active { background: var(--ink); color: var(--gold-200); }

.nav-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: var(--white); border: 1px solid var(--line); color: var(--ink);
  cursor: pointer; position: relative; transition: all .18s ease;
}
.icon-btn:hover { border-color: var(--amber-500); color: var(--amber-600); transform: translateY(-2px); }
.icon-btn .count {
  position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: var(--pill); background: var(--berry); color: var(--white);
  font-size: .68rem; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--cream);
}

/* product gallery thumbnails */
.thumb { border-width: 1.5px; }
.thumb.is-active { border-color: var(--amber-500); box-shadow: 0 0 0 2px var(--gold-200); }
.thumb:focus-visible { outline: 2px solid var(--amber-600); outline-offset: 2px; }
@media (max-width: 520px) {
  .thumb { width: 62px !important; height: 52px !important; }
}
.nav-toggle { display: none; }

/* search overlay */
.search-pop {
  position: absolute; inset-inline: 0; top: 100%;
  background: var(--white); border-bottom: 1px solid var(--line); box-shadow: var(--sh-2);
  padding: 22px 0; display: none;
}
.search-pop.is-open { display: block; }
.search-form { display: flex; gap: 10px; }
.search-form input {
  flex: 1; padding: 14px 20px; border-radius: var(--pill);
  border: 1.5px solid var(--line); background: var(--cream); outline: 0;
}
.search-form input:focus { border-color: var(--amber-500); background: var(--white); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative; overflow: hidden;
  background: radial-gradient(120% 120% at 80% 0%, var(--gold-300) 0%, var(--gold-400) 42%, var(--gold-500) 100%);
  padding: clamp(48px, 6vw, 86px) 0 clamp(70px, 8vw, 120px);
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(60% 60% at 15% 90%, rgba(255, 255, 255, .35), transparent 70%);
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 2; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 40px; }
.hero h1 { color: var(--ink); margin-bottom: .35em; }
.hero h1 em { font-style: normal; color: var(--white); text-shadow: 0 3px 14px rgba(36, 12, 0, .34); }
.hero-lead { font-size: 1.08rem; color: var(--ink-2); max-width: 48ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 30px; margin-top: 40px; }
.hero-stats b { display: block; font-family: var(--ff-display); font-size: 1.7rem; color: var(--ink); line-height: 1; }
.hero-stats span { font-size: .82rem; font-weight: 600; color: var(--ink-2); }

.hero-art { position: relative; display: grid; place-items: center; min-height: 320px; }
.hero-art img { border-radius: var(--r-xl); box-shadow: var(--sh-3); }
.hero-float {
  position: absolute; background: rgba(255, 255, 255, .92); border-radius: var(--r);
  padding: 12px 16px; box-shadow: var(--sh-2); display: flex; align-items: center; gap: 10px;
  font-size: .82rem; font-weight: 700; animation: bob 5s ease-in-out infinite;
}
.hero-float i { color: var(--amber-500); font-size: 1.1rem; }
.hero-float--tl { top: 8%; left: -4%; }
.hero-float--br { bottom: 10%; right: -3%; animation-delay: -2.5s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* decorative leaves */
.leaf-deco { position: absolute; opacity: .8; pointer-events: none; z-index: 1; }
.leaf-deco--1 { top: 6%;  left: -20px; width: 120px; transform: rotate(-18deg); }
.leaf-deco--2 { bottom: 8%; right: -24px; width: 150px; transform: rotate(24deg); }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--card); border: 1px solid rgba(230, 215, 181, .7);
  border-radius: var(--r-lg); padding: 24px;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.card--white { background: var(--white); }
.card--hover:hover { transform: translateY(-5px); box-shadow: var(--sh-2); border-color: var(--gold-300); }

/* product card */
.p-card {
  background: var(--card); border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid rgba(230, 215, 181, .7); display: flex; flex-direction: column;
  transition: transform .22s ease, box-shadow .22s ease;
}
.p-card:hover { transform: translateY(-6px); box-shadow: var(--sh-2); }
.p-thumb { position: relative; aspect-ratio: 4 / 3; background: var(--cream-2); overflow: hidden; }
.p-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.p-card:hover .p-thumb img { transform: scale(1.05); }
.p-thumb .badge { position: absolute; top: 12px; left: 12px; }
.p-wish {
  position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255, 255, 255, .9); border: 0; display: grid; place-items: center;
  color: var(--ink-2); cursor: pointer;
}
.p-wish:hover { color: var(--berry); }
.p-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.p-cat { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.p-name { font-family: var(--ff-display); font-size: 1.08rem; margin: 6px 0 8px; line-height: 1.3; }
.p-name a:hover { color: var(--amber-600); }
.p-foot { margin-top: auto; padding-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.price { font-family: var(--ff-display); font-size: 1.22rem; font-weight: 700; }
.price s { font-family: var(--ff-body); font-size: .85rem; font-weight: 500; color: var(--ink-3); margin-left: 7px; }
.stars { color: var(--gold-500); font-size: .8rem; letter-spacing: 1px; }

/* category pill card */
.cat-card {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 22px 14px; border-radius: var(--r-lg); background: var(--white);
  border: 1px solid var(--line); text-align: center;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.cat-card:hover { transform: translateY(-5px); box-shadow: var(--sh-2); border-color: var(--gold-300); }
.cat-card img, .cat-ico {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
  background: linear-gradient(135deg, var(--gold-200), var(--gold-400));
  display: grid; place-items: center; color: var(--amber-700); font-size: 1.5rem;
}
.cat-card b { font-size: .92rem; }
.cat-card span { font-size: .76rem; color: var(--ink-3); }

/* package card */
.pkg-card { position: relative; background: var(--white); border-radius: var(--r-lg); border: 1px solid var(--line);
  padding: 26px 24px; display: flex; flex-direction: column; transition: all .22s ease; }
.pkg-card:hover { transform: translateY(-6px); box-shadow: var(--sh-2); border-color: var(--gold-300); }
.pkg-card.is-featured { background: linear-gradient(160deg, var(--white), var(--gold-100)); border-color: var(--gold-300); }
.pkg-price { font-family: var(--ff-display); font-size: 2rem; color: var(--amber-700); line-height: 1; margin: 6px 0 4px; }
.pkg-list { list-style: none; padding: 0; margin: 16px 0 22px; display: grid; gap: 9px; font-size: .9rem; }
.pkg-list li { display: flex; gap: 9px; align-items: flex-start; color: var(--ink-2); }
.pkg-list i { color: var(--leaf); margin-top: 4px; font-size: .8rem; }

/* feature / usp strip */
.usp { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.usp-item { display: flex; gap: 14px; align-items: flex-start; padding: 20px; background: var(--white);
  border-radius: var(--r); border: 1px solid var(--line); }
.usp-ico { flex: 0 0 46px; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  background: var(--gold-100); color: var(--amber-600); font-size: 1.15rem; }
.usp-item b { display: block; font-size: .95rem; }
.usp-item p { margin: 2px 0 0; font-size: .84rem; color: var(--ink-2); line-height: 1.5; }

/* split feature (image + copy) */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.split-art { border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--sh-2); }
.split-art img { width: 100%; height: 100%; object-fit: cover; }

/* stat tiles */
.stat-tile { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.stat-tile b { display: block; font-family: var(--ff-display); font-size: 1.8rem; line-height: 1; }
.stat-tile span { font-size: .8rem; color: var(--ink-3); font-weight: 600; }

/* reward rail */
.reward-card { text-align: center; padding: 22px 16px; background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-lg); transition: all .2s ease; }
.reward-card:hover { transform: translateY(-5px); box-shadow: var(--sh-2); border-color: var(--gold-300); }
.reward-card .r-ico { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 18px; display: grid;
  place-items: center; background: linear-gradient(135deg, var(--gold-200), var(--gold-400));
  color: var(--amber-700); font-size: 1.3rem; }
.reward-card b { display: block; font-size: .95rem; }
.reward-card span { font-size: .76rem; color: var(--ink-3); }

/* testimonial */
.quote-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px; }
.quote-card p { font-size: .95rem; color: var(--ink-2); }
.quote-who { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--gold-400), var(--amber-500)); color: var(--ink); font-weight: 800; font-size: .85rem; }

/* CTA band */
.cta-band {
  background: linear-gradient(135deg, var(--gold-300), var(--amber-500));
  border-radius: var(--r-xl); padding: clamp(32px, 5vw, 56px);
  display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap;
  box-shadow: var(--sh-2);
}
.cta-band h2 { margin-bottom: .25em; color: var(--ink); }
.cta-band p { margin: 0; color: var(--ink-2); }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .85rem; font-weight: 700; margin-bottom: 6px; color: var(--ink-2); }
.input, .field input, .field select, .field textarea {
  width: 100%; padding: 12px 16px; border-radius: var(--r-sm);
  border: 1.5px solid var(--line); background: var(--white); outline: 0;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.input:focus, .field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--amber-500); box-shadow: 0 0 0 3px var(--ring-primary);
}
.field .hint { font-size: .78rem; color: var(--ink-3); margin-top: 5px; }

/* ---------- Alerts ---------- */
.alert { padding: 13px 18px; border-radius: var(--r-sm); font-size: .9rem; font-weight: 600;
  display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; border: 1px solid transparent; }
.alert-success { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok-line); }
.alert-danger  { background: var(--bad-bg); color: var(--bad-ink); border-color: var(--bad-line); }
.alert-warning { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-line); }
.alert-info    { background: var(--info-bg); color: var(--info-ink); border-color: var(--info-line); }

.flash-stack { position: fixed; top: 88px; right: 20px; z-index: 200; width: min(340px, calc(100vw - 40px)); }
.flash-stack .alert { box-shadow: var(--sh-2); animation: slideIn .3s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--r); border: 1px solid var(--line); background: var(--white); }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 620px; }
table.tbl th { text-align: left; padding: 13px 16px; background: var(--cream-2); font-size: .76rem;
  text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); white-space: nowrap; }
table.tbl td { padding: 13px 16px; border-top: 1px solid var(--line); }
table.tbl tbody tr:hover { background: var(--cream); }

/* ---------- Breadcrumb ---------- */
.crumb { display: flex; gap: 8px; align-items: center; font-size: .82rem; color: var(--ink-3); padding: 18px 0; }
.crumb a:hover { color: var(--amber-600); }
.crumb i { font-size: .6rem; }

/* ---------- Pagination ---------- */
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 36px; }
.pager a, .pager span { min-width: 40px; height: 40px; padding: 0 12px; border-radius: var(--r-sm);
  display: grid; place-items: center; background: var(--white); border: 1px solid var(--line); font-weight: 600; font-size: .88rem; }
.pager a:hover { border-color: var(--amber-500); color: var(--amber-600); }
.pager .is-active { background: var(--ink); border-color: var(--ink); color: var(--gold-200); }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 60px 20px; color: var(--ink-3); }
.empty i { font-size: 2.6rem; color: var(--gold-400); margin-bottom: 14px; display: block; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: var(--ink); color: var(--on-ink-2); padding: clamp(46px, 6vw, 76px) 0 0; }
.site-footer h4 { color: var(--gold-200); font-family: var(--ff-body); font-size: .82rem;
  letter-spacing: .16em; text-transform: uppercase; margin-bottom: 16px; }
.site-footer a { color: var(--on-ink-3); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 36px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; font-size: .9rem; }
.footer-grid a { color: var(--on-ink-3); }
.footer-grid a:hover { color: var(--gold-300); }
.footer-brand p { font-size: .9rem; color: var(--on-ink-3); max-width: 34ch; }
.footer-brand .logo { color: var(--on-ink); }
.footer-brand .logo small { color: var(--on-ink-4); }
.social { display: flex; gap: 10px; margin-top: 16px; }
.social a { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .07); color: var(--gold-200); transition: all .2s ease; }
.social a:hover { background: var(--amber-500); color: var(--ink); transform: translateY(-2px); }
.foot-contact { display: grid; gap: 12px; font-size: .9rem; }
.foot-contact div { display: flex; gap: 10px; align-items: flex-start; }
.foot-contact i { color: var(--gold-400); margin-top: 4px; }
.footer-bottom { margin-top: 46px; border-top: 1px solid rgba(255, 255, 255, .09);
  padding: 20px 0; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .82rem; color: var(--on-ink-4); }

/* ============================================================
   DASHBOARD SHELL  (member + admin)
   ============================================================ */
.dash { display: grid; grid-template-columns: 268px 1fr; min-height: 100vh; background: var(--cream); }

.side {
  background: var(--ink); color: var(--on-ink-3); padding: 22px 16px;
  display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side .logo { color: var(--on-ink); margin-bottom: 18px; padding-inline: 8px; }
.side .logo small { color: var(--on-ink-4); }
.side-group { font-size: .68rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--on-ink-5); margin: 16px 0 6px; padding-inline: 12px; }
.side a {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px;
  font-size: .92rem; font-weight: 600; color: var(--on-ink-3); transition: all .16s ease;
}
.side a i { width: 18px; text-align: center; font-size: .95rem; color: var(--on-ink-4); }
.side a:hover { background: rgba(255, 255, 255, .07); color: var(--on-ink); }
.side a.is-active { background: linear-gradient(135deg, var(--gold-400), var(--amber-500)); color: var(--ink); }
.side a.is-active i { color: var(--ink); }
.side .side-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .09); }

.dash-body { min-width: 0; display: flex; flex-direction: column; }
.dash-top {
  position: sticky; top: 0; z-index: 30;
  background: rgba(253, 247, 231, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 14px 28px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.dash-top h1 { font-size: 1.4rem; margin: 0; }
.dash-top .spacer { margin-left: auto; }
.dash-main { padding: 28px; flex: 1; }
.side-toggle { display: none; }

/* metric tiles */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.tile {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 20px; display: flex; gap: 14px; align-items: flex-start;
}
.tile-ico { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: var(--gold-100); color: var(--amber-600); font-size: 1.05rem; }
.tile b { display: block; font-family: var(--ff-display); font-size: 1.55rem; line-height: 1.1; }
.tile span { font-size: .8rem; color: var(--ink-3); font-weight: 600; }
.tile--gold { background: linear-gradient(150deg, var(--gold-300), var(--gold-500)); border-color: transparent; }
.tile--gold .tile-ico { background: rgba(255, 255, 255, .5); color: var(--ink-2); }
.tile--gold b, .tile--gold span { color: var(--ink); }
.tile--dark { background: var(--ink); border-color: transparent; }
.tile--dark .tile-ico { background: rgba(255, 255, 255, .09); color: var(--gold-300); }
.tile--dark b { color: var(--on-ink); } .tile--dark span { color: var(--on-ink-4); }

/* panel */
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.panel-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex;
  align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.panel-head h3 { margin: 0; font-size: 1.05rem; }
.panel-body { padding: 20px; }
.panel .table-wrap { border: 0; border-radius: 0; }

/* referral link box */
.copy-box { display: flex; gap: 8px; background: var(--cream); border: 1.5px dashed var(--gold-400);
  border-radius: var(--r-sm); padding: 8px 8px 8px 14px; align-items: center; }
.copy-box input { flex: 1; border: 0; background: transparent; outline: 0; font-size: .86rem; font-weight: 600; min-width: 0; }

/* binary tree */
.tree { display: flex; flex-direction: column; align-items: center; gap: 0; }
.tree-row { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }
.tree-node {
  width: 132px; padding: 12px 10px; border-radius: var(--r); text-align: center;
  background: var(--white); border: 1.5px solid var(--line); font-size: .78rem;
}
.tree-node.is-me { background: linear-gradient(150deg, var(--gold-300), var(--gold-500)); border-color: transparent; }
.tree-node.is-empty { background: var(--cream-2); border-style: dashed; color: var(--ink-3); }
.tree-node .t-av { width: 34px; height: 34px; margin: 0 auto 6px; border-radius: 50%; display: grid;
  place-items: center; background: var(--ink); color: var(--gold-200); font-weight: 800; font-size: .72rem; }
.tree-node b { display: block; font-size: .8rem; line-height: 1.25; }
.tree-node span { color: var(--ink-3); font-size: .68rem; }
.tree-link { width: 2px; height: 26px; background: var(--line); }
.tree-legs { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* progress */
.bar { height: 9px; border-radius: 99px; background: var(--cream-3); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--gold-400), var(--amber-500)); }

@media (max-width: 980px) {
  .dash { grid-template-columns: 1fr; }
  .side {
    position: fixed; inset: 0 auto 0 0; width: 268px; z-index: 90;
    transform: translateX(-100%); transition: transform .25s ease;

    /* 100vh on a phone is the LARGE viewport — it includes the space behind
       the browser URL bar and the Android navigation bar. The panel was
       therefore taller than the screen, and because .side-foot is pushed down
       with margin-top:auto, "Back to site" and "Sign out" ended up below the
       fold with no way to reach them. dvh is the height actually visible. */
    height: 100vh;              /* fallback for older browsers */
    height: 100dvh;
    max-height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;   /* scrolling the menu must not scroll the page */

    /* Clear the gesture bar / navigation bar at the bottom of the screen. */
    padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  }
  .side.is-open { transform: none; box-shadow: var(--sh-3); }

  /* Sign out is the last thing in the panel and the one people look for, so it
     stays put while the links above it scroll. */
  .side .side-foot {
    position: sticky; bottom: 0;
    margin-top: auto; padding-bottom: 4px;
    background: var(--ink);
    box-shadow: 0 -10px 16px -8px var(--ink);
  }
  .side .side-foot a:last-child { color: var(--gold-300); font-weight: 700; }

  /* Touch-friendly and readable at arm's length. */
  .side a { min-height: 48px; font-size: .98rem; padding: 12px 14px; }
  .side a i { font-size: 1.05rem; width: 22px; }
  .side-group { font-size: .72rem; margin: 18px 0 6px; }
  .side .logo { font-size: 1.15rem; margin-bottom: 14px; }
  .side-toggle { display: grid; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .dash-main { padding: 20px 16px; }
  .dash-top { padding: 12px 16px; }
}
@media (max-width: 560px) {
  .tiles { grid-template-columns: 1fr; }
  .tree-legs { grid-template-columns: 1fr; }
}

/* ---------- Utilities ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 20px;
  overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
.rail > * { scroll-snap-align: start; }
.rail::-webkit-scrollbar { height: 6px; }
.rail::-webkit-scrollbar-thumb { background: var(--gold-300); border-radius: 3px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .g-4, .usp { grid-template-columns: repeat(2, 1fr); }
  .g-6 { grid-template-columns: repeat(3, 1fr); }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
  .leaf-deco { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .nav-menu {
    position: fixed; inset: var(--nav-h) 0 auto 0; flex-direction: column; align-items: stretch;
    background: var(--cream); border-bottom: 1px solid var(--line); box-shadow: var(--sh-2);
    padding: 14px 20px 22px; gap: 4px; display: none;
    max-height: calc(100vh - var(--nav-h)); overflow-y: auto;
  }
  .nav-menu.is-open { display: flex; }
  .nav-menu a { padding: 12px 16px; border-radius: var(--r-sm); }
  .nav-toggle { display: grid; }
  .logo { margin-right: auto; }
  .topbar-links { display: none; }

  /* Account links belong in the dropdown here; the bar has no room for them. */
  .nav-account { display: flex; flex-direction: column; gap: 4px;
                 margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
  .nav-account a { display: flex; align-items: center; gap: 10px; }
  .nav-account .is-signout { color: var(--bad); font-weight: 700; }
}

/* On desktop the same links sit in the bar, so the dropdown copy is redundant. */
@media (min-width: 861px) {
  .nav-account { display: none; }
}

/* ---------- Header must never push the page sideways ----------
   .nav is a flex row: a 1.3rem logo plus search, cart, a button and the
   hamburger overflowed a 360px screen, which clipped the header and let the
   whole page scroll horizontally. Let the logo give way instead. */
@media (max-width: 560px) {
  .nav { gap: 10px; }
  .logo { font-size: 1.05rem; gap: 8px; min-width: 0; }
  .logo > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .logo small { display: none; }            /* the "Wellness & Rewards" strapline */
  .logo-mark { width: 34px; height: 34px; border-radius: 11px; flex: 0 0 34px; }
  .nav-actions { gap: 6px; }
  .icon-btn { width: 38px; height: 38px; }
  .nav-cta { padding: 9px 14px; }
  .nav-cta-text { display: none; }           /* icon-only Sign in / Dashboard */
  .nav-signout { display: none; }            /* it is in the dropdown instead */
}

/* Belt and braces: nothing may make the document wider than the screen. */
html, body { max-width: 100%; overflow-x: hidden; }
@media (max-width: 680px) {
  /* !important is deliberate. Fourteen pages set grid-template-columns as an
     inline style (checkout, cart, contact, register, deposit and most admin
     screens), and an inline style outranks a media query — so without this
     they stayed two-column on a phone and every field was half-width. */
  .g-2, .g-3, .g-4, .g-6, .usp, .split { grid-template-columns: 1fr !important; }
  .hero-stats { gap: 20px; }
  .cta-band { flex-direction: column; align-items: flex-start; text-align: left; }
  .footer-grid { grid-template-columns: 1fr; }
  .flash-stack { top: auto; bottom: 16px; right: 16px; }

  /* A sticky summary column eats the screen once things are stacked. */
  .split > aside[style*="sticky"] { position: static !important; top: auto !important; }

  /* Comfortable tap targets and no iOS zoom-on-focus (needs >= 16px). */
  input, select, textarea { font-size: 16px; }
  .btn { padding: 13px 22px; }
  .btn-sm { padding: 11px 18px; }
}

/* ---------- Binary tree on small screens ---------- */
@media (max-width: 680px) {
  /* The tree keeps its own horizontal scroll, but shrink the nodes so a phone
     shows a useful amount of it before scrolling. */
  .tree[style*="min-width"] { min-width: 460px !important; }
  .tree-node { min-width: 96px; padding: 10px 8px; }
  .tree-node b { font-size: .74rem; }
  .tree-node span { font-size: .62rem; }
  .tree-node .t-av { width: 28px; height: 28px; }
  .tree-row { gap: 10px; }
  .tree-legs { gap: 10px; }
}

/* Tables always scroll rather than squashing or pushing the page sideways. */
@media (max-width: 560px) {
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .tbl { font-size: .86rem; }
  .tbl th, .tbl td { padding-inline: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   RESPONSIVE LAYER
   Mobile-first behaviour for desktop, laptop, tablet and phone.
   Appended last so it settles ties with the rules above.

   Breakpoints in use across this file:
     1024px  laptop / tablet landscape
      900px  tablet portrait   (added here)
      860px  navbar collapses
      680px  large phone
      560px  phone
   ============================================================ */

/* ---------- 1. Nothing may exceed the viewport ---------- */

/* The single most common cause of sideways scroll: a grid or flex child
   defaults to min-width:auto, so a wide item — a 620px table, a long word, an
   unbroken URL — pushes its track wider than the screen instead of scrolling
   inside it. Allowing children to shrink lets the overflow container do its job. */
.grid > *,
.split > *,
.tiles > *,
.dash-body,
.panel,
.card { min-width: 0; }

/* Long unbroken strings (order codes, payment ids, emails) wrap instead of
   stretching their column. */
body { overflow-wrap: break-word; }

/* Media scales with its box rather than forcing width. height:auto keeps the
   aspect ratio when a width/height attribute is present on the tag. */
img, svg, video, canvas, iframe { max-width: 100%; height: auto; }

/* Any element that opts into a fixed pixel width still cannot beat the screen. */
[style*="min-width"] { max-width: 100%; }

/* Anchor targets clear the sticky header. */
html { scroll-padding-top: calc(var(--nav-h) + 12px); }

/* ---------- 2. Tablet portrait ---------- */
@media (max-width: 900px) {
  /* An asymmetric two-column split (1.6fr 1fr and friends) leaves a sidebar
     too narrow to use at this width, so stack instead. Inline styles set these
     per page, hence !important. */
  .split { grid-template-columns: 1fr !important; }
  .g-3   { grid-template-columns: repeat(2, 1fr) !important; }
  .g-6   { grid-template-columns: repeat(3, 1fr) !important; }

  /* A stacked sidebar has no reason to stick. */
  .split > aside[style*="sticky"] { position: static !important; top: auto !important; }

  .section { padding: clamp(36px, 6vw, 64px) 0; }
  .section-head { margin-bottom: 28px; }
}

/* ---------- 3. Touch targets ---------- */
/* Driven by width, not by pointer type. (hover:none)/(pointer:coarse) is
   unreliable — hybrid laptops, desktop emulation and some Android browsers all
   report the wrong thing — so a narrow screen gets comfortable targets whatever
   it claims to be. 44px is the size Apple and Google both recommend. */
@media (max-width: 900px) {
  .btn           { min-height: 44px; }
  .btn-sm        { min-height: 40px; padding-block: 10px; }
  .btn-lg        { min-height: 50px; }
  .icon-btn      { min-width: 42px; min-height: 42px; }
  .chip          { min-height: 38px; padding-block: 9px; }
  .nav-menu a    { min-height: 46px; display: flex; align-items: center; }
  input, select, textarea, .field input, .field select { min-height: 44px; }
  input[type="checkbox"], input[type="radio"] { min-height: 0; width: 20px; height: 20px; }
  /* Buttons inside data tables stay compact but remain tappable. */
  .tbl a.btn, .tbl button.btn { min-height: 38px; }
}

/* Coarse pointers get a little more room again, on top of the above. */
@media (pointer: coarse) {
  .btn { min-height: 46px; }
  .icon-btn { min-width: 44px; min-height: 44px; }
}

/* ---------- 4. Tables ---------- */
/* Data tables keep a sensible minimum and scroll inside their wrapper. The
   wrapper is what scrolls — the page never does. */
.table-wrap { max-width: 100%; overflow-x: auto; }

@media (max-width: 680px) {
  table.tbl { min-width: 540px; }
  .tbl th, .tbl td { white-space: normal; }
  /* A hint that there is more to the right. */
  .table-wrap { scrollbar-width: thin; }
}

/* ---------- 5. Typography ---------- */
/* Headings already use clamp(). These keep body copy readable at both ends
   without a wall of breakpoints. */
@media (max-width: 560px) {
  body { font-size: 15.5px; line-height: 1.6; }
  .wrap { padding-inline: 16px; }
  .card, .panel-body { padding: 16px; }
  .section-head p { font-size: 1rem; }
  .price { font-size: 1.1rem; }
  .tile b { font-size: 1.25rem; }
}

/* Wide desktops: stop lines becoming uncomfortably long. */
@media (min-width: 1600px) {
  :root { --wrap: 1320px; }
}

/* ---------- 6. Forms ---------- */
@media (max-width: 680px) {
  /* Field rows stack; a half-width postcode box is unusable on a phone. */
  .field { margin-bottom: 14px; }
  .grid.g-4 .field, .grid.g-2 .field { margin-bottom: 14px; }
  /* Buttons that sat side by side go full width and stack. */
  .flex.wrapf > .btn { flex: 1 1 100%; }
}

/* ---------- 7. Print ---------- */
@media print {
  .side, .nav, .topbar, .site-footer, .btn, .icon-btn, .flash-stack { display: none !important; }
  body { background: #fff; color: #000; }
  .panel, .card { box-shadow: none; border: 1px solid #ccc; }
  a[href]::after { content: " (" attr(href) ")"; font-size: .8em; }
}
