*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f5f3ef; --surface: #fff; --border: rgba(0,0,0,0.08);
  --text: #1a1916; --muted: #6b6860; --accent: #2d6a4f;
  --peek: 64px;
}
html, body { height: 100%; overflow: hidden; font-family: 'Plus Jakarta Sans', sans-serif; }
#az-map { position: fixed; inset: 0; z-index: 1; }
.leaflet-popup { display: none !important; }

/* ── GPS ONBOARDING OVERLAY ── */
#gps-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(15,15,12,0.72);
  backdrop-filter: blur(6px);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0 0 env(safe-area-inset-bottom, 0);
  animation: fadeInOverlay 0.3s ease both;
}
@keyframes fadeInOverlay { from { opacity: 0; } to { opacity: 1; } }
#gps-overlay.hiding {
  animation: fadeOutOverlay 0.28s ease both;
}
@keyframes fadeOutOverlay { from { opacity: 1; } to { opacity: 0; } }

.gps-card {
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 8px 24px 36px;
  width: 100%;
  max-width: 480px;
  animation: slideUpCard 0.38s cubic-bezier(.32,.72,0,1) both;
}
@keyframes slideUpCard { from { transform: translateY(120%); } to { transform: translateY(0); } }

.gps-drag-bar {
  width: 36px; height: 4px; border-radius: 99px;
  background: rgba(0,0,0,0.12); margin: 8px auto 20px;
}
.gps-icon-wrap {
  width: 64px; height: 64px; border-radius: 18px;
  background: linear-gradient(135deg, #edf7f3 0%, #d0ede3 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; margin: 0 auto 16px;
  box-shadow: 0 4px 16px rgba(45,106,79,0.18);
}
.gps-title {
  font-size: 18px; font-weight: 700; color: var(--text);
  text-align: center; margin-bottom: 8px;
}
.gps-desc {
  font-size: 13px; color: var(--muted); text-align: center;
  line-height: 1.6; margin-bottom: 24px; padding: 0 8px;
}
.gps-btn-allow {
  width: 100%; height: 50px; border-radius: 14px;
  background: var(--accent); color: #fff;
  font-size: 15px; font-weight: 700; font-family: inherit;
  border: none; cursor: pointer; margin-bottom: 10px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 16px rgba(45,106,79,0.3);
  transition: transform 0.1s, box-shadow 0.1s;
}
.gps-btn-allow:active { transform: scale(0.97); box-shadow: 0 2px 8px rgba(45,106,79,0.2); }
.gps-btn-skip {
  width: 100%; height: 44px; border-radius: 14px;
  background: var(--bg); color: var(--muted);
  font-size: 14px; font-weight: 600; font-family: inherit;
  border: 1px solid var(--border); cursor: pointer;
  transition: background 0.1s;
}
.gps-btn-skip:active { background: #ece9e4; }

/* ── GPS PULSE (user location) ── */
.gps-pulse-wrap {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.gps-pulse-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #1a5fb4; border: 2px solid #fff;
  box-shadow: 0 0 0 0 rgba(26,95,180,0.4);
  animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
  0%   { box-shadow: 0 0 0 0   rgba(26,95,180,0.4); }
  70%  { box-shadow: 0 0 0 10px rgba(26,95,180,0); }
  100% { box-shadow: 0 0 0 0   rgba(26,95,180,0); }
}

/* MODERASI & UPLOAD */
.jfb-compress-overlay { display: none; margin-top: 10px; padding: 10px; background: rgba(0, 124, 186, 0.1); border-radius: 8px; font-size: 13px; color: #1a1916; text-align: center; }
.jfb-compress-spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid #e3e3e3; border-top: 2px solid #007cba; border-radius: 50%; animation: jfb-spin 1s linear infinite; vertical-align: middle; margin-right: 6px; }
@keyframes jfb-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* TOP BAR */
.top-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 400;
  padding: 10px 12px 8px; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.top-row { display: flex; align-items: center; gap: 8px; pointer-events: all; }
.logo-pill {
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 700;
  padding: 6px 14px; border-radius: 99px; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2); flex-shrink: 0;
}
.search-box {
  flex: 1; background: #fff; border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
  display: flex; align-items: center; position: relative;
}
.search-box input {
  width: 100%; border: none; outline: none; background: transparent;
  padding: 9px 40px 9px 34px; font-size: 14px; font-family: inherit; color: var(--text);
}
.search-box input::placeholder { color: var(--muted); }
.search-icon { position: absolute; left: 11px; color: var(--muted); font-size: 14px; pointer-events: none; }
.search-clear {
  position: absolute; right: 10px; width: 22px; height: 22px;
  border-radius: 99px; border: none; background: #e8e6e2; color: var(--muted);
  font-size: 12px; cursor: pointer; display: none; align-items: center; justify-content: center;
}
.search-clear.show { display: flex; }

.filter-row {
  display: flex; gap: 7px; overflow-x: auto; padding-bottom: 2px;
  pointer-events: all; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }
.fchip {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 13px; border-radius: 99px; white-space: nowrap; flex-shrink: 0;
  font-size: 12px; font-weight: 600; font-family: inherit; cursor: pointer;
  border: none; box-shadow: 0 1px 6px rgba(0,0,0,0.13);
  background: #fff; color: var(--muted); transition: all 0.15s;
}
.fchip.active[data-cat="all"]       { background: #1a1916; color: #fff; }



/* GPS BTN — posisi diatur JS via --gps-bottom */
.btn-gps {
  position: fixed; right: 14px; z-index: 600;
  background: #fff; border: none; border-radius: 12px;
  width: 42px; height: 42px; cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  font-size: 18px; display: flex; align-items: center; justify-content: center;
  transition: bottom 0.38s cubic-bezier(.32,.72,0,1);
  bottom: calc(var(--peek) + 14px); /* default mobile */
}
.btn-gps.locating { animation: spinPulse 1s linear infinite; }
@keyframes spinPulse {
  0%   { box-shadow: 0 0 0 0 rgba(26,95,180,0.4); }
  50%  { box-shadow: 0 0 0 8px rgba(26,95,180,0); }
  100% { box-shadow: 0 0 0 0 rgba(26,95,180,0); }
}

/* ADD BTN */
.btn-add {
  position: fixed; right: 14px; z-index: 600;
  background: var(--accent); color: white; border: none; border-radius: 12px;
  width: 42px; height: 42px; cursor: pointer; text-decoration: none;
  box-shadow: 0 4px 12px rgba(45,106,79,0.3);
  font-size: 24px; font-weight: bold; display: flex; align-items: center; justify-content: center;
  bottom: calc(var(--peek) + 64px); 
}
.btn-add:active { transform: scale(0.95); }

/* ── ADD PANEL OVERLAY ── */
#add-overlay {
  position: fixed; inset: 0; z-index: 8000;
  background: rgba(15,15,12,0.55);
  backdrop-filter: blur(4px);
  display: none; align-items: flex-end; justify-content: center;
  animation: fadeInOverlay 0.25s ease both;
}
#add-overlay.show { display: flex; }
#add-overlay.hiding { animation: fadeOutOverlay 0.25s ease both; }

.add-card {
  background: var(--surface); border-radius: 20px 20px 0 0;
  width: 100%; max-width: 520px;
  max-height: 88vh; overflow-y: auto;
  padding: 8px 20px 28px;
  animation: slideUpCard 0.35s cubic-bezier(.32,.72,0,1) both;
}
.add-card-bar { width: 36px; height: 4px; border-radius: 99px; background: rgba(0,0,0,0.12); margin: 8px auto 16px; }
.add-card-title { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.add-group { margin-bottom: 16px; }
.add-group label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.add-input {
  width: 100%; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg);
  font-family: inherit; font-size: 13px; color: var(--text); transition: border-color 0.2s;
}
.add-input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
select.add-input {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: right 0.8rem center; background-size: 1em;
}
textarea.add-input { resize: vertical; min-height: 70px; }
.add-row { display: flex; gap: 10px; }
.add-row > * { flex: 1; }
.add-gps-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; color: var(--accent); background: #edf7f3;
  border: none; padding: 5px 10px; border-radius: 99px; cursor: pointer; font-family: inherit; margin-bottom: 6px;
}
.add-submit {
  width: 100%; padding: 12px; background: var(--accent); color: white; border: none;
  border-radius: 12px; font-size: 14px; font-weight: 700; cursor: pointer;
  font-family: inherit; box-shadow: 0 4px 12px rgba(45,106,79,0.25); margin-top: 4px;
}
.add-submit:active { transform: scale(0.98); }
.add-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.add-cancel {
  width: 100%; padding: 10px; background: var(--bg); color: var(--muted); border: 1px solid var(--border);
  border-radius: 12px; font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: inherit; margin-top: 8px;
}
.add-error { color: #c0392b; font-size: 11px; margin-top: 3px; }
.add-success {
  display: flex; align-items: center; gap: 8px; background: #edf7f3;
  border-radius: 10px; padding: 10px 14px; font-size: 13px; color: var(--accent); font-weight: 600;
  margin-bottom: 12px; animation: fadeUp 0.3s ease both;
}
.add-pick-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; color: #1a5fb4; background: #eef4fd;
  border: none; padding: 5px 10px; border-radius: 99px; cursor: pointer; font-family: inherit; margin-bottom: 6px; margin-left: 6px;
}

/* MAP PICK MODE */
#map-pick-overlay {
  position: fixed; inset: 0; z-index: 7000;
  display: none; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none;
}
#map-pick-overlay.show { display: flex; }
.map-pick-banner {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%);
  background: rgba(26,26,22,0.88); color: #fff; padding: 10px 20px;
  border-radius: 14px; font-size: 13px; font-weight: 600; font-family: inherit;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25); z-index: 7001;
  pointer-events: all; display: flex; align-items: center; gap: 8px;
  animation: fadeUp 0.3s ease both;
}
.map-pick-cancel {
  background: rgba(255,255,255,0.15); border: none; color: #fff; padding: 4px 10px;
  border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.map-pick-cancel:hover { background: rgba(255,255,255,0.25); }
.map-pick-crosshair {
  width: 40px; height: 40px; position: relative;
  pointer-events: none;
}
.map-pick-crosshair::before, .map-pick-crosshair::after {
  content: ''; position: absolute; background: #c0392b;
}
.map-pick-crosshair::before { width: 2px; height: 100%; left: 50%; transform: translateX(-50%); }
.map-pick-crosshair::after { height: 2px; width: 100%; top: 50%; transform: translateY(-50%); }
.map-pick-dot {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 10px; height: 10px; border-radius: 50%; background: #c0392b;
  box-shadow: 0 0 0 3px rgba(192,57,43,0.25);
}

@media (min-width: 640px) {
  .add-card { border-radius: 20px; margin: 0 auto 40px; max-height: 80vh; }
  #add-overlay { align-items: center; }
}

/* BOTTOM SHEET */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 500;
  background: var(--surface); border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.10);
  display: flex; flex-direction: column;
  height: calc(100vh - 56px);
  transform: translateY(calc(100vh - 56px - var(--peek)));
  will-change: transform; touch-action: none;
  transition: transform 0.38s cubic-bezier(.32,.72,0,1);
}
.drag-handle { padding: 10px 0 4px; cursor: grab; flex-shrink: 0; user-select: none; }
.drag-handle:active { cursor: grabbing; }
.drag-bar { width: 36px; height: 4px; border-radius: 99px; background: rgba(0,0,0,0.15); margin: 0 auto; }
.peek-title {
  padding: 4px 16px 10px;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0; cursor: pointer;
}
.peek-label { font-size: 15px; font-weight: 700; color: var(--text); }
.peek-meta  { display: flex; align-items: center; gap: 8px; }
.peek-count { font-size: 12px; color: var(--muted); background: var(--bg); padding: 3px 10px; border-radius: 99px; }
.peek-arrow { font-size: 13px; color: var(--muted); transition: transform 0.3s; }

.sheet-list-wrap { flex: 1; display: flex; flex-direction: column; overflow: hidden; border-top: 1px solid var(--border); }
.sheet-list { flex: 1; overflow-y: auto; padding: 8px 10px 16px; -webkit-overflow-scrolling: touch; }
.sheet-list::-webkit-scrollbar { width: 3px; }
.sheet-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

.result-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 2px 8px; font-size: 11px; color: var(--muted);
}
.result-header strong { color: var(--text); font-size: 12px; }

.pl-card {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 11px; border-radius: 12px; margin-bottom: 5px;
  cursor: pointer; border: 1px solid transparent; transition: background 0.12s;
  animation: fadeUp 0.22s ease both;
}
@keyframes fadeUp { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }
.pl-card:hover, .pl-card.active { background: var(--bg); border-color: var(--border); }
.pl-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.pl-info { flex: 1; min-width: 0; }
.pl-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-sub  { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.pl-stars { color: #d4820a; font-weight: 600; }
.pl-badge { font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 99px; }
.pl-chevron { color: #ccc; font-size: 14px; flex-shrink: 0; }

/* DETAIL PANEL */
.detail-panel {
  position: absolute; inset: 0; border-radius: 20px 20px 0 0;
  background: var(--surface); z-index: 10;
  transform: translateY(100%); transition: transform 0.32s cubic-bezier(.32,.72,0,1);
  display: flex; flex-direction: column; overflow: hidden;
}
.detail-panel.open { transform: translateY(0); }
.detail-header {
  padding: 14px 16px 12px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.detail-back {
  width: 34px; height: 34px; border-radius: 10px; background: var(--bg);
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.detail-header-info { flex: 1; min-width: 0; }
.detail-cat-badge { font-size: 10px; font-weight: 600; padding: 2px 9px; border-radius: 99px; display: inline-block; margin-bottom: 3px; }
.detail-name { font-size: 15px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detail-body { flex: 1; overflow-y: auto; padding: 16px; }
.detail-rating-row { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.detail-stars { color: #d4820a; font-weight: 700; font-size: 16px; }
.detail-reviews { font-size: 12px; color: var(--muted); }
.detail-blacklist-warn {
  background: #fdf0ef; border-left: 3px solid #c0392b;
  padding: 10px 12px; border-radius: 0 10px 10px 0;
  font-size: 12px; color: #c0392b; margin-bottom: 14px; line-height: 1.5; font-weight: 500;
}
.detail-desc { font-size: 13px; color: #3a3935; line-height: 1.65; margin-bottom: 18px; }
.detail-section-title { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 8px; }
.detail-actions { display: flex; flex-direction: column; gap: 8px; }
.det-btn {
  width: 100%; height: 44px; border-radius: 12px; font-size: 14px; font-weight: 600;
  font-family: inherit; cursor: pointer; border: none;
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.det-btn.primary { color: #fff; }
.det-btn.secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.det-btn.danger { background: #fdf0ef; color: #c0392b; }

/* DESKTOP */
@media (min-width: 640px) {
  .sheet {
    width: 340px; left: auto; right: 0; top: 0; bottom: 0;
    height: 100vh; border-radius: 0; transform: none !important;
    box-shadow: -2px 0 20px rgba(0,0,0,0.08); transition: none;
  }
  .drag-handle, .peek-title { display: none; }
  .sheet-list-wrap { border-top: none; }
  .sheet-list { padding-top: 90px; }
  #az-map { right: 340px; }
  .top-bar { right: 350px; }
  .btn-gps { right: 354px; bottom: 80px !important; transition: none; }
  .btn-add { right: 354px; bottom: 130px !important; transition: none; }
  .leaflet-control-zoom { margin-bottom: 30px !important; }
  .detail-panel { border-radius: 0; }
  .gps-card { border-radius: 24px; max-width: 380px; margin: 0 auto 40px; }
  #gps-overlay { align-items: center; }
}
@media (max-width: 639px) {
  .leaflet-control-zoom { margin-bottom: calc(var(--peek) + 52px) !important; margin-left: 14px !important; }
}

/* ── FOTO: THUMBNAIL DI CARD ── */
.pl-thumb {
  width: 48px; height: 48px; border-radius: 12px;
  flex-shrink: 0; overflow: hidden; background: #e8e6e2;
  position: relative;
}
.pl-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 0.25s ease;
  display: block;
}
.pl-thumb img.loaded { opacity: 1; }

/* ── FOTO: HERO DI DETAIL ── */
/* Hero slot di LUAR scroll container — konten tidak pernah tertutup foto */
.det-hero-slot {
  flex-shrink: 0;
  overflow: hidden;
  background: #e8e6e2;
}
.det-hero-slot:empty { display: none; max-height: 0; }
.det-hero {
  width: 100%; height: 160px;
  overflow: hidden; position: relative;
}
@media (max-width: 639px) {
  .det-hero { height: 140px; }
}
.det-hero-img {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 0.3s ease;
  display: block;
}
.det-hero-img.loaded { opacity: 1; }

/* ── SHIMMER PLACEHOLDER ── */
.shimmer {
  background: linear-gradient(90deg, #ece9e4 25%, #f5f3ef 50%, #ece9e4 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}