/* =========================================================
   Nestaura | buy.css
   Standalone stylesheet for buy.html — no Tailwind dependency.
   ========================================================= */

:root {
  --teal: #004d40;
  --teal-dark: #00332b;
  --teal-soft: #e6efed;
  --brass: #a97c43;
  --brass-dark: #8c6435;
  --brass-soft: #f3e8d6;
  --cream: #f8f5ef;
  --white: #ffffff;
  --ink: #1f2a28;
  --gray-500: #6b7280;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --shadow-card: 0 2px 10px rgba(0,0,0,0.06);
  --shadow-modal: 0 -4px 24px rgba(0,0,0,0.15);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Raleway', sans-serif;
  background: var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

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

.pt-safe { padding-top: env(safe-area-inset-top); }
.pb-safe { padding-bottom: calc(0.9rem + env(safe-area-inset-bottom)); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn:active { transform: scale(0.98); }
.btn-teal { background: var(--teal); color: var(--white); }
.btn-teal:hover { background: var(--teal-dark); }
.btn-outline-teal { background: var(--white); color: var(--teal); border: 1.5px solid var(--teal); }
.btn-outline-teal:hover { background: var(--teal-soft); }
.btn-brass { background: var(--brass); color: var(--white); }
.btn-brass:hover { background: var(--brass-dark); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 0.8rem; }
.icon-btn {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 50%;
  color: var(--teal);
}

/* ---------- Responsive visibility utilities (used by the bottom tab bar) ---------- */
.desktop-only { display: none; }
.mobile-only { display: block; }

/* ---------- Site header (single responsive header, no duplicate desktop/mobile trees) ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--gray-100);
}
@media (min-width: 768px) { .site-header { padding: 14px 24px; gap: 20px; } }

.site-header .brand { display: flex; align-items: center; flex-shrink: 0; }
.site-header img.logo { height: 30px; }
@media (min-width: 768px) { .site-header img.logo { height: 40px; } }

.site-header .nav-links { display: none; gap: 22px; }
@media (min-width: 768px) { .site-header .nav-links { display: flex; } }
.site-header .nav-links a { color: var(--teal); font-weight: 600; white-space: nowrap; }
.site-header .nav-links a.active { background: var(--teal); color: #fff; padding: 6px 16px; border-radius: var(--radius-sm); font-weight: 700; }

.header-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.header-actions .tel { display: none; color: var(--teal); font-weight: 700; white-space: nowrap; }
@media (min-width: 768px) { .header-actions .tel { display: inline; } }

.list-link { font-size: 0.72rem; font-weight: 700; color: var(--teal); white-space: nowrap; }
@media (min-width: 768px) { .list-link { font-size: 0.9rem; } }

.login-btn { display: flex; align-items: center; }
.login-btn .login-label { display: none; background: var(--teal); color: #fff; padding: 6px 16px; border-radius: var(--radius-sm); font-weight: 700; }
@media (min-width: 768px) {
  .login-btn .login-label { display: inline-block; }
  .login-btn .login-icon { display: none; }
}

/* ---------- Main / filters ---------- */
main.page { max-width: 1100px; margin: 0 auto; padding: 20px 16px 24px; }
.page-title { font-size: 1.3rem; font-weight: 700; color: var(--teal); margin: 0 0 16px; }

.filters {
  display: flex; flex-wrap: wrap; gap: 10px;
  background: var(--white); padding: 14px; border-radius: var(--radius-md);
  box-shadow: var(--shadow-card); margin-bottom: 20px;
}
.filters input, .filters select {
  flex: 1 1 140px; min-width: 120px;
  border: 1px solid var(--gray-200); border-radius: var(--radius-sm);
  padding: 9px 12px; font-size: 0.88rem; background: var(--white); color: var(--ink);
}
.filters input:focus, .filters select:focus { outline: 2px solid var(--brass-soft); border-color: var(--brass); }

.status-msg { font-size: 0.85rem; color: var(--gray-500); margin-bottom: 10px; }

/* ---------- Property grid & cards ---------- */
.property-grid {
  display: grid; grid-template-columns: 1fr; gap: 20px;
}
@media (min-width: 640px) { .property-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .property-grid { grid-template-columns: 1fr 1fr 1fr; } }

.property-card {
  background: var(--white); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-card);
  position: relative; transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}
.property-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.1); }
.property-card .thumb-wrap { position: relative; }
.property-card img.thumb { width: 100%; height: 210px; object-fit: cover; background: var(--gray-100); }
.badge-verified {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: var(--teal); color: #fff; font-size: 0.62rem; font-weight: 700;
  padding: 5px 9px; border-radius: 20px; display: flex; align-items: center; gap: 4px;
  text-transform: uppercase; letter-spacing: 0.02em;
}
.card-body { padding: 14px 16px; }
.card-body h3 { margin: 0 0 6px; font-size: 1.02rem; color: var(--teal); font-weight: 700; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { background: var(--gray-100); color: var(--gray-500); font-size: 0.72rem; padding: 3px 9px; border-radius: 20px; }
.chip-brass { background: var(--brass-soft); color: var(--brass-dark); }
.card-desc { font-size: 0.85rem; color: var(--gray-500); margin: 0 0 8px; line-height: 1.4; }
.card-location { font-size: 0.78rem; color: var(--gray-500); margin: 0 0 6px; display: flex; align-items: center; gap: 4px; }
.card-price { font-size: 1.05rem; font-weight: 700; color: var(--ink); margin: 4px 0 0; }
.card-actions { display: flex; gap: 8px; padding: 0 16px 16px; }
.card-actions .btn { flex: 1; }

/* ---------- Skeleton loading ---------- */
.skeleton { background: linear-gradient(90deg,#eee 25%,#f5f5f5 37%,#eee 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.skel-card { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-card); background: var(--white); }
.skel-img { width: 100%; height: 210px; }
.skel-line { height: 12px; margin: 10px 16px; }

/* =========================================================
   Property detail overlay (full-screen "modal")
   ========================================================= */
.detail-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: var(--cream);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.28s ease, visibility 0s linear 0.28s;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.detail-overlay.open { transform: translateX(0); visibility: visible; transition: transform 0.28s ease; }

.detail-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; position: sticky; top: 0; z-index: 3;
  background: var(--cream);
}
.detail-topbar .brand { display: flex; flex-direction: column; align-items: center; }
.detail-topbar img.logo { height: 34px; }
.detail-topbar .right-actions { display: flex; gap: 10px; }

.hero-wrap { position: relative; padding: 0 16px; }
.hero-carousel { position: relative; border-radius: var(--radius-lg); overflow: hidden; }
.hero-slide { width: 100%; height: 300px; object-fit: cover; display: block; background: var(--gray-100); }
.hero-badge-verified {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  background: var(--teal); color: #fff; font-size: 0.72rem; font-weight: 700;
  padding: 6px 10px; border-radius: 20px; display: flex; align-items: center; gap: 5px;
}
.hero-photo-count {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  background: rgba(255,255,255,0.92); color: var(--ink); font-size: 0.72rem; font-weight: 700;
  padding: 6px 10px; border-radius: 20px; display: flex; align-items: center; gap: 5px;
}
.hero-price-overlay {
  position: absolute; bottom: 12px; left: 12px; z-index: 2;
  background: rgba(0,0,0,0.6); color: #fff; padding: 10px 14px; border-radius: var(--radius-md);
}
.hero-price-overlay .price { font-size: 1.15rem; font-weight: 700; }
.hero-price-overlay .status { color: #e8c98f; font-size: 0.8rem; font-weight: 600; }
.hero-nav-btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  background: rgba(255,255,255,0.85); border: none; border-radius: 50%;
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
}
.hero-nav-btn.prev { left: 10px; } .hero-nav-btn.next { right: 10px; }

.detail-tabs {
  display: flex; gap: 4px; overflow-x: auto; padding: 14px 16px 0;
  border-bottom: 1px solid var(--gray-200); scrollbar-width: none;
}
.detail-tabs::-webkit-scrollbar { display: none; }
.detail-tab {
  display: flex; align-items: center; gap: 5px; white-space: nowrap;
  padding: 8px 10px 12px; font-size: 0.82rem; color: var(--gray-500); font-weight: 600;
  border-bottom: 2px solid transparent; background: none; border-top: none; border-left: none; border-right: none;
}
.detail-tab.active { color: var(--teal); border-bottom-color: var(--teal); }

.detail-content { padding: 18px 16px 0; }
.detail-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.detail-title-row h1 { font-size: 1.25rem; color: var(--teal); font-weight: 700; margin: 0; max-width: 60%; }
.detail-title-row .asking { text-align: right; }
.detail-title-row .asking .label { font-size: 0.75rem; color: var(--gray-500); }
.detail-title-row .asking .value { font-size: 1.15rem; font-weight: 700; color: var(--teal); }

.location-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 0.85rem; color: var(--gray-500); }
.pill-status { background: var(--brass-soft); color: var(--brass-dark); padding: 3px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 700; }

.quick-facts {
  display: flex; flex-wrap: wrap; gap: 14px; margin: 16px 0;
  padding: 12px 0; border-top: 1px solid var(--gray-200); border-bottom: 1px solid var(--gray-200);
}
.fact-item { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--gray-500); }
.fact-item strong { color: var(--ink); font-weight: 600; }

.trust-band {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
  background: var(--brass-soft); border-radius: var(--radius-md);
  padding: 16px; margin-bottom: 20px;
}
@media (min-width: 500px) { .trust-band { grid-template-columns: repeat(4, 1fr); } }
.trust-item { display: flex; flex-direction: column; gap: 4px; }
.trust-item .icon-circle { color: var(--brass-dark); margin-bottom: 2px; }
.trust-item .t-title { font-size: 0.8rem; font-weight: 700; color: var(--ink); }
.trust-item .t-desc { font-size: 0.7rem; color: var(--gray-500); line-height: 1.3; }

.section-title { font-size: 1.05rem; font-weight: 700; color: var(--teal); margin: 0 0 8px; }
.about-text { font-size: 0.88rem; color: var(--gray-500); line-height: 1.6; margin: 0; }
.about-text.clamped { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.read-more-btn { background: none; border: none; color: var(--teal); font-weight: 600; font-size: 0.85rem; padding: 4px 0; }

.features-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px; }
@media (min-width: 500px) { .features-grid { grid-template-columns: repeat(3, 1fr); } }
.feature-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--gray-100); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 0.8rem; color: var(--ink); font-weight: 500;
}
.feature-chip svg { color: var(--gray-500); flex-shrink: 0; }

.map-tab-content { padding: 4px 0 20px; }
.map-locked {
  background: var(--gray-100); border-radius: var(--radius-md); padding: 30px 16px;
  text-align: center; color: var(--gray-500); font-size: 0.85rem;
}
.map-embed { width: 100%; height: 260px; border: 0; border-radius: var(--radius-md); }

.sticky-bar {
  position: sticky; bottom: 0; background: var(--white);
  border-radius: var(--radius-md); box-shadow: var(--shadow-card);
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; margin: 8px 0 12px; gap: 12px;
}
.sticky-bar .price-block .label { font-size: 0.75rem; color: var(--gray-500); }
.sticky-bar .price-block .value { font-size: 1.1rem; font-weight: 700; color: var(--teal); }
.sticky-bar .btn { flex-direction: column; align-items: flex-start; gap: 0; padding: 10px 18px; }
.sticky-bar .btn .sub { font-size: 0.68rem; font-weight: 400; opacity: 0.85; }
.sticky-bar .btn .main-line { display: flex; align-items: center; gap: 6px; }

.visit-card {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--brass-soft); border-radius: var(--radius-md);
  padding: 12px 14px; margin-bottom: 12px; flex-wrap: wrap;
}
.visit-card .left { display: flex; align-items: center; gap: 10px; }
.visit-card .icon-circle-teal {
  width: 36px; height: 36px; border-radius: 50%; background: var(--teal);
  color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.visit-card .t-title { font-size: 0.85rem; font-weight: 700; color: var(--ink); }
.visit-card .t-desc { font-size: 0.72rem; color: var(--gray-500); }
.visit-card .btn-outline-teal { padding: 8px 14px; font-size: 0.8rem; }

.bottom-actions { display: flex; gap: 10px; margin-bottom: 28px; }
.bottom-actions .btn { flex: 1; }

/* ---------- Unlock & visit modals (bottom sheet) ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,0.5);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  background: var(--white); border-radius: 20px 20px 0 0;
  padding: 22px 20px calc(20px + env(safe-area-inset-bottom));
  width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto; position: relative;
}
@media (min-width: 640px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 16px; } }
.sheet-close { position: absolute; top: 12px; right: 16px; background: none; border: none; font-size: 1.6rem; line-height: 1; color: var(--gray-500); }
.sheet h2 { color: var(--teal); font-size: 1.1rem; margin: 0 0 4px; }
.sheet .sub { font-size: 0.82rem; color: var(--gray-500); margin: 0 0 16px; }

.tier-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.tier-card {
  border: 2px solid var(--gray-200); border-radius: var(--radius-md);
  padding: 12px; text-align: left; background: var(--white);
}
.tier-card.selected { border-color: var(--brass); background: var(--brass-soft); }
.tier-card .tier-label { font-size: 0.72rem; color: var(--gray-500); }
.tier-card .tier-price { font-size: 1.1rem; font-weight: 700; color: var(--teal); }
.tier-card .tier-desc { font-size: 0.7rem; color: var(--gray-500); margin-top: 4px; }

.info-box { background: var(--brass-soft); border-radius: var(--radius-md); padding: 12px; font-size: 0.75rem; color: var(--gray-500); margin-bottom: 16px; }

.form-field { width: 100%; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 0.88rem; margin-bottom: 10px; }
.trust-row { display: flex; justify-content: center; gap: 16px; margin-top: 14px; font-size: 0.7rem; color: var(--gray-300); }

.result-row { font-size: 0.88rem; margin-bottom: 8px; }
.result-row .k { color: var(--gray-500); }
.wa-btn { display: inline-flex; align-items: center; gap: 6px; background: #25d366; color: #fff; font-size: 0.75rem; padding: 7px 12px; border-radius: var(--radius-sm); margin-top: 4px; }

/* ---------- Bottom tab bar ---------- */
.bottom-tabbar {
  display: flex; justify-content: space-around; align-items: center;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--white); border-top: 1px solid var(--gray-200);
  padding-top: 8px;
}
.tab-item { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 0.66rem; color: var(--gray-500); }
.tab-item.active { color: var(--teal); font-weight: 700; }

@media (max-width: 767px) { main.page { padding-bottom: 90px; } }

/* ---------- Desktop overrides ---------- */
@media (min-width: 768px) {
  .desktop-only { display: flex; }
  .mobile-only { display: none; }
  .bottom-tabbar { display: none; }

  .detail-overlay {
    display: flex; align-items: flex-start; justify-content: center;
    background: rgba(0,0,0,0.4); padding: 40px 20px;
    transform: none; visibility: visible; opacity: 0; pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .detail-overlay.open { opacity: 1; pointer-events: auto; }
  .detail-overlay .detail-panel {
    background: var(--cream); width: 100%; max-width: 880px; border-radius: var(--radius-lg);
    max-height: 92vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  }
  .detail-topbar { position: static; }
  .hero-slide { height: 380px; }
}
