:root {
  --ivory: #f8f3ea;
  --paper: #fffaf2;
  --sand: #ded0bb;
  --charcoal: #25231f;
  --muted: #746b5e;
  --green: #2f5f48;
  --terracotta: #a95e3f;
  --line: rgba(37, 35, 31, 0.14);
  --shadow: 0 24px 70px rgba(45, 37, 25, 0.16);
  --font: "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ivory);
  color: var(--charcoal);
  font-family: var(--font);
  line-height: 1.55;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  align-items: center;
  background: rgba(248, 243, 234, 0.84);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid transparent;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  left: 0;
  padding: 20px 5vw;
  position: fixed;
  right: 0;
  top: 0;
  transition: 0.25s ease;
  z-index: 20;
}

.site-header.compact {
  border-color: var(--line);
  padding-block: 12px;
}

.brand {
  align-items: center;
  display: flex;
  font-size: 1.15rem;
  font-weight: 700;
  gap: 10px;
  white-space: nowrap;
}

.brand-mark {
  align-items: center;
  background: var(--green);
  color: var(--paper);
  display: inline-flex;
  font-size: 0.75rem;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.nav-links {
  align-items: center;
  display: flex;
  gap: 22px;
  font-size: 0.95rem;
}

.nav-links a {
  color: rgba(37, 35, 31, 0.72);
}

.nav-links a:hover {
  color: var(--charcoal);
}

.header-actions {
  align-items: center;
  display: flex;
  gap: 12px;
}

.language-toggle,
.filter-bar button,
.chip,
.menu-toggle {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--charcoal);
  cursor: pointer;
}

.language-toggle {
  padding: 10px 12px;
}

.btn {
  border: 0;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  min-height: 46px;
  padding: 12px 20px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--terracotta);
  color: var(--paper);
  box-shadow: 0 12px 28px rgba(169, 94, 63, 0.24);
}

.btn-outline {
  background: var(--charcoal);
  color: var(--paper);
}

.btn-light {
  background: var(--paper);
  color: var(--green);
}

.menu-toggle {
  display: none;
  height: 42px;
  position: relative;
  width: 46px;
}

.menu-toggle span {
  background: var(--charcoal);
  height: 2px;
  left: 12px;
  position: absolute;
  right: 12px;
}

.menu-toggle span:first-child {
  top: 16px;
}

.menu-toggle span:last-child {
  top: 24px;
}

.hero {
  min-height: 92vh;
  padding: 170px 5vw 80px;
  position: relative;
  display: grid;
  align-items: end;
}

.hero-media {
  background:
    linear-gradient(90deg, rgba(22, 20, 17, 0.68), rgba(22, 20, 17, 0.2)),
    url("https://images.unsplash.com/photo-1600607687939-ce8a6c25118c?auto=format&fit=crop&w=1800&q=84")
      center/cover;
  inset: 0;
  position: absolute;
  z-index: -1;
}

.hero-content {
  color: var(--paper);
  max-width: 720px;
}

.eyebrow {
  color: var(--terracotta);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #f1c8a5;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2.7rem, 7vw, 6.8rem);
  line-height: 1.04;
  margin-bottom: 18px;
  max-width: 960px;
}

h2 {
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1.08;
  margin-bottom: 14px;
}

h3 {
  font-size: 1.22rem;
  margin-bottom: 8px;
}

.hero-copy {
  color: rgba(255, 250, 242, 0.88);
  font-size: 1.2rem;
  max-width: 660px;
}

.search-panel {
  align-items: end;
  background: rgba(255, 250, 242, 0.94);
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
  grid-template-columns: 1.2fr 0.85fr 0.85fr auto;
  margin-top: 42px;
  max-width: 1120px;
  padding: 18px;
}

label span {
  color: var(--muted);
  display: block;
  font-size: 0.82rem;
  margin-bottom: 6px;
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--charcoal);
  min-height: 46px;
  padding: 10px 12px;
  width: 100%;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.quick-search {
  margin-top: -34px;
  padding: 0 5vw;
  position: relative;
  z-index: 2;
}

.chip-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.chip {
  background: var(--paper);
  box-shadow: 0 10px 28px rgba(45, 37, 25, 0.08);
  flex: 0 0 auto;
  padding: 12px 18px;
}

.chip.active {
  background: var(--green);
  color: var(--paper);
}

.section {
  padding: 92px 5vw;
}

.section-heading {
  margin-bottom: 34px;
  max-width: 760px;
}

.section-heading.compact {
  align-items: end;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  max-width: none;
}

.section-heading p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.05rem;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.filter-bar button {
  background: var(--paper);
  padding: 10px 14px;
}

.property-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.property-card {
  background: var(--paper);
  border: 1px solid rgba(37, 35, 31, 0.08);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.property-card:hover,
.location-tile:hover,
.category-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.property-image {
  aspect-ratio: 1.28;
  background: var(--sand) center/cover;
  position: relative;
}

.badge {
  background: rgba(47, 95, 72, 0.92);
  color: var(--paper);
  font-size: 0.78rem;
  left: 14px;
  padding: 6px 10px;
  position: absolute;
  top: 14px;
}

.property-body {
  padding: 18px;
}

.property-meta {
  color: var(--muted);
  font-size: 0.94rem;
  margin-bottom: 10px;
}

.price {
  color: var(--green);
  font-size: 1.45rem;
  font-weight: 800;
  margin: 12px 0;
}

.specs {
  color: var(--muted);
  font-size: 0.94rem;
}

.card-action {
  color: var(--terracotta);
  font-weight: 700;
  margin-top: 16px;
}

.featured-section {
  background: var(--paper);
}

.featured-layout {
  display: grid;
  gap: 24px;
  grid-template-columns: 1.15fr 0.85fr;
}

.featured-layout .property-card:first-child {
  grid-row: span 2;
}

.featured-layout .property-card:first-child .property-image {
  aspect-ratio: 1.12;
}

.map-preview {
  background:
    linear-gradient(45deg, rgba(47, 95, 72, 0.1) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(169, 94, 63, 0.1) 25%, transparent 25%),
    var(--paper);
  background-size: 90px 90px;
  border: 1px solid var(--line);
  min-height: 430px;
  overflow: hidden;
  position: relative;
}

.map-line {
  background: rgba(116, 107, 94, 0.34);
  height: 2px;
  position: absolute;
  transform-origin: left center;
}

.marker {
  background: var(--terracotta);
  border: 4px solid var(--paper);
  border-radius: 50%;
  box-shadow: 0 8px 20px rgba(45, 37, 25, 0.2);
  cursor: pointer;
  height: 22px;
  position: absolute;
  width: 22px;
}

.map-card {
  background: var(--paper);
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  grid-template-columns: 96px 1fr;
  left: 24px;
  max-width: 360px;
  padding: 12px;
  position: absolute;
  top: 24px;
}

.map-card img {
  height: 96px;
  object-fit: cover;
  width: 96px;
}

.location-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(6, 1fr);
}

.location-tile {
  align-items: end;
  aspect-ratio: 0.8;
  background: var(--sand) center/cover;
  color: var(--paper);
  cursor: pointer;
  display: flex;
  overflow: hidden;
  padding: 18px;
  position: relative;
  transition: 0.22s ease;
}

.location-tile::before {
  background: linear-gradient(180deg, transparent, rgba(16, 14, 12, 0.72));
  content: "";
  inset: 0;
  position: absolute;
}

.location-tile > div {
  position: relative;
}

.location-tile p {
  color: rgba(255, 250, 242, 0.82);
  margin-bottom: 0;
}

.category-grid,
.info-grid,
.trust-grid,
.step-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.category-card,
.info-grid article,
.trust-grid article,
.step-grid article {
  background: var(--paper);
  border: 1px solid rgba(37, 35, 31, 0.08);
  padding: 22px;
}

.how-section {
  background: #efe4d3;
}

.step-grid span {
  color: var(--terracotta);
  font-weight: 800;
}

.category-card {
  cursor: pointer;
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 18px;
  transition: 0.22s ease;
}

.category-card img {
  height: 110px;
  object-fit: cover;
  width: 110px;
}

.category-card p,
.info-grid p,
.trust-grid p,
.about-section p,
.footer p {
  color: var(--muted);
}

.owner-band {
  align-items: center;
  background:
    linear-gradient(90deg, rgba(47, 95, 72, 0.95), rgba(47, 95, 72, 0.78)),
    url("https://images.unsplash.com/photo-1600566753190-17f0baa2a6c3?auto=format&fit=crop&w=1600&q=84")
      center/cover;
  color: var(--paper);
  display: flex;
  justify-content: space-between;
  gap: 40px;
  padding: 92px 5vw;
}

.owner-band .eyebrow,
.owner-band p {
  color: rgba(255, 250, 242, 0.82);
}

.trust-grid span {
  color: var(--terracotta);
  font-weight: 800;
}

.about-section {
  align-items: start;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 40px;
  grid-template-columns: 0.9fr 1.1fr;
}

.footer {
  background: var(--charcoal);
  color: var(--paper);
  display: grid;
  gap: 30px;
  grid-template-columns: 1.1fr 1.6fr auto;
  padding: 56px 5vw;
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
}

.mobile-cta {
  background: var(--terracotta);
  border: 0;
  bottom: 16px;
  box-shadow: var(--shadow);
  color: var(--paper);
  cursor: pointer;
  display: none;
  left: 16px;
  min-height: 50px;
  position: fixed;
  right: 16px;
  z-index: 12;
}

.modal-shell {
  background: rgba(20, 18, 15, 0.58);
  display: none;
  inset: 0;
  padding: 28px;
  position: fixed;
  z-index: 40;
}

.modal-shell.open {
  display: grid;
  place-items: center;
}

.modal {
  animation: modalIn 0.22s ease;
  background: var(--paper);
  box-shadow: var(--shadow);
  max-height: 92vh;
  max-width: 1060px;
  overflow: auto;
  position: relative;
  width: min(100%, 1060px);
}

.modal.form-modal {
  max-width: 760px;
}

.modal-close {
  background: var(--charcoal);
  border: 0;
  color: var(--paper);
  cursor: pointer;
  height: 42px;
  position: absolute;
  right: 16px;
  top: 16px;
  width: 42px;
  z-index: 2;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.detail-gallery {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
  padding: 18px;
}

.detail-gallery img:first-child {
  grid-column: span 2;
}

.detail-gallery img {
  height: 210px;
  object-fit: cover;
  width: 100%;
}

.detail-content,
.form-content {
  padding: 34px;
}

.detail-list {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, 1fr);
  margin: 24px 0;
}

.detail-list span {
  background: var(--ivory);
  padding: 12px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.form-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
}

.form-grid label:last-of-type,
.form-grid .full {
  grid-column: span 2;
}

.success-note {
  background: rgba(47, 95, 72, 0.1);
  color: var(--green);
  display: none;
  margin-top: 16px;
  padding: 12px;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .nav-links {
    display: none;
  }

  .nav-links.open {
    background: var(--paper);
    border-top: 1px solid var(--line);
    box-shadow: var(--shadow);
    display: grid;
    left: 0;
    padding: 18px 5vw;
    position: absolute;
    right: 0;
    top: 100%;
  }

  .menu-toggle {
    display: block;
  }

  .search-panel,
  .property-grid,
  .featured-layout,
  .about-section,
  .footer {
    grid-template-columns: 1fr 1fr;
  }

  .search-panel .btn {
    grid-column: span 2;
  }

  .location-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 760px) {
  .site-header {
    padding-inline: 16px;
  }

  .language-toggle,
  .header-actions .btn {
    display: none;
  }

  .hero {
    min-height: 94vh;
    padding: 130px 16px 66px;
  }

  h1 {
    font-size: 3.15rem;
  }

  .search-panel,
  .property-grid,
  .featured-layout,
  .location-grid,
  .category-grid,
  .info-grid,
  .trust-grid,
  .step-grid,
  .about-section,
  .footer,
  .detail-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .search-panel .btn,
  .form-grid label:last-of-type,
  .form-grid .full {
    grid-column: span 1;
  }

  .section,
  .owner-band {
    padding: 64px 16px;
  }

  .section-heading.compact,
  .owner-band {
    align-items: start;
    flex-direction: column;
  }

  .quick-search {
    padding-inline: 16px;
  }

  .location-tile {
    aspect-ratio: 1.35;
  }

  .category-card {
    grid-template-columns: 92px 1fr;
  }

  .category-card img {
    height: 92px;
    width: 92px;
  }

  .modal-shell {
    padding: 0;
  }

  .modal {
    max-height: 100vh;
    min-height: 100vh;
  }

  .detail-gallery img {
    height: 150px;
  }

  .detail-content,
  .form-content {
    padding: 24px 18px 80px;
  }

  .mobile-cta {
    display: block;
  }
}
