/* ============================================================
   Surya Pro — Etalase Katalog (desain Figma "Catalog App")
   Tema: navy-900 #091e40 permukaan utama, orange-500 #f97316 aksen
   Font: Outfit (judul) + Inter (isi)
   Tampilan: aplikasi mobile dalam bingkai ponsel (desktop),
             penuh layar di HP — 2 kolom kartu, persis Figma
   ============================================================ */
:root {
  --navy: #091e40;
  --navy-deep: #051230;
  --navy-soft: #122a56;
  --navy-muted: rgba(255, 255, 255, 0.62);
  --orange: #f97316;
  --orange-dark: #ea580c;
  --orange-soft: #fff4ec;
  --bg: #eef1f6;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --shadow: 0 18px 50px rgba(2, 8, 24, 0.55);
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--navy-deep);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand-text strong, .product-name {
  font-family: "Outfit", "Inter", sans-serif;
}

/* ─── Panggung: latar gelap + ponsel di tengah ─────────────── */
.stage {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 14px 18px;
  background:
    radial-gradient(1000px 520px at 50% -10%, rgba(var(--orange-rgb, 249, 115, 22), 0.14), transparent 60%),
    radial-gradient(800px 600px at 85% 110%, rgba(var(--navy-soft-rgb, 18, 42, 86), 0.55), transparent 60%),
    var(--navy-deep);
}

.phone-frame {
  width: 100%;
  max-width: 430px;
  background: #000;
  border-radius: 46px;
  padding: 12px;
  box-shadow: var(--shadow), 0 0 0 1px rgba(255, 255, 255, 0.06);
  position: relative;
}

.app {
  background: var(--bg);
  border-radius: 36px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 640px;
  max-height: 86vh;
}

/* ─── Bilah atas aplikasi ──────────────────────────────────── */
.app-header {
  background: var(--navy);
  padding: 14px 16px 10px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 2px 12px;
}

.brand-logo {
  background: var(--orange);
  border-radius: 11px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 12px rgba(var(--orange-rgb, 249, 115, 22), 0.45);
  flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 17px; font-weight: 800; color: #fff; letter-spacing: 0.2px; }
.brand-text small {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.6px;
  color: var(--orange);
  margin-top: 2px;
}

/* ─── Kolom pencarian ──────────────────────────────────────── */
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--navy-soft);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 6px 6px 6px 14px;
  transition: border-color 0.2s, background 0.2s;
}

.search-box:focus-within {
  border-color: var(--orange);
  background: rgba(var(--navy-soft-rgb, 18, 42, 86), 0.9);
}

.search-icon { color: var(--navy-muted); flex-shrink: 0; }

.search-box input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: #fff;
  font-size: 14px;
  font-family: "Inter", sans-serif;
}

.search-box input::placeholder { color: var(--navy-muted); }

.btn-search {
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 10px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.1s;
}

.btn-search:hover { background: var(--orange-dark); }
.btn-search:active { transform: scale(0.95); }

/* ─── Pil kategori (geser mendatar) ────────────────────────── */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.chips::-webkit-scrollbar { display: none; }

.chip {
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  background: var(--navy-soft);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 7px 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.chip.active .chip-count { background: rgba(255, 255, 255, 0.28); }

/* ─── Pilih kelompok: tombol dropdown + panel pencarian ────── */
.group-picker {
  position: relative;
  margin-top: 12px;
}

.group-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--navy-soft);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 11px 14px;
  color: #fff;
  cursor: pointer;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  transition: border-color 0.2s, background 0.2s;
}

.group-btn:hover { background: rgba(255, 255, 255, 0.08); }
.group-btn[aria-expanded="true"] { border-color: var(--orange); }

.group-btn-icon { font-size: 17px; line-height: 1; flex-shrink: 0; }

.group-btn-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-btn-chevron {
  flex-shrink: 0;
  color: var(--navy-muted);
  transition: transform 0.2s;
}

.group-btn[aria-expanded="true"] .group-btn-chevron { transform: rotate(180deg); color: var(--orange); }

.group-panel {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--navy-panel, #0d2249);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  box-shadow: 0 18px 44px rgba(2, 8, 24, 0.6);
  overflow: hidden;
}

.group-panel.open { display: block; }

.group-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 10px 6px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 11px;
  color: var(--navy-muted);
}

.group-search:focus-within { border-color: var(--orange); }

.group-search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: #fff;
  font-size: 13.5px;
  font-family: "Inter", sans-serif;
}

.group-search input::placeholder { color: var(--navy-muted); }

.group-list {
  max-height: 260px;
  overflow-y: auto;
  padding: 2px 8px 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.group-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.12s;
}

.group-item:hover { background: rgba(255, 255, 255, 0.08); }

.group-item.active {
  background: var(--orange);
  color: #fff;
  font-weight: 700;
}

.group-item-icon { font-size: 16px; line-height: 1; flex-shrink: 0; }

.group-item-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-item-count {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 1px 9px;
  flex-shrink: 0;
}

.group-item.active .group-item-count { background: rgba(255, 255, 255, 0.28); }

.group-empty {
  padding: 16px 10px;
  text-align: center;
  color: var(--navy-muted);
  font-size: 13px;
}

/* Pil pintasan populer — tampil sebagai deretan geser di bawah dropdown */
.chips-shortcut {
  padding-top: 10px;
}

.chips-shortcut .chip { font-size: 12px; padding: 6px 12px; }
.chips-shortcut .chip-icon { font-size: 13px; line-height: 1; }

.chip:hover { background: rgba(255, 255, 255, 0.12); }

.chip.active {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
  box-shadow: 0 4px 14px rgba(var(--orange-rgb, 249, 115, 22), 0.35);
}

.chip-label { line-height: 1; }

/* Ikon golongan: bulat, cukup emoji (nama muncul setelah diklik) */
.chip-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
  background: var(--navy-soft);
}

.chip-icon-emoji { font-size: 21px; line-height: 1; }

.chip-icon.active {
  background: var(--orange);
  border-color: var(--orange);
  box-shadow: 0 4px 14px rgba(var(--orange-rgb, 249, 115, 22), 0.45);
  transform: scale(1.06);
}

.chip-icon-count {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 9px;
  font-weight: 700;
  background: var(--card, #fff);
  color: var(--orange-dark);
  border-radius: 999px;
  min-width: 17px;
  height: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.chip-icon.active .chip-icon-count { background: #fff; color: var(--orange-dark); }

/* ─── Konten ───────────────────────────────────────────────── */
.content {
  flex: 1;
  padding: 4px 14px 18px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 2px 12px;
}

.catalog-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 2px 10px;
}

.catalog-title h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.2px;
}

.count-pill {
  font-size: 12px;
  font-weight: 700;
  color: var(--orange-dark);
  background: var(--card, #fff);
  border: 1px solid var(--accent-softer, #fde0cf);
  border-radius: 999px;
  padding: 5px 12px;
  box-shadow: 0 2px 8px rgba(2, 8, 24, 0.06);
  white-space: nowrap;
}

.result-text { font-size: 12.5px; color: var(--muted); }
.result-text strong { color: var(--navy); font-weight: 700; }
.reset-link { color: var(--orange-dark); text-decoration: none; font-size: 12.5px; font-weight: 600; }

/* ─── Grid produk: 2 kolom, kartu putih (persis Figma) ─────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.product-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(2, 8, 24, 0.25);
  transition: transform 0.15s, box-shadow 0.15s;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(2, 8, 24, 0.35);
}

.photo-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  background: linear-gradient(160deg, var(--bg), var(--bg-2, #e2e8f0));
  overflow: hidden;
}

.product-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

.photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

.placeholder-icon {
  font-size: 40px;
  opacity: 0.4;
  filter: grayscale(0.2);
}

.product-body { padding: 10px 12px 13px; }

.group-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  background: var(--orange-soft);
  color: var(--orange-dark);
  border: 1px solid var(--accent-softer, #fee3d3);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 7px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── Tombol muat lebih banyak ─────────────────────────────── */
.load-more {
  display: block;
  width: 100%;
  margin: 16px 0 6px;
  padding: 12px;
  border: 1.5px dashed var(--garis, #c3cad6);
  border-radius: 14px;
  background: var(--card, #fff);
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
  font-family: "Outfit", sans-serif;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.load-more:hover { background: var(--orange-soft); border-color: var(--orange); }
.load-more:disabled { opacity: 0.6; cursor: wait; }

/* ─── Kosong ───────────────────────────────────────────────── */
.empty-state {
  background: var(--card, #fff);
  border: 1px dashed var(--garis, #c3cad6);
  border-radius: var(--radius);
  text-align: center;
  padding: 46px 18px;
}

.empty-icon { font-size: 40px; margin-bottom: 10px; }
.empty-state h3 { font-size: 17px; margin-bottom: 6px; font-weight: 700; color: var(--navy); }
.empty-state p { color: var(--muted); margin-bottom: 16px; font-size: 13.5px; }

.empty-btn {
  display: inline-flex;
  width: auto;
  padding: 10px 22px;
  border-radius: 12px;
}

/* ─── Footer aplikasi ──────────────────────────────────────── */
.app-footer {
  background: var(--navy-deep);
  padding: 12px 16px 14px;
  text-align: center;
}

.app-footer p { color: var(--navy-muted); font-size: 12px; margin-bottom: 4px; }

.admin-link {
  color: var(--navy-muted);
  text-decoration: none;
  font-size: 11.5px;
}

.admin-link:hover { color: var(--orange); }

.stage-caption {
  margin-top: 14px;
  font-size: 12px;
  letter-spacing: 0.6px;
  color: rgba(255, 255, 255, 0.4);
}

/* ─── Lightbox ─────────────────────────────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(var(--navy-deep-rgb, 5, 18, 48), 0.94);
  z-index: 100;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 30px;
  cursor: zoom-out;
}

.lightbox.show { display: flex; }

.lightbox img {
  max-width: 92vw;
  max-height: 78vh;
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55);
}

.lightbox p { color: #fff; margin-top: 14px; font-size: 15px; text-align: center; }

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 26px;
  font-size: 40px;
  color: #fff;
  cursor: pointer;
  line-height: 1;
}

/* ─── HP: bingkai ponsel hilang, aplikasi penuh layar ──────── */
@media (max-width: 560px) {
  .stage { padding: 0; justify-content: flex-start; }
  .phone-frame { max-width: none; border-radius: 0; padding: 0; box-shadow: none; }
  .app { border-radius: 0; min-height: 100vh; max-height: none; }
  .stage-caption { display: none; }
}

@media (min-width: 561px) {
  .app { min-height: 660px; }
}
