/* === TOKENS === */
:root {
  --brand:      #38946b;
  --brand-dark: #2d7655;
  --active:     #e3fceb;
  --white:      #ffffff;
  --surface:    #f4f4f5;
  --border:     #e4e4e7;
  --ink:        #09090b;
  --slate:      #18181b;
  --dark:       #27272a;
  --muted:      #71717a;
  --danger:     #ef4444;

  --wide:       1340px;
  --text:       645px;
  --px:         clamp(30px, 5vw, 50px);

  --r-card:     14px;
  --r-post:     0.5rem;
  --r-pill:     9999px;

  --shadow:     0 10px 40px rgba(9,9,11,0.08);
  --shadow-h:   0 16px 48px rgba(9,9,11,0.12);

  --ease: 0.2s ease;
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
ul { list-style: none; }

/* === BASE === */
html { font-size: 16px; }
body {
  font-family: 'Manrope', sans-serif;
  font-weight: 300;
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  letter-spacing: -0.01em;
}

/* === LAYOUT === */
.container {
  width: 100%;
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: var(--px);
}
.container--text {
  max-width: var(--text);
}

/* === TYPOGRAPHY === */
h1 { font-size: clamp(2.15rem, 2.15rem + ((1vw - 0.2rem) * 1.333), 3rem); font-weight: 400; line-height: 1.125; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.75rem, 1.75rem + ((1vw - 0.2rem) * 0.392), 2rem); font-weight: 400; letter-spacing: -0.01em; }
h3 { font-size: clamp(1.125rem, 1.125rem + ((1vw - 0.2rem) * 0.392), 1.375rem); font-weight: 400; }
h4 { font-size: clamp(1rem, 1rem + ((1vw - 0.2rem) * 0.196), 1.125rem); font-weight: 400; }

.section-title {
  font-size: clamp(1.375rem, 2.2vw, 1.75rem);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}

/* === HEADER === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  height: 64px;
  gap: 2rem;
}
.site-logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--brand);
  letter-spacing: -0.03em;
  flex-shrink: 0;
}
.site-logo span { color: var(--ink); }
.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-left: auto;
}
.site-nav a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
  transition: color var(--ease);
}
.site-nav a:hover { color: var(--brand); }
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1.25rem;
  background: var(--brand);
  color: var(--white);
  border-radius: var(--r-pill);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background var(--ease);
}
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.25rem;
  border: 2px solid var(--brand);
  color: var(--brand);
  border-radius: var(--r-pill);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background var(--ease), color var(--ease);
}
.btn-outline:hover { background: var(--brand); color: var(--white); }

/* === FOOTER === */
.site-footer {
  background: var(--dark);
  color: var(--white);
  padding: clamp(2.5rem, 5vw, 4rem) 0 2rem;
}
.site-footer .container { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 3rem; }
.footer-brand { font-size: 1.25rem; font-weight: 800; color: var(--brand); margin-bottom: 0.75rem; }
.footer-desc { font-size: 0.875rem; color: #a1a1aa; line-height: 1.6; }
.footer-col h4 { font-size: 0.8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #a1a1aa; margin-bottom: 1rem; }
.footer-col ul { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-col a { font-size: 0.9375rem; color: #d4d4d8; transition: color var(--ease); }
.footer-col a:hover { color: var(--brand); }
.footer-bottom {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #3f3f46;
  text-align: center;
  font-size: 0.8125rem;
  color: #71717a;
}

/* === PROPERTY CARD === */
.property-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--ease), box-shadow var(--ease);
  cursor: pointer;
}
.property-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-h);
}
.property-card__thumb {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--surface);
}
.property-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.property-card:hover .property-card__thumb img { transform: scale(1.04); }
.property-card__body { padding: 1rem 1.125rem 1.25rem; }
.property-card__type {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand);
  margin-bottom: 0.375rem;
}
.property-card__title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--brand);
  line-height: 1.3;
  margin-bottom: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.property-card:hover .property-card__title { color: var(--brand-dark); }
.property-card__address {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.property-card__meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 0.875rem;
  flex-wrap: wrap;
}
.property-card__meta span { display: flex; align-items: center; gap: 0.25rem; }
.property-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.property-card__price { font-size: 1.0625rem; font-weight: 700; color: var(--brand-dark); }
.property-card__cta {
  padding: 0.375rem 0.875rem;
  border: 2px solid var(--brand);
  border-radius: 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--brand);
  transition: background var(--ease), color var(--ease);
}
.property-card__cta:hover { background: var(--brand); color: var(--white); }

/* === HERO === */
.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero__bg {
  position: absolute;
  inset: 0;
  background: url('https://picsum.photos/seed/danang/1600/900') center/cover no-repeat;
}
.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(9,9,11,0.65) 0%, rgba(9,9,11,0.3) 100%);
}
.hero__content {
  position: relative;
  z-index: 1;
  width: 100%;
}
.hero__container { max-width: 900px; }
.hero__eyebrow {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand);
  background: rgba(56,148,107,0.15);
  padding: 0.375rem 0.875rem;
  border-radius: var(--r-pill);
  margin-bottom: 1.5rem;
  border: 1px solid rgba(56,148,107,0.3);
}
.hero__title {
  color: var(--white);
  margin-bottom: 1rem;
  max-width: 700px;
}
.hero__subtitle {
  color: rgba(255,255,255,0.75);
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  max-width: 500px;
  margin-bottom: 2.5rem;
}
/* Search card */
.search-card {
  background: var(--white);
  border-radius: 14px;
  padding: 1.5rem;
  max-width: 820px;
  box-shadow: 0 24px 64px rgba(9,9,11,0.24);
}
.search-card__tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
}
.search-tab {
  padding: 0.375rem 1.125rem;
  border-radius: var(--r-pill);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  transition: background var(--ease), color var(--ease);
}
.search-tab.active {
  background: var(--brand);
  color: var(--white);
}
.search-card__fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 0.75rem;
  align-items: end;
}
.search-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.375rem;
}
.search-field select,
.search-field input {
  width: 100%;
  height: 2.875rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0 0.875rem;
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--ink);
  background: var(--white);
  appearance: none;
  transition: border-color var(--ease);
}
.search-field select:focus,
.search-field input:focus {
  outline: none;
  border-color: var(--brand);
}
.search-submit {
  height: 2.875rem;
  padding: 0 1.5rem;
  background: var(--brand);
  color: var(--white);
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9375rem;
  white-space: nowrap;
  transition: background var(--ease);
}
.search-submit:hover { background: var(--brand-dark); }

/* === SECTION === */
.section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section--surface { background: var(--surface); }
.section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
}
.section__link { font-size: 0.9375rem; color: var(--brand); font-weight: 600; }
.section__link:hover { color: var(--brand-dark); }

/* === GRID === */
.property-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1rem, 2vw, 1.5rem);
}
.property-grid--3 { grid-template-columns: repeat(3, 1fr); }
.property-grid--4 { grid-template-columns: repeat(4, 1fr); }

/* === CTA BANNER === */
.cta-banner {
  background: var(--brand-dark);
  padding: clamp(3rem, 6vw, 5rem) 0;
  text-align: center;
}
.cta-banner h2 { color: var(--white); margin-bottom: 0.75rem; }
.cta-banner p { color: rgba(255,255,255,0.8); font-size: 1.0625rem; margin-bottom: 2rem; }

/* === FILTER BAR === */
.filter-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}
.filter-bar .container { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.filter-select {
  height: 2.5rem;
  padding: 0 2rem 0 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r-pill);
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--ink);
  background: var(--white);
  appearance: none;
  cursor: pointer;
  transition: border-color var(--ease);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2371717a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}
.filter-select:focus { outline: none; border-color: var(--brand); }
.filter-count { margin-left: auto; font-size: 0.875rem; color: var(--muted); font-weight: 500; }

/* === LISTING PAGE === */
.listing-section { padding: clamp(2rem, 4vw, 3rem) 0; }
.listing-empty { text-align: center; padding: 4rem 0; color: var(--muted); font-size: 1.125rem; }

/* === PAGINATION === */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.375rem;
  margin-top: 3rem;
}
.page-btn {
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  transition: background var(--ease), color var(--ease);
}
.page-btn:hover { background: var(--surface); color: var(--ink); }
.page-btn.active { background: var(--brand); color: var(--white); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* === DETAIL PAGE === */
.breadcrumb {
  padding: 1rem 0;
  font-size: 0.875rem;
  color: var(--muted);
}
.breadcrumb a { color: var(--muted); transition: color var(--ease); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb span { margin: 0 0.375rem; }

.gallery {
  display: grid;
  grid-template-columns: 3fr 2fr;
  grid-template-rows: repeat(2, 1fr);
  gap: 0.5rem;
  border-radius: var(--r-post);
  overflow: hidden;
  height: 460px;
  margin-bottom: 2rem;
}
.gallery__main {
  grid-row: span 2;
  overflow: hidden;
}
.gallery__main img,
.gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--r-post);
  transition: transform 0.35s ease;
}
.gallery__main:hover img,
.gallery__thumb:hover img { transform: scale(1.03); }
.gallery__thumb { overflow: hidden; position: relative; }
.gallery__more {
  position: absolute;
  inset: 0;
  background: rgba(9,9,11,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-post);
  color: var(--white);
  font-weight: 700;
  font-size: 1.25rem;
  cursor: pointer;
}

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2.5rem;
  align-items: start;
  margin-bottom: 4rem;
}
.detail-price {
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--brand-dark);
  margin: 0.5rem 0;
}
.detail-address { color: var(--muted); font-size: 0.9375rem; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.375rem; }
.badges { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.badge {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: 0.875rem;
  color: var(--ink);
  font-weight: 500;
}

/* Tabs */
.tabs { margin-top: 1.5rem; }
.tabs__nav {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
  gap: 0;
}
.tab-btn {
  padding: 0.75rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--ease), border-color var(--ease);
}
.tab-btn.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.tab-panel p { color: var(--ink); line-height: 1.8; font-size: 0.9375rem; }

/* Features list */
.features-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0.625rem; margin-top: 1rem; }
.features-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  color: var(--ink);
  padding: 0.5rem 0;
}
.features-list li::before { content: '✓'; color: var(--brand); font-weight: 700; }

/* Map placeholder */
.map-placeholder {
  width: 100%;
  height: 280px;
  background: var(--surface);
  border-radius: var(--r-post);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.9375rem;
  margin-top: 1rem;
}

/* Contact aside */
.contact-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 120px;
}
.contact-card__agent { display: flex; align-items: center; gap: 0.875rem; margin-bottom: 1.25rem; }
.contact-card__avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--surface);
  overflow: hidden;
}
.contact-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.contact-card__name { font-weight: 700; color: var(--slate); }
.contact-card__role { font-size: 0.8125rem; color: var(--muted); }
.contact-card__price-box {
  background: var(--surface);
  border-radius: 8px;
  padding: 0.875rem 1rem;
  margin-bottom: 1.25rem;
}
.contact-card__price-label { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }
.contact-card__price-value { font-size: 1.5rem; font-weight: 800; color: var(--brand-dark); margin-top: 0.125rem; }
.contact-btns { display: flex; flex-direction: column; gap: 0.625rem; }
.contact-btns .btn-primary,
.contact-btns .btn-outline { width: 100%; justify-content: center; height: 2.875rem; border-radius: 8px; font-size: 1rem; }

/* Related */
.related-section { padding: clamp(2rem, 5vw, 3.5rem) 0; background: var(--surface); }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .property-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .property-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .search-card__fields { grid-template-columns: 1fr 1fr; }
  .search-card__fields .search-submit { grid-column: span 2; }
  .site-footer .container { grid-template-columns: 1fr 1fr; }
  .detail-layout { grid-template-columns: 1fr; }
  .contact-card { position: static; }
  .gallery { height: 360px; }
}

@media (max-width: 640px) {
  .property-grid--4,
  .property-grid--3 { grid-template-columns: 1fr; }
  .search-card__fields { grid-template-columns: 1fr; }
  .search-card__fields .search-submit { grid-column: auto; }
  .site-nav .btn-primary { display: none; }
  .site-footer .container { grid-template-columns: 1fr; gap: 2rem; }
  .gallery { height: 280px; grid-template-columns: 1fr; grid-template-rows: 2fr 1fr 1fr; }
  .gallery__main { grid-row: auto; }
  .features-list { grid-template-columns: 1fr; }
  .section__header { flex-direction: column; gap: 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .property-card, .property-card__thumb img, .gallery__main img, .gallery__thumb img { transition: none; }
}
