/* ===== Variabel ===== */
:root {
  --bg: #000;
  --surface: #121212;
  --line: #2a2a2a;
  --text: #f2f2f2;
  --muted: #a8a8a8;
  --accent: #c4c9d1;
  --font: 'Poppins', system-ui, sans-serif;
  --radius: 1.2rem;
  --header-h: 7rem;
}
/* ===== Reset ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 62.5%; scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body { font-family: var(--font); font-size: 1.6rem; line-height: 1.7; background: var(--bg); color: var(--text); overflow-x: hidden; }
body.lock { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
button { font-family: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ===== Header ===== */
.site-header { position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--header-h); padding: 0 5%; display: flex; align-items: center; justify-content: space-between; transition: background .3s, box-shadow .3s; }
.site-header.scrolled { background: rgba(0,0,0,.88); backdrop-filter: blur(8px); box-shadow: 0 1px 0 var(--line); }
.logo { font-size: 2.6rem; font-weight: 700; color: var(--accent); }
.menu-btn { background: none; border: 0; color: var(--text); font-size: 2.6rem; cursor: pointer; padding: 1rem; }
nav { position: absolute; top: var(--header-h); right: 0; width: min(70%, 28rem); background: var(--surface); border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); border-bottom-left-radius: var(--radius); display: none; padding: 1rem 0; }
nav.open { display: block; }
nav a { display: block; padding: 1.2rem 2.4rem; color: var(--muted); font-weight: 500; transition: color .2s; }
nav a:hover, nav a.active { color: var(--text); }
nav a.active { box-shadow: inset 3px 0 var(--accent); }
@media (min-width: 996px) {
  .menu-btn { display: none; }
  nav { position: static; display: flex; gap: 3rem; width: auto; background: none; border: 0; padding: 0; }
  nav a { padding: .4rem 0; font-size: 1.5rem; border-bottom: 2px solid transparent; }
  nav a.active { box-shadow: none; border-bottom-color: var(--accent); }
}

/* ===== Section umum ===== */
section { padding: 9rem 5% 6rem; max-width: 120rem; margin: 0 auto; }
.title { font-size: 3.2rem; margin-bottom: 4rem; }
.hl { color: var(--accent); }
.reveal { opacity: 0; transform: translateY(2.4rem); transition: opacity .7s, transform .7s; }
.reveal.visible { opacity: 1; transform: none; }

/* ===== Beranda ===== */
.home { position: relative; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.home > .home-text { position: relative; z-index: 1; }
/* Background foto Beranda (aktif dari JS: kelas .has-photo) */
.hero-bg { position: absolute; top: 0; left: 50%; width: 100vw; height: 100%; transform: translateX(-50%); background: center / cover no-repeat; opacity: 0; transition: opacity 1s; pointer-events: none; z-index: 0; }
.hero-bg::after { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,var(--hero-overlay, .6)); }
.home.has-photo .hero-bg { opacity: 1; }
.home.has-photo p { color: var(--text); }
.home.has-photo h1, .home.has-photo .typing, .home.has-photo p { text-shadow: 0 1px 14px rgba(0,0,0,.55); }
.home.has-photo .btn-ghost { background: rgba(0,0,0,.55); }
.home.has-photo .btn-ghost:hover { background: var(--accent); }
#particles { position: absolute; top: 0; left: 50%; width: 100vw; height: 100%; transform: translateX(-50%); pointer-events: none; z-index: 0; }
.home h1 { font-size: 3.6rem; line-height: 1.25; }
.typing { font-size: 2.4rem; font-weight: 600; min-height: 4rem; margin: 1rem 0; }
.cursor { display: inline-block; width: 3px; height: 1em; background: var(--accent); margin-left: 4px; vertical-align: -.1em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.home p { max-width: 55rem; color: var(--muted); margin: 0 auto 3rem; }
.btn { display: inline-block; padding: 1.1rem 2.8rem; margin: .5rem; background: var(--accent); color: #000; border: 2px solid var(--accent); border-radius: 4rem; font: 600 1.6rem var(--font); cursor: pointer; transition: transform .2s, background .2s, color .2s; }
.btn:hover { transform: translateY(-2px) scale(1.03); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent); color: #000; }
@media (min-width: 996px) { .home h1 { font-size: 5.4rem; } .typing { font-size: 3rem; } }

/* ===== Filter dan pencarian ===== */
.toolbar { display: grid; gap: 1.6rem; margin-bottom: 3rem; }
input[type="search"] { width: 100%; max-width: 44rem; padding: 1.2rem 1.4rem; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: .8rem; font: inherit; }
input[type="search"]:focus { border-color: var(--accent); }
.filters { display: flex; flex-wrap: wrap; gap: 1rem; }
.chip { padding: .6rem 1.8rem; background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 4rem; font-size: 1.4rem; font-weight: 500; cursor: pointer; transition: color .2s, border-color .2s, background .2s; }
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); color: #000; border-color: var(--accent); }
.empty { color: var(--muted); text-align: center; padding: 4rem 0; }

/* ===== Kartu produk ===== */
.grid { display: grid; gap: 2.4rem; grid-template-columns: repeat(auto-fill, minmax(26rem, 1fr)); }
.card { position: relative; display: flex; flex-direction: column; text-align: left; background: var(--surface); color: inherit; border: 1px solid var(--line); border-radius: var(--radius); padding: 3rem; cursor: pointer; transition: border-color .2s, transform .2s; }
.card:hover { border-color: var(--accent); transform: translateY(-4px); }
.card img { width: calc(100% + 6rem); margin: -3rem -3rem 2rem; max-width: none; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius) var(--radius) 0 0; background: var(--line); }
.card small { color: var(--accent); font-weight: 500; }
.card h3 { font-size: 2rem; margin: .2rem 0 .8rem; }
.card p { color: var(--muted); font-size: 1.5rem; flex: 1; }
.price { color: var(--text); font-size: 2rem; font-weight: 600; margin: 1rem 0; }
.card .price { margin-bottom: 0; }
.card.is-out img { filter: grayscale(1); opacity: .5; }
.badge { position: absolute; top: 1.2rem; left: 1.2rem; z-index: 1; padding: .2rem 1.2rem; background: var(--text); color: #000; border-radius: 4rem; font-size: 1.3rem; font-weight: 600; line-height: 1.7; pointer-events: none; }

/* ===== Tentang ===== */
.about p { color: var(--muted); max-width: 70ch; }
.about h3 { font-size: 2.2rem; margin: 3.2rem 0 1rem; }
.points { max-width: 70ch; margin-top: 1rem; color: var(--muted); }
.points li { position: relative; padding-left: 2.4rem; margin-bottom: 1.2rem; }
.points li::before { content: ''; position: absolute; left: 0; top: .85em; width: .8rem; height: .8rem; border-radius: 50%; background: var(--accent); transform: translateY(-50%); }
.points strong { color: var(--text); font-weight: 600; }
.stats { display: flex; flex-wrap: wrap; gap: 3rem; margin-top: 3rem; color: var(--muted); }
.stats strong { display: block; font-size: 3.2rem; color: var(--text); line-height: 1.2; }

/* ===== Daftar info (dipakai di modal produk) ===== */
.info li { margin-bottom: 1.5rem; display: flex; flex-wrap: wrap; gap: 1.2rem; }
.lbl { color: var(--accent); font-weight: 600; min-width: 11rem; }
.info a:hover { color: var(--accent); }

/* ===== Footer ===== */
footer { display: flex; justify-content: space-between; align-items: center; padding: 3rem 5%; border-top: 1px solid var(--line); color: var(--muted); font-size: 1.4rem; }
.top { width: 4.4rem; height: 4.4rem; display: grid; place-items: center; border: 2px solid var(--accent); border-radius: 50%; color: var(--accent); font-size: 2rem; transition: background .2s, color .2s; }
.top:hover { background: var(--accent); color: #000; }

/* ===== Modal detail ===== */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 1.6rem; background: rgba(0,0,0,.8); backdrop-filter: blur(4px); }
.modal-box { position: relative; width: min(100%, 96rem); max-height: 92vh; overflow-y: auto; display: grid; gap: 2.4rem; padding: 2.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); animation: pop .25s ease; }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
.modal-close { position: absolute; top: .8rem; right: 1.2rem; z-index: 2; background: rgba(0,0,0,.6); color: var(--text); border: 1px solid var(--line); width: 4rem; height: 4rem; border-radius: 50%; font-size: 2.4rem; line-height: 1; cursor: pointer; }
.g-main { position: relative; aspect-ratio: 4/3; background: var(--line); border-radius: 1rem; overflow: hidden; touch-action: pan-y; user-select: none; }
.g-main img { width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; }
.g-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 4rem; height: 4rem; border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: var(--text); font-size: 1.6rem; cursor: pointer; }
.g-nav:hover { background: var(--accent); color: #000; }
.g-nav.prev { left: 1rem; } .g-nav.next { right: 1rem; }
.g-thumbs { display: flex; gap: .8rem; margin-top: 1rem; overflow-x: auto; }
.g-thumbs button { flex: 0 0 7rem; padding: 0; border: 2px solid transparent; border-radius: .8rem; overflow: hidden; background: none; cursor: pointer; opacity: .6; }
.g-thumbs button[aria-current="true"] { border-color: var(--accent); opacity: 1; }
.g-thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.m-info h3 { font-size: 2.6rem; line-height: 1.3; }
.m-info p { color: var(--muted); }
.m-info .price { color: var(--text); }
.m-info .btn { margin: 2rem 0 0; }
.m-info .info { margin-top: 1.6rem; font-size: 1.5rem; }
.m-info .info li:last-child { margin-bottom: 0; }
.m-info .info a { text-decoration: underline; text-underline-offset: .3rem; }
.btn[aria-disabled="true"], .btn[aria-disabled="true"]:hover { opacity: .5; cursor: not-allowed; transform: none; }
@media (min-width: 768px) { .modal-box { grid-template-columns: 1.2fr 1fr; padding: 3rem; } }

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
