
/* ══════════════════════════════════════════
   RESET & BASE
══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green-dark:  #0A2E25;
  --green-mid:   #155C4A;
  --green:       #1A7A62;
  --green-light: #3DA68A;
  --green-pale:  #D0EAE4;
  --green-bg:    #EDF7F4;
  --gold:        #C9A227;
  --gold-light:  #E8C355;
  --gold-pale:   #FBF3D5;
  --cream:       #F5F9F8;
  --border:      #A8CFC6;
  --border-lt:   #D0EAE4;
  --txt:         #08201A;
  --txt-mid:     #1A5545;
  --txt-light:   #4A8275;
  --white:       #FFFFFF;
  --r-sm: 8px; --r-md: 14px; --r-lg: 20px;
  --sh-sm: 0 2px 10px rgba(10,46,37,.08);
  --sh-md: 0 6px 24px rgba(10,46,37,.12);
  --sh-lg: 0 16px 48px rgba(10,46,37,.16);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Montserrat', sans-serif;
  background: var(--cream);
  color: var(--txt);
  font-size: 14px;
  line-height: 1.6;
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0);
  overscroll-behavior-y: contain;
}

* { -webkit-tap-highlight-color: transparent; }
a, button, [onclick] { touch-action: manipulation; }

/* ══════════════════════════════════════════
   HEADER
══════════════════════════════════════════ */
header {
  position: sticky; top: 0; z-index: 200;
  background: var(--green-mid);
  box-shadow: 0 2px 16px rgba(10,46,37,.28);
  width: 100%;
}

.hdr-top {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px;
}

/* Brand — desktop only */
.hdr-brand {
  display: none; align-items: center; gap: 10px;
  flex-shrink: 0; text-decoration: none;
}
.hdr-brand-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.hdr-brand-name { font-size: 13px; font-weight: 800; color: #fff; white-space: nowrap; }
.hdr-brand-sub  { font-size: 9px; font-weight: 600; color: rgba(255,255,255,.5); white-space: nowrap; text-transform: uppercase; letter-spacing: .5px; }

.back-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.15); border: none;
  color: #fff; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; cursor: pointer; text-decoration: none;
  transition: background .2s;
}
.back-btn:hover { background: rgba(255,255,255,.25); }

.hdr-search {
  flex: 1;
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.14); border-radius: 24px;
  padding: 0 14px; border: 1.5px solid rgba(255,255,255,.2);
  transition: border-color .2s;
}
.hdr-search:focus-within { border-color: var(--gold-light); }
.hdr-search-icon { color: rgba(255,255,255,.6); display: flex; flex-shrink: 0; }
.hdr-search input {
  flex: 1; border: none; background: transparent;
  font-family: 'Montserrat', sans-serif; font-size: 13px;
  color: #fff; padding: 9px 0; outline: none;
}
.hdr-search input::placeholder { color: rgba(255,255,255,.5); }



/* Sort & view toolbar */
.toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 16px 10px;
  overflow-x: auto; scrollbar-width: none;
  scroll-snap-type: x mandatory;
}
.toolbar::-webkit-scrollbar { display: none; }
.sort-btn {
  flex-shrink: 0; scroll-snap-align: start;
  padding: 6px 14px; border-radius: 20px;
  border: 1.5px solid rgba(255,255,255,.25);
  background: transparent;
  font-family: 'Montserrat', sans-serif; font-size: 11px; font-weight: 600;
  color: rgba(255,255,255,.7); cursor: pointer;
  transition: all .2s; white-space: nowrap;
}
.sort-btn.active { background: var(--gold); border-color: var(--gold); color: var(--green-dark); }
.sort-btn:hover:not(.active) { background: rgba(255,255,255,.12); }
.toolbar-spacer { flex: 1; }
.view-btns { display: flex; gap: 4px; flex-shrink: 0; }
.view-btn {
  width: 30px; height: 30px; border-radius: var(--r-sm);
  border: 1.5px solid rgba(255,255,255,.25);
  background: transparent; cursor: pointer; color: rgba(255,255,255,.6);
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.view-btn.active { background: var(--gold); border-color: var(--gold); color: var(--green-dark); }

/* ══════════════════════════════════════════
   RESULTS BAR
══════════════════════════════════════════ */
.results-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px 6px;
}
.results-count { font-size: 13px; font-weight: 700; color: var(--txt); }
.results-count span { color: var(--green); }
.results-sub { font-size: 11px; color: var(--txt-light); margin-top: 1px; }
.results-add-btn {
  display: none; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--r-sm);
  background: var(--green-mid); color: #fff; border: none;
  font-family: 'Montserrat', sans-serif; font-size: 12px; font-weight: 700;
  cursor: pointer; transition: background .2s; white-space: nowrap;
}
.results-add-btn:hover { background: var(--green-dark); }

/* ══════════════════════════════════════════
   CATALOG GRID
══════════════════════════════════════════ */
.catalog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 8px 16px 32px;
}
.catalog-grid.list-view { grid-template-columns: 1fr; }

/* ══════════════════════════════════════════
   PROPERTY CARD
══════════════════════════════════════════ */
.prop-card {
  background: var(--white); border-radius: var(--r-lg);
  box-shadow: var(--sh-sm); border: 1px solid var(--border-lt);
  overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column;
  transition: box-shadow .25s, transform .25s;
}
.prop-card:hover { box-shadow: var(--sh-md); transform: translateY(-3px); }
.prop-card:active { transform: scale(.98); box-shadow: var(--sh-sm); }
.prop-card.hidden { display: none; }

.card-img-wrap {
  position: relative; overflow: hidden;
  aspect-ratio: 1/1; background: var(--green-pale);
}
.catalog-grid.list-view .card-img-wrap { aspect-ratio: 16/7; }

.card-img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .4s;
}
.prop-card:hover .card-img { transform: scale(1.05); }

.card-status {
  position: absolute; top: 8px; left: 8px;
  font-size: 9px; font-weight: 800; padding: 3px 8px;
  border-radius: 20px; text-transform: uppercase; letter-spacing: .3px;
}
.status-jual  { background: var(--green-mid); color: #fff; }
.status-sewa  { background: var(--gold);      color: var(--green-dark); }
.status-kerja { background: #6B46C1;          color: #fff; }
.status-investasi { background: #2B6CB0;      color: #fff; }

.card-fav {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0,0,0,.35); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px); transition: background .2s;
}
.card-fav:hover { background: rgba(0,0,0,.55); }
.card-fav svg { transition: transform .2s; }
.card-fav:hover svg { transform: scale(1.2); }

.card-img-count {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0,0,0,.45); color: #fff;
  font-size: 9px; font-weight: 700; padding: 2px 7px;
  border-radius: 10px; display: flex; align-items: center; gap: 3px;
  backdrop-filter: blur(4px);
}

.card-body { padding: 10px 12px 8px; flex: 1; min-width: 0; }
.card-price {
  font-size: 14px; font-weight: 800; color: var(--green-dark);
  margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-name {
  font-size: 11px; font-weight: 700; color: var(--txt);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.3; margin-bottom: 3px;
}
.card-loc {
  font-size: 10px; color: var(--txt-light);
  display: flex; align-items: center; gap: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-specs {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 7px; padding-top: 7px;
  border-top: 1px solid var(--border-lt);
}
.card-spec {
  display: flex; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 600; color: var(--txt-mid);
}
.card-spec svg { opacity: .7; }

/* List-view extra actions */
.card-actions { display: none; padding: 0 12px 12px; gap: 8px; }
.catalog-grid.list-view .card-actions { display: flex; }
.card-act-btn {
  flex: 1; padding: 9px; border-radius: var(--r-sm);
  border: 1.5px solid var(--border); background: transparent;
  font-family: 'Montserrat', sans-serif; font-size: 11px; font-weight: 700;
  color: var(--txt-mid); cursor: pointer; transition: all .2s;
}
.card-act-btn.primary { background: var(--green-mid); border-color: var(--green-mid); color: #fff; }
.card-act-btn:hover:not(.primary) { background: var(--green-bg); }
.card-act-btn.primary:hover { background: var(--green-dark); }

/* ══════════════════════════════════════════
   EMPTY STATE & LOAD MORE
══════════════════════════════════════════ */
.empty-state {
  display: none; text-align: center; padding: 64px 24px;
}
.empty-state.show { display: block; }
.empty-icon { font-size: 56px; margin-bottom: 14px; opacity: .35; }
.empty-title { font-size: 17px; font-weight: 800; margin-bottom: 6px; }
.empty-sub   { font-size: 13px; color: var(--txt-light); margin-bottom: 20px; }
.empty-btn {
  padding: 12px 28px; background: var(--green-mid); color: #fff;
  border: none; border-radius: var(--r-md);
  font-family: 'Montserrat', sans-serif; font-size: 13px; font-weight: 700; cursor: pointer;
}

.load-more-wrap { text-align: center; padding: 8px 16px 36px; }
.load-more-btn {
  padding: 13px 40px; background: var(--white); color: var(--green-mid);
  border: 2px solid var(--green-mid); border-radius: var(--r-md);
  font-family: 'Montserrat', sans-serif; font-size: 13px; font-weight: 800;
  cursor: pointer; transition: all .2s; width: 100%; max-width: 300px;
}
.load-more-btn:hover { background: var(--green-mid); color: #fff; }

/* ══════════════════════════════════════════
   MODAL DETAIL
══════════════════════════════════════════ */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 400;
  background: rgba(10,46,37,.65); backdrop-filter: blur(6px);
  align-items: flex-end;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--white); border-radius: 24px 24px 0 0;
  width: 100%; max-height: 92vh; overflow-y: auto;
  animation: slideUp .35s cubic-bezier(.4,0,.2,1);
  position: relative;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.modal-handle { width: 40px; height: 4px; background: var(--border); border-radius: 2px; margin: 14px auto 0; }

.modal-close-btn {
  position: fixed; top: calc(14px + env(safe-area-inset-top, 0px)); right: 14px;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.92); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--green-dark); box-shadow: var(--sh-sm);
  transition: background .2s, transform .15s; z-index: 600;
}
.modal-close-btn:hover { background: #fff; transform: scale(1.08); }
.modal-handle { display: none; }

/* Image slider */
.modal-img-wrap {
  position: relative; overflow: hidden;
  aspect-ratio: 3/2; width: 100%; background: var(--green-pale);
}
.modal-slider {
  display: flex; height: 100%;
  transition: transform .35s cubic-bezier(.4,0,.2,1);
}
.modal-slide { min-width: 100%; height: 100%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.modal-img { max-width: 100%; max-height: 100%; width: auto; height: auto; display: block; cursor: zoom-in; }
.modal-slide-video { background: #000; display: flex; align-items: center; justify-content: center; }
.modal-slide-video video { width: 100%; height: 100%; object-fit: contain; display: block; }

.modal-slide-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(0,0,0,.45); border: none; cursor: pointer;
  color: #fff; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(3px); transition: background .2s; z-index: 5;
}
.modal-slide-arrow:hover { background: rgba(0,0,0,.65); }
.modal-slide-arrow.prev { left: 10px; }
.modal-slide-arrow.next { right: 10px; }

.modal-slide-dots {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 5px; z-index: 5;
}
.modal-slide-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,.5); cursor: pointer;
  transition: background .2s, transform .2s;
}
.modal-slide-dot.active { background: #fff; transform: scale(1.3); }

.modal-img-counter {
  position: absolute; bottom: 10px; right: 12px;
  background: rgba(0,0,0,.5); color: #fff;
  font-size: 10px; font-weight: 700; padding: 2px 8px;
  border-radius: 10px; backdrop-filter: blur(4px); z-index: 5;
}
.modal-slide-type {
  position: absolute; top: 10px; left: 12px;
  background: rgba(0,0,0,.55); color: #fff;
  font-size: 9px; font-weight: 800; padding: 3px 8px;
  border-radius: 8px; backdrop-filter: blur(4px); z-index: 5;
  letter-spacing: .4px; text-transform: uppercase;
}

/* Modal body */
.modal-body { padding: 18px 20px 24px; }
.modal-status-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.modal-badge { font-size: 10px; font-weight: 800; padding: 4px 12px; border-radius: 20px; }
.modal-agent {
  display: none; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 700; color: var(--txt-mid);
  background: var(--green-bg); border: 1px solid var(--border-lt);
  padding: 3px 9px 3px 6px; border-radius: 20px; margin-left: auto;
}
.modal-agent.show { display: flex; }
.modal-agent svg { opacity: .6; flex-shrink: 0; }
.modal-price { font-size: 24px; font-weight: 900; color: var(--green-dark); margin-bottom: 4px; }
.modal-name  { font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.modal-loc   { font-size: 13px; color: var(--txt-light); margin-bottom: 16px; display: flex; align-items: center; gap: 4px; }
.modal-loc svg { opacity: .7; flex-shrink: 0; }

/* ── Specs: Dimensi (KT / KM / LB / LT / Lantai) ── */
.modal-specs-grid {
  display: flex; flex-wrap: wrap;
  border: 1px solid var(--border-lt); border-radius: var(--r-md);
  overflow: hidden; margin-bottom: 10px;
}
.modal-spec {
  flex: 1 1 0; text-align: center; padding: 11px 6px;
  border-right: 1px solid var(--border-lt);
  min-width: 0;
}
.modal-spec:last-child { border-right: none; }
.modal-spec-val { font-size: 15px; font-weight: 900; color: var(--green-dark); line-height: 1.2; }
.modal-spec-key { font-size: 9px; font-weight: 600; color: var(--txt-light); margin-top: 3px; text-transform: uppercase; letter-spacing: .3px; }

/* ── Info grid (Listrik / Air / Legalitas / Hadap) ── */
.modal-info-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 7px; margin-bottom: 16px;
}
.modal-info-item {
  display: flex; align-items: center; gap: 9px;
  background: var(--green-bg); border: 1px solid var(--border-lt);
  border-radius: 10px; padding: 9px 12px; min-width: 0;
}
.modal-info-icon {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--white); border: 1px solid var(--border-lt);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--green-mid);
}
.modal-info-text { min-width: 0; }
.modal-info-label { font-size: 9px; font-weight: 700; color: var(--txt-light); text-transform: uppercase; letter-spacing: .4px; }
.modal-info-val   { font-size: 12px; font-weight: 800; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }

.modal-desc { font-size: 13px; color: var(--txt-mid); line-height: 1.75; margin-bottom: 18px; }
.modal-features { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.modal-feature {
  display: flex; align-items: center; gap: 5px;
  background: var(--green-bg); color: var(--green-mid);
  font-size: 11px; font-weight: 600; padding: 5px 12px; border-radius: 20px;
}
.modal-feature svg { opacity: .8; flex-shrink: 0; }

.modal-cta { display: flex; gap: 10px; }
.modal-cta-btn {
  flex: 1; padding: 14px; border-radius: var(--r-md); border: none;
  font-family: 'Montserrat', sans-serif; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all .2s; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.modal-cta-btn.primary   { background: var(--green-mid); color: #fff; }
.modal-cta-btn.secondary { background: var(--gold-pale); color: var(--green-dark); border: 1.5px solid var(--gold); }
.modal-cta-btn.primary:hover   { background: var(--green-dark); }
.modal-cta-btn.secondary:hover { background: var(--gold-light); }
.modal-cta-btn:active { opacity: .85; }

/* ══════════════════════════════════════════
   LIGHTBOX
══════════════════════════════════════════ */
#lightbox {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.93); backdrop-filter: blur(6px);
  align-items: center; justify-content: center;
  flex-direction: column; gap: 12px;
}
#lightbox.open { display: flex; animation: lbIn .2s ease; }
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }

#lightbox-img {
  max-width: min(92vw, 1200px); max-height: 80vh;
  object-fit: contain; border-radius: 8px;
  box-shadow: 0 24px 64px rgba(0,0,0,.7);
}
.lb-close {
  position: absolute; top: 16px; right: 16px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.12); border: none; cursor: pointer;
  color: #fff; display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.lb-close:hover { background: rgba(255,255,255,.25); }
.lb-nav { display: flex; align-items: center; gap: 16px; }
.lb-arrow {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.12); border: none; cursor: pointer;
  color: #fff; display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.lb-arrow:hover { background: rgba(255,255,255,.25); }
.lb-counter { font-size: 13px; font-weight: 700; color: rgba(255,255,255,.7); min-width: 50px; text-align: center; }

/* ══════════════════════════════════════════
   FAB & AUTH
══════════════════════════════════════════ */
.fab-add {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 250; height: 48px; padding: 0 22px 0 16px;
  border-radius: 999px; background: var(--gold); border: none; cursor: pointer;
  box-shadow: 0 6px 24px rgba(10,46,37,.30);
  display: flex; align-items: center; gap: 8px;
  color: var(--green-dark);
  transition: box-shadow .2s, background .2s;
  white-space: nowrap;
}
.fab-add:hover   { background: var(--gold-light); box-shadow: 0 8px 28px rgba(10,46,37,.38); }
.fab-add:active  { transform: translateX(-50%) scale(.93); }
.fab-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px; font-weight: 800; color: var(--green-dark);
}

[data-auth="required"] { display: none !important; }
[data-auth="required"].auth-visible { display: revert !important; }
[data-auth="required"].auth-visible.auth-flex { display: flex !important; }


/* ══════════════════════════════════════════
   SKELETON
══════════════════════════════════════════ */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}
.skeleton {
  background: linear-gradient(90deg, #deecea 25%, #c6d8d5 50%, #deecea 75%);
  background-size: 1200px 100%; animation: shimmer 1.4s infinite;
  border-radius: 6px;
}

/* ══════════════════════════════════════════
   FORM OVERLAY
══════════════════════════════════════════ */
@keyframes fadeIn  { from{opacity:0} to{opacity:1} }
@keyframes shakeErr { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-5px)} 40%{transform:translateX(5px)} 60%{transform:translateX(-4px)} 80%{transform:translateX(4px)} }
@keyframes spin    { to { transform: rotate(360deg); } }

#form-overlay {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: var(--green-bg);
  flex-direction: column; overflow: hidden;
}
#form-overlay.open { display: flex; animation: fadeIn .25s ease; }

.fwrap { display: flex; flex-direction: column; flex: 1; overflow: hidden; width: 100%; }

.fh {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top,0px));
  background: var(--green-mid); flex-shrink: 0;
}
.fb {
  width: 36px; height: 36px; border-radius: 10px; border: none;
  background: rgba(255,255,255,.15); color: #fff;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: pointer;
}
.fb:hover { background: rgba(255,255,255,.25); }
.ft { font-size: 15px; font-weight: 800; color: #fff; min-width: 0; flex: 1; }

.fbody {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px 8px; display: flex; flex-direction: column; gap: 10px;
  background: var(--green-bg);
  width: 100%; box-sizing: border-box;
}

.fc {
  background: #fff; border-radius: 16px;
  border: 1.5px solid var(--border-lt);
  display: flex; align-items: center;
  min-height: 58px; padding: 0 16px;
  box-shadow: 0 1px 6px rgba(21,92,74,.06);
  min-width: 0; overflow: hidden;
}
.fc .fl { font-size: 13px; font-weight: 700; color: var(--green-light); white-space: nowrap; flex-shrink: 0; min-width: 80px; max-width: 120px; }
.fc .fi {
  flex: 1; min-width: 0; border: none; background: transparent;
  font-family: 'Montserrat', sans-serif; font-size: 13px;
  font-weight: 600; color: var(--txt); outline: none; min-height: 58px; padding: 0;
}
.fc .fi::placeholder { color: var(--border); font-weight: 500; }
.fc .fsel {
  flex: 1; min-width: 0; border: none; background: transparent;
  font-family: 'Montserrat', sans-serif; font-size: 13px;
  font-weight: 600; color: var(--txt); outline: none;
  -webkit-appearance: none; min-height: 58px; padding: 0; cursor: pointer;
}
.farr { color: var(--green-light); flex-shrink: 0; pointer-events: none; }

/* Grid wrappers — overflow hidden agar tidak keluar area */
.fc-grid2 { display: flex; flex-direction: column; gap: 8px; }
.spec-r2  { display: flex; flex-direction: column; gap: 8px; }
.spec-r1  { display: flex; flex-direction: column; gap: 8px; }
.spec-r1b { display: flex; flex-direction: column; gap: 8px; }

/* ──────────────────── */

.fc-sp {
  background: #fff; border-radius: 14px;
  border: 1.5px solid var(--border-lt);
  display: flex; flex-direction: column;
  align-items: flex-start; justify-content: center;
  min-height: 58px; padding: 7px 14px; gap: 1px;
  box-shadow: 0 1px 6px rgba(21,92,74,.06);
  min-width: 0; overflow: hidden;
}
.fc-sp .fl {
  font-size: 10px; font-weight: 700;
  color: var(--green-light); white-space: nowrap;
  text-transform: uppercase; letter-spacing: .4px;
}
.fc-sp .si5 {
  width: 100%; border: none; background: transparent;
  font-family: 'Montserrat', sans-serif; font-size: 15px;
  font-weight: 800; color: var(--txt); outline: none;
  padding: 0; line-height: 1.3;
  -webkit-appearance: none; -moz-appearance: textfield;
}
.fc-sp .si5::placeholder { color: var(--border); font-weight: 500; font-size: 13px; }
.fc-sp .si5::-webkit-outer-spin-button,
.fc-sp .si5::-webkit-inner-spin-button { -webkit-appearance: none; }

.ferr { font-size: 12px; color: #E53E3E; padding: 2px 4px; min-height: 16px; }
.fc.ferr-card, .fc-sp.ferr-card { border-color: #E53E3E; animation: shakeErr .4s ease; }

.ffoot {
  display: flex; gap: 12px;
  padding: 14px 16px; padding-bottom: calc(14px + env(safe-area-inset-bottom,0px));
  border-top: 1.5px solid var(--border-lt);
  background: #fff; flex-shrink: 0;
}
.fbatal {
  flex: 1; padding: 14px; border-radius: 12px;
  border: 1.5px solid var(--border); background: transparent;
  font-family: 'Montserrat', sans-serif; font-size: 14px; font-weight: 700; color: var(--txt-mid); cursor: pointer;
}
.fbatal:hover { background: #f5f5f5; }
.fsimpan {
  flex: 2; padding: 14px; border-radius: 12px; border: none;
  background: var(--green-mid); color: #fff;
  font-family: 'Montserrat', sans-serif; font-size: 14px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
}
.fsimpan:hover { background: var(--green-dark); }
.fsimpan:disabled { opacity: .55; cursor: not-allowed; }
.fsimpan .sp { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; display: none; }
.fsimpan.loading .sp { display: block; }
.fsimpan.loading .sl2 { display: none; }

/* Keterangan textarea */
.fc-ta {
  background: #fff; border-radius: 16px;
  border: 1.5px solid var(--border-lt);
  display: flex; flex-direction: column;
  padding: 10px 16px 8px;
  box-shadow: 0 1px 6px rgba(21,92,74,.06);
  min-width: 0;
  gap: 2px;
}
.fc-ta .fl { font-size: 13px; font-weight: 700; color: var(--green-light); margin-bottom: 2px; }
.fc-ta textarea {
  border: none; background: transparent;
  font-family: 'Montserrat', sans-serif; font-size: 13px;
  font-weight: 600; color: var(--txt); outline: none;
  resize: none; min-height: 90px; padding: 4px 0 0;
  line-height: 1.65; width: 100%;
}
.fc-ta textarea::placeholder { color: var(--border); font-weight: 500; }
.fc-ta-counter {
  font-size: 10px; font-weight: 600; color: var(--txt-light);
  text-align: right; margin-top: 2px;
  transition: color .2s;
}
.fc-ta-counter.near-limit { color: var(--gold); }
.fc-ta-counter.at-limit   { color: #E53E3E; }

/* Media upload section */
.nd-media-section {
  display: flex; background: #fff; border-radius: 16px;
  border: 1.5px solid var(--border-lt); overflow: hidden; flex-shrink: 0;
  min-width: 0;
}
.nd-media-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px 12px; }
.nd-media-col + .nd-media-col { border-left: 1.5px solid var(--border-lt); }
.nd-thumbs-wrap { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; width: 100%; }
.nd-thumb { width: 44px; height: 44px; border-radius: 8px; position: relative; overflow: hidden; background: var(--green-bg); flex-shrink: 0; border: 1.5px solid var(--border-lt); }
.nd-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nd-thumb-video { width: 44px; height: 44px; border-radius: 8px; background: #0a1a14; flex-shrink: 0; display: flex; align-items: center; justify-content: center; position: relative; border: 1.5px solid #2a6b50; }
.nd-thumb-video .vt-play-sm { width: 18px; height: 18px; border-radius: 50%; background: rgba(255,255,255,.2); border: 1.5px solid rgba(255,255,255,.5); display: flex; align-items: center; justify-content: center; }
.nd-thumb .nd-remove, .nd-thumb-video .nd-remove { position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; border: none; cursor: pointer; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.nd-add-box {
  width: min(80px, 100%); height: 80px; border-radius: 14px;
  border: 2px dashed var(--green-light); background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; cursor: pointer; color: var(--green); transition: background .18s; flex-shrink: 0;
}
.nd-add-box:hover { background: var(--green-bg); }
.nd-add-box svg { opacity: .65; }
.nd-add-box span { font-size: 11px; font-weight: 700; color: var(--green-light); }
.nd-media-label { font-size: 11px; font-weight: 600; color: var(--txt-light); text-align: center; }

/* ══════════════════════════════════════════
   REDUCED MOTION
══════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ══════════════════════════════════════════
   MOBILE ≤ 639px
══════════════════════════════════════════ */
@media (max-width: 639px) {
  .hdr-top    { padding: 9px 12px; gap: 8px; }
  .toolbar    { padding: 6px 12px 8px; gap: 6px; }
  .sort-btn   { padding: 5px 11px; font-size: 10px; }
  .back-btn   { width: 32px; height: 32px; }
  .hdr-search input { font-size: 12px; padding: 8px 0; }

  .results-bar  { padding: 10px 12px 4px; }
  .results-count { font-size: 12px; }
  .results-sub   { font-size: 10px; }

  .catalog-grid { padding: 6px 12px 100px; gap: 10px; }

  .card-body  { padding: 7px 9px 6px; }
  .card-price { font-size: 11.5px; }
  .card-name  { font-size: 10px; -webkit-line-clamp: 1; }
  .card-loc   { font-size: 9px; }
  .card-specs { margin-top: 5px; padding-top: 5px; gap: 4px; }
  .card-spec  { font-size: 9px; gap: 2px; }
  .card-status { font-size: 8px; padding: 2px 6px; }
  .card-img-count { font-size: 8px; }

  .load-more-wrap { padding: 6px 12px 32px; }
  .load-more-btn  { font-size: 12px; padding: 11px 24px; }

  .modal-body  { padding: 14px 14px 20px; }
  .modal-price { font-size: 20px; }
  .modal-name  { font-size: 13px; }
  .modal-loc   { font-size: 12px; margin-bottom: 12px; }
  .modal-spec-val { font-size: 13px; }
  .modal-spec-key { font-size: 8px; }
  .modal-spec     { padding: 9px 4px; }
  .modal-info-item { padding: 7px 10px; gap: 7px; }
  .modal-info-icon { width: 24px; height: 24px; border-radius: 6px; }
  .modal-info-val   { font-size: 11px; }
  .modal-info-label { font-size: 8px; }
  .modal-cta-btn  { padding: 13px; font-size: 13px; }

  .fbody { padding: 10px 12px 6px; gap: 8px; }
  .fc { min-height: 50px; }
  .fc .fl { font-size: 11.5px; min-width: 70px; max-width: 100px; }
  .fc .fi, .fc .fsel { font-size: 12px; }
  .fc-sp { min-height: 52px; padding: 6px 12px; }
  .fc-sp .fl { font-size: 9px; }
  .fc-sp .si5 { font-size: 14px; }
  .ffoot { padding: 10px 12px env(safe-area-inset-bottom, 14px); gap: 8px; }
  .fbatal, .fsimpan { font-size: 13px; padding: 12px; }
  .fc-ta .fl { font-size: 11.5px; }
  .fc-ta textarea { font-size: 12px; min-height: 76px; }

  .fab-add {
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    height: 44px; padding: 0 18px 0 12px;
    max-width: calc(100vw - 32px);
  }
  .fab-label { font-size: 12px; }

  @media (max-width: 359px) {
    .catalog-grid { grid-template-columns: 1fr; }
    .hdr-top { padding: 8px 10px; }
  }
}
@media (max-width: 375px) {
  .hdr-search input { font-size: 11.5px; }
  .sort-btn { padding: 5px 9px; font-size: 9.5px; }
}

/* ══════════════════════════════════════════
   TABLET ≥ 640px
══════════════════════════════════════════ */
@media (min-width: 640px) {
  .catalog-grid { grid-template-columns: repeat(3,1fr); gap: 14px; padding: 10px 18px 32px; }
  .card-img-wrap { aspect-ratio: 4/3; }

  #form-overlay {
    align-items: center; justify-content: center;
    background: rgba(10,46,37,.55); backdrop-filter: blur(6px);
  }
  #form-overlay > .fwrap {
    border-radius: 20px; overflow: hidden;
    width: 100%; max-width: 520px;
    height: 90vh;           /* eksplisit agar fbody bisa scroll */
    max-height: 90vh;
    box-shadow: 0 24px 64px rgba(0,0,0,.25);
  }
  .fh { padding: 14px 20px; }
  .fbody { padding: 16px 20px 10px; }
  .ffoot { padding: 14px 20px; }

  .modal-overlay { align-items: center; justify-content: center; }
  .modal { border-radius: 20px !important; max-width: 520px; width: 92%; max-height: 90vh; animation: fadeIn .25s ease; }
  .modal-price { font-size: 26px; }
  .modal-name  { font-size: 16px; }
}

/* ══════════════════════════════════════════
   TABLET LANDSCAPE ≥ 768px
══════════════════════════════════════════ */
@media (min-width: 768px) {
  .hdr-top { padding: 12px 22px; gap: 14px; }
  .toolbar  { padding: 8px 22px 11px; }
  .catalog-grid { grid-template-columns: repeat(3,1fr); gap: 16px; padding: 12px 22px 36px; }
  .card-img-wrap { aspect-ratio: 4/3; }
  .results-bar { padding: 14px 22px 8px; }
  .load-more-wrap { padding: 10px 22px 40px; }
}

/* ══════════════════════════════════════════
   DESKTOP ≥ 1024px  —  FULL WIDTH
══════════════════════════════════════════ */
@media (min-width: 1024px) {
  /* Header full-width */
  .hdr-top {
    padding: 14px 40px;
    gap: 20px;
  }
  .toolbar {
    padding: 9px 40px 12px;
    overflow: visible;
    gap: 10px;
  }
  .sort-btn { padding: 7px 18px; font-size: 12px; }
  .view-btn  { width: 34px; height: 34px; }
  .back-btn  { width: 40px; height: 40px; }

  /* Brand tampil */
  .hdr-brand { display: flex; }

  /* Search: max-width agar tidak terlalu lebar */
  .hdr-search { max-width: 500px; }
  .hdr-search input { font-size: 14px; padding: 10px 0; }

  /* Results */
  .results-bar { padding: 18px 40px 12px; }
  .results-count { font-size: 15px; }
  .results-sub   { font-size: 12px; }
  .results-add-btn { display: flex; }

  /* Grid: 4 kolom, full-width padding */
  .catalog-grid {
    grid-template-columns: repeat(4,1fr);
    gap: 20px;
    padding: 16px 40px 52px;
  }
  .catalog-grid.list-view { grid-template-columns: 1fr; }
  .card-img-wrap { aspect-ratio: 3/2; }

  /* Card lebih besar */
  .card-body  { padding: 14px 16px 12px; }
  .card-price { font-size: 16px; }
  .card-name  { font-size: 12px; }
  .card-spec  { font-size: 11px; }
  .card-specs { gap: 12px; padding-top: 9px; margin-top: 9px; }

  /* List-view desktop */
  .catalog-grid.list-view .prop-card { flex-direction: row; max-height: 220px; }
  .catalog-grid.list-view .card-img-wrap { width: 300px; flex-shrink: 0; aspect-ratio: unset; height: 100% !important; max-height: 220px; }
  .catalog-grid.list-view .card-body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 18px 24px; }
  .catalog-grid.list-view .card-price { font-size: 22px; }
  .catalog-grid.list-view .card-name  { font-size: 14px; -webkit-line-clamp: 2; }
  .catalog-grid.list-view .card-loc   { font-size: 13px; }
  .catalog-grid.list-view .card-spec  { font-size: 13px; }
  .catalog-grid.list-view .card-actions { display: flex; padding: 0 24px 18px; }
  .catalog-grid.list-view .card-act-btn { font-size: 12px; padding: 10px; }

  .load-more-wrap { padding: 12px 40px 56px; }
  .load-more-btn  { font-size: 14px; max-width: 320px; }

  /* Modal — two-column */
  .modal-overlay { align-items: center; justify-content: center; }
  .modal {
    border-radius: 20px !important;
    max-width: 900px; width: 94%; max-height: 88vh;
    overflow: hidden;
    display: grid; grid-template-columns: 1fr 1fr;
    animation: fadeIn .25s ease;
  }
  .modal-img-wrap  { grid-column: 1; grid-row: 1; aspect-ratio: unset; height: 88vh; max-height: 88vh; border-radius: 0; }
  .modal-slide     { position: relative; align-items: stretch; }
  .modal-img       { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; max-width: unset; max-height: unset; }
  .modal-body      { grid-column: 2; grid-row: 1; overflow-y: auto; padding: 36px 30px 30px; max-height: 88vh; }
  .modal-price     { font-size: 28px; }
  .modal-name      { font-size: 17px; }
  .modal-spec-val  { font-size: 17px; }
  .modal-info-val  { font-size: 13px; }
  .modal-info-label { font-size: 10px; }
  .modal-cta-btn   { padding: 15px; font-size: 14px; }

  /* Form — modal centered */
  #form-overlay {
    align-items: center; justify-content: center;
    background: rgba(10,46,37,.55); backdrop-filter: blur(6px);
  }
  #form-overlay > .fwrap { border-radius: 20px; overflow: hidden; max-width: 580px; height: 92vh; max-height: 92vh; box-shadow: 0 24px 64px rgba(0,0,0,.3); }
  .fh { padding: 16px 24px; }
  .fbody { padding: 18px 24px 12px; gap: 10px; }
  .ffoot { padding: 16px 24px; }
  .fc { min-height: 62px; padding: 0 18px; }
  .fc-sp { min-height: 64px; padding: 8px 16px; }
  .fc .fl, .fc .fi, .fc .fsel { font-size: 14px; }
  .fc-sp .fl { font-size: 11px; }
  .fc-sp .si5 { font-size: 16px; }
  .fc-ta .fl { font-size: 14px; }
  .fc-ta textarea { font-size: 14px; min-height: 100px; }
  .ft { font-size: 15px; }

  /* FAB → hidden (pakai tombol di results bar) */
  .fab-add { display: none; }
}

/* ══════════════════════════════════════════
   LARGE DESKTOP ≥ 1400px
══════════════════════════════════════════ */
@media (min-width: 1400px) {
  .hdr-top  { padding: 16px 56px; }
  .toolbar  { padding: 9px 56px 13px; }
  .catalog-grid {
    grid-template-columns: repeat(5,1fr);
    gap: 22px;
    padding: 18px 56px 60px;
  }
  .results-bar    { padding: 20px 56px 12px; }
  .load-more-wrap { padding: 12px 56px 60px; }
  .hdr-search     { max-width: 560px; }
  .modal { max-width: 960px; }
}

/* ══════════════════════════════════════════
   EXTRA LARGE ≥ 1800px
══════════════════════════════════════════ */
@media (min-width: 1800px) {
  .hdr-top  { padding: 16px 80px; }
  .toolbar  { padding: 9px 80px 13px; }
  .catalog-grid {
    grid-template-columns: repeat(6,1fr);
    gap: 24px;
    padding: 20px 80px 64px;
  }
  .results-bar    { padding: 22px 80px 14px; }
  .load-more-wrap { padding: 12px 80px 64px; }
}

/* ── FLOATING WHATSAPP ── */
.wa-float {
  position: fixed; bottom: 80px; right: 20px; z-index: 999;
  width: 52px; height: 52px; border-radius: 50%;
  background: #25D366; color: white; border: none;
  box-shadow: 0 4px 16px rgba(37,211,102,0.45);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.wa-float:hover  { transform: scale(1.1); box-shadow: 0 6px 20px rgba(37,211,102,0.55); }
.wa-float:active { transform: scale(0.94); }
.wa-float svg { flex-shrink: 0; }

