:root {
  --gold: #F5A623;
  --dark: #1a1a1a;
  --rent-color: #7F77DD;
  --sale-color: #D85A30;
  --text-secondary: #6b6b68;
  --border: #e6e4dc;
  --radius: 12px;
  --max-width: 480px;
}

* { box-sizing: border-box; }

.icon-svg {
  display: inline-block;
  vertical-align: -0.15em;
  flex-shrink: 0;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: #f4f3ee;
  color: #222;
}

.app-shell {
  max-width: var(--max-width);
  margin: 0 auto;
  background: #fff;
  min-height: 100vh;
  position: relative;
  padding-bottom: 70px; /* space for bottom nav */
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ---------- Top nav ---------- */
.top-nav {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  z-index: 5;
}
.top-nav .logo { display:flex; align-items:center; gap:8px; }
.top-nav .logo img { height: 60px; width: auto; }
.top-nav .logo-text { font-weight: 700; font-size: 18px; color: var(--gold); }
.top-nav .actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px; border: none; cursor: pointer;
}
.icon-btn.white-bg { background: #fff; color: #25D366; }

/* ---------- Top nav: SOLID white variant for pages without a hero (everything except homepage) ---------- */
.top-nav.solid {
  position: fixed;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-width);
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  z-index: 50;
}
.top-nav.solid .logo-text { color: var(--dark); }
.top-nav.solid .desktop-menu a { color: #333; }
.top-nav.solid .desktop-menu a.active,
.top-nav.solid .desktop-menu a:hover { color: var(--gold); }
.top-nav.solid .icon-btn {
  background: #f2f1ec;
  color: #222;
}
.top-nav.solid .icon-btn.white-bg {
  background: #fff;
  color: #25D366;
  border: 1px solid var(--border);
  box-shadow: 0 1px 5px rgba(0,0,0,0.1);
}

/* Reserve space at the top of the page so content doesn't hide under the fixed nav */
body.has-fixed-nav .app-shell { padding-top: 68px; }

/* Desktop nav menu - hidden on mobile, shown at >=992px */
.desktop-menu { display: none; }
.nav-item-wrap { position: relative; }
.dropdown-menu {
  display: none;
  position: absolute; top: 100%; left: 0; margin-top: 14px;
  background: #fff; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  min-width: 200px; padding: 6px 0; z-index: 30;
}
.dropdown-menu a {
  display: block; padding: 10px 16px; color: #222 !important;
  font-size: 13px; border-bottom: none !important;
}
.dropdown-menu a:hover { background: #f7f5ef; color: var(--gold) !important; }
.nav-item-wrap.has-dropdown:hover .dropdown-menu { display: block; }
.phone-pill {
  display: none;
  align-items: center; gap: 8px;
  border: 1px solid var(--gold); color: var(--gold);
  padding: 8px 18px; border-radius: 30px; font-weight: 700; font-size: 14px;
  white-space: nowrap;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  color: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero video, .hero .hero-fallback-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.45) 100%);
  z-index: 1;
}
.hero-content { position: relative; z-index: 2; padding: 20px 20px 0; }
.hero-content h1, .hero-content p { text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.hero-content h1 { font-size: 30px; margin: 0; line-height: 1.15; font-weight: 800; }
.hero-content h1 .accent { color: var(--gold); display: block; }
.hero-content p { font-size: 14px; color: #eee; line-height: 1.6; margin: 14px 0 0; }
.btn-explore {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 18px; background: var(--gold); color: #222;
  padding: 12px 20px; border-radius: 8px; font-weight: 700;
  font-size: 14px; border: none; cursor: pointer;
}

/* ---------- Stats bar ---------- */
.stats-bar {
  margin: -167px 16px 0;
  position: relative;
  z-index: 3;
  background: rgba(20,20,20,0.94);
  border: 1px solid var(--gold);
  border-radius: 10px;
  padding: 18px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px 10px;
  color: #fff;
}
.whatsapp-float {
  position: fixed;
  right: 16px;
  bottom: 82px; /* sits just above the bottom nav */
  width: 50px; height: 50px;
  background: #25D366;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 26px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
  z-index: 25;
}
.stat-item .stat-value { color: var(--gold); font-weight: 800; font-size: 18px; }
.stat-item .stat-label { font-size: 10.5px; color: #ddd; line-height: 1.3; margin-top: 2px;}
.stat-item {
  position: relative;
}
.stat-item:not(:nth-child(3n)) {
  border-right: 1px solid rgba(245,166,35,0.35);
}

/* ---------- Rent/Sale cards ---------- */
.rent-sale-grid {
  padding: 40px 16px 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.rs-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: #fff;
}
.rs-card .rs-title { font-weight: 700; font-size: 16px; }
.rs-card .rs-sub { font-size: 12px; color: var(--text-secondary); margin: 4px 0 14px; }
.rs-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px;
}
.rs-icon.rent { background: var(--rent-color); }
.rs-icon.sale { background: var(--sale-color); }

/* ---------- Section header ---------- */
.section { padding: 18px 16px 4px; }
.section-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.section-header h2 { font-size: 17px; margin: 0; font-weight: 700; }
.section-header .view-all { font-size: 13px; color: var(--rent-color); font-weight: 600; }

/* ---------- Categories ---------- */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  text-align: center;
}
.cat-item .cat-icon {
  width: 52px; height: 52px; border-radius: 12px;
  background: #f2f1ec; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 6px; font-size: 22px; color: #333;
}
.cat-item .cat-label { font-size: 12px; color: #333; }

/* ---------- Property cards ---------- */
.property-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
  background: #fff;
}
.property-card .thumb-wrap { position: relative; }
.property-card .thumb-wrap img { width: 100%; height: 160px; object-fit: cover; }
.badge-type {
  position: absolute; top: 10px; left: 10px;
  font-size: 11px; font-weight: 700; color: #fff;
  padding: 4px 10px; border-radius: 5px;
}
.badge-type.sale { background: #2e8b57; }
.badge-type.rent { background: var(--rent-color); }
.badge-video {
  position: absolute; bottom: 10px; right: 10px;
  background: rgba(0,0,0,0.65); color: #fff; font-size: 11px;
  padding: 4px 8px; border-radius: 5px; display:flex; align-items:center; gap:4px;
}
.fav-btn {
  position: absolute; top: 10px; right: 10px;
  width: 30px; height: 30px; border-radius: 50%; background: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  border: none; color: #333;
}
.fav-btn.active { color: #D85A30; }
.property-card .info { padding: 12px 14px; }
.property-card .price { font-weight: 800; font-size: 16px; }
.property-card .price .unit { font-weight: 500; font-size: 12px; color: var(--text-secondary); }
.property-card .meta { font-size: 13px; color: #444; margin: 3px 0; }
.property-card .location { font-size: 12px; color: var(--text-secondary); display:flex; align-items:center; gap:4px; }

.property-list-grid { display: block; }

/* ---------- Filter chips ---------- */
.filter-bar {
  display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px;
  -webkit-overflow-scrolling: touch;
}
.filter-bar::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 8px 16px; border-radius: 20px;
  border: 1px solid var(--border); font-size: 13px; background: #fff; color: #333;
}
.chip.active { background: var(--dark); color: #fff; border-color: var(--dark); }

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 50%;
  width: 100%; max-width: var(--max-width);
  background: #fff; border-top: 1px solid var(--border);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 10px 0 8px; z-index: 20;
  transform: translate(-50%, 100%);
  transition: transform 0.35s ease;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
}
.bottom-nav.visible {
  transform: translate(-50%, 0);
}
.nav-item {
  text-align: center; font-size: 15px; color: #888;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.nav-item .icon-svg { font-size: 20px; }
.nav-item.active { color: var(--rent-color); }
.nav-item.post .post-circle {
  width: 34px; height: 34px; border-radius: 50%; background: var(--rent-color);
  color: #fff; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 2px; font-size: 18px;
}

/* ---------- Detail page ---------- */
.detail-gallery img, .detail-gallery iframe { width: 100%; height: 260px; object-fit: cover; border: 0; }
.detail-gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
.detail-gallery > div { flex: 0 0 100%; scroll-snap-align: start; }
.detail-body { padding: 16px; }
.detail-body h1 { font-size: 20px; margin: 0 0 6px; }
.detail-body .price-row { font-size: 22px; font-weight: 800; color: var(--dark); margin-bottom: 10px; }
.detail-body .desc { font-size: 14px; line-height: 1.7; color: #333; margin-top: 14px; }
.contact-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--max-width);
  display: flex; gap: 10px; padding: 10px 16px; background: #fff;
  border-top: 1px solid var(--border); z-index: 20;
}
.contact-bar a {
  flex: 1; text-align: center; padding: 12px; border-radius: 8px;
  font-weight: 700; font-size: 14px;
}
.contact-bar .call { background: var(--dark); color: #fff; }
.contact-bar .whatsapp { background: #25D366; color: #fff; }

/* ---------- Forms (admin + inquiry) ---------- */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; font-family: inherit;
}
.btn {
  display: inline-block; padding: 12px 20px; border-radius: 8px;
  font-weight: 700; font-size: 14px; border: none; cursor: pointer; text-align:center;
}
.btn-primary { background: var(--dark); color: #fff; }
.btn-gold { background: var(--gold); color: #222; }

/* ---------- Admin ---------- */
.admin-wrap { max-width: 900px; margin: 0 auto; padding: 20px; font-family: -apple-system, sans-serif; }
.admin-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 20px; margin-bottom: 16px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { text-align: left; padding: 10px; border-bottom: 1px solid var(--border); }
.admin-nav { display: flex; gap: 16px; padding: 14px 20px; background: var(--dark); color: #fff; flex-wrap: wrap; }
.admin-nav a { color: #ddd; font-size: 14px; }
.admin-nav a.active { color: var(--gold); font-weight: 700; }
.status-badge { padding: 3px 10px; border-radius: 5px; font-size: 12px; color: #fff; }
.status-active { background: #2e8b57; }
.status-sold, .status-rented { background: #999; }
.status-inactive { background: #c0392b; }

/* ============================================================
   DESKTOP / LAPTOP VIEW (>= 992px)
   Full-width horizontal nav bar layout (matches "Image 2" ref)
   ============================================================ */
@media (min-width: 992px) {

  .app-shell {
    max-width: 100%;
  }

  /* Top nav becomes a full horizontal bar with menu + phone pill */
  .top-nav {
    padding: 20px 48px;
  }
  .top-nav.solid {
    max-width: 100%;
    left: 0;
    transform: none;
  }
  body.has-fixed-nav .app-shell { padding-top: 84px; }
  .desktop-menu {
    display: flex;
    gap: 28px;
  }
  .desktop-menu a {
    font-size: 14px;
    color: #fff;
    font-weight: 500;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
  }
  .desktop-menu a.active,
  .desktop-menu a:hover {
    color: var(--gold);
    border-bottom-color: var(--gold);
  }
  .phone-pill { display: inline-flex; }
  .mobile-only { display: none !important; }

  /* Hero takes full viewport width, text block constrained for readability */
  .hero-content {
    max-width: 640px;
    padding: 0 48px 60px;
  }
  .hero-content h1 { font-size: 44px; }
  .hero-content p { font-size: 16px; max-width: 560px; }

  /* Stats bar - single row of 6 instead of 3x2 */
  .stats-bar {
    margin: -140px 48px 0;
    grid-template-columns: repeat(6, 1fr);
    padding: 26px 30px;
    gap: 10px;
  }
  .stat-item .stat-value { font-size: 22px; }
  .stat-item .stat-label { font-size: 12px; }
  .stat-item { border-right: 1px solid rgba(245,166,35,0.35); padding-right: 10px; }
  .stat-item:last-child { border-right: none; }

  /* Give inner sections breathing room + wider grids */
  .rent-sale-grid { padding: 56px 48px 8px; gap: 20px; max-width: 1200px; margin: 0 auto; }
  .section { padding: 28px 48px 8px; max-width: 1200px; margin: 0 auto; }

  .categories-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
  }
  .cat-item .cat-icon { width: 64px; height: 64px; font-size: 26px; }

  /* Property cards - multi-column grid on desktop */
  .property-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }
  .property-card { margin-bottom: 0; }
  .property-card .thumb-wrap img { height: 190px; }

  /* Filter chips row gets the same max-width container */
  .filter-bar { padding: 16px 48px; max-width: 1200px; margin: 0 auto; }

  /* Bottom mobile nav + whatsapp float repositioned/hidden - desktop uses top nav instead */
  .bottom-nav { display: none; }
  .whatsapp-float { bottom: 24px; right: 24px; }
  .contact-bar { display: none; } /* desktop shows phone pill in top nav instead */

  /* Detail page gets a comfortable reading width */
  .detail-body { max-width: 900px; margin: 0 auto; padding: 24px 48px; }
  .detail-gallery img, .detail-gallery iframe { height: 420px; }
  .detail-gallery > div { flex: 0 0 70%; }

  /* Gallery + About Us pages */
  .section div[style*="grid-template-columns:repeat(2,1fr)"] { grid-template-columns: repeat(4, 1fr) !important; }
}

/* ============================================================
   MOBILE RIGHT-SIDE DRAWER MENU (hamburger)
   ============================================================ */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 90;
}
.drawer-overlay.open { opacity: 1; visibility: visible; }

.mobile-drawer {
  position: fixed;
  top: 0; right: 0;
  height: 100%;
  width: 78%;
  max-width: 320px;
  background: #fff;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 95;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
}
.mobile-drawer.open { transform: translateX(0); }

.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 16px;
  background: var(--dark);
  color: #fff;
}
.drawer-close {
  background: rgba(255,255,255,0.15); border: none; color: #fff;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.drawer-menu {
  flex: 1;
  overflow-y: auto;
  display: flex; flex-direction: column;
  padding: 10px 0;
}
.drawer-menu a {
  display: block;
  padding: 14px 20px;
  font-size: 15px; font-weight: 600; color: #222;
  border-bottom: 1px solid var(--border);
}
.drawer-menu a.drawer-submenu {
  padding-left: 36px;
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
}
.drawer-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

/* Drawer only needed on mobile - hide entirely on desktop */
@media (min-width: 992px) {
  .drawer-overlay, .mobile-drawer { display: none; }
}

/* ============================================================
   Animated search bar (properties/search page)
   ============================================================ */
.search-hero-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--rent-color);
  border-radius: 12px;
  padding: 14px 16px;
  color: #fff;
}
.search-hero-bar .icon-svg { font-size: 18px; flex-shrink: 0; color: #fff; }
.search-hero-bar input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  color: #fff;
  font-size: 14px;
}
.search-hero-bar input::placeholder { color: rgba(255,255,255,0.85); }

/* ============================================================
   Drawer "Connect with us" social section
   ============================================================ */
.drawer-social {
  padding: 16px;
  border-top: 1px solid var(--border);
}
.drawer-social-title {
  font-size: 13px; font-weight: 700; color: #333;
  margin-bottom: 12px;
}
.drawer-social-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.social-item {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  font-size: 10px; color: #555; font-weight: 500;
}
.social-badge {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
