/* CTS Kacang Puteh, mobile first. Colours from the brand profile. */
:root {
  --green: #008000; --forest: #0B4D2C; --tint: #E3F1E0; --cream: #F7F1E3; --white: #fff;
  --gold: #E0A82E; --gold-ink: #3D2A05; --chilli: #B83A1E; --kraft: #A67C52; --kraft-ink: #7A5634;
  --ink: #2B2A24; --muted: #5C5A50; --line: #DDD3BE; --wa: #128C3E;
  --r-sm: 4px; --r-md: 8px; --r-lg: 16px;
  --display: 'Caladea', Cambria, Georgia, 'Times New Roman', serif;
  --sans: Arial, Helvetica, Roboto, system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 16px/1.5 var(--sans); padding-bottom: 72px; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); }
a:hover { color: var(--forest); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.15; color: var(--forest); margin: 0 0 .5em; }
h1 { font-size: 1.9rem; } h2 { font-size: 1.45rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 680px; }
.center { text-align: center; } .center img { margin: 0 auto 12px; }
.muted { color: var(--muted); } .small { font-size: .875rem; }
.eyebrow { font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--kraft-ink); font-weight: 700; margin-bottom: .4em; }
.eyebrow a { color: inherit; text-decoration: none; }
.lead { font-size: 1.15rem; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px; z-index: 99; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* header */
/* Header, scroll-linked: --p goes from 0 (top of page) to 1 (header fully small) as the page scrolls,
   set by a few lines in site.js. Every size and position below is "top value" blended towards
   "small value" by --p, so the header follows the thumb exactly. The name keeps its size and stays centred.
   The logo moves a little faster (--pl) and the name starts rising a little later (--pn), so they never overlap. */
:root {
  --p: 0;
  --pl: min(1, var(--p) * 1.6);
  --pn: max(0, (var(--p) - .35) / .65);
  --hdr-row: 186px; --hdr-row-small: 64px; --hdr-nav: 44px;
  --logo-big: 104px; --logo-small: 44px; --logo-top: 14px; --logo-top-small: 10px;
  --name-w: 240px; --name-h: 33px; --name-top: 130px;
}
.header-space { height: calc(var(--hdr-row) + var(--hdr-nav)); }
html { scroll-padding-top: calc(var(--hdr-row-small) + var(--hdr-nav) + 12px); }
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 20; background: var(--forest);
  box-shadow: 0 2px 10px rgba(0, 0, 0, calc(.18 * var(--p))); }
.header-row { position: relative; height: calc(var(--hdr-row) - (var(--hdr-row) - var(--hdr-row-small)) * var(--pn)); }
.site-header .brand { position: absolute; inset: 0 16px; display: block; text-decoration: none; }
.brand-logo, .brand-name { position: absolute; }
.brand-logo {
  --size: calc(var(--logo-big) - (var(--logo-big) - var(--logo-small)) * var(--pl));
  width: var(--size); height: var(--size);
  left: calc((50% - var(--size) / 2) * (1 - var(--pl)));                     /* centre -> left edge */
  top: calc(var(--logo-top) - (var(--logo-top) - var(--logo-top-small)) * var(--pl));
}
.brand-name {
  width: min(var(--name-w), 100% - 2 * (var(--logo-small) + 12px)); height: auto;
  left: 50%; transform: translateX(-50%);                                      /* always centred */
  top: calc(var(--name-top) - (var(--name-top) - (var(--hdr-row-small) - var(--name-h)) / 2) * var(--pn));
}
.order-icon { position: absolute; right: 8px; top: 12px; color: var(--cream); padding: 8px; z-index: 1; }
.order-icon .count { position: absolute; top: 0; right: -2px; background: var(--chilli); color: #fff; border-radius: 99px; font-size: .75rem; min-width: 20px; height: 20px; line-height: 20px; text-align: center; font-weight: 700; padding: 0 5px; }
.main-nav { background: var(--forest); border-top: 1px solid rgba(224, 168, 46, .45); height: var(--hdr-nav); }
.main-nav .wrap { display: flex; justify-content: center; gap: 4px; overflow-x: auto; }
.main-nav a { color: var(--cream); text-decoration: none; padding: 11px 14px; font-weight: 700; font-size: .95rem; white-space: nowrap; }
.main-nav a[aria-current="page"], .main-nav a:hover { color: var(--gold); }
.notice-bar { background: var(--gold); color: var(--gold-ink); font-weight: 700; text-align: center; padding: 8px 0; font-size: .95rem; }
.notice-bar a { color: var(--gold-ink); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 18px; border-radius: var(--r-md);
  border: 2px solid transparent; font: 700 1rem/1.2 var(--sans); text-decoration: none; cursor: pointer; text-align: center; }
.btn-primary { background: var(--green); color: #fff; } .btn-primary:hover { background: var(--forest); color: #fff; }
.btn-wa { background: var(--wa); color: #fff; } .btn-wa:hover { background: #0d6b2f; color: #fff; }
.btn-gold { background: var(--gold); color: var(--gold-ink); } .btn-gold:hover { background: #c9921f; color: var(--gold-ink); }
.btn-outline { background: var(--white); color: var(--forest); border-color: var(--forest); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn-lg { min-height: 52px; font-size: 1.05rem; }
.btn-block { display: flex; width: 100%; margin-bottom: 10px; }
.btn[disabled] { opacity: .6; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.link-btn { background: none; border: 0; color: var(--chilli); font: inherit; font-size: .85rem; cursor: pointer; padding: 4px; text-decoration: underline; }

/* sections */
.section { padding: 32px 0; }
.section-tint { background: var(--white); }
.section-forest { background: var(--forest); color: var(--cream); }
.section-forest h2 { color: var(--white); } .section-forest .eyebrow { color: var(--gold); }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.section-head h1, .section-head h2 { margin: 0; }
.two-col { display: grid; gap: 24px; }
.empty { color: var(--muted); padding: 16px 0; }

/* hero */
.hero { background: var(--white); padding: 24px 0; }
.hero-grid { display: grid; gap: 20px; align-items: center; }
.hero h1 { font-size: 2rem; }
.hero-img { border-radius: var(--r-lg); aspect-ratio: 4 / 5; object-fit: cover; width: 100%; max-height: 420px; }

/* product grid: 2 per row, cards 2 : 2.5 */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; display: flex; flex-direction: column; }
.card-photo { display: block; aspect-ratio: 2 / 2.5; background: var(--cream); }
.card-img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 10px; display: flex; flex-direction: column; gap: 4px; flex: 1; border-top: 4px solid var(--kraft); }
.card h3 { font-size: 1rem; margin: 0; } .card h3 a { color: var(--ink); text-decoration: none; }
.card-size { font-size: .85rem; margin: 0; }
.card .btn { margin-top: auto; }
.price { font-weight: 700; color: var(--green); margin: 0; font-size: 1.05rem; }
.price-lg { font-size: 1.6rem; margin-bottom: 12px; }
.soldout { color: var(--chilli); font-weight: 700; font-size: .9rem; margin-top: auto; }
.line-gold .card-body, .line-gold.product-info { border-top-color: var(--gold); }
.line-green .card-body, .line-green.product-info { border-top-color: var(--green); }
.line-chilli .card-body, .line-chilli.product-info { border-top-color: var(--chilli); }
.line-kraft .card-body, .line-kraft.product-info { border-top-color: var(--kraft); }

/* missing photo placeholder (annotated with the file name to upload) */
.ph-missing { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 100%;
  min-height: 160px; background: repeating-linear-gradient(45deg, var(--cream), var(--cream) 10px, #EFE6D2 10px, #EFE6D2 20px); color: var(--kraft-ink); text-align: center; padding: 10px; }
.ph-missing .ph-logo { width: 40%; max-width: 110px; opacity: .35; }
.ph-note { font-size: .75rem; line-height: 1.35; background: rgba(255,255,255,.85); border: 1px dashed var(--kraft); border-radius: var(--r-sm); padding: 4px 6px; word-break: break-all; }
.ph-note code { font-size: .75rem; color: var(--chilli); font-weight: 700; }
.family-photo, .shop-photo, .story-photo { border-radius: var(--r-lg); aspect-ratio: 4 / 3; object-fit: cover; width: 100%; min-height: 200px; margin-bottom: 16px; }

/* lines, chips */
.lines { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.line-tile { padding: 22px 12px; border-radius: var(--r-md); font-weight: 700; text-decoration: none; text-align: center; font-family: var(--display); font-size: 1.1rem; }
.line-tile.line-gold { background: var(--gold); color: var(--gold-ink); }
.line-tile.line-kraft { background: var(--kraft); color: #fff; }
.line-tile.line-green { background: var(--tint); color: var(--forest); }
.line-tile.line-chilli { background: var(--chilli); color: #fff; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 14px; }
.chips a { white-space: nowrap; border: 1px solid var(--forest); color: var(--forest); border-radius: 99px; padding: 6px 14px; text-decoration: none; font-size: .9rem; background: var(--white); }
.chips a[aria-current="page"] { background: var(--forest); color: var(--white); }

/* trust, steps, timeline */
.trust { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.trust li { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; }
.trust strong { display: block; color: var(--forest); } .trust span { font-size: .875rem; color: var(--muted); }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { counter-increment: s; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 12px 12px 52px; position: relative; }
.steps li::before { content: counter(s); position: absolute; left: 12px; top: 12px; width: 28px; height: 28px; border-radius: 50%; background: var(--green); color: #fff; font-weight: 700; text-align: center; line-height: 28px; }
.steps strong, .timeline strong { display: block; color: var(--forest); }
.timeline { list-style: none; padding: 0 0 0 18px; margin: 0; border-left: 3px solid var(--gold); }
.timeline li { margin: 0 0 18px; position: relative; } .timeline li::before { content: ''; position: absolute; left: -26px; top: 4px; width: 13px; height: 13px; border-radius: 50%; background: var(--green); }
.open-badge { display: inline-block; font-size: .8rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.is-open { background: var(--tint); color: var(--forest); } .is-closed { background: #F6E1DB; color: var(--chilli); }
.map { width: 100%; height: 260px; border: 0; border-radius: var(--r-md); }

/* product page */
.product-grid { display: grid; gap: 20px; }
.product-img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--r-lg); }
.product-photo .ph-missing { aspect-ratio: 4 / 5; border-radius: var(--r-lg); }
.product-info { border-top: 6px solid var(--kraft); padding-top: 12px; }
.sizes { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.sizes legend { font-weight: 700; margin-bottom: 6px; }
.size input { position: absolute; opacity: 0; }
.size span { display: block; border: 2px solid var(--line); border-radius: var(--r-md); padding: 8px 12px; background: var(--white); cursor: pointer; font-weight: 700; }
.size small { display: block; font-weight: 400; color: var(--muted); }
.size input:checked + span { border-color: var(--green); background: var(--tint); }
.size input:focus-visible + span { outline: 3px solid var(--gold); }
.size.is-out span { opacity: .5; cursor: not-allowed; }
.qty-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-weight: 700; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--white); }
.qty button { width: 40px; height: 40px; border: 0; background: none; font-size: 1.3rem; cursor: pointer; color: var(--forest); }
.qty input { width: 48px; height: 40px; border: 0; text-align: center; font: 700 1rem var(--sans); -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.share { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.share .btn { min-height: 40px; padding: 8px 14px; font-size: .95rem; }
.product-details { border-top: 1px solid var(--line); padding-top: 14px; }
.product-details h2 { font-size: 1.1rem; margin-top: 1em; }

/* order */
.basket { margin-bottom: 16px; }
.basket-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px; margin-bottom: 8px; }
.basket-name a { font-weight: 700; color: var(--ink); text-decoration: none; }
.basket-amount { font-weight: 700; text-align: right; }
.order-form fieldset { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--white); padding: 12px; margin: 0 0 14px; }
.order-form legend { font-weight: 700; padding: 0 4px; }
.radio { display: flex; gap: 10px; padding: 8px 0; align-items: flex-start; cursor: pointer; }
.radio input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--green); }
.radio small { display: block; color: var(--muted); }
label { display: block; font-weight: 700; margin-bottom: 10px; }
input[type=text], input[type=tel], input[type=email], input[type=number], input[type=password], input[type=datetime-local], select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border: 1px solid #BFB59E; border-radius: var(--r-md); font: 400 1rem var(--sans); background: var(--white); color: var(--ink); }
.qty input[type=number] { display: inline-block; width: 48px; margin: 0; border: 0; padding: 0; }
.field-error { color: var(--chilli); font-size: .9rem; margin: -6px 0 10px; }
.alert { background: #F6E1DB; color: #7A2412; border-radius: var(--r-md); padding: 10px 12px; }
.success { background: var(--tint); color: var(--forest); border-radius: var(--r-md); padding: 10px 12px; font-weight: 700; }
.totals { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; margin-bottom: 14px; }
.totals p { display: flex; justify-content: space-between; margin: 0 0 6px; }
.totals .total { font-weight: 700; font-size: 1.15rem; color: var(--forest); border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.free-hint { color: var(--kraft-ink); font-size: .9rem; }
.inline-form { display: grid; gap: 4px; }
.stack { display: grid; gap: 2px; }
.summary { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--r-md); margin: 14px 0; font-size: .95rem; }
.summary th, .summary td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.summary .num { text-align: right; white-space: nowrap; }
.summary .total td { font-weight: 700; color: var(--forest); font-size: 1.05rem; }

/* footer and bottom bar */
.site-footer { background: var(--forest); color: var(--cream); padding: 28px 0 16px; margin-top: 24px; }
.site-footer a { color: var(--cream); }
.footer-grid { display: grid; gap: 12px; }
.footer-name { width: 240px; height: auto; margin-bottom: 10px; }
.bottom-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: 1fr 1.6fr; gap: 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: var(--white); border-top: 1px solid var(--line); box-shadow: 0 -2px 10px rgba(0,0,0,.06); }
.bottom-bar .btn { min-height: 46px; }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(20px); background: var(--forest); color: #fff; padding: 10px 16px; border-radius: var(--r-md); opacity: 0; transition: .2s; z-index: 40; max-width: 90vw; font-weight: 700; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.prose h2 { margin-top: 1.2em; }

@media (min-width: 720px) {
  h1 { font-size: 2.4rem; } .hero h1 { font-size: 2.6rem; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .lines { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .trust { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .two-col, .hero-grid, .product-grid { grid-template-columns: 1fr 1fr; align-items: start; }
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
  :root { --hdr-row: 216px; --hdr-row-small: 72px; --logo-big: 124px; --logo-small: 52px; --logo-top: 16px;
          --name-w: 300px; --name-h: 41px; --name-top: 152px; }
  .inline-form { grid-template-columns: 1fr 1fr auto; align-items: end; gap: 12px; }
  .section { padding: 48px 0; }
}
@media (min-width: 1000px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body { padding-bottom: 0; }
  .bottom-bar { left: auto; right: 16px; bottom: 16px; width: 380px; border-radius: var(--r-lg); border: 1px solid var(--line); }
}
