/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans HK', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #000328;
  background: #fff;
  line-height: 1.6;
  font-size: 15px;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
img { max-width: 100%; display: block; }
select { font-family: inherit; }

/* ===== LAYOUT ===== */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.section { padding: 48px 0; }
.section.bg-light { background: #f7f8fc; }

/* ===== NAVBAR ===== */
.navbar {
  position: sticky; top: 0; z-index: 49;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid #f0f0f4;
}
.nav-inner { display: flex; align-items: center; height: 92px; gap: 40px; }
.logo { display: flex; align-items: center; gap: 5px; font-weight: 700; font-size: 20px; color: #00002a; letter-spacing: -0.3px; }
.logo-img { height: 48px; width: auto; display: block; }
.logo-text { background: linear-gradient(90deg, #44b5f5, #716ce5); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; font-size: 22px; font-weight: 800; }
.logo-sub { font-size: 14px; color: #30bced; font-weight: 600; -webkit-text-fill-color: #30bced; }
.nav-links { display: flex; gap: 32px; margin-left: auto; }
.nav-links a { font-size: 15px; font-weight: 500; color: #00002a; transition: all .2s; position: relative; padding: 4px 0; }
.nav-links a:hover { background: linear-gradient(90deg, #44b5f5, #716ce5); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.nav-links a.active { background: linear-gradient(90deg, #44b5f5, #716ce5); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; font-weight: 700; }
.nav-btn-cs { font-size: 15px; font-weight: 500; color: #00002a; background: none; border: none; cursor: pointer; padding: 4px 0; transition: all .2s; line-height: 1; }
.nav-btn-cs:hover { background: linear-gradient(90deg, #44b5f5, #716ce5); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
/* mobile auth row — hidden on desktop, shown inside mobile menu */
.nav-links .mobile-auth { display: none; }
.btn-ghost { padding: 8px 18px; border-radius: 20px; font-size: 14px; font-weight: 500; color: #00002a; border: 1.5px solid #e0e0e8; transition: all .2s; background: #fff; }
.btn-ghost:hover { background: #f2f2f5; border-color: #c8c8d8; }
.btn-primary { padding: 8px 22px; border-radius: 20px; font-size: 14px; font-weight: 600; background: #00002a; color: #fff; transition: all .2s; }
.btn-primary:hover { background: #00005a; transform: translateY(-1px); }
.hamburger { display: none; flex-direction: column; gap: 5px; padding: 4px; margin-left: auto; }
.hamburger span { display: block; width: 22px; height: 2px; background: #000328; border-radius: 2px; }

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: 414px;
  background: #000010;
  overflow: hidden;
  display: flex;
  align-items: center;
}
.hero-bg-img {
  position: absolute; inset: 0;
  background: url('https://images.unsplash.com/photo-1536431311719-398b6704d4cc?auto=format&fit=crop&w=1600&q=80') center/cover no-repeat;
  filter: blur(3px) brightness(0.75);
  transform: scale(1.05);
}
.hero-overlay { position: absolute; inset: 0; background: rgba(0,0,10,0.55); }
.hero-content { position: relative; z-index: 2; padding: 60px 0 80px; width: 100%; }
.hero-title { font-size: 32px; font-weight: 700; font-style: italic; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,0.3); margin-bottom: 8px; line-height: 1.25; }
.hero-sub { font-size: 15px; color: rgba(255,255,255,0.8); margin-bottom: 32px; }

/* SEARCH BOX — floats below hero */
.search-wrap { position: relative; z-index: 3; margin-top: -56px; }
.search-box {
  background: #fff;
  border-radius: 16px;
  padding: 20px 24px 24px;
  box-shadow: 0 12px 24px rgba(0,0,90,0.1);
  max-width: 900px;
}
.search-tabs { display: flex; gap: 4px; margin-bottom: 16px; background: #f2f2f5; border-radius: 10px; padding: 4px; width: fit-content; }
.tab { padding: 8px 28px; border-radius: 8px; font-size: 14px; font-weight: 700; color: #7f8094; transition: all .2s; }
.tab.active { background: #00002a; color: #fff; }
.search-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.search-field { flex: 1; min-width: 150px; }
.search-field label { display: block; font-size: 11px; font-weight: 700; color: #b0b0c0; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.6px; }
.search-field select {
  width: 100%; padding: 11px 14px;
  background: #f2f2f5; border: none; border-radius: 8px;
  font-size: 14px; color: #000328; font-weight: 500;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237f8094'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  cursor: pointer; transition: background .2s;
}
.search-field select:focus { outline: none; background-color: #e8e8f0; }
.btn-search {
  padding: 11px 32px;
  background: linear-gradient(90deg, #44b5f5, #716ce5);
  color: #fff; border-radius: 8px;
  font-size: 15px; font-weight: 700;
  white-space: nowrap; transition: all .2s;
  box-shadow: 0 2px 8px rgba(113,108,229,0.3);
}
.btn-search:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-search:active { transform: scale(0.97); }

.hero-stats { display: flex; gap: 40px; margin-top: 40px; }
.stat { display: flex; flex-direction: column; }
.stat-num { font-size: 26px; font-weight: 700; color: #fff; }
.stat-label { font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 2px; }

/* ===== SECTION HEADER ===== */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-title { font-size: 22px; font-weight: 700; color: #00005a; }
.see-all { font-size: 13px; font-weight: 600; color: #30bced; transition: opacity .2s; }
.see-all:hover { opacity: 0.7; }

/* ===== PROPERTY GRID ===== */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }

/* ===== PROPERTY CARD ===== */
.property-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all .3s;
  display: flex;
  flex-direction: column;
}
.property-card:hover {
  box-shadow: 0 12px 24px rgba(0,0,90,0.1);
  transform: translateY(-2px);
}
.card-img {
  width: 100%;
  aspect-ratio: 4/3;
  background-size: cover;
  background-position: center;
  background-color: #f2f2f5;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}
.card-badge {
  position: absolute; top: 10px; left: 10px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}
.card-badge-buy { background: rgba(0,0,42,0.85); color: #fff; }
.card-badge-rent { background: rgba(48,188,237,0.9); color: #fff; }
.card-body { padding: 10px 4px 4px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.card-price { font-size: 22px; font-weight: 700; color: #00005a; }
.card-title { font-size: 14px; font-weight: 700; color: #000328; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-en { font-weight: 400; color: #7f8094; font-size: 12px; }
.card-meta-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.card-pill {
  display: inline-block; font-size: 12px; font-weight: 400;
  color: #000328; padding: 2px 8px; border-radius: 2px;
  background: #f2f2f5;
}
.card-pill-region { background: #cbeefb; }
.card-region { font-size: 12px; color: #7f8094; margin-top: 2px; }
.card-feature { font-size: 12px; color: #7f8094; margin-top: 4px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-ref { font-size: 11px; color: #c8c8d8; margin-top: 4px; }

/* ===== FEATURED ESTATE CARD ===== */
.estate-card-big {
  display: flex; border-radius: 16px; overflow: hidden;
  cursor: pointer; transition: all .3s;
  box-shadow: 0 4px 16px rgba(0,0,90,0.08);
}
.estate-card-big:hover { box-shadow: 0 12px 32px rgba(0,0,90,0.14); transform: translateY(-2px); }
.estate-big-img { width: 46%; min-height: 300px; background-size: cover; background-position: center; background-color: #f2f2f5; flex-shrink: 0; }
.estate-big-info { padding: 28px 32px; flex: 1; background: #fff; }
.estate-big-tag { display: inline-block; background: #cbeefb; color: #000328; font-size: 12px; font-weight: 600; padding: 3px 12px; border-radius: 20px; margin-bottom: 10px; }
.estate-big-info h3 { font-size: 24px; font-weight: 700; color: #00005a; margin-bottom: 4px; }
.estate-meta-row { display: flex; flex-wrap: wrap; gap: 16px; margin: 12px 0; font-size: 13px; color: #7f8094; }
.score-row { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.score-item { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #7f8094; }
.score-bar { flex: 1; height: 4px; background: #f2f2f5; border-radius: 2px; max-width: 180px; }
.score-fill { height: 100%; background: linear-gradient(90deg, #44b5f5, #716ce5); border-radius: 2px; }
.tag { display: inline-block; background: #f2f2f5; color: #000328; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 20px; margin-right: 6px; margin-bottom: 4px; }

/* ===== PAGE HEADER ===== */
.page-header { background: #00002a; color: #fff; padding: 36px 0 28px; }
.page-header h1 { font-size: 28px; font-weight: 700; }
.page-header p { font-size: 14px; color: rgba(255,255,255,0.6); margin-top: 4px; }

/* ===== FILTER BAR ===== */
.filter-bar {
  background: #fff; border-bottom: 1px solid #f0f0f4;
  padding: 14px 0;
  position: sticky; top: 92px; z-index: 30;
}
.filter-inner { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-group label { font-size: 11px; font-weight: 700; color: #b0b0c0; text-transform: uppercase; letter-spacing: 0.5px; }
.filter-group select {
  padding: 9px 32px 9px 12px; background: #f2f2f5;
  border: none; border-radius: 8px; font-size: 13px;
  color: #000328; font-weight: 500; min-width: 130px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237f8094'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  cursor: pointer; transition: background .2s;
}
.filter-group select:focus { outline: none; background-color: #e8e8f0; }
.btn-reset { padding: 9px 16px; background: #f2f2f5; border-radius: 8px; font-size: 13px; font-weight: 500; color: #7f8094; transition: all .2s; }
.btn-reset:hover { background: #e8e8f0; color: #000328; }

/* RESULTS */
.results-header { margin-bottom: 14px; }
.result-count { font-size: 14px; color: #7f8094; }
.no-results { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 60px; color: #b0b0c0; text-align: center; }

/* ===== ESTATE DETAIL ===== */
.estate-gallery { display: grid; grid-template-columns: 1fr 280px; height: 420px; gap: 3px; background: #000; }
.gallery-main-wrap { overflow: hidden; }
.gallery-main { width: 100%; height: 100%; background-size: cover; background-position: center; background-color: #1a1a2e; }
.gallery-thumbs { display: grid; grid-template-rows: repeat(4, 1fr); gap: 3px; }
.gallery-thumb { position: relative; cursor: pointer; overflow: hidden; }
.gallery-thumb > div { width: 100%; height: 100%; background-size: cover; background-position: center; background-color: #1a1a2e; transition: transform .3s; }
.gallery-thumb:hover > div { transform: scale(1.05); }
.gallery-more { position: relative; }
.gallery-more span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.5); color: #fff; font-size: 18px; font-weight: 700; }

.estate-layout { display: grid; grid-template-columns: 1fr 340px; gap: 32px; padding-top: 28px; padding-bottom: 60px; align-items: start; }
.estate-main { min-width: 0; }
.estate-title-block { margin-bottom: 20px; }
.breadcrumb { font-size: 12px; color: #b0b0c0; margin-bottom: 8px; }
.estate-title-block h1 { font-size: 26px; font-weight: 700; color: #00005a; }

/* TABS */
.tabs { display: flex; gap: 0; border-bottom: 1.5px solid #f2f2f5; margin-bottom: 20px; }
.tab-btn { padding: 10px 18px; font-size: 14px; font-weight: 600; color: #b0b0c0; border-bottom: 2px solid transparent; margin-bottom: -1.5px; transition: all .2s; }
.tab-btn:hover { color: #000328; }
.tab-btn.active { color: #00005a; border-bottom-color: #30bced; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* SUB TABS */
.sub-tabs { display: flex; gap: 4px; background: #f2f2f5; border-radius: 8px; padding: 3px; width: fit-content; }
.sub-tab { padding: 6px 18px; border-radius: 6px; font-size: 13px; font-weight: 600; color: #7f8094; transition: all .2s; }
.sub-tab.active { background: #fff; color: #00002a; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }

/* INFO GRID */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid #f0f0f4; border-radius: 10px; overflow: hidden; }
.info-item { padding: 11px 16px; border-bottom: 1px solid #f0f0f4; border-right: 1px solid #f0f0f4; }
.info-item:nth-child(2n) { border-right: none; }
.info-item:nth-last-child(-n+2) { border-bottom: none; }
.info-label { display: block; font-size: 11px; color: #b0b0c0; margin-bottom: 2px; font-weight: 500; }
.info-value { font-size: 14px; font-weight: 600; color: #000328; }

/* SCORE */
.score-hero { text-align: center; padding: 28px; background: #00002a; border-radius: 12px; color: #fff; margin-bottom: 20px; }
.score-big { font-size: 56px; font-weight: 700; background: linear-gradient(90deg, #44b5f5, #716ce5); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; line-height: 1; }
.score-big-label { font-size: 14px; color: rgba(255,255,255,0.6); margin-top: 6px; }
.score-list { display: flex; flex-direction: column; gap: 14px; }
.score-row-item { display: flex; align-items: center; gap: 12px; }
.score-icon { font-size: 16px; width: 24px; text-align: center; display: none; }
.score-label { width: 72px; font-size: 13px; color: #7f8094; font-weight: 500; }
.score-bar-wide { flex: 1; height: 6px; background: #f2f2f5; border-radius: 3px; }
.score-fill-wide { height: 100%; background: linear-gradient(90deg, #44b5f5, #716ce5); border-radius: 3px; }
.score-num { width: 32px; text-align: right; font-size: 13px; font-weight: 700; color: #000328; }

/* FAQ */
.faq-list { border: 1px solid #f0f0f4; border-radius: 10px; overflow: hidden; }
.faq-item { border-bottom: 1px solid #f0f0f4; }
.faq-item:last-child { border-bottom: none; }
.faq-q { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; cursor: pointer; font-size: 14px; font-weight: 600; color: #000328; transition: background .2s; gap: 12px; }
.faq-q:hover { background: #f7f8fc; }
.faq-arrow { color: #30bced; font-size: 11px; flex-shrink: 0; transition: transform .2s; }
.faq-a { padding: 0 18px 14px; font-size: 13px; color: #7f8094; line-height: 1.7; }

/* SIDEBAR */
.estate-sidebar { position: sticky; top: 110px; }
.sidebar-card { background: #fff; border: 1px solid #f0f0f4; border-radius: 12px; padding: 18px; box-shadow: 0 2px 12px rgba(0,0,90,0.06); }
.sidebar-card h4 { font-size: 14px; font-weight: 700; color: #00005a; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid #f2f2f5; }
.market-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid #f7f8fc; font-size: 13px; color: #7f8094; }
.market-row:last-child { border-bottom: none; }
.market-val { font-weight: 700; color: #000328; }
.trend-up { color: #e84040; }
.map-placeholder { height: 150px; background: #f2f2f5; border-radius: 8px; display: flex; align-items: flex-end; justify-content: center; padding: 12px; }
.map-link-btn { background: #fff; color: #000328; font-size: 12px; font-weight: 600; padding: 7px 14px; border-radius: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.12); }

/* ===== FOOTER ===== */
.footer { background: #00001a; color: #fff; padding: 36px 0 20px; }
.footer-inner { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 20px; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { color: #7f8094; font-size: 13px; transition: color .2s; }
.footer-links a:hover { color: #fff; }
.footer .logo-text { -webkit-text-fill-color: transparent; }
.footer .logo-sub { -webkit-text-fill-color: #30bced; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-inner { height: 70px; }
  .filter-bar { top: 70px; }
  .hamburger { display: flex; }
  .nav-links {
    display: none; position: absolute; top: 70px; left: 0; right: 0;
    background: #00002a; flex-direction: column;
    padding: 16px 24px; gap: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  }
  .nav-links.open { display: flex; }
  .nav-links a { color: rgba(255,255,255,0.85); font-size: 16px; }
  .nav-links a:hover, .nav-links a.active { -webkit-text-fill-color: #fff; color: #fff; background: none; }
  .nav-btn-cs { color: rgba(255,255,255,0.85); font-size: 16px; text-align: left; }
  .nav-btn-cs:hover { -webkit-text-fill-color: #fff; color: #fff; background: none; }
  .nav-actions { display: none; }
  /* mobile auth buttons injected into nav-links by auth.js */
  .nav-links .mobile-auth { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.1); margin-top: 4px; width: 100%; }
  .hero { min-height: 320px; }
  .hero-title { font-size: 24px; }
  .search-wrap { margin-top: -20px; }
  .search-box { border-radius: 12px; padding: 16px; }
  .search-row { flex-direction: column; }
  .search-field { min-width: unset; width: 100%; }
  .hero-stats { gap: 24px; }
  .estate-card-big { flex-direction: column; }
  .estate-big-img { width: 100%; min-height: 200px; }
  .estate-gallery { grid-template-columns: 1fr; height: 260px; }
  .gallery-thumbs { display: none; }
  .estate-layout { grid-template-columns: 1fr; }
  .estate-sidebar { position: static; }
  .info-grid { grid-template-columns: 1fr; }
  .info-item { border-right: none !important; }
  .grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .section { padding: 32px 0; }
  .container { padding: 0 16px; }
}

@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .estate-layout { grid-template-columns: 1fr 300px; }
}

/* ===== WHATSAPP WIDGET ===== */
.wa-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none;
}
.wa-widget.open { pointer-events: auto; }
.wa-fab { pointer-events: auto; }
.wa-menu {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
  overflow: hidden;
  min-width: 220px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.97);
  transform-origin: bottom right;
  transition: opacity .2s ease, transform .2s ease;
}
.wa-widget.open .wa-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.wa-menu-header {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #25d366;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}
.wa-menu-header svg { flex-shrink: 0; }
.wa-agent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  text-decoration: none;
  color: #111;
  border-top: 1px solid #f0f0f4;
  transition: background .15s;
}
.wa-agent:hover { background: #f7fef9; }
.wa-agent-last { /* no extra style needed, border handled by border-top */ }
.wa-agent-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wa-agent-name {
  font-size: 13px;
  font-weight: 700;
  color: #00005a;
}
.wa-agent-phone {
  font-size: 12px;
  color: #7f8094;
  letter-spacing: 0.3px;
}
.wa-agent-arrow {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.wa-fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25d366;
  box-shadow: 0 4px 16px rgba(37,211,102,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  transition: transform .18s, box-shadow .18s;
  flex-shrink: 0;
}
.wa-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(37,211,102,0.55);
}
.wa-fab svg { transition: transform .22s; }
.wa-widget.open .wa-fab svg { transform: rotate(45deg); }
@media (max-width: 480px) {
  .wa-widget { bottom: 16px; right: 16px; }
  .wa-fab { width: 50px; height: 50px; }
  .wa-menu { min-width: 190px; }
}
