:root{
  --bg:#f6f7fb;
  --card:#ffffff;
  --text:#0b1220;
  --muted:rgba(11,18,32,.65);
  --line:rgba(12,30,60,.12);
  --brand:#111827;
  --accent:#2563eb;
  --ok:#16a34a;
  --bad:#ef4444;
  --warn:#f59e0b;
  --shadow:0 10px 30px rgba(0,0,0,.08);
  --radius:18px;
}
*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial;
  background:var(--bg);
  color:var(--text);
}
a{ color:inherit; text-decoration:none; }
.container{
  max-width: 540px;
  margin: 0 auto;
  padding: 14px 14px 88px;
}
.topbar{
  position: sticky;
  top:0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(246,247,251,.75);
  border-bottom:1px solid var(--line);
}
.topbar .inner{
  max-width:540px;
  margin:0 auto;
  padding: 12px 14px;
  display:flex;
  align-items:center;
  gap:10px;
}
.brand{
  font-weight:800;
  letter-spacing:.3px;
}
.pill{
  display:flex;
  align-items:center;
  gap:8px;
  border:1px solid var(--line);
  background:#fff;
  border-radius: 999px;
  padding: 8px 10px;
  flex:1;
}
.pill input{
  border:0;
  outline:0;
  width:100%;
  font:inherit;
}
.iconbtn{
  width:42px; height:42px;
  border-radius: 14px;
  border:1px solid var(--line);
  background:#fff;
  display:grid;
  place-items:center;
}
.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}

/* ===== Product card ===== */
.prod{
  overflow:hidden;
  position:relative; /* penting untuk z-index layers */
}
.prod .thumb{
  width:100%;
  aspect-ratio: 1/1;
  background:#eef2ff;
  display:block;
  object-fit:cover;
}
.prod .pad{ padding:12px; }

.muted{ color:var(--muted); font-size:12px; }
.price{ font-weight:800; }
.row{ display:flex; gap:10px; align-items:center; }
.row.between{ justify-content:space-between; }

.badge{
  font-size:12px;
  padding:6px 10px;
  border-radius: 999px;
  border:1px solid var(--line);
  background:#fff;
}
.badge.ok{ border-color: rgba(22,163,74,.25); color: var(--ok); }
.badge.warn{ border-color: rgba(245,158,11,.25); color: var(--warn); }
.badge.bad{ border-color: rgba(239,68,68,.25); color: var(--bad); }

/* Button clickable desktop fix */
.badge.ok{
  cursor:pointer;
  position:relative;
  z-index:10;
}

.btn{
  width:100%;
  border:0;
  border-radius: 16px;
  padding: 13px 14px;
  font:inherit;
  font-weight:800;
  background: var(--accent);
  color:#fff;
}
.btn.ghost{
  background:#fff;
  border:1px solid var(--line);
  color:var(--text);
}

.btnbar{
  position: fixed;
  left:0; right:0;
  bottom:0;
  padding: 10px 0 18px;
  background: linear-gradient(to top, rgba(246,247,251,1), rgba(246,247,251,.85), rgba(246,247,251,0));
}
.btnbar .inner{
  max-width:540px;
  margin:0 auto;
  padding: 0 14px;
  display:flex;
  gap:10px;
}

.bottomnav{
  position: fixed;
  left:0; right:0;
  bottom:0;
  background:#fff;
  border-top:1px solid var(--line);
}
.bottomnav .inner{
  max-width:540px;
  margin:0 auto;
  padding: 10px 14px;
  display:flex;
  justify-content:space-between;
  gap:10px;
}
.navitem{
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  font-size:11px;
  color:rgba(11,18,32,.7);
}
.navitem b{ font-size:12px; color:var(--text); }

.sheet{
  position: fixed;
  left:0; right:0; bottom:-100%;
  background:#fff;
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  box-shadow: 0 -20px 40px rgba(0,0,0,.18);
  transition: bottom .2s ease;
  z-index: 100;
}
.sheet.open{ bottom:0; }
.sheet .pad{ padding: 14px; }
.sheet .handle{
  width:46px; height:5px;
  border-radius:999px;
  background:rgba(0,0,0,.18);
  margin: 10px auto 6px;
}
.field label{ display:block; font-size:12px; color:var(--muted); margin: 10px 0 6px; }
.field input, .field textarea, .field select{
  width:100%;
  border:1px solid var(--line);
  border-radius: 14px;
  padding: 12px 12px;
  font:inherit;
  background:#fff;
  outline:none;
}
.field textarea{ min-height: 90px; resize: vertical; }
.kv{ display:flex; justify-content:space-between; padding:8px 0; font-size:14px; }
.hr{ height:1px; background:var(--line); margin:10px 0; }
.small{ font-size:12px; color:var(--muted); }

.toast{
  position:fixed;
  left:50%;
  transform:translateX(-50%);
  bottom:88px;
  background:#111827;
  color:#fff;
  padding:10px 12px;
  border-radius: 14px;
  font-size: 13px;
  opacity:0;
  pointer-events:none;
  transition: opacity .2s ease;
  z-index: 200;
}
.toast.show{ opacity:1; }

/* ===== Kotakraya TikTok-style upgrades ===== */

/* Home card video */
.prodLink{
  display:block;
  position:relative;
  z-index:1; /* link layer */
}
.prodMedia{
  border-radius:18px;
  overflow:hidden;
  background:#000;
}
.prodVideo{
  width:100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  display:block;
  background:#000;
}

/* Title styling */
.prodTitleText{
  font-weight:800;
  line-height:1.2;
  min-height:38px;
}

/* Action area must be above link (desktop fix) */
.prodActions{
  position:relative;
  z-index:5;
}

/* Product hero wrapper */
.prodHero{ border-radius:18px; overflow:hidden; background:#f3f5f7; }

/* Sticky CTA like TikTok shop (atas bottom nav) */
.stickyCta{
  position: fixed;
  left: 0; right: 0;
  bottom: 68px;  /* ruang untuk bottomnav */
  z-index: 80;
  padding: 10px 14px;
}
.stickyCta .inner{
  max-width: 540px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 10px 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.ctaPrice{ font-size:18px; font-weight:900; }
.ctaSub{ font-size:12px; margin-top:2px; }
.ctaRight{ display:flex; align-items:center; gap:10px; }
