:root {
  --bg: #f1f2f4;
  --surface: #ffffff;
  --ink: #23201c;
  --muted: #7a726a;
  --line: #eceeef;
  --brand: #ee4d2d;      /* oranye (ala Shopee, cocok dgn logo) */
  --brand-dark: #d4381f;
  --brand2: #2ca89a;     /* teal dari logo */
  --accent: #ee4d2d;     /* harga/SALE oranye */
  --new: #1f6feb;        /* biru BARU */
  --wa: #25d366;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 6px 20px rgba(0,0,0,.04);
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
}
[x-cloak] { display: none !important; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* ---------- Header (gaya Shopee, oranye) ---------- */
.header {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(180deg, #ff5f3a, #ee4d2d);
  box-shadow: 0 2px 8px rgba(238,77,45,.25);
}
.header__inner { max-width: 1120px; margin: 0 auto; padding: 10px 14px 12px; }
.header__bar { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.logo { display: flex; align-items: center; gap: 9px; }
.logo__img { width: 38px; height: 38px; object-fit: contain; flex: 0 0 auto; background: #fff; border-radius: 9px; padding: 2px; }
.logo__name { font-weight: 800; font-size: 15px; letter-spacing: -.01em; color: #fff; }
.logo__tag { font-size: 10.5px; color: rgba(255,255,255,.85); }
.header__spacer { flex: 1; }
.iconbtn {
  position: relative; width: 38px; height: 38px; border: 0; background: rgba(255,255,255,.18);
  border-radius: 10px; display: grid; place-items: center; font-size: 18px; color: #fff; text-decoration: none;
}
.iconbtn__count {
  position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px;
  background: #fff; color: var(--brand); border: 1px solid var(--brand); border-radius: 10px;
  font-size: 11px; font-weight: 800; display: grid; place-items: center;
}
.searchbar { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 999px; padding: 4px 6px 4px 14px; }
.searchbar input { flex: 1; border: 0; outline: 0; font-size: 14px; padding: 7px 0; background: transparent; color: var(--ink); }
.searchbar button { border: 0; background: var(--brand); color: #fff; width: 34px; height: 34px; border-radius: 999px; font-size: 16px; display: grid; place-items: center; }

/* ---------- Layout ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 16px; }
.section-title { font-size: 18px; font-weight: 800; margin: 4px 0 12px; letter-spacing: -.01em; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.muted { color: var(--muted); }
.link { color: var(--brand); font-weight: 600; }

/* ---------- Category chips ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 14px; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 600; white-space: nowrap; color: var(--ink);
}
.chip--active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------- Product grid ---------- */
.grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 820px) { .grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1040px){ .grid { grid-template-columns: repeat(5, 1fr); } }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.card__imgwrap { position: relative; aspect-ratio: 1/1; background: #f2ece3; }
.card__img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.card__ph { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); font-size: 12px; text-align: center; padding: 10px; }
.badges { position: absolute; top: 8px; left: 8px; display: flex; gap: 6px; }
.badge { font-size: 10px; font-weight: 800; color: #fff; padding: 3px 7px; border-radius: 6px; letter-spacing: .02em; }
.badge--sale { background: var(--accent); }
.badge--new { background: var(--new); }
.card__body { padding: 10px 11px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card__cat { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.card__name { font-size: 13px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 34px; }
.card__price { font-size: 15px; font-weight: 800; color: var(--brand); margin-top: auto; }
.card__unit { font-size: 11px; color: var(--muted); font-weight: 500; }
.card__add {
  margin-top: 8px; border: 1px solid var(--brand); color: var(--brand); background: var(--surface);
  border-radius: 9px; padding: 8px; font-weight: 700; font-size: 13px;
}
.card__add:active { background: var(--brand); color: #fff; }

/* ---------- Toolbar (list) ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.select { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 11px; font-weight: 600; font-size: 13px; }

.btn {
  border: 0; border-radius: 11px; padding: 12px 16px; font-weight: 700; font-size: 14px;
  background: var(--brand); color: #fff;
}
.btn--block { width: 100%; }
.btn--wa { background: var(--wa); color: #0a2e1a; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn--ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.more { display: grid; place-items: center; margin: 18px 0; }

/* ---------- Product detail ---------- */
.detail { display: grid; gap: 18px; }
@media (min-width: 720px) { .detail { grid-template-columns: 1fr 1fr; align-items: start; } }
.detail__imgwrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); aspect-ratio: 1/1; }
.detail__img { width: 100%; height: 100%; object-fit: contain; padding: 18px; }
.detail__name { font-size: 22px; font-weight: 800; line-height: 1.25; margin: 2px 0 8px; }
.detail__price { font-size: 26px; font-weight: 800; color: var(--brand); }
.meta { margin: 14px 0; border-top: 1px solid var(--line); }
.meta__row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.meta__row span:first-child { color: var(--muted); }
.qtybox { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.qtybox button { width: 40px; height: 40px; background: var(--surface); border: 0; font-size: 18px; font-weight: 700; color: var(--brand); }
.qtybox span { min-width: 44px; text-align: center; font-weight: 700; }

/* ---------- Cart ---------- */
.cart-line { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: center; }
.cart-line__img { width: 60px; height: 60px; object-fit: contain; background: #f2ece3; border-radius: 10px; flex: 0 0 auto; }
.cart-line__body { flex: 1; min-width: 0; }
.cart-line__name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.cart-line__price { font-size: 13px; color: var(--muted); }
.cart-line__rm { border: 0; background: none; color: var(--accent); font-weight: 700; font-size: 12px; padding: 4px; }
.summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 16px; position: sticky; bottom: 0; box-shadow: var(--shadow); }
.summary__total { display: flex; justify-content: space-between; font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.note { font-size: 12px; color: var(--muted); margin: 6px 0 12px; }
.ordertext { width: 100%; min-height: 120px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; font: 13px/1.5 ui-monospace, monospace; }

/* ---------- States ---------- */
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.banner {
  background: linear-gradient(135deg, var(--brand), #13855f); color: #fff; border-radius: 18px;
  padding: 26px 22px; margin-bottom: 20px;
}
.banner h1 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.02em; }
.banner p { margin: 0; opacity: .92; font-size: 14px; }
.preview-flag {
  background: #fff6d6; border: 1px solid #f0dd9a; color: #7a5d00; font-size: 12px;
  padding: 8px 14px; text-align: center;
}
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 30px 16px 40px; }
.backlink { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--brand); margin-bottom: 14px; }

/* ===== Gaya marketplace (beranda) ===== */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.panel__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel__title { font-size: 13px; font-weight: 800; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }

/* kategori: lingkaran, 2 baris, geser horizontal */
.catscroll { display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, auto); grid-auto-columns: 78px; gap: 16px 4px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.catscroll::-webkit-scrollbar { height: 6px; }
.catscroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.catcell { display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; scroll-snap-align: start; }
.catcell__circle { width: 62px; height: 62px; border-radius: 50%; background: #eef0f2; overflow: hidden; display: grid; place-items: center; border: 1px solid var(--line); }
.catcell__circle img { width: 100%; height: 100%; object-fit: cover; }
.catcell__label { font-size: 11px; line-height: 1.2; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* flash sale */
.flash__head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.flash__logo { display: flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 900; font-style: italic; font-size: 20px; letter-spacing: -.02em; }
.flash__timer { display: flex; gap: 4px; align-items: center; }
.flash__box { background: #1e1e1e; color: #fff; font-weight: 700; font-size: 13px; border-radius: 5px; padding: 3px 6px; min-width: 26px; text-align: center; font-variant-numeric: tabular-nums; }
.flash__sep { color: #1e1e1e; font-weight: 800; }
.flash__more { margin-left: auto; color: var(--accent); font-weight: 700; font-size: 13px; }

/* baris produk geser horizontal */
.hscroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.hscroll::-webkit-scrollbar { height: 6px; }
.hscroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.hscroll .card { flex: 0 0 152px; scroll-snap-align: start; }

/* ribbon diskon ala marketplace + bar promo (tanpa angka stok/diskon palsu) */
.ribbon { position: absolute; top: 0; right: 0; background: linear-gradient(#ff8a00, #ff4d2e); color: #fff; font-weight: 800; font-size: 12px; padding: 3px 8px; border-bottom-left-radius: 10px; z-index: 2; }
.ribbon--new { background: linear-gradient(#2b8bff, #1f6feb); }
.card__price--sale { color: var(--accent); }
.promobar { margin-top: 6px; height: 20px; border-radius: 10px; overflow: hidden; background: #ffe3cc; position: relative; display: flex; align-items: center; justify-content: center; }
.promobar::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 65%; background: linear-gradient(90deg, #ff8a00, #ff4d2e); }
.promobar span { position: relative; z-index: 1; font-size: 10px; font-weight: 800; color: #7a2e00; display: flex; align-items: center; gap: 4px; }

/* ===== Menu ikon (ala shortcut Shopee) ===== */
.quickmenu { display: flex; gap: 4px; }
.qm { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; }
.qm__icon { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; font-size: 23px; }
.qm__label { font-size: 11px; line-height: 1.2; color: var(--ink); }
.qm--a .qm__icon { background: #fff0ec; }
.qm--b .qm__icon { background: #e7f6f3; }
.qm--c .qm__icon { background: #eaf1ff; }
.qm--d .qm__icon { background: #fff4e0; }
.qm--e .qm__icon { background: #eafbef; }

/* ===== Strip info (pengganti baris dompet Shopee) ===== */
.infostrip { display: flex; align-items: stretch; }
.infostrip > div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px; text-align: center; }
.infostrip > div + div { border-left: 1px solid var(--line); }
.infostrip b { font-size: 12px; }
.infostrip small { font-size: 10.5px; color: var(--muted); line-height: 1.2; }

/* ===== Tab bar bawah ===== */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fff;
  border-top: 1px solid var(--line); display: flex; box-shadow: 0 -2px 10px rgba(0,0,0,.05);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 8px; font-size: 11px; font-weight: 600; color: var(--muted); position: relative; }
.tab--active { color: var(--brand); }
.tab__ic { font-size: 20px; line-height: 1; }
.tab__count { position: absolute; top: 4px; left: 50%; margin-left: 4px; min-width: 17px; height: 17px; padding: 0 4px; background: var(--brand); color: #fff; border-radius: 9px; font-size: 10px; font-weight: 800; display: grid; place-items: center; }
body { padding-bottom: 66px; }

/* lokasi/toko di kartu (Shopee menampilkan lokasi penjual) */
.card__loc { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 4px; }

/* ===== Detail produk (gaya Shopee) ===== */
.pd-gallery { background: #fff; }
.pd-gallery img { width: 100%; aspect-ratio: 1/1; object-fit: contain; }
.pd-price { background: #fff; padding: 14px 16px; }
.pd-price__now { color: var(--brand); font-size: 28px; font-weight: 800; }
.pd-price__unit { color: var(--muted); font-size: 13px; }
.pd-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.pd-tag { font-size: 11px; font-weight: 700; color: var(--brand); border: 1px solid var(--brand); border-radius: 4px; padding: 2px 6px; background: #fff4f1; }
.pd-sect { background: #fff; margin-top: 8px; padding: 14px 16px; }
.pd-sect h3 { margin: 0 0 10px; font-size: 15px; font-weight: 800; }
.pd-desc { font-size: 14px; color: #3a3a3a; line-height: 1.6; }
.spec { border-top: 1px solid var(--line); margin-top: 10px; }
.spec__row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.spec__row span:first-child { color: var(--muted); }

/* ===== Action bar bawah (detail) ===== */
.actionbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -2px 10px rgba(0,0,0,.06); }
.actionbar .ab-ic { flex: 0 0 76px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--brand2); padding: 8px 0; }
.actionbar .ab-ic span { font-size: 19px; }
.actionbar .ab-add { flex: 1; background: #ffb088; color: #fff; border: 0; font-weight: 800; font-size: 14px; }
.actionbar .ab-buy { flex: 1; background: var(--brand); color: #fff; border: 0; font-weight: 800; font-size: 14px; }

/* ===== Bottom sheet (variasi + jumlah) ===== */
.sheet-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; }
.sheet { width: 100%; max-width: 1120px; margin: 0 auto; background: #fff; border-radius: 18px 18px 0 0; max-height: 86vh; overflow-y: auto; padding: 16px 16px calc(16px + env(safe-area-inset-bottom,0)); }
.sheet__top { display: flex; gap: 12px; align-items: flex-end; }
.sheet__thumb { width: 96px; height: 96px; border-radius: 12px; object-fit: contain; background: #f2f3f5; border: 1px solid var(--line); flex: 0 0 auto; }
.sheet__price { color: var(--brand); font-size: 22px; font-weight: 800; }
.sheet__stock { color: var(--muted); font-size: 12px; }
.sheet__close { margin-left: auto; align-self: flex-start; border: 0; background: none; font-size: 22px; color: var(--muted); }
.sheet__label { font-size: 13px; font-weight: 700; margin: 16px 0 8px; }
.variations { display: flex; flex-wrap: wrap; gap: 8px; }
.variation { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 13px; font-weight: 600; background: #fff; }
.variation--on { border-color: var(--brand); color: var(--brand); background: #fff4f1; }
.sheet__row { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.sheet__add { margin-top: 18px; }

/* ===== Keranjang (gaya Shopee) ===== */
.chk { width: 20px; height: 20px; accent-color: var(--brand); flex: 0 0 auto; }
.cartgroup { background: #fff; border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; box-shadow: var(--shadow); }
.cartgroup__head { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.store-badge { background: var(--brand); color: #fff; font-size: 10px; font-weight: 800; border-radius: 4px; padding: 2px 6px; }
.ship-note { display: flex; align-items: center; gap: 8px; background: #e9f9f1; color: #0a7a45; font-size: 12px; font-weight: 600; border-radius: 8px; padding: 8px 10px; margin: 10px 0; }
.cline { display: flex; gap: 10px; padding: 12px 0; align-items: center; }
.cline__img { width: 70px; height: 70px; object-fit: contain; background: #f2f3f5; border-radius: 10px; flex: 0 0 auto; }
.cline__body { flex: 1; min-width: 0; }
.cline__name { font-size: 13px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cline__var { display: inline-block; font-size: 11px; color: var(--muted); background: #f2f3f5; border-radius: 6px; padding: 2px 8px; margin-top: 4px; }
.cline__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.cline__price { color: var(--brand); font-weight: 800; font-size: 15px; }

/* ===== Cart bar bawah (checkout) ===== */
.cartbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; align-items: center; gap: 10px; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -2px 10px rgba(0,0,0,.06); padding: 8px 14px calc(8px + env(safe-area-inset-bottom,0)); }
.cartbar__all { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.cartbar__total { margin-left: auto; text-align: right; line-height: 1.1; }
.cartbar__total b { color: var(--brand); font-size: 17px; }
.cartbar__total small { display: block; color: var(--muted); font-size: 11px; }
.cartbar__btn { background: var(--brand); color: #fff; border: 0; border-radius: 999px; padding: 11px 18px; font-weight: 800; font-size: 14px; white-space: nowrap; }
.cartbar__btn:disabled { opacity: .45; }

/* ===== Animasi: transisi halaman ===== */
@keyframes pageIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.pageview { animation: pageIn .3s cubic-bezier(.2,.7,.2,1) both; }
@media (prefers-reduced-motion: reduce) { .pageview, .sk, .loadbar::before, .sheet { animation: none !important; } }

/* ===== Bar loading tipis di atas ===== */
.loadbar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 70; overflow: hidden; background: #ffe0d2; }
.loadbar::before { content: ""; position: absolute; top: 0; height: 100%; width: 40%; border-radius: 3px; background: linear-gradient(90deg, #ff8a5c, var(--brand)); animation: loadslide 1s infinite ease-in-out; }
@keyframes loadslide { from { left: -42%; } to { left: 100%; } }

/* ===== Skeleton (placeholder berkilau) ===== */
@keyframes shimmer { from { background-position: -500px 0; } to { background-position: 500px 0; } }
.sk { background: #e9ebee; background-image: linear-gradient(90deg, #e9ebee 0, #f4f5f6 160px, #e9ebee 320px); background-size: 650px 100%; animation: shimmer 1.25s infinite linear; }
.sk-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.sk-img { aspect-ratio: 1/1; }
.sk-line { height: 12px; margin: 11px; border-radius: 6px; }
.sk-line.sh { width: 55%; }
.sk-line.pr { width: 40%; height: 16px; }

/* ===== Bottom sheet slide-up ===== */
.sheet { animation: sheetUp .26s cubic-bezier(.2,.8,.2,1) both; }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }

/* ===== Kartu: umpan balik sentuh ===== */
.card { transition: transform .12s ease, box-shadow .2s ease; }
.card:active { transform: scale(.97); }
.catcell:active .catcell__circle, .qm:active .qm__icon { transform: scale(.92); transition: transform .1s ease; }
