:root {
  --primary: #1a3a5c;
  --primary-light: #2a5280;
  --gold: #c9a84c;
  --gold-light: #e8c96d;
  --bg: #f4f6f9;
  --white: #ffffff;
  --text: #2c3e50;
  --text-muted: #6b7280;
  --border: #e2e8f0;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.15);
  --radius: 12px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* ---- Header ---- */
header {
  background: var(--primary);
  color: var(--white);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--white);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--gold);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.logo-sub {
  font-size: 11px;
  opacity: 0.75;
  display: block;
  line-height: 1;
  margin-top: 1px;
}

nav a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  margin-left: 24px;
  font-size: 14px;
  transition: color 0.2s;
}

nav a:hover, nav a.active {
  color: var(--gold-light);
}

/* ---- Hero ---- */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  padding: 56px 24px;
  text-align: center;
}

.hero h1 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 8px;
}

.hero p {
  font-size: 16px;
  opacity: 0.85;
  margin-bottom: 32px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 32px;
}

.hero-stat {
  text-align: center;
}

.hero-stat-number {
  font-size: 28px;
  font-weight: 700;
  color: var(--gold-light);
}

.hero-stat-label {
  font-size: 13px;
  opacity: 0.8;
}

/* ---- Filter Bar ---- */
.filter-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  position: sticky;
  top: 64px;
  z-index: 90;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.filter-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.filter-select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  cursor: pointer;
  transition: border-color 0.2s;
  min-width: 140px;
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary);
}

.filter-count {
  margin-left: auto;
  font-size: 13px;
  color: var(--text-muted);
}

.btn-reset {
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-reset:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ---- Main Content ---- */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* ---- House Grid ---- */
.houses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.house-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s, box-shadow 0.25s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.house-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.card-img-wrap {
  position: relative;
  overflow: hidden;
  height: 220px;
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.house-card:hover .card-img-wrap img {
  transform: scale(1.05);
}

.card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-available {
  background: rgba(16, 185, 129, 0.9);
  color: white;
}

.badge-reserved {
  background: rgba(245, 158, 11, 0.9);
  color: white;
}

.badge-sold {
  background: rgba(107, 114, 128, 0.9);
  color: white;
}

.card-type-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(26, 58, 92, 0.85);
  color: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.card-body {
  padding: 18px;
}

.card-project {
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
  line-height: 1.3;
}

.card-location {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-specs {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.spec-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.spec-icon {
  font-size: 18px;
}

.spec-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.spec-label {
  font-size: 11px;
  color: var(--text-muted);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.card-price {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
}

.card-price-unit {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
}

.btn-detail {
  padding: 8px 16px;
  background: var(--primary);
  color: white;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.btn-detail:hover {
  background: var(--primary-light);
}

/* ---- Loading / Empty ---- */
.loading {
  text-align: center;
  padding: 60px 0;
  color: var(--text-muted);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  padding: 60px 0;
  color: var(--text-muted);
}

.empty-state h3 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--text);
}

/* ---- House Detail Page ---- */
.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 24px;
  transition: gap 0.2s;
}

.detail-back:hover {
  gap: 10px;
}

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  align-items: start;
}

.detail-img-main {
  width: 100%;
  height: 420px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.detail-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 88px;
}

.detail-project {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}

.detail-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.3;
  margin-bottom: 8px;
}

.detail-location {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.detail-price {
  font-size: 32px;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 4px;
}

.detail-price-note {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.detail-specs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.detail-spec {
  background: var(--bg);
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
}

.detail-spec-icon {
  font-size: 20px;
  display: block;
  margin-bottom: 4px;
}

.detail-spec-value {
  font-size: 16px;
  font-weight: 700;
  display: block;
}

.detail-spec-label {
  font-size: 11px;
  color: var(--text-muted);
}

.status-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
}

.btn-contact {
  width: 100%;
  padding: 14px;
  background: var(--gold);
  color: var(--primary);
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
  margin-bottom: 10px;
}

.btn-contact:hover {
  background: var(--gold-light);
}

.btn-brochure {
  width: 100%;
  padding: 12px;
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-brochure:hover {
  background: var(--primary);
  color: white;
}

.detail-info {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-top: 24px;
}

.detail-info h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

.detail-desc {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.features-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.features-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
}

.features-list li::before {
  content: '✓';
  color: var(--gold);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ---- Footer ---- */
footer {
  background: var(--primary);
  color: rgba(255,255,255,0.75);
  text-align: center;
  padding: 28px 24px;
  margin-top: 60px;
  font-size: 14px;
}

footer strong {
  color: var(--gold-light);
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .detail-layout {
    grid-template-columns: 1fr;
  }
  .detail-card {
    position: static;
  }
  .detail-img-main {
    height: 280px;
  }
  .features-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .hero h1 { font-size: 26px; }
  .hero-stats { gap: 20px; }
  .houses-grid { grid-template-columns: 1fr; }
  nav { display: none; }
  .filter-inner { gap: 8px; }
  .filter-select { min-width: 110px; }
}
