/* ============================================================
   Pesan Bareng — gaya mengikuti flocoffee.id (putih, hitam, krem)
   ditambah satu warna aksen untuk progres dan animasi kantong.
   ============================================================ */

:root {
  --bg: #ffffff;
  --ink: #000000;
  --muted: #6b6b6b;
  --line: #e5e5e5;
  --cream: #f4f1ec;
  --cream-deep: #ebe6de;
  --accent: #b5562b;        /* terakota: progres, harga grup */
  --accent-soft: #f6e6dc;
  --ok: #2f6b4f;
  --ok-soft: #e3efe8;
  --warn: #8a5a00;
  --warn-soft: #fbf0d9;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --headline: "Poppins", "Inter", -apple-system, sans-serif;
  --serif: "Fraunces", Georgia, serif;
  --r: 14px;
  --maxw: 1080px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--sans);
  font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; cursor: pointer; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 16px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* ── Pita versi uji ── */
.test-ribbon {
  background: #111; color: #fff; text-align: center; font-size: 12px;
  letter-spacing: .08em; padding: 4px 8px;
}

/* ── Header ── */
.top {
  position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.94);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.top-inner { display: flex; align-items: center; justify-content: space-between; height: 54px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 22px; width: auto; }
.brand span { font-family: var(--headline); font-weight: 500; font-size: 14px; padding-left: 10px; border-left: 1px solid var(--line); }
.top a.shop-link { font-size: 13px; color: var(--muted); text-decoration: none; }

/* ── Tombol ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 22px; border-radius: 999px; border: 1px solid var(--ink);
  background: var(--ink); color: #fff; font-weight: 600; font-size: 15px; text-decoration: none;
  transition: transform .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.accent { background: var(--accent); border-color: var(--accent); }
.btn.wa { background: #1f8f4e; border-color: #1f8f4e; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 13px; }
.btn.block { width: 100%; }
.link-btn { background: none; border: 0; text-decoration: underline; font-size: 13px; color: var(--muted); padding: 6px 0; }

/* ── Hero (layar pertama HP) ── */
.hero { padding: 18px 0 22px; background: linear-gradient(180deg, var(--cream) 0%, #fff 100%); }
.hero-grid { display: grid; grid-template-columns: 1fr 112px; column-gap: 14px; align-items: center;
  grid-template-areas: "text bag" "cta cta" "note note"; }
.hero-text { grid-area: text; }
.hero-bag { grid-area: bag; }
.hero-ctas { grid-area: cta; }
.hero-note { grid-area: note; }
.eyebrow { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 8px; }
.hero h1 { font-family: var(--headline); font-weight: 600; font-size: 27px; line-height: 1.18; letter-spacing: -.01em; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .sub { margin-top: 8px; font-size: 15px; color: #333; }
.price-row { display: flex; align-items: baseline; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.price-row s { color: var(--muted); font-size: 15px; }
.price-row { gap: 8px; }
.price-row strong { font-family: var(--headline); font-size: 24px; color: var(--accent); }
.price-row .per { font-size: 13px; color: var(--muted); }
.save-pill { display: inline-block; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.hero-bag { position: relative; }
.hero-bag img { width: 112px; height: 140px; object-fit: cover; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.10); background: #fff; }
.hero-bag .bag-name { font-size: 11px; text-align: center; margin-top: 6px; color: #333; line-height: 1.3; }
.hero-ctas { display: grid; gap: 10px; margin-top: 16px; }
.hero-note { font-size: 12px; color: var(--muted); margin-top: 10px; }

/* ── Section umum ── */
section.block { padding: 34px 0; }
section.block.alt { background: var(--cream); }
.h2 { font-family: var(--headline); font-weight: 600; font-size: 22px; line-height: 1.2; margin-bottom: 6px; }
.lead { color: var(--muted); font-size: 14px; margin-bottom: 18px; }

/* ── Kartu grup berjalan ── */
.group-cards { display: grid; gap: 12px; }
.gcard { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; background: #fff; display: grid; gap: 10px; text-decoration: none; }
.gcard-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.gcard-title { font-weight: 600; font-size: 15px; }
.gcard-meta { font-size: 13px; color: var(--muted); }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--cream-deep); color: #333; }
.badge.flo { background: #111; color: #fff; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.mini-bar { height: 8px; background: var(--cream-deep); border-radius: 999px; overflow: hidden; }
.mini-bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.mini-bar i.done { background: var(--ok); }
.mini-thumbs { display: flex; gap: -6px; }
.mini-thumbs img { width: 26px; height: 32px; object-fit: cover; border-radius: 5px; border: 2px solid #fff; margin-right: -6px; background: #fff; }

/* ── Statistik ── */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.stat { background: #fff; border-radius: var(--r); padding: 12px; border: 1px solid var(--line); }
.stat b { font-family: var(--headline); font-size: 22px; display: block; }
.stat span { font-size: 12px; color: var(--muted); }

/* ── Langkah ── */
.steps { display: grid; gap: 12px; counter-reset: s; }
.step { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; }
.step::before { counter-increment: s; content: counter(s); width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 600; }
.step b { display: block; font-size: 15px; }
.step p { font-size: 14px; color: var(--muted); }

/* ── Grid kopi ── */
.coffee-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.coffee { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.coffee img { aspect-ratio: 4/5; object-fit: cover; width: 100%; background: #fff; }
.coffee .c-body { padding: 10px 12px 12px; display: grid; gap: 4px; }
.coffee .c-name { font-weight: 600; font-size: 14px; line-height: 1.3; }
.coffee .c-notes { font-size: 12px; color: var(--muted); }
.coffee .c-price { font-size: 13px; }
.coffee .c-price s { color: var(--muted); margin-right: 4px; }
.coffee .c-price b { color: var(--accent); }

/* ── FAQ ── */
details { border-bottom: 1px solid var(--line); padding: 14px 0; }
summary { font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
summary::after { content: "+"; font-weight: 400; color: var(--muted); }
details[open] summary::after { content: "–"; }
details p { margin-top: 8px; color: #444; font-size: 14px; }

/* ── Footer ── */
footer { padding: 28px 0 110px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
footer a { color: var(--ink); }

/* ── CTA menempel di bawah (HP) ── */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.96); border-top: 1px solid var(--line); backdrop-filter: blur(8px);
  transform: translateY(110%); transition: transform .25s ease;
}
.sticky-cta.show { transform: translateY(0); }

/* ═══════════ HALAMAN GRUP ═══════════ */
.g-head { padding: 18px 0 8px; }
.g-head h1 { font-family: var(--headline); font-size: 24px; font-weight: 600; line-height: 1.2; }
.g-head .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }

.progress-card { border-radius: 20px; background: var(--cream); padding: 16px; margin-top: 12px; position: relative; overflow: hidden; }
.shelf { position: relative; height: 66px; display: flex; align-items: flex-end; gap: 4px; padding: 0 2px; overflow: hidden; }
.shelf .bag { flex: 0 0 auto; border-radius: 6px; object-fit: cover; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.12); }
.shelf .bag.s100 { width: 30px; height: 38px; }
.shelf .bag.s200 { width: 36px; height: 46px; }
.shelf .bag.s500 { width: 46px; height: 58px; }
.shelf .bag.drop { animation: drop .9s cubic-bezier(.22,1.2,.36,1) both; }
@keyframes drop {
  0% { transform: translateY(-140px) rotate(-14deg); opacity: 0; }
  55% { opacity: 1; }
  80% { transform: translateY(4px) rotate(3deg); }
  100% { transform: translateY(0) rotate(0); }
}
.shelf .more { font-size: 12px; color: var(--muted); align-self: center; padding-left: 4px; }
.big-bar { position: relative; height: 18px; background: #fff; border-radius: 999px; overflow: hidden; margin-top: 8px; border: 1px solid var(--cream-deep); }
.big-bar i { position: absolute; inset: 0 auto 0 0; background: repeating-linear-gradient(-45deg, var(--accent) 0 10px, #c46638 10px 20px); border-radius: 999px; transition: width .9s cubic-bezier(.22,1,.36,1); }
.big-bar i.done { background: repeating-linear-gradient(-45deg, var(--ok) 0 10px, #3a7c5d 10px 20px); }
.big-bar .goal { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--ink); opacity: .35; }
.bar-legend { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; font-size: 13px; color: var(--muted); }
.bar-legend b { font-family: var(--headline); color: var(--ink); font-size: 22px; }
.g-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.g-fact { background: #fff; border-radius: 12px; padding: 10px 12px; }
.g-fact b { display: block; font-family: var(--headline); font-size: 18px; font-variant-numeric: tabular-nums; }
.g-fact span { font-size: 12px; color: var(--muted); }
.reached { margin-top: 12px; background: var(--ok); color: #fff; border-radius: 12px; padding: 10px 12px; font-weight: 600; font-size: 14px; }

.people { margin-top: 18px; display: grid; gap: 8px; }
.person { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--cream-deep); display: grid; place-items: center; font-weight: 600; font-size: 14px; }
.person .p-name { font-weight: 600; font-size: 14px; }
.person .p-items { font-size: 12px; color: var(--muted); }
.person .p-gram { font-weight: 600; font-size: 14px; }

.panel { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-top: 16px; background: #fff; }
.panel h3 { font-family: var(--headline); font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.panel.me { border-color: var(--ink); }
.banner { border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-top: 12px; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.ok { background: var(--ok-soft); color: var(--ok); }
.banner.info { background: var(--cream); color: #333; }
.rows { display: grid; gap: 6px; font-size: 14px; }
.rows .r { display: flex; justify-content: space-between; gap: 10px; }
.rows .r.total { font-weight: 700; font-size: 16px; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.rows .r s { color: var(--muted); }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ── Bottom sheet (pilih kopi + data diri) ── */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 60; opacity: 0; transition: opacity .2s; }
.sheet-backdrop.show { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; background: #fff; border-radius: 20px 20px 0 0;
  max-height: 92vh; display: flex; flex-direction: column; transform: translateY(100%); transition: transform .25s ease;
  max-width: 640px; margin: 0 auto;
}
.sheet.show { transform: translateY(0); }
.sheet-head { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sheet-head b { font-family: var(--headline); font-size: 17px; }
.sheet-close { background: none; border: 0; font-size: 26px; line-height: 1; padding: 4px 8px; }
.sheet-body { overflow-y: auto; padding: 12px 16px; flex: 1; }
.sheet-foot { padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: grid; gap: 8px; }
.meter { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.meter b { color: var(--ink); }
.meter-bar { height: 6px; background: var(--cream-deep); border-radius: 999px; overflow: hidden; }
.meter-bar i { display: block; height: 100%; background: var(--ink); transition: width .2s; }

.pick { display: grid; grid-template-columns: 56px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.pick img { width: 56px; height: 70px; object-fit: cover; border-radius: 8px; background: #fff; border: 1px solid var(--line); }
.pick .p-title { font-weight: 600; font-size: 14px; line-height: 1.3; }
.pick .p-sub { font-size: 12px; color: var(--muted); }
.sizes { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.size { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 6px 10px; font-size: 12px; text-align: left; min-width: 84px; }
.size b { display: block; font-size: 13px; }
.size .q { color: var(--accent); font-weight: 700; }
.size.on { border-color: var(--ink); background: var(--ink); color: #fff; }
.size.on .q { color: #fff; }
.size[disabled] { opacity: .35; }
.out { font-size: 12px; color: var(--muted); margin-top: 6px; }

.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 13px; font-weight: 600; }
.field input, .field textarea, .field select { border: 1px solid #cfcfcf; border-radius: 10px; padding: 12px; width: 100%; background: #fff; }
.field .hint { font-size: 12px; color: var(--muted); }
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 10px 8px; font-size: 13px; text-align: left; }
.seg button b { display: block; font-size: 14px; }
.seg button.on { background: var(--ink); color: #fff; }
.err { color: #b00020; font-size: 13px; }
.suggest { border: 1px solid var(--line); border-radius: 10px; max-height: 220px; overflow-y: auto; }
.suggest button { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: #fff; padding: 10px 12px; font-size: 13px; }

/* ── Bagikan ── */
.share-box { display: grid; gap: 8px; margin-top: 10px; }
.share-url { display: flex; gap: 6px; }
.share-url input { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: 13px; background: var(--cream); }

/* ── Konfeti saat tembus 1 kg ── */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 8px; height: 14px; border-radius: 2px; animation: fall 2.6s linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: #111; color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 13px; z-index: 90; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .shelf .bag.drop, .confetti i { animation: none; }
  .big-bar i { transition: none; }
}

/* ── Desktop ── */
@media (min-width: 760px) {
  .hero { padding: 48px 0 56px; }
  .hero-grid { grid-template-columns: 1.2fr .8fr; column-gap: 56px; align-items: start;
    grid-template-areas: "text bag" "cta bag" "note bag"; grid-template-rows: auto auto 1fr; }
  .hero-text { padding-top: 40px; }
  .hero h1 { font-size: 46px; }
  .hero .sub { font-size: 18px; }
  .price-row strong { font-size: 34px; }
  .hero-bag img { width: 100%; height: auto; aspect-ratio: 4/5; max-width: 340px; margin: 0 auto; border-radius: 18px; }
  .hero-bag .bag-name { font-size: 14px; }
  .hero-ctas { grid-template-columns: auto auto; justify-content: start; }
  .group-cards { grid-template-columns: repeat(3, 1fr); }
  .stats { grid-template-columns: repeat(2, 220px); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .coffee-grid { grid-template-columns: repeat(4, 1fr); }
  .h2 { font-size: 30px; }
  .sticky-cta { display: none; }
  footer { padding-bottom: 40px; }
  .g-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; align-items: start; }
  .shelf { height: 76px; }
  .sheet { bottom: auto; top: 50%; border-radius: 20px; transform: translateY(-40%); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-height: 86vh; }
  .sheet.show { transform: translateY(-50%); opacity: 1; pointer-events: auto; }
}
