:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --border: #e4e4e7;
  --text: #18181b;
  --muted: #71717a;
  --subtle: #f4f4f5;
  --primary: #18181b;
  --primary-text: #ffffff;
  --primary-hover: #27272a;
  --success: #15803d;
  --success-bg: #f0fdf4;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --wa: #16a34a;
  --radius: 14px;
  --font-heading: inherit;
  --topbar-bg: rgba(250,250,250,.9);
  --banner: linear-gradient(135deg, #27272a, #52525b);
  --shadow: none;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { display: block; max-width: 100%; }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--subtle); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn-wa:hover { background: #15803d; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--primary); color: var(--primary-text); font-weight: 700;
}

/* ---------- Beranda ---------- */
.home { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
/* padding-block agar padding horizontal .container tetap berlaku */
.home-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 20px; }
.home-hero { flex: 1; display: flex; align-items: center; padding-block: 48px 64px; }
.home-hero-inner { width: 100%; max-width: 560px; }
.home-badge {
  display: inline-block; padding: 4px 12px; margin-bottom: 20px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 500;
}
.home h1 { font-size: clamp(30px, 6vw, 48px); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 16px; overflow-wrap: break-word; }
.home-lead { color: var(--muted); font-size: 17px; margin: 0 0 32px; }
.home-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.home-features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 12px;
  list-style: none; padding: 0; margin: 48px 0 0;
}
.home-features li { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.home-features strong { display: block; margin-bottom: 2px; }
.home-features span { color: var(--muted); font-size: 14px; }
@media (max-width: 599px) {
  .home-nav { padding-block: 14px; }
  .home-hero { align-items: flex-start; padding-block: 24px 40px; }
  .home-badge { margin-bottom: 16px; font-size: 12px; }
  .home h1 { margin-bottom: 12px; }
  .home-lead { font-size: 16px; margin-bottom: 24px; }
  .home-actions { flex-direction: column; gap: 10px; }
  .home-actions .btn { width: 100%; min-height: 48px; }
  .home-features { margin-top: 32px; gap: 10px; }
  .home-features li { padding: 14px; }
}
.footer { padding: 24px 0; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.footer a { color: var(--text); font-weight: 600; text-decoration: none; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer .footer-links a { color: var(--muted); font-weight: 500; }
.footer .footer-links a:hover { color: var(--text); }

/* Navigasi beranda & halaman profil */
.home-nav-links { display: flex; align-items: center; gap: 20px; }
.home-nav-links > a:not(.btn) { color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; }
.home-nav-links > a:not(.btn):hover, .home-nav-links > a[aria-current="page"] { color: var(--text); }

/* ---------- Halaman konten (Tentang, Kontak, Kebijakan Privasi) ---------- */
.page { flex: 1; padding-block: 40px 72px; }
.prose { max-width: 720px; }
.prose h1 { margin-bottom: 12px; }
.prose h2 { font-size: 20px; line-height: 1.3; letter-spacing: -0.01em; margin: 40px 0 10px; scroll-margin-top: 16px; }
.prose h3 { font-size: 16px; margin: 20px 0 4px; }
.prose p, .prose ul, .prose ol { margin: 0 0 14px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose a { font-weight: 600; text-underline-offset: 3px; }
.prose code { font-size: 13px; padding: 1px 6px; border-radius: 6px; background: var(--subtle); overflow-wrap: anywhere; }
.page-meta { color: var(--muted); font-size: 14px; }

.feature-list { list-style: none; padding: 0 !important; display: grid; gap: 10px; }
.feature-list li { margin: 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.feature-list strong { display: block; }
.feature-list span { color: var(--muted); font-size: 14px; }

.cta-card, .contact-card {
  display: flex; flex-direction: column; gap: 16px;
  margin: 32px 0; padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.cta-card strong { display: block; font-size: 17px; }
.cta-card span { color: var(--muted); font-size: 14px; }
.contact-card { gap: 6px; align-items: flex-start; margin-top: 8px; }
.contact-card p { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.contact-label { color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.prose .contact-value { font-size: 20px; font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }

.toc { margin: 24px 0 8px; padding: 16px 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.toc strong { display: block; margin-bottom: 6px; }
.toc ol { margin: 0; columns: 2; column-gap: 24px; }
.toc li { margin-bottom: 4px; break-inside: avoid; }
.toc a { font-weight: 500; text-decoration: none; }
.toc a:hover { text-decoration: underline; }

@media (max-width: 599px) {
  .home-nav-links { gap: 14px; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; }
  .page { padding-block: 20px 48px; }
  .prose h2 { font-size: 18px; margin-top: 32px; }
  .cta-card, .contact-card { padding: 18px; }
  .contact-card .btn { width: 100%; }
  .toc ol { columns: 1; }
}
@media (max-width: 359px) {
  .home-nav-links > a:not(.btn) { display: none; }
}

/* ---------- Etalase ---------- */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--topbar-bg); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.topbar-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.banner { height: 180px; background: var(--banner); overflow: hidden; }
.banner img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 720px) { .banner { height: 240px; } }

.profile { position: relative; margin-top: -44px; padding-bottom: 8px; }
.profile-logo {
  width: 88px; height: 88px; border-radius: 20px; border: 4px solid var(--bg);
  background: var(--primary); color: var(--primary-text);
  display: grid; place-items: center; font-size: 34px; font-weight: 700; overflow: hidden;
}
.profile-logo img { width: 100%; height: 100%; object-fit: cover; }
.profile h1 { font-size: clamp(24px, 4vw, 32px); line-height: 1.2; margin: 14px 0 6px; letter-spacing: -0.01em; }
.profile-desc { color: var(--muted); margin: 0 0 16px; max-width: 680px; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.profile-meta a { color: var(--text); font-weight: 500; }
.socials { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.chip {
  display: inline-flex; align-items: center; min-height: 34px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.chip:hover { background: var(--subtle); }
.chip.active { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }

.catalog { padding: 24px 0 48px; }
.catalog-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.catalog-head h2 { font-size: 20px; margin: 0; }
.search { display: flex; gap: 8px; width: 100%; max-width: 360px; }
.search input {
  flex: 1; min-width: 0; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit;
}
.search input:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 18px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.card-img { aspect-ratio: 4 / 3; background: var(--subtle); display: grid; place-items: center; color: var(--muted); font-size: 32px; font-weight: 700; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; }
.card-cat { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.card-title { font-size: 16px; font-weight: 700; margin: 0; line-height: 1.3; }
.card-desc { font-size: 13px; color: var(--muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-price { font-size: 18px; font-weight: 700; margin-top: 4px; }
.card-price small { font-size: 13px; font-weight: 500; color: var(--muted); }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-ok { background: var(--success-bg); color: var(--success); }
.badge-out { background: var(--danger-bg); color: var(--danger); }
.card .btn { margin-top: auto; }

.empty { padding: 48px 16px; text-align: center; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted); }
.empty strong { display: block; color: var(--text); margin-bottom: 4px; }

/* ---------- 404 ---------- */
.notfound { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 16px; }
.notfound h1 { font-size: 64px; margin: 0; letter-spacing: -0.03em; }
.notfound p { color: var(--muted); margin: 8px 0 24px; }

/* ---------- Keranjang etalase ---------- */
.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 479px) {
  .card-body { padding: 10px 10px 12px; gap: 4px; }
  .card-title { font-size: 14px; }
  .card-desc { display: none; }
  .card-price { font-size: 15px; }
  .card-foot { flex-direction: column; align-items: flex-start; gap: 2px; }
  .card-chat-label { display: none; }
}
.card-foot { flex-wrap: wrap; }
.card-actions { display: flex; gap: 8px; margin-top: auto; }
.card .card-actions .btn { margin-top: 0; }
.card-add { flex: 1; min-width: 0; padding: 0 10px; white-space: nowrap; }
.card-add:disabled { opacity: .5; cursor: not-allowed; }
/* Jumlah barang ini di keranjang (di samping ikon); dikurangi lewat panel keranjang */
.card-add-count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--surface); color: var(--text);
  font-size: 12px; font-weight: 700; line-height: 20px; text-align: center;
}
.card-add-count[hidden] { display: none; }
.card-chat { flex: 0 0 auto; padding: 0 12px; }
.card-actions > .btn-wa:only-child { flex: 1; }
.card-actions > .btn-wa:only-child .card-chat-label { display: inline; }

.stepper {
  flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between;
  min-height: 36px; border: 1px solid var(--primary); border-radius: 10px; overflow: hidden;
}
.stepper[hidden] { display: none; }
.stepper button {
  width: 36px; align-self: stretch; border: 0; background: var(--subtle);
  font: inherit; font-size: 18px; font-weight: 700; cursor: pointer; color: var(--text);
}
.stepper button:disabled { opacity: .35; cursor: not-allowed; }
.stepper span { font-weight: 700; font-size: 14px; }

/* Footer etalase melayang di bawah layar; disembunyikan saat bar checkout muncul */
body.has-floating-footer { padding-bottom: 72px; }
.footer-floating {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 19;
  background: var(--surface); box-shadow: 0 -8px 24px rgba(0,0,0,.06);
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); text-align: center;
}
body.has-cart .footer-floating { display: none; }
body.has-cart { padding-bottom: 84px; }
.cartbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--surface); border-top: 1px solid var(--border);
  box-shadow: 0 -8px 24px rgba(0,0,0,.06);
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
}
.cartbar[hidden] { display: none; }
.cartbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cartbar-summary {
  display: flex; align-items: center; gap: 12px; min-width: 0;
  border: 0; background: none; padding: 0; font: inherit; text-align: left; cursor: pointer; color: var(--text);
  line-height: 1.25;
}
.cartbar-summary small { color: var(--muted); font-size: 12px; }
.cartbar-count {
  flex: 0 0 auto; min-width: 36px; height: 36px; padding: 0 8px; border-radius: 999px;
  display: grid; place-items: center; background: var(--primary); color: var(--primary-text); font-weight: 700;
}

.sheet { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.4); }
.sheet-panel {
  position: relative; width: 100%; max-width: 520px; max-height: 85vh; overflow-y: auto;
  background: var(--surface); border-radius: 18px 18px 0 0;
  padding: 18px 16px calc(16px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 12px;
}
@media (min-width: 720px) { .sheet { align-items: center; } .sheet-panel { border-radius: 18px; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h2 { font-size: 18px; margin: 0; }
.sheet-close { width: 36px; height: 36px; border: 0; border-radius: 999px; background: var(--subtle); color: var(--text); cursor: pointer; font-size: 14px; }
.cart-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.cart-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-info strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-info small { color: var(--muted); }
.cart-item .stepper { flex: 0 0 auto; width: 112px; }
.cart-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 600; }
.cart-field input {
  width: 88px; min-height: 40px; padding: 0 12px; text-align: center;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit;
}
.cart-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; }
.cart-total strong { font-size: 18px; }
.btn-ghost { border-color: transparent; color: var(--muted); }

/* ---------- Tema etalase (fitur Pro) ----------
   body[data-theme] menimpa token warna di :root; basic-white memakai nilai default. */
.topbar-name, .profile h1, .catalog-head h2, .card-title, .sheet-head h2 { font-family: var(--font-heading); }

body[data-theme="dark-night"] {
  color-scheme: dark;
  --bg: #0b0b10;
  --surface: #15151c;
  --border: #272731;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --subtle: #1f1f28;
  --primary: #f4f4f5;
  --primary-text: #0b0b10;
  --primary-hover: #d4d4d8;
  --success: #4ade80;
  --success-bg: rgba(34,197,94,.14);
  --danger: #f87171;
  --danger-bg: rgba(239,68,68,.14);
  --topbar-bg: rgba(11,11,16,.85);
  --banner: linear-gradient(135deg, #1e1b4b, #0b0b10 70%);
}

body[data-theme="blue-moon"] {
  --bg: #f0f5ff;
  --surface: #ffffff;
  --border: #d6e2f7;
  --text: #0f1e3d;
  --muted: #5b6b8c;
  --subtle: #e6eefc;
  --primary: #1d4ed8;
  --primary-text: #ffffff;
  --primary-hover: #1e40af;
  --topbar-bg: rgba(240,245,255,.9);
  --banner: linear-gradient(135deg, #0f1e3d, #1d4ed8 60%, #60a5fa);
  --shadow: 0 1px 2px rgba(15,30,61,.06), 0 6px 20px rgba(29,78,216,.06);
}

body[data-theme="joyful"] {
  --bg: #fff8f1;
  --surface: #ffffff;
  --border: #fbdcc4;
  --text: #3b1d4a;
  --muted: #8a6b7e;
  --subtle: #fff0e2;
  --primary: #f43f5e;
  --primary-text: #ffffff;
  --primary-hover: #e11d48;
  --radius: 22px;
  --font-heading: 'Fredoka', 'Plus Jakarta Sans', system-ui, sans-serif;
  --topbar-bg: rgba(255,248,241,.9);
  --banner: linear-gradient(120deg, #f97316, #ec4899 50%, #8b5cf6);
  --shadow: 0 6px 18px rgba(244,63,94,.08);
}
body[data-theme="joyful"] .btn, body[data-theme="joyful"] .search input { border-radius: 999px; }
body[data-theme="joyful"] .profile-logo { border-radius: 50%; }
body[data-theme="joyful"] .card-cat { color: #8b5cf6; }
body[data-theme="joyful"] .card-price { color: var(--primary); }

body[data-theme="luxury"] {
  color-scheme: dark;
  --bg: #0f0d0a;
  --surface: #191612;
  --border: #3a3226;
  --text: #f5efe2;
  --muted: #b3a68c;
  --subtle: #241f18;
  --primary: #c9a45c;
  --primary-text: #191612;
  --primary-hover: #b8924a;
  --success: #a3c585;
  --success-bg: rgba(163,197,133,.12);
  --danger: #e09a8a;
  --danger-bg: rgba(224,154,138,.12);
  --radius: 4px;
  --font-heading: 'Lora', Georgia, serif;
  --topbar-bg: rgba(15,13,10,.88);
  --banner: linear-gradient(135deg, #191612, #3a2f1c 55%, #8a6d36);
}
body[data-theme="luxury"] .btn, body[data-theme="luxury"] .search input, body[data-theme="luxury"] .cart-field input { border-radius: 2px; }
body[data-theme="luxury"] .profile-logo { border-radius: 4px; border-color: var(--primary); }
body[data-theme="luxury"] .card-cat { color: var(--primary); letter-spacing: .12em; }
body[data-theme="luxury"] .card-price { color: var(--primary); }
body[data-theme="luxury"] .topbar-name { letter-spacing: .04em; }
