/* Katalog Adun Mancing — tema biru putih, mobile-first */

@font-face { font-family: "PJS"; src: url("fonts/pjs-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "PJS"; src: url("fonts/pjs-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "PJS"; src: url("fonts/pjs-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "PJS"; src: url("fonts/pjs-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  color-scheme: light;
  --biru-900: #0a2a5e;
  --biru-800: #0a3d91;
  --biru-700: #0b4fb3;
  --biru-600: #1565c0;
  --biru-500: #1f7ae0;
  --biru-200: #c7dcf7;
  --biru-100: #e4effc;
  --biru-50: #f2f7fe;
  --latar: #f3f7fc;
  --putih: #ffffff;
  --teks: #13233f;
  --teks-2: #55657e;
  --garis: #dbe5f1;
  --radius: 14px;
  --bayang: 0 1px 2px rgba(10, 42, 94, .06), 0 4px 14px rgba(10, 42, 94, .06);
  --font: "PJS", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 140px; }
html.kunci { overflow: hidden; }
body {
  margin: 0;
  background: var(--latar);
  color: var(--teks);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--biru-600); }
svg { width: 1em; height: 1em; flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--biru-500); outline-offset: 2px; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: #fff; padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ───────── Kepala ───────── */

.brandrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px 6px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: linear-gradient(135deg, var(--biru-800), var(--biru-500));
  color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; }
.brand img { width: 40px; height: auto; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .25)); }
.brand span { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand b { font-size: 17px; font-weight: 800; letter-spacing: .2px; white-space: nowrap; }
.brand small { font-size: 12.5px; font-weight: 600; opacity: .85; }

.chat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .35);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.chat svg { width: 18px; height: 18px; }
.chat:hover { background: rgba(255, 255, 255, .26); }

.bar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: linear-gradient(135deg, var(--biru-800), var(--biru-500));
  color: #fff;
  padding: 6px 16px 0;
  box-shadow: 0 2px 10px rgba(10, 42, 94, .18);
}
.bar-inner { display: flex; align-items: center; gap: 14px; max-width: 1240px; margin: 0 auto; }
.brand-desktop, .chat-desktop { display: none; }

.search { position: relative; flex: 1; min-width: 0; color: var(--teks); }
.search-box {
  display: flex;
  align-items: center;
  height: 46px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .4), 0 2px 8px rgba(10, 42, 94, .18);
}
.search-ico { width: 20px; height: 20px; margin: 0 4px 0 12px; color: var(--teks-2); }
.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  padding: 0 6px;
  font-size: 16px; /* 16px: iPhone tidak zoom otomatis */
  outline: none;
}
.search input::placeholder { color: #8a97ab; }
.search input::-webkit-search-cancel-button { display: none; }
.search .clear, .search .go {
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  height: 100%;
  padding: 0 10px;
  color: var(--teks-2);
}
.search .clear svg { width: 18px; height: 18px; }
.search .go {
  margin: 4px;
  height: 38px;
  border-radius: 9px;
  background: var(--biru-700);
  color: #fff;
  padding: 0 14px;
}
.search .go svg { width: 19px; height: 19px; }
.search .go:hover { background: var(--biru-600); }

/* Dropdown saran */
.saran {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--garis);
  box-shadow: 0 16px 40px rgba(10, 42, 94, .22);
  max-height: min(70vh, 560px);
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 40;
}
.saran li {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 10px;
  cursor: pointer;
}
.saran li[aria-selected="true"], .saran li:hover { background: var(--biru-50); }
.saran li[aria-selected="true"] { box-shadow: inset 0 0 0 1.5px var(--biru-200); }
.saran img { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: var(--biru-100); }
.saran .s-nama { font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.saran .s-nama mark { background: none; color: var(--biru-700); font-weight: 800; }
.saran .s-harga { font-size: 13px; font-weight: 800; color: var(--biru-700); margin-top: 1px; }
.saran .s-semua {
  display: flex;
  justify-content: center;
  grid-template-columns: none;
  margin-top: 4px;
  padding: 10px;
  border-top: 1px solid var(--garis);
  border-radius: 0 0 10px 10px;
  color: var(--biru-700);
  font-weight: 700;
  font-size: 14px;
}
.saran .s-kosong { display: block; padding: 12px; color: var(--teks-2); font-size: 14px; cursor: default; }
.saran .s-kosong:hover { background: none; }

/* Label BAM / Non BAM */
.lbl {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .3px;
  line-height: 1.6;
  white-space: nowrap;
}
.lbl.bam { background: var(--biru-700); color: #fff; }
.lbl.non { background: #fff; color: var(--biru-700); box-shadow: inset 0 0 0 1.5px var(--biru-200); }

/* Tab */
.tabs {
  display: flex;
  gap: 6px;
  max-width: 1240px;
  margin: 8px auto 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 8px 12px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, .82);
  font-weight: 700;
  font-size: 14.5px;
  white-space: nowrap;
}
.tabs button span {
  font-size: 11.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
}
.tabs button[aria-selected="true"] { color: #fff; border-bottom-color: #fff; }
.tabs button[aria-selected="true"] span { background: #fff; color: var(--biru-700); }

/* ───────── Daftar produk ───────── */

.main { max-width: 1240px; margin: 0 auto; padding: 12px 16px 28px; min-height: 60vh; }

/* Catatan ongkos kirim */
.ongkir {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 2px 0 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff6db;
  border: 1.5px solid #f2c94c;
  color: #5c4300;
  box-shadow: var(--bayang);
}
.ongkir svg { width: 28px; height: 28px; color: #b7791f; margin-top: 1px; }
.ongkir b { display: block; font-size: 16px; font-weight: 800; color: #3d2c00; line-height: 1.3; }
.ongkir span { display: block; font-size: 13.5px; line-height: 1.4; margin-top: 2px; }
.d-info .ongkir { margin: 10px 0 0; box-shadow: none; }
.ongkir a { color: #7a5200; font-weight: 700; white-space: nowrap; }

/* Halaman teks (Ketentuan & Privasi) */
.halaman-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: linear-gradient(135deg, var(--biru-800), var(--biru-500)); color: #fff; }
.halaman-top .kembali { display: inline-flex; align-items: center; gap: 6px; color: #fff; font-weight: 700; text-decoration: none; padding: 8px 12px; border-radius: 999px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .35); font-size: 14px; }
.halaman-top .kembali svg { width: 18px; height: 18px; }
.teks { max-width: 760px; margin: 0 auto; padding: 20px 16px 36px; }
.teks article { background: #fff; border: 1px solid var(--garis); border-radius: var(--radius); padding: 20px 18px 24px; box-shadow: var(--bayang); }
.teks h1 { font-size: 24px; line-height: 1.25; margin: 0 0 4px; color: var(--biru-900); }
.teks .tgl { color: var(--teks-2); font-size: 13.5px; margin: 0 0 8px; }
.teks h2 { font-size: 17px; margin: 24px 0 8px; padding-top: 16px; border-top: 1px solid var(--garis); color: var(--biru-900); }
.teks p, .teks li { font-size: 15px; line-height: 1.6; }
.teks ul, .teks ol { padding-left: 22px; margin: 6px 0 10px; }
.teks li { margin: 4px 0; }
.info { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-height: 28px; margin: 2px 0 12px; color: var(--teks-2); font-size: 14px; }
.info b { color: var(--teks); }
.info .reset {
  border: 0;
  background: var(--biru-100);
  color: var(--biru-700);
  font-weight: 700;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 999px;
}

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--garis);
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  box-shadow: var(--bayang);
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(10, 42, 94, .14); }
.card:active { transform: scale(.985); }
.foto {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--biru-100);
  overflow: hidden;
}
.foto img { width: 100%; height: 100%; object-fit: cover; }
.card .lbl { align-self: flex-start; font-size: 10.5px; padding: 1px 7px; }
.card-isi { display: flex; flex-direction: column; gap: 5px; padding: 9px 11px 12px; flex: 1; border-top: 1px solid var(--garis); }
.card h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}
.harga { margin-top: auto; font-weight: 800; color: var(--biru-700); font-size: 15.5px; letter-spacing: .1px; }

.more { height: 1px; }
.empty {
  text-align: center;
  background: #fff;
  border: 1px dashed var(--biru-200);
  border-radius: var(--radius);
  padding: 32px 18px;
}
.empty img { width: 64px; margin: 0 auto 10px; opacity: .9; }
.empty h2 { font-size: 18px; margin: 0 0 6px; }
.empty p { margin: 0 auto 14px; color: var(--teks-2); max-width: 420px; }
.empty .saran-kata { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 16px; }
.chip {
  border: 1px solid var(--biru-200);
  background: var(--biru-50);
  color: var(--biru-700);
  font-weight: 700;
  font-size: 13.5px;
  padding: 7px 12px;
  border-radius: 999px;
  text-decoration: none;
}
.chip:hover { background: var(--biru-100); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 18px;
  border: 0;
  border-radius: 12px;
  font-weight: 800;
  font-size: 15.5px;
  text-decoration: none;
}
.btn svg { width: 22px; height: 22px; }
.btn-pesan { background: var(--biru-700); color: #fff; box-shadow: 0 4px 14px rgba(11, 79, 179, .3); }
.btn-pesan:hover { background: var(--biru-800); }

/* ───────── Kaki ───────── */

.foot {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 16px calc(28px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--garis);
  color: var(--teks-2);
  font-size: 13.5px;
}
.foot img { width: 40px; flex: none; }
.foot b { color: var(--teks); font-size: 14.5px; }
.foot p { margin: 4px 0 0; }
.foot a { font-weight: 600; }
.foot .copy { font-size: 12.5px; opacity: .8; }

/* ───────── Detail produk ───────── */

.detail {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #fff;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  animation: naik .22s ease-out;
}
.detail[data-langsung], .detail[data-langsung] .d-panel { animation: none; }
@keyframes naik { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pudar { from { opacity: 0; } to { opacity: 1; } }

.d-top {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  padding-top: max(8px, env(safe-area-inset-top));
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--garis);
}
.d-back, .d-share, .d-close {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: var(--biru-50);
  color: var(--biru-700);
  font-weight: 700;
  font-size: 14.5px;
}
.d-back svg, .d-share svg, .d-close svg { width: 20px; height: 20px; }
.d-back:hover, .d-share:hover, .d-close:hover { background: var(--biru-100); }
.d-close { display: none; }

.d-wrap { display: block; }
.d-foto { position: relative; background: var(--biru-100); aspect-ratio: 1 / 1; max-height: 70vh; margin: 0 auto; }
.d-foto img { width: 100%; height: 100%; object-fit: contain; }
.d-foto .ph-teks {
  position: absolute;
  inset: auto 0 10px;
  text-align: center;
  font-size: 12px;
  color: var(--teks-2);
}
.d-info { padding: 16px 16px 8px; }
.d-info .lbl { font-size: 12px; }
.d-info h1 { font-size: 21px; line-height: 1.3; margin: 8px 0 6px; font-weight: 800; }
.d-harga { font-size: 26px; font-weight: 800; color: var(--biru-700); margin: 0 0 4px; letter-spacing: .2px; }
.d-sec { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--garis); }
.d-sec h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; margin: 0 0 8px; font-weight: 800; color: var(--biru-900); }
.d-sec p { margin: 0 0 8px; white-space: pre-line; }
.d-sec .kosong { color: var(--teks-2); font-style: italic; }

.langkah { list-style: none; counter-reset: l; margin: 4px 0 0; padding: 0; display: grid; gap: 10px; }
.langkah li { counter-increment: l; position: relative; padding: 10px 12px 10px 48px; background: var(--biru-50); border-radius: 12px; border: 1px solid var(--biru-100); }
.langkah li::before {
  content: counter(l);
  position: absolute;
  left: 10px;
  top: 9px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--biru-700);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
}
.catatan { margin-top: 10px; padding: 10px 12px; border-left: 4px solid var(--biru-500); background: #fff; border-radius: 0 10px 10px 0; box-shadow: var(--bayang); font-size: 14px; }
.catatan b { color: var(--biru-700); }

.varian { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; }
.varian a {
  flex: none;
  display: flex;
  flex-direction: column;
  min-width: 120px;
  max-width: 180px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--garis);
  background: #fff;
  color: var(--teks);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.3;
}
.varian a b { color: var(--biru-700); font-size: 13px; margin-top: 2px; }
.varian a[aria-current="true"] { border-color: var(--biru-600); background: var(--biru-50); }

.d-order {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .97);
  border-top: 1px solid var(--garis);
  box-shadow: 0 -6px 20px rgba(10, 42, 94, .08);
}
.qty { display: flex; align-items: center; border: 1.5px solid var(--garis); border-radius: 12px; height: 48px; flex: none; }
.qty button { width: 40px; height: 100%; border: 0; background: transparent; display: grid; place-items: center; color: var(--biru-700); }
.qty button:disabled { color: #b7c2d3; cursor: default; }
.qty button svg { width: 18px; height: 18px; }
.qty output { min-width: 28px; text-align: center; font-weight: 800; font-size: 16px; }
.d-order .btn-pesan { flex: 1; min-width: 0; }
.d-order .btn-pesan span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.total { font-size: 12.5px; color: var(--teks-2); margin-top: 2px; }
.total b { color: var(--teks); }

/* Halaman tanpa JavaScript */
.ns { background: #fff; border-radius: var(--radius); padding: 16px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 90;
  background: var(--biru-900);
  color: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  animation: pudar .2s ease-out;
  max-width: calc(100vw - 32px);
}

/* ───────── Layar lebih lebar ───────── */

@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .tabs button { flex: 0 0 auto; min-width: 130px; }
}

@media (min-width: 900px) {
  html { scroll-padding-top: 120px; }
  .brandrow { display: none; }
  .bar { padding: 10px 24px 0; }
  .brand-desktop, .chat-desktop { display: flex; }
  .chat-desktop { display: inline-flex; }
  .search { max-width: 680px; margin: 0 auto; }
  .main { padding: 18px 24px 36px; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .card h3 { font-size: 14px; }
  .foot { padding-left: 24px; padding-right: 24px; }

  .detail {
    display: grid;
    place-items: center;
    padding: 4vh 24px;
    background: rgba(10, 30, 66, .55);
    animation: pudar .18s ease-out;
  }
  .d-panel {
    position: relative;
    width: min(1040px, 100%);
    max-height: 92vh;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
    animation: naik .22s ease-out;
    display: flex;
    flex-direction: column;
  }
  .d-top { position: static; padding: 10px 14px; }
  .d-close { display: inline-flex; padding: 8px 10px; }
  .d-wrap { display: grid; grid-template-columns: minmax(0, 46%) minmax(0, 1fr); overflow: hidden; flex: 1; min-height: 0; }
  .d-foto { max-height: none; height: auto; align-self: start; margin: 18px 0 18px 18px; border-radius: 16px; overflow: hidden; }
  .d-kanan { overflow-y: auto; display: flex; flex-direction: column; min-height: 0; }
  .d-info { padding: 18px 24px 8px; }
  .d-info h1 { font-size: 24px; }
  .d-order { position: sticky; bottom: 0; padding: 12px 24px; margin-top: auto; }
}

@media (min-width: 1200px) {
  .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
