/* Nexinull — tema navy, mode terang & gelap */
:root {
  --navy: #14213D;
  --navy-2: #1E2F55;
  --orange: #EE4D2D;
  --orange-2: #D7401F;
  --bg: #F6F7FB;
  --surface: #FFFFFF;
  --text: #1A1A1A;
  --muted: #5F6676;
  --line: #E3E6EE;
  --chip: #EEF1F7;
  --shadow: 0 1px 2px rgba(20, 33, 61, .06), 0 6px 18px -10px rgba(20, 33, 61, .25);
  --radius: 14px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0B1220;
  --surface: #121A2E;
  --text: #E8EBF3;
  --muted: #9AA3B8;
  --line: #22304F;
  --chip: #1A2540;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 22px -12px rgba(0, 0, 0, .7);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1220;
    --surface: #121A2E;
    --text: #E8EBF3;
    --muted: #9AA3B8;
    --line: #22304F;
    --chip: #1A2540;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 22px -12px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input { font: inherit; color: inherit; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: var(--navy); color: #fff;
  padding-top: env(safe-area-inset-top, 0px);
  box-shadow: 0 2px 12px -6px rgba(0, 0, 0, .5);
}
.top-in { display: flex; align-items: center; gap: 10px; min-height: 58px; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; flex: 0 0 auto; }
.logo-mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  background: #fff; color: var(--navy); font-weight: 800; font-size: 20px; line-height: 1; position: relative;
}
.logo-mark::after { content: ""; position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--orange); border: 2px solid var(--navy); }
.logo-word { font-weight: 800; letter-spacing: -.02em; font-size: 19px; }
.search { flex: 1; min-width: 0; }
.search input {
  width: 100%; height: 40px; border-radius: 999px; border: 0; padding: 0 16px;
  background: rgba(255, 255, 255, .12); color: #fff; outline: none; font-size: 15px;
}
.search input::placeholder { color: rgba(255, 255, 255, .65); }
.search input:focus { background: rgba(255, 255, 255, .2); box-shadow: 0 0 0 2px rgba(255, 255, 255, .35); }
.btn-feed, .theme-btn {
  flex: 0 0 auto; height: 40px; padding: 0 14px; border-radius: 999px; border: 0;
  background: rgba(255, 255, 255, .12); color: #fff; text-decoration: none; font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; cursor: pointer;
}
.theme-btn { width: 40px; padding: 0; justify-content: center; font-size: 18px; }
.btn-feed:hover, .theme-btn:hover { background: rgba(255, 255, 255, .2); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 7px 14px; border-radius: 999px; text-decoration: none; font-size: 14px; font-weight: 600;
  background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .9); white-space: nowrap;
}
.chip.on { background: #fff; color: var(--navy); }

/* ---------- Konten ---------- */
.main { padding-top: 20px; padding-bottom: 40px; min-height: 60vh; }
.hero { padding: 12px 0 22px; max-width: 720px; }
.hero h1 { font-size: clamp(28px, 6vw, 44px); line-height: 1.1; letter-spacing: -.03em; margin: 0 0 10px; font-weight: 800; }
.hero h1 span { color: var(--orange); }
.hero p { color: var(--muted); margin: 0 0 16px; font-size: 16px; }
.hero-cta { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; background: var(--navy); color: #fff; text-decoration: none; font-weight: 700; }
:root[data-theme="dark"] .hero-cta { background: #fff; color: var(--navy); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-cta { background: #fff; color: var(--navy); } }
.page-title { font-size: 24px; letter-spacing: -.02em; margin: 4px 0 18px; }
.empty { color: var(--muted); padding: 30px 0; }

/* ---------- Grid produk ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .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 (min-width: 1140px) { .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.card {
  background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column; border: 1px solid var(--line);
}
.card-link { text-decoration: none; display: block; }
.card-img { aspect-ratio: 1 / 1; background: var(--chip); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.card:hover .card-img img { transform: scale(1.04); }
.card-title {
  font-size: 14px; font-weight: 600; line-height: 1.35; margin: 10px 12px 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em;
}
.card-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; padding: 0 12px; margin-bottom: 10px; }
.price { font-weight: 800; color: var(--orange); font-size: 16px; }
.sold { font-size: 12px; color: var(--muted); }
.ph { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(135deg, var(--navy), var(--navy-2)); }
.ph span { font-size: 48px; font-weight: 800; color: rgba(255, 255, 255, .85); text-transform: uppercase; }
.ph-lg { aspect-ratio: 1 / 1; border-radius: var(--radius); }

/* ---------- Tombol beli ---------- */
.buy {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 18px; border-radius: 12px; background: var(--orange); color: #fff;
  text-decoration: none; font-weight: 800; font-size: 15px; border: 0; cursor: pointer;
  box-shadow: 0 6px 16px -8px rgba(238, 77, 45, .8);
}
.buy:hover { background: var(--orange-2); }
.buy-sm { margin: auto 12px 12px; min-height: 38px; font-size: 13px; border-radius: 10px; }
.buy-lg { width: 100%; min-height: 54px; font-size: 17px; }

/* ---------- Halaman produk ---------- */
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.pd { display: grid; gap: 22px; }
@media (min-width: 860px) { .pd { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; gap: 36px; } }
.gallery-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--radius);
  background: var(--chip); scrollbar-width: none;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track img { flex: 0 0 100%; aspect-ratio: 1 / 1; object-fit: cover; scroll-snap-align: start; }
.gallery-hint { font-size: 12px; color: var(--muted); margin: 8px 2px 0; }
.pd-cat { display: inline-block; font-size: 13px; font-weight: 700; color: var(--muted); text-decoration: none; margin-bottom: 6px; }
.pd-title { font-size: clamp(22px, 4.5vw, 30px); line-height: 1.2; letter-spacing: -.02em; margin: 0 0 10px; }
.pd-price { font-size: 30px; font-weight: 800; color: var(--orange); letter-spacing: -.02em; }
.pd-meta { color: var(--muted); font-size: 14px; margin: 4px 0 18px; }
.pd-note { font-size: 12px; color: var(--muted); margin: 8px 0 18px; text-align: center; }
.pd-hl { margin: 0 0 16px; padding: 14px 16px 14px 34px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.pd-hl li { margin: 4px 0; }
.pd-desc { margin: 0 0 16px; color: var(--text); }
.pd-orig { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.pd-orig summary { cursor: pointer; font-weight: 600; }
.share {
  min-height: 42px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 700; cursor: pointer; width: 100%;
}
.related { margin-top: 40px; }
.related h2 { font-size: 20px; margin: 0 0 14px; }
.sticky-buy {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px -14px rgba(0, 0, 0, .4);
  transform: translateY(110%); transition: transform .25s ease;
}
.sticky-buy.show { transform: none; }
.sticky-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.sticky-title { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sticky-info strong { color: var(--orange); font-size: 17px; }
@media (min-width: 860px) { .sticky-buy { display: none; } }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 26px 0 calc(40px + env(safe-area-inset-bottom, 0px)); color: var(--muted); font-size: 13px; }
.foot p { margin: 0 0 8px; max-width: 760px; }
.foot-brand { color: var(--text); font-size: 14px; }
.foot a { color: var(--text); }

/* ---------- Mode scroll (feed) ---------- */
.page-feed { background: #000; color: #fff; overflow: hidden; }
html:has(.page-feed), .page-feed { height: 100%; }
.feed-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px;
  background: linear-gradient(rgba(0, 0, 0, .55), transparent);
}
.feed-back { color: #fff; text-decoration: none; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.feed-cats { display: flex; gap: 6px; }
.feed-cats a {
  min-width: 40px; height: 36px; padding: 0 12px; border-radius: 999px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .14); color: #fff; text-decoration: none; font-size: 14px; font-weight: 700;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.feed-cats a.on { background: #fff; color: var(--navy); }
.feed { height: 100vh; height: 100dvh; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; }
.slide {
  position: relative; height: 100vh; height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always;
  overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; background: #0B1220;
}
.slide-bg { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(30px) brightness(.45); transform: scale(1.1); }
.slide-media {
  position: absolute; inset: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding-top: calc(64px + env(safe-area-inset-top, 0px)); padding-bottom: 210px;
}
.slide-media::-webkit-scrollbar { display: none; }
.slide-media img, .slide-media .ph { flex: 0 0 100%; width: 100%; height: 100%; object-fit: contain; scroll-snap-align: center; }
.slide-media .ph { border-radius: 0; aspect-ratio: auto; background: transparent; }
.slide-count { position: absolute; right: 14px; top: calc(64px + env(safe-area-inset-top, 0px)); font-size: 12px; background: rgba(0, 0, 0, .45); padding: 4px 10px; border-radius: 999px; }
.slide-body {
  position: relative; z-index: 2; padding: 60px 18px calc(22px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(transparent, rgba(0, 0, 0, .85) 45%);
}
.slide-cat { display: inline-block; font-size: 12px; font-weight: 700; background: rgba(255, 255, 255, .16); padding: 4px 10px; border-radius: 999px; margin-bottom: 8px; }
.slide-title { font-size: 21px; line-height: 1.25; margin: 0 0 6px; letter-spacing: -.01em; text-shadow: 0 1px 8px rgba(0, 0, 0, .5); }
.slide-price { font-size: 24px; font-weight: 800; color: #FF8A6B; margin: 0 0 14px; }
.slide-price small { font-size: 13px; color: rgba(255, 255, 255, .75); font-weight: 600; margin-left: 6px; }
.slide-actions { display: flex; gap: 8px; }
.slide-actions .buy { flex: 1; min-height: 52px; font-size: 16px; }
.ghost {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 16px; border-radius: 12px;
  background: rgba(255, 255, 255, .14); color: #fff; text-decoration: none; font-weight: 700; border: 0; cursor: pointer;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.ghost.icon { width: 52px; padding: 0; font-size: 20px; }
.slide-end { justify-content: center; text-align: center; }
.slide-end .slide-body { background: none; }
.slide-end .buy { margin-top: 10px; }
@media (min-width: 760px) {
  .feed { max-width: 480px; margin: 0 auto; }
  .feed-top { max-width: 480px; margin: 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
