/* ============================================================
   GarasiX.com — Marketplace Kendaraan
   Design system bergaya OLX dengan identitas GarasiX (hitam–merah)
   ============================================================ */

:root {
  --red: #e4121f;
  --red-dark: #b80d18;
  --red-soft: #fdeaeb;
  --ink: #0d0f12;
  --ink-2: #1c2026;
  --gray-900: #23272e;
  --gray-700: #41474f;
  --gray-500: #6b7280;
  --gray-400: #9aa1ab;
  --gray-300: #d4d8de;
  --gray-200: #e6e9ed;
  --gray-100: #f1f3f5;
  --gray-50: #f7f8fa;
  --white: #ffffff;
  --green: #25a55f;
  --wa: #25d366;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(13, 15, 18, .06), 0 1px 3px rgba(13, 15, 18, .08);
  --shadow-md: 0 4px 14px rgba(13, 15, 18, .10);
  --shadow-lg: 0 12px 34px rgba(13, 15, 18, .16);
  --maxw: 1240px;
  --header-h: 64px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--gray-50);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 18px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 11px 20px;
  font-weight: 700;
  font-size: 14px;
  transition: transform .08s ease, background .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-dark); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-2); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--gray-300); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { filter: brightness(.95); }
.btn-lg { padding: 14px 26px; font-size: 15px; }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 2px 14px rgba(13,15,18,.08);
}
.header-row {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand { display: flex; align-items: center; flex-shrink: 0; line-height: 0; }
.brand img { height: 30px; width: auto; }
.brand .brand-fallback {
  font-weight: 900; font-size: 22px; letter-spacing: -.5px; color: var(--ink);
}
.brand .brand-fallback span { color: var(--red); }

.search-bar {
  flex: 1;
  display: flex;
  background: var(--gray-50);
  border: 1.5px solid var(--gray-300);
  border-radius: 999px;
  overflow: hidden;
  max-width: 620px;
}
.search-bar:focus-within { border-color: var(--ink); background: #fff; }
.search-bar .loc {
  display: flex; align-items: center; gap: 6px;
  padding: 0 14px; color: var(--gray-700); font-size: 13.5px; font-weight: 600;
  border-right: 1px solid var(--gray-300); background: transparent; white-space: nowrap;
}
.search-bar .loc select,
.search-bar .loc input {
  border: none; background: transparent; font: inherit; font-weight: 600;
  color: var(--gray-700); outline: none; cursor: pointer; width: 156px; min-width: 0;
  text-overflow: ellipsis;
}
.search-bar .loc input::placeholder { color: var(--gray-500); font-weight: 600; }

/* ---------- Dropdown lokasi custom (tinggi tetap, scroll di dalam) ---------- */
.locpick { position: relative; display: block; }
.locpick-input { padding-right: 26px; }
.locpick-caret {
  position: absolute; right: 11px; top: 50%; width: 7px; height: 7px; pointer-events: none;
  border-right: 2px solid var(--gray-500); border-bottom: 2px solid var(--gray-500);
  transform: translateY(-70%) rotate(45deg); transition: transform .18s ease;
}
.locpick.open .locpick-caret { transform: translateY(-30%) rotate(-135deg); }
.locpick-panel {
  position: fixed; z-index: 500;
  width: 260px; max-width: 92vw; background: #fff;
  border: 1px solid var(--gray-200); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 8px;
}
.locpick-panel[hidden] { display: none; }
.locpick-search {
  width: 100%; padding: 9px 11px; border: 1.5px solid var(--gray-300); border-radius: 8px;
  font: inherit; font-size: 14px; outline: none; margin-bottom: 6px; box-sizing: border-box;
}
.locpick-search:focus { border-color: var(--red); }
.locpick-list { max-height: 240px; overflow-y: auto; }
.locpick-opt { padding: 9px 11px; border-radius: 7px; cursor: pointer; font-size: 14px; color: var(--gray-800); }
.locpick-opt:hover, .locpick-opt.active { background: var(--gray-100); color: var(--ink); }
.locpick-empty { padding: 12px; color: var(--gray-500); font-size: 13px; text-align: center; }
[data-theme="dark"] .locpick-panel { background: #1b1e24; border-color: var(--gray-200); }
[data-theme="dark"] .locpick-search { background: #12141a; color: var(--ink); }
[data-theme="dark"] .locpick-opt:hover, [data-theme="dark"] .locpick-opt.active { background: #2b313a; }
.search-bar input {
  flex: 1; border: none; outline: none; padding: 0 14px; font-size: 14.5px; color: var(--ink);
  min-width: 60px;
}
.search-bar .search-btn {
  background: var(--red); border: none; color: #fff; padding: 0 20px; display: flex; align-items: center;
}
.search-bar .search-btn:hover { background: var(--red-dark); }

.header-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; flex-shrink: 0; }
.header-link {
  display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--gray-700);
}
.header-link:hover { color: var(--red); }
.header-link svg { opacity: .9; }
.btn-jual {
  border: 2px solid var(--red);
  background: var(--red);
  color: #fff;
  border-radius: 999px;
  padding: 9px 20px;
  font-weight: 800;
  display: inline-flex; align-items: center; gap: 7px;
  box-shadow: 0 4px 14px rgba(228,18,31,.35);
}
.btn-jual:hover { background: var(--red-dark); border-color: var(--red-dark); }

/* ---------- Category nav ---------- */
.cat-nav { background: #fff; border-top: 1px solid var(--gray-200); }
.cat-nav-row { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.cat-nav-row::-webkit-scrollbar { display: none; }
.cat-nav a {
  display: flex; align-items: center; gap: 7px;
  padding: 12px 14px; font-size: 13.5px; font-weight: 600; color: var(--gray-700); white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.cat-nav a:hover { color: var(--ink); }
.cat-nav a.active { color: var(--red); border-bottom-color: var(--red); }
.cat-nav a .ic { font-size: 16px; }

/* mobile menu toggle */
.menu-toggle { display: none; background: none; border: none; color: var(--ink); padding: 6px; flex-shrink: 0; }
.menu-toggle svg { width: 24px; height: 24px; flex-shrink: 0; }

/* ---------- Hero ---------- */
.hero {
  background:
    linear-gradient(120deg, rgba(13,15,18,.94) 0%, rgba(28,32,38,.84) 50%, rgba(42,20,22,.88) 100%),
    url("https://images.unsplash.com/photo-1503376780353-7e6692767b70?w=1600&q=80&auto=format&fit=crop") center/cover no-repeat;
  color: #fff;
  padding: 46px 0 54px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -120px; top: -60px; width: 460px; height: 460px;
  background: radial-gradient(circle, rgba(228,18,31,.28), transparent 62%);
}
.hero-inner { position: relative; z-index: 1; max-width: 760px; }
.hero h1 { font-size: 40px; line-height: 1.1; margin: 0 0 12px; font-weight: 900; letter-spacing: -1px; }
.hero h1 .accent { color: var(--red); }
.hero p { font-size: 17px; color: #c7ccd4; margin: 0 0 26px; max-width: 560px; }
.hero-stats { display: flex; gap: 34px; margin-top: 30px; flex-wrap: wrap; }
.hero-stats .stat .num { font-size: 26px; font-weight: 900; }
.hero-stats .stat .lbl { font-size: 13px; color: #9aa1ab; }

.hero-search {
  background: #fff; border-radius: 16px; padding: 10px; display: flex; gap: 8px;
  box-shadow: var(--shadow-lg); max-width: 640px;
}
.hero-search input {
  flex: 1; border: none; outline: none; font-size: 16px; padding: 0 14px; color: var(--ink);
}
.hero-search .btn { flex-shrink: 0; }

/* glow biru tambahan agar latar tak datar */
.hero::before {
  content: ""; position: absolute; left: -110px; bottom: -130px; width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(59, 130, 246, .16), transparent 62%); z-index: 0;
}
/* chip pencarian populer */
.hero-chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; position: relative; z-index: 1; }
.hero-chips a {
  background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .18);
  color: #e7e9ee; font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 30px;
  transition: background .15s, border-color .15s, transform .15s;
}
.hero-chips a:hover { background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .45); transform: translateY(-1px); }
/* lencana kepercayaan */
.hero-trust { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 22px; position: relative; z-index: 1; }
.hero-trust span { font-size: 13.5px; color: #c7ccd4; display: flex; align-items: center; gap: 7px; }
.hero-trust b { color: #fff; }
/* kartu statistik (glass) */
.hero-stats .stat {
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 14px; padding: 14px 20px; min-width: 118px;
}
.hero-stats .stat .ic { font-size: 19px; margin-bottom: 3px; }
.hero-stats { gap: 14px; }

/* Testimoni */
.testi { background: #fff; border: 1px solid var(--gray-200); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); }
.testi .stars { color: #f5a623; font-size: 14px; letter-spacing: 1px; margin-bottom: 8px; }
.testi .quote { font-size: 15px; line-height: 1.75; color: var(--gray-700, #444); margin: 0 0 16px; }
.testi .who { display: flex; align-items: center; gap: 11px; }
.testi .who .av { width: 40px; height: 40px; border-radius: 50%; background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; flex: 0 0 40px; }
.testi .who .n { font-weight: 700; font-size: 14px; }
.testi .who .c { font-size: 12.5px; color: var(--gray-500); }

/* ---------- Section ---------- */
.section { padding: 36px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.section-head h2 { font-size: 22px; font-weight: 800; margin: 0; letter-spacing: -.4px; }
.section-head .link-all { color: var(--red); font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 4px; }
.section-head .link-all:hover { text-decoration: underline; }

/* ---------- Category tiles ---------- */
.cat-grid {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 12px;
}
.cat-tile {
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius);
  padding: 18px 10px; text-align: center; transition: .15s; display: flex; flex-direction: column; align-items: center; gap: 9px;
}
.cat-tile:hover { border-color: var(--red); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.cat-tile .emoji {
  width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center;
  background: var(--red-soft); font-size: 24px;
}
.cat-tile .name { font-size: 13px; font-weight: 700; color: var(--gray-900); }

/* ---------- Listing grid ---------- */
.grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.card {
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius);
  overflow: hidden; transition: .15s; position: relative; display: flex; flex-direction: column;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--gray-300); }
.card-media { position: relative; aspect-ratio: 4 / 3; background: var(--gray-100); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.card:hover .card-media img { transform: scale(1.04); }
.badge {
  position: absolute; top: 10px; left: 10px; background: var(--ink); color: #fff;
  font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 6px; letter-spacing: .3px;
}
.badge.featured { background: var(--red); }
.badge.classic { background: #b8860b; }
.badge.sold { background: #16a34a; }
.badge.donatur { background: linear-gradient(135deg, #db2777, #f59e0b); box-shadow: 0 2px 10px rgba(219, 39, 119, .45); }
.card.sold .card-media img { filter: grayscale(1); opacity: .72; }
.tip-opt { flex: 1; min-width: 92px; padding: 13px; border: 1.5px solid var(--gray-300); border-radius: 12px; background: #fff; font-weight: 800; font-size: 15px; cursor: pointer; }
.tip-opt.sel { border-color: var(--red); background: var(--red-soft); color: var(--red); }
/* Indikator notifikasi admin */
.notif-dot { position: absolute; width: 11px; height: 11px; border-radius: 50%; border: 2px solid #fff; }
.notif-dot.green { background: #16a34a; top: -3px; right: -3px; }
.notif-dot.red { background: #e4121f; bottom: -3px; right: -3px; }
.notif-badge { display: inline-block; min-width: 18px; text-align: center; font-size: 11px; font-weight: 800; color: #fff; border-radius: 20px; padding: 1px 6px; margin-left: 4px; }
.notif-badge.green { background: #16a34a; }
.notif-badge.red { background: #e4121f; }
/* Lencana PREMIUM — mahkota emas metalik mewah + kilau bergerak */
.badge.premium {
  background: linear-gradient(135deg, #8a6d1d 0%, #d4af37 22%, #fff4c2 48%, #d4af37 74%, #8a6d1d 100%);
  background-size: 180% 180%;
  color: #4a3500; font-weight: 900; letter-spacing: .6px; text-transform: uppercase;
  padding: 5px 12px; border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, .6);
  box-shadow: 0 3px 14px rgba(184, 134, 11, .5), inset 0 1px 0 rgba(255, 255, 255, .7);
  overflow: hidden;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
  animation: premiumHue 6s ease infinite;
}
@keyframes premiumHue {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
.badge.premium::after {
  content: ""; position: absolute; top: 0; left: -70%; width: 45%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, .9), transparent);
  transform: skewX(-20deg);
  animation: premiumShine 3s ease-in-out infinite;
}
@keyframes premiumShine {
  0%   { left: -70%; }
  55%, 100% { left: 140%; }
}
/* Lencana TOP — petir biru berkilau (efek mewah seperti premium) */
.badge.top {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 35%, #60a5fa 60%, #2563eb 100%);
  background-size: 180% 180%;
  color: #fff; font-weight: 900; letter-spacing: .5px; text-transform: uppercase;
  padding: 5px 12px; border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, .45);
  box-shadow: 0 3px 14px rgba(37, 99, 235, .5), inset 0 1px 0 rgba(255, 255, 255, .4);
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  animation: premiumHue 6s ease infinite;
}
.badge.top::after {
  content: ""; position: absolute; top: 0; left: -70%; width: 45%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, .9), transparent);
  transform: skewX(-20deg);
  animation: premiumShine 3s ease-in-out infinite;
}
/* Kartu di-highlight (bingkai emas + warna hangat + cahaya) */
.card.hl {
  border: 2px solid #f5a623;
  box-shadow: 0 0 0 3px rgba(245, 166, 35, .15), 0 12px 30px rgba(245, 166, 35, .28);
}
.card.hl .card-body { background: linear-gradient(180deg, #fff8e7, #fff); }
.fav-btn {
  position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.92); border: none; display: grid; place-items: center; color: var(--gray-700);
  box-shadow: var(--shadow-sm);
}
.fav-btn:hover { color: var(--red); }
.fav-btn.active { color: var(--red); }
.card-body { padding: 12px 13px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-price { font-size: 18px; font-weight: 900; color: var(--ink); letter-spacing: -.4px; }
.card-title {
  font-size: 14px; color: var(--gray-900); font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 38px;
}
.card-specs { display: flex; gap: 10px; font-size: 12px; color: var(--gray-500); flex-wrap: wrap; }
.card-specs span { display: inline-flex; align-items: center; gap: 4px; }
.card-foot {
  display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 8px;
  font-size: 12px; color: var(--gray-400); border-top: 1px solid var(--gray-100);
}
.card-foot .loc { display: inline-flex; align-items: center; gap: 4px; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Promo band ---------- */
.promo {
  background: linear-gradient(110deg, var(--red) 0%, var(--red-dark) 100%);
  color: #fff; border-radius: 16px; padding: 30px 34px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  overflow: hidden; position: relative;
}
.promo::after { content:"🚗"; position:absolute; right: 26px; bottom: -16px; font-size: 120px; opacity: .14; }
.promo h3 { margin: 0 0 6px; font-size: 24px; font-weight: 900; }
.promo p { margin: 0; opacity: .92; }
.promo .btn { background: #fff; color: var(--red); }
.promo .btn:hover { background: #f1f1f1; }

/* ---------- Listing page layout ---------- */
.page-head { background: #fff; border-bottom: 1px solid var(--gray-200); padding: 18px 0; }
.breadcrumb { font-size: 13px; color: var(--gray-500); display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--red); }
.page-head h1 { margin: 8px 0 0; font-size: 24px; font-weight: 800; }
.page-head .count { color: var(--gray-500); font-weight: 500; font-size: 15px; }

.listing-layout { display: grid; grid-template-columns: 270px 1fr; gap: 22px; align-items: start; padding: 24px 0 50px; }

.filters {
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 4px 18px 18px;
  position: sticky; top: calc(var(--header-h) + 14px);
}
.filter-group { padding: 16px 0; border-bottom: 1px solid var(--gray-100); }
.filter-group:last-child { border-bottom: none; }
.filter-group h4 { margin: 0 0 12px; font-size: 14px; font-weight: 800; }
.filter-group label.opt { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: 14px; color: var(--gray-700); cursor: pointer; }
.filter-group label.opt input { accent-color: var(--red); width: 16px; height: 16px; }
.field { width: 100%; padding: 10px 12px; border: 1px solid var(--gray-300); border-radius: var(--radius-sm); font: inherit; font-size: 14px; outline: none; background: #fff; }
.field:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.price-range { display: flex; gap: 8px; align-items: center; }
.price-range .field { padding: 9px 10px; }

.results-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.results-bar .sort { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--gray-600); }
.results-bar .sort select { padding: 8px 12px; border: 1px solid var(--gray-300); border-radius: var(--radius-sm); font: inherit; font-weight: 600; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: var(--gray-100); border: 1px solid var(--gray-200); border-radius: 999px; padding: 6px 13px; font-size: 13px; font-weight: 600; color: var(--gray-700); display: inline-flex; gap: 6px; align-items: center; }
.chip.active, .chip:hover { background: var(--ink); color: #fff; border-color: var(--ink); }

.grid-3 { grid-template-columns: repeat(3, 1fr); }

.empty { text-align: center; padding: 70px 20px; color: var(--gray-500); }
.empty .big { font-size: 48px; margin-bottom: 10px; }

/* ---------- Detail page ---------- */
.detail-layout { display: grid; grid-template-columns: 1fr 360px; gap: 26px; align-items: start; padding: 24px 0 50px; }
.gallery { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; }
.gallery-main { aspect-ratio: 16 / 10; background: var(--gray-100); position: relative; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-main .badge { font-size: 12px; }
.gallery-thumbs { display: flex; gap: 8px; padding: 10px; overflow-x: auto; }
.gallery-thumbs img { width: 84px; height: 64px; object-fit: cover; border-radius: 7px; cursor: pointer; border: 2px solid transparent; flex-shrink: 0; }
.gallery-thumbs img.active { border-color: var(--red); }

.detail-block { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 22px; margin-top: 18px; }
.detail-block h3 { margin: 0 0 16px; font-size: 18px; font-weight: 800; }
.detail-map { height: 260px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--gray-200); position: relative; z-index: 0; }
.map-note { font-size: 12.5px; color: var(--gray-500); margin-top: 10px; line-height: 1.6; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.map-note .cicon { flex-shrink: 0; }
.spec-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 24px; }
.spec-item { display: flex; align-items: center; gap: 12px; }
.spec-item .ic { width: 40px; height: 40px; border-radius: 10px; background: var(--gray-100); display: grid; place-items: center; font-size: 18px; flex-shrink: 0; }
.spec-item .k { font-size: 12px; color: var(--gray-500); }
.spec-item .v { font-size: 14px; font-weight: 700; }
.desc-text { color: var(--gray-700); line-height: 1.7; white-space: pre-line; }

.detail-aside { position: sticky; top: calc(var(--header-h) + 14px); display: flex; flex-direction: column; gap: 18px; }
.price-card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 20px; }
.price-card .big-price { font-size: 30px; font-weight: 900; letter-spacing: -1px; }
.price-card .title { font-size: 16px; color: var(--gray-900); font-weight: 600; margin: 4px 0 12px; }
.price-card .meta { font-size: 13px; color: var(--gray-500); display: flex; align-items: center; gap: 6px; margin-bottom: 16px; }
.price-card .actions { display: flex; flex-direction: column; gap: 10px; }
.price-card .actions .row2 { display: flex; gap: 10px; }
.price-card .actions .row2 .btn { flex: 1; }

.seller-card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 20px; }
.seller-head { display: flex; align-items: center; gap: 12px; }
.seller-avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 20px; }
.seller-head .name { font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.seller-head .since { font-size: 12.5px; color: var(--gray-500); }
.verified { color: var(--green); }
.seller-stats { display: flex; gap: 18px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--gray-100); }
.seller-stats .s .n { font-weight: 800; font-size: 16px; }
.seller-stats .s .l { font-size: 12px; color: var(--gray-500); }
.safety-note { background: #fff7e6; border: 1px solid #ffe2a8; border-radius: var(--radius); padding: 14px 16px; font-size: 13px; color: #8a6d1a; display: flex; gap: 10px; }

/* ---------- Form / Pasang Iklan ---------- */
.form-wrap { max-width: 760px; margin: 0 auto; padding: 28px 0 60px; }
.form-card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 26px; margin-bottom: 20px; }
.form-card h3 { margin: 0 0 4px; font-size: 18px; font-weight: 800; }
.form-card .hint { color: var(--gray-500); font-size: 13.5px; margin: 0 0 18px; }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 7px; }
.form-row label .req { color: var(--red); }
.form-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
textarea.field { resize: vertical; min-height: 120px; }
.upload-zone {
  border: 2px dashed var(--gray-300); border-radius: var(--radius); padding: 28px 20px; text-align: center; color: var(--gray-500);
  cursor: pointer; transition: .15s; background: var(--gray-50);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.upload-zone:hover { border-color: var(--red); background: var(--red-soft); color: var(--red-dark); }
.upload-zone .big { font-size: 32px; margin-bottom: 4px; }
.upload-zone small { font-size: 12.5px; opacity: .85; }
.photo-previews { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 14px; }
.photo-previews .pv { aspect-ratio: 1; border-radius: 10px; overflow: hidden; position: relative; border: 1px solid var(--gray-200); background: var(--gray-100); }
.photo-previews .pv img { width: 100%; height: 100%; object-fit: cover; }
.photo-previews .pv button { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,.62); color: #fff; border: none; font-size: 13px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.photo-previews .pv button:hover { background: var(--red); }
.photo-previews .pv .cover { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 9.5px; font-weight: 800; letter-spacing: .5px; text-align: center; padding: 3px; }
.steps { display: flex; gap: 8px; margin-bottom: 22px; }
.steps .step { flex: 1; text-align: center; font-size: 12.5px; font-weight: 700; color: var(--gray-400); position: relative; padding-top: 30px; }
.steps .step::before { content: attr(data-n); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 24px; height: 24px; border-radius: 50%; background: var(--gray-200); color: var(--gray-500); display: grid; place-items: center; font-size: 12px; }
.steps .step.done::before, .steps .step.active::before { background: var(--red); color: #fff; }
.steps .step.active, .steps .step.done { color: var(--ink); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 13px 22px; border-radius: 999px; font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: .25s; z-index: 300; display: flex; align-items: center; gap: 9px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast .ic { color: var(--green); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #c7ccd4; padding: 46px 0 26px; margin-top: 30px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 30px; }
.footer-grid h5 { color: #fff; font-size: 14px; font-weight: 800; margin: 0 0 14px; }
.footer-grid a { display: block; padding: 5px 0; font-size: 13.5px; color: #aab0ba; }
.footer-grid a:hover { color: #fff; }
.footer-brand .logo { font-weight: 900; font-size: 24px; color: #fff; letter-spacing: -.5px; margin-bottom: 12px; }
.footer-brand .logo span { color: var(--red); }
.footer-logo { display: inline-block; margin-bottom: 16px; line-height: 0; }
.footer-logo img { height: 34px; width: auto; }
.footer-brand p { font-size: 13.5px; line-height: 1.7; max-width: 320px; }
.footer-social { display: flex; gap: 10px; margin-top: 16px; }
.footer-social a { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.08); display: grid; place-items: center; color: #fff; }
.footer-social a:hover { background: var(--red); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 32px; padding-top: 22px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 12.5px; color: #8a909b; }
.footer-badges { display: flex; gap: 14px; align-items: center; }

/* ---------- Article ---------- */
.article-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.article-card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; transition: .15s; }
.article-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.article-card .thumb { aspect-ratio: 16/9; background: var(--gray-100); }
.article-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.article-card .body { padding: 16px; }
.article-card .tag { font-size: 11px; font-weight: 800; color: var(--red); text-transform: uppercase; letter-spacing: .5px; }
.article-card h3 { font-size: 16px; margin: 8px 0; line-height: 1.4; }
.article-card .meta { font-size: 12.5px; color: var(--gray-500); }

/* ---------- Mobile drawer ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: .2s; z-index: 200; }
.drawer-backdrop.show { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; left: 0; bottom: 0; width: 280px; background: #fff; transform: translateX(-100%); transition: .25s; z-index: 201; padding: 20px; overflow-y: auto; }
.drawer.show { transform: translateX(0); }
.drawer .d-brand { font-weight: 900; font-size: 22px; margin-bottom: 18px; }
.drawer .d-brand span { color: var(--red); }
.drawer-search { display: flex; gap: 6px; margin: 0 0 16px; }
.drawer-search input { flex: 1; border: 1.5px solid var(--gray-300); border-radius: 10px; padding: 10px 12px; font-size: 14px; outline: none; }
.drawer-search input:focus { border-color: var(--ink); }
.drawer-search button { background: var(--red); color: #fff; border: none; border-radius: 10px; padding: 0 14px; display: flex; align-items: center; cursor: pointer; }
.drawer a { display: flex; align-items: center; gap: 10px; padding: 13px 6px; font-weight: 600; border-bottom: 1px solid var(--gray-100); color: var(--ink); }

/* ---------- Masa tayang / countdown ---------- */
.countdown {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700;
  color: var(--green);
}
.countdown.warn { color: #d98300; }
.countdown.dead { color: var(--red); }
.badge.expired { background: #6b7280; }
.card.expired .card-media img { filter: grayscale(1); opacity: .65; }
.card.expired .card-price { color: var(--gray-500); }
.expired-ribbon {
  position: absolute; inset: 0; display: grid; place-items: center; background: rgba(28,32,38,.5);
}
.expired-ribbon span { background: var(--ink); color: #fff; font-size: 12px; font-weight: 800; padding: 7px 14px; border-radius: 8px; }

/* banner masa tayang di halaman detail */
.expire-banner {
  border-radius: var(--radius); padding: 14px 18px; font-size: 13.5px; display: flex; align-items: center; gap: 10px; margin-bottom: 18px;
}
.expire-banner.ok { background: #eafaf1; border: 1px solid #b8e6cd; color: #1c7a4a; }
.expire-banner.warn { background: #fff7e6; border: 1px solid #ffe2a8; color: #8a6d1a; }
.expire-banner.dead { background: var(--red-soft); border: 1px solid #f6c2c5; color: var(--red-dark); }

.renew-box { background: var(--red-soft); border: 1px dashed #f0b6ba; border-radius: var(--radius); padding: 16px; text-align: center; }
.renew-box p { margin: 0 0 12px; font-size: 13.5px; color: var(--red-dark); }

/* info masa tayang di form */
.notice {
  background: #eef4ff; border: 1px solid #cfe0ff; color: #1d4ed8; border-radius: var(--radius);
  padding: 13px 16px; font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; margin-bottom: 20px;
}

/* ---------- Modal Perpanjang ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(13,15,18,.6); display: grid; place-items: center; padding: 18px;
  opacity: 0; pointer-events: none; transition: .2s; z-index: 250;
}
.modal-backdrop.show { opacity: 1; pointer-events: auto; }
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); transform: translateY(14px); transition: .2s;
}
.modal-backdrop.show .modal { transform: translateY(0); }
.modal-head { padding: 20px 22px; border-bottom: 1px solid var(--gray-200); display: flex; justify-content: space-between; align-items: flex-start; }
.modal-head h3 { margin: 0 0 3px; font-size: 18px; font-weight: 800; }
.modal-head p { margin: 0; font-size: 13px; color: var(--gray-500); }
.modal-head .x { background: none; border: none; font-size: 22px; color: var(--gray-400); line-height: 1; }
.modal-body { padding: 20px 22px; }
.plan {
  border: 2px solid var(--gray-200); border-radius: var(--radius); padding: 15px 16px; margin-bottom: 12px; cursor: pointer;
  display: flex; align-items: center; gap: 14px; transition: .12s; position: relative;
}
.plan:hover { border-color: var(--gray-400); }
.plan.sel { border-color: var(--red); background: var(--red-soft); }
.plan .radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--gray-300); flex-shrink: 0; display: grid; place-items: center; }
.plan.sel .radio { border-color: var(--red); }
.plan.sel .radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.plan .info { flex: 1; }
.plan .info .t { font-weight: 800; font-size: 15px; }
.plan .info .d { font-size: 12.5px; color: var(--gray-500); }
.plan .price { font-weight: 900; font-size: 16px; }
.plan .tag-hemat { position: absolute; top: -9px; right: 12px; background: var(--green); color: #fff; font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 6px; }
.pay-methods { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 18px; }
.pay-methods .pm { border: 1px solid var(--gray-200); border-radius: 8px; padding: 8px 12px; font-size: 12.5px; font-weight: 700; color: var(--gray-700); }

/* ---------- Login / Auth ---------- */
.btn-login {
  display: inline-flex; align-items: center; gap: 7px; background: transparent;
  border: 1.5px solid var(--gray-300); color: var(--ink); border-radius: 999px;
  padding: 8px 18px; font-weight: 700; font-size: 14px;
}
.btn-login:hover { border-color: var(--ink); }

.user-menu { position: relative; }
.user-chip {
  display: inline-flex; align-items: center; gap: 8px; background: var(--gray-100);
  border: 1px solid var(--gray-200); border-radius: 999px; padding: 5px 12px 5px 5px; font-weight: 700; font-size: 14px; color: var(--ink);
}
.user-chip:hover { background: var(--gray-200); }
.u-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; flex-shrink: 0; }
.u-avatar.lg { width: 44px; height: 44px; font-size: 18px; }
.u-name { display: inline-flex; align-items: center; gap: 5px; }
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 10px); width: 250px; background: #fff;
  border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 8px; display: none; z-index: 120;
}
.user-dropdown.show { display: block; }
.user-dropdown .u-head { display: flex; gap: 11px; align-items: center; padding: 10px; border-bottom: 1px solid var(--gray-100); margin-bottom: 6px; }
.user-dropdown .u-head .n { font-weight: 800; font-size: 14px; display: flex; align-items: center; gap: 5px; }
.user-dropdown .u-head .c { font-size: 12px; color: var(--gray-500); word-break: break-all; }
.user-dropdown a, .user-dropdown button {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; background: none; border: none;
  padding: 11px 10px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--ink);
}
.user-dropdown a:hover, .user-dropdown button:hover { background: var(--gray-100); }
.user-dropdown .logout { color: var(--red); border-top: 1px solid var(--gray-100); margin-top: 4px; }
.badge-verified {
  display: inline-flex; align-items: center; gap: 4px; background: #eafaf1; color: var(--green);
  font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; border: 1px solid #b8e6cd;
}

/* auth modal */
.auth-tabs { display: flex; gap: 8px; background: var(--gray-100); padding: 5px; border-radius: 999px; margin-bottom: 18px; }
.auth-tab { flex: 1; border: none; background: transparent; padding: 10px; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--gray-600); display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.auth-tab.sel { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.auth-field-label { display: block; font-size: 13.5px; font-weight: 700; margin: 0 0 7px; }
.auth-demo { background: #fff7e6; border: 1px dashed #ffd98a; color: #8a6d1a; border-radius: 8px; padding: 10px 12px; font-size: 12.5px; margin: 14px 0; text-align: center; }
.auth-demo b { font-size: 16px; letter-spacing: 3px; color: var(--ink); }
.otp-row { display: flex; gap: 8px; justify-content: space-between; margin: 16px 0; }
.otp-box { width: 100%; aspect-ratio: 1; max-width: 52px; text-align: center; font-size: 22px; font-weight: 800; border: 1.5px solid var(--gray-300); border-radius: 10px; outline: none; }
.otp-box:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.auth-meta { font-size: 13px; color: var(--gray-600); text-align: center; }
.auth-link { background: none; border: none; color: var(--red); font-weight: 700; font-size: 13px; cursor: pointer; }
.auth-back { background: none; border: none; color: var(--gray-500); font-weight: 600; font-size: 13px; cursor: pointer; padding: 0; margin-bottom: 4px; }

/* ---------- Akun / Iklan Saya ---------- */
.akun-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.akun-stats .stat-card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 18px; }
.akun-stats .stat-card .n { font-size: 26px; font-weight: 900; }
.akun-stats .stat-card .n.red { color: var(--red); }
.akun-stats .stat-card .l { font-size: 13px; color: var(--gray-500); }
.myad {
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 14px; display: flex; gap: 14px; align-items: center; margin-bottom: 12px;
}
.myad img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.myad .m-info { flex: 1; min-width: 0; }
.myad .m-info .t { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.myad .m-info .p { font-weight: 900; color: var(--ink); }
.myad .m-actions { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.myad .m-actions .btn { padding: 8px 14px; font-size: 13px; }
@media (max-width: 640px) {
  .akun-stats { grid-template-columns: repeat(2, 1fr); }
  .myad { flex-wrap: wrap; }
  .myad .m-actions { flex-direction: row; width: 100%; }
  .myad .m-actions .btn { flex: 1; }
}

/* ---------- Halaman konten (Tentang, Aturan) ---------- */
.content-hero { background: linear-gradient(120deg, #0d0f12 0%, #1c2026 58%, #2a1416 100%); color: #fff; padding: 44px 0; position: relative; overflow: hidden; }
.content-hero::after { content: ""; position: absolute; right: -100px; top: -60px; width: 380px; height: 380px; background: radial-gradient(circle, rgba(228,18,31,.26), transparent 62%); }
.content-hero .inner { position: relative; z-index: 1; }
.content-hero .eyebrow { color: var(--red); font-weight: 800; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; }
.content-hero h1 { font-size: 34px; font-weight: 900; margin: 6px 0 10px; letter-spacing: -.5px; }
.content-hero p { color: #c7ccd4; margin: 0; max-width: 640px; font-size: 16px; }

.content-layout { display: grid; grid-template-columns: 240px 1fr; gap: 26px; align-items: start; padding: 28px 0 56px; }
.toc { position: sticky; top: calc(var(--header-h) + 14px); background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 8px; }
.toc .toc-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--gray-400); padding: 8px 12px 4px; }
.toc a { display: block; padding: 9px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--gray-700); }
.toc a:hover { background: var(--gray-100); color: var(--ink); }

.prose { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 30px 32px; }
.prose section { scroll-margin-top: calc(var(--header-h) + 60px); }
.prose h2 { font-size: 21px; font-weight: 800; margin: 30px 0 12px; }
.prose section:first-child h2 { margin-top: 0; }
.prose h3 { font-size: 16px; font-weight: 800; margin: 18px 0 8px; }
.prose p { color: var(--gray-700); line-height: 1.78; margin: 0 0 12px; }
.prose ul, .prose ol { color: var(--gray-700); line-height: 1.8; padding-left: 20px; margin: 0 0 14px; }
.prose li { margin-bottom: 5px; }
.prose strong { color: var(--ink); }
.prose .lead { font-size: 16.5px; color: var(--gray-900); line-height: 1.7; }
.prose hr { border: none; border-top: 1px solid var(--gray-200); margin: 26px 0; }
.callout { border-left: 4px solid var(--red); background: var(--red-soft); padding: 14px 18px; border-radius: 8px; margin: 16px 0; color: var(--red-dark); font-size: 14px; }
.callout.info { border-color: #1d4ed8; background: #eef4ff; color: #1d4ed8; }
.callout.ok { border-color: var(--green); background: #eafaf1; color: #1c7a4a; }
.value-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 16px 0; }
.value-card { border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 18px; }
.value-card .ic { font-size: 26px; }
.value-card h4 { margin: 10px 0 5px; font-size: 15px; }
.value-card p { font-size: 13.5px; margin: 0; color: var(--gray-600); }
.about-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 6px 0 0; }
.about-stats .s { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius); padding: 16px; }
.about-stats .s .n { font-size: 24px; font-weight: 900; color: #fff; }
.about-stats .s .l { font-size: 12.5px; color: #9aa1ab; }

@media (max-width: 900px) {
  .content-layout { grid-template-columns: 1fr; }
  .toc { position: static; }
  .value-grid { grid-template-columns: 1fr; }
  .about-stats { grid-template-columns: repeat(2, 1fr); margin-top: 22px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
  .grid, .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .listing-layout { grid-template-columns: 1fr; }
  .filters { position: static; display: none; }
  .filters.show { display: block; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-aside { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .article-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .header-link, .btn-jual .lbl-full { display: none; }
  .menu-toggle { display: block; }
  /* header HP = 1 baris bersih: hamburger · logo · (dorong) · tema · akun · tombol + */
  .search-bar { display: none; }            /* cari pindah ke menu hamburger */
  .header-row { gap: 10px; }                /* rapatkan agar muat di layar HP */
  .brand { margin-right: auto; }            /* dorong aksi ke kanan, isi ruang */
  .header-actions { gap: 8px; }
  .btn-jual { padding: 8px 12px; box-shadow: none; }
  .theme-toggle { padding: 4px; }
  /* tanda panah geser pada menu kategori */
  .cat-nav { position: relative; }
  /* gradasi memudar di tepi kanan (petunjuk bisa digeser) */
  .cat-nav::before {
    content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 54px; z-index: 2; pointer-events: none;
    background: linear-gradient(90deg, rgba(255,255,255,0), #fff 65%);
  }
  /* panah chevron (dari border, pasti tampil) */
  .cat-nav::after {
    content: ""; position: absolute; right: 18px; top: 50%; z-index: 3; pointer-events: none;
    width: 9px; height: 9px;
    border-top: 2.5px solid var(--gray-500); border-right: 2.5px solid var(--gray-500);
    transform: translateY(-55%) rotate(45deg);
  }
  .hero h1 { font-size: 30px; }
  .hero p { font-size: 15px; }
  .grid, .grid-3 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .form-grid2 { grid-template-columns: 1fr; }
  .promo { flex-direction: column; text-align: center; }
  .card-price { font-size: 16px; }
  .hero-stats { gap: 22px; }
  /* footer bawah lebih lega di HP (tidak berdesakan) */
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 14px; }
  .footer-badges { flex-wrap: wrap; row-gap: 10px; column-gap: 16px; }
}
@media (max-width: 460px) {
  .grid, .grid-3 { grid-template-columns: 1fr 1fr; }
  .article-grid { grid-template-columns: 1fr; }   /* artikel 1 kolom di HP (tak ada kartu yatim) */
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .photo-previews { grid-template-columns: repeat(3, 1fr); }
  /* Kartu sempit: footer disusun vertikal biar rapi & tak berdempetan */
  .card-foot { flex-direction: column; align-items: flex-start; gap: 4px; }
  .card-foot .loc { max-width: 100%; }
  .card-body { padding: 11px 11px 12px; }
}

/* Statistik live (beranda) */
.live-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; text-align: center; }
.live-stats .ls { background: #fff; border: 1px solid var(--gray-200); border-radius: 14px; padding: 20px 14px; }
.live-stats .ls .n { font-size: 30px; font-weight: 900; color: var(--ink); line-height: 1.1; }
.live-stats .ls .l { font-size: 13px; color: var(--gray-500); margin-top: 4px; }
@media (max-width: 540px) { .live-stats .ls .n { font-size: 23px; } .live-stats .ls .l { font-size: 11.5px; } }

/* Grid testimoni */
.testi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 760px) { .testi-grid { grid-template-columns: 1fr; } }

/* Penyempurnaan layar kecil (HP) */
@media (max-width: 540px) {
  .hero h1 { font-size: 27px; }
  .hero-search { flex-direction: column; align-items: stretch; }
  .hero-search .btn { width: 100%; justify-content: center; }
  .hero-stats { gap: 10px; }
  .hero-stats .stat { flex: 1 1 calc(50% - 5px); min-width: 0; padding: 12px 14px; }
  .page-head h1 { font-size: 24px; }
}

/* ======================= DARK MODE ======================= */
.theme-toggle { background: none; border: none; font-size: 18px; cursor: pointer; padding: 6px; line-height: 1; border-radius: 8px; }
.theme-toggle:hover { background: var(--gray-100); }

[data-theme="dark"] {
  --ink: #e8eaed; --ink-2: #c6cbd3;
  --gray-900: #e8eaed; --gray-800: #d5d9df; --gray-700: #c0c5cd; --gray-600: #aeb4bd; --gray-500: #99a0aa; --gray-400: #7c828d;
  --gray-300: #3b414a; --gray-200: #2b313a; --gray-100: #20242b; --gray-50: #15181d;
  --white: #1b1e24; --red-soft: #3a1417;
  color-scheme: dark;
}
[data-theme="dark"] body { background: #15181d; }
[data-theme="dark"] .site-header,
[data-theme="dark"] .cat-nav,
[data-theme="dark"] .page-head,
[data-theme="dark"] .card,
[data-theme="dark"] .form-card,
[data-theme="dark"] .testi,
[data-theme="dark"] .gallery,
[data-theme="dark"] .detail-block,
[data-theme="dark"] .price-card,
[data-theme="dark"] .seller-card,
[data-theme="dark"] .article-card,
[data-theme="dark"] .drawer,
[data-theme="dark"] .akun-stats .stat-card,
[data-theme="dark"] .myad,
[data-theme="dark"] .toc,
[data-theme="dark"] .prose,
[data-theme="dark"] .value-card,
[data-theme="dark"] .live-stats .ls,
[data-theme="dark"] .pcard,
[data-theme="dark"] .infobox,
[data-theme="dark"] .user-dropdown,
[data-theme="dark"] .modal,
[data-theme="dark"] .hero-search,
[data-theme="dark"] .field,
[data-theme="dark"] .search-bar,
[data-theme="dark"] .filters,
[data-theme="dark"] .tip-opt,
[data-theme="dark"] .auth-tab.sel,
[data-theme="dark"] .kontak-cara a,
[data-theme="dark"] .kontak-cara .row {
  background: #1b1e24; border-color: var(--gray-200); color: var(--ink);
}
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select,
[data-theme="dark"] .search-bar input { background: #1b1e24; color: var(--ink); }
[data-theme="dark"] .search-bar input::placeholder,
[data-theme="dark"] .field::placeholder { color: var(--gray-400); }
[data-theme="dark"] .prow .ic,
[data-theme="dark"] .kontak-cara .ic,
[data-theme="dark"] .auth-tabs { background: var(--gray-100); }
[data-theme="dark"] .cat-nav::before { background: linear-gradient(90deg, rgba(27,30,36,0), #1b1e24 65%); }
[data-theme="dark"] .cat-nav::after { border-color: var(--gray-600); }
[data-theme="dark"] .callout.ok { background: #12301e; color: #7fe0a6; }
[data-theme="dark"] .callout.info { background: #10284a; color: #9cc4ff; }
[data-theme="dark"] .prow.best { background: #2a2410; }
[data-theme="dark"] .article-body .callout,
[data-theme="dark"] .legal .callout { background: #20242b; color: var(--gray-700); }
/* Footer tetap gelap & kontras di dark mode (jangan ikut --ink terang) */
[data-theme="dark"] .site-footer { background: #0f1115; color: #c7ccd4; }
/* Pita TERJUAL/DIBERIKAN tetap gelap tegas di dark mode (jangan ikut --ink terang) */
[data-theme="dark"] .expired-ribbon span { background: #0b0d10; color: #fff; }
/* Avatar profil tetap kontras di dark mode (jangan ikut --ink terang) */
[data-theme="dark"] .u-avatar { background: var(--red); color: #fff; }
[data-theme="dark"] .btn-login { color: var(--ink); border-color: var(--gray-300); }
/* Elemen ber-latar var(--ink) agar tetap kontras di dark mode */
[data-theme="dark"] .btn-dark { background: #2b313a; color: #fff; border: 1px solid #3a4048; }
[data-theme="dark"] .btn-dark:hover { background: #3a4048; }
[data-theme="dark"] .seller-avatar { background: var(--red); color: #fff; }
[data-theme="dark"] .chip.active, [data-theme="dark"] .chip:hover { background: #3a4048; color: #fff; border-color: #3a4048; }
[data-theme="dark"] .toast { background: #2b313a; color: #fff; }
/* Kartu kategori & tile ikut gelap di dark mode */
[data-theme="dark"] .cat-tile { background: #1b1e24; border-color: var(--gray-200); }
[data-theme="dark"] .cat-tile .emoji { background: #2b313a; }
/* Callout & banner peringatan kontras di dark mode */
[data-theme="dark"] .callout { background: #2a1416; color: #f0b9bc; }
[data-theme="dark"] .expire-banner.ok { background: #12301e; border-color: #1c5a38; color: #7fe0a6; }
[data-theme="dark"] .expire-banner.warn { background: #2a2410; border-color: #4a3d1a; color: #e6c877; }
[data-theme="dark"] .expire-banner.dead { background: #3a1417; border-color: #5c2327; color: #ff9ea3; }
[data-theme="dark"] .safety-note { background: #2a2410; border-color: #4a3d1a; color: #e6c877; }
[data-theme="dark"] .search-bar:focus-within { background: #1b1e24; }

/* Ikon garis kategori (ikut ukuran & warna teks) */
.cicon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.14em; flex-shrink: 0; }
.cat-tile .emoji .cicon { width: 26px; height: 26px; }

/* Varian callout kuning (peringatan) — tema-aware */
.callout.warn { border-left-color: #f0a020; background: #fff7e6; color: #8a6d1a; }
[data-theme="dark"] .callout.warn { background: #2a2410; color: #e6c877; border-left-color: #b8860b; }

/* Badan kartu highlight jadi gelap di dark mode (teks jelas) */
[data-theme="dark"] .card.hl .card-body { background: linear-gradient(180deg, #2a2410, #1b1e24); }

/* ============================================================
   PENYEMPURNAAN MOBILE (UX di HP)
   ============================================================ */

/* Gambar/media tidak melebihi lebar layar */
img, svg, video, iframe { max-width: 100%; }

/* Pengaman: kunci gerakan horizontal (halaman tak bisa "digoyang" ke samping).
   Pakai clip (BUKAN hidden) agar header sticky tetap berfungsi. */
html, body {
  overflow-x: clip;
  overscroll-behavior-x: none;    /* matikan pantulan/geser horizontal (rubber-band) */
}

/* Scroll horizontal (kategori, galeri) jadi mulus di HP */
.cat-nav-row, .gallery-thumbs, .chip-row { -webkit-overflow-scrolling: touch; }

@media (max-width: 720px) {
  /* Cegah ZOOM otomatis di iPhone/Safari saat mengetik (font input wajib >= 16px) */
  .field,
  input, select, textarea,
  .drawer-search input,
  .search-bar input, .search-bar select { font-size: 16px; }

  /* Tap target lebih besar & nyaman disentuh (min ~44px) */
  .btn { padding: 12px 20px; min-height: 46px; }
  .btn-lg { min-height: 52px; }
  .myad .m-actions .btn { min-height: 42px; }
  .cat-nav a { padding-top: 12px; padding-bottom: 12px; }
  .drawer a { padding-top: 13px; padding-bottom: 13px; }
  .toc a { padding-top: 12px; padding-bottom: 12px; }
  a, button { -webkit-tap-highlight-color: rgba(0,0,0,.06); }

  /* Judul & harga kartu tetap terbaca */
  .card-title { font-size: 14px; line-height: 1.35; }
}

/* HP mungil (lebar <= 380px) */
@media (max-width: 380px) {
  .akun-stats { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 23px; }
  .btn { padding: 11px 16px; }
  .page-head h1 { font-size: 22px; }
}
