@font-face {
  font-family: "Noto Sans Thai";
  src: url("./fonts/NotoSansThai-Regular.ttf") format("truetype");
  font-weight: 400;
}

@font-face {
  font-family: "Noto Sans Thai";
  src: url("./fonts/NotoSansThai-SemiBold.ttf") format("truetype");
  font-weight: 600;
}

@font-face {
  font-family: "Noto Sans Thai";
  src: url("./fonts/NotoSansThai-Bold.ttf") format("truetype");
  font-weight: 700;
}

:root {
  color-scheme: light;
  --warm: #f7f3ec;
  --surface: #ffffff;
  --surface-soft: #fbf8f2;
  --text: #1f2523;
  --muted: #6b716d;
  --border: #e5ded2;
  --green: #183b32;
  --green-soft: #e8eee9;
  --brass: #b8955a;
  --brass-soft: #f4ead8;
  --danger: #9f2d20;
  --shadow: 0 18px 46px rgba(31, 37, 35, 0.1);
  --radius: 10px;
  font-family: "Noto Sans Thai", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background: var(--warm);
}

body.drawer-open,
body.lightbox-open,
body.decision-open {
  overflow: hidden;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  border-bottom: 1px solid rgba(229, 222, 210, 0.92);
  padding: 0 18px;
  background: var(--warm);
}

.brand {
  max-width: 180px;
  color: var(--green);
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.topbar nav {
  display: none;
  gap: 18px;
  align-items: center;
}

.topbar nav a {
  color: var(--muted);
  font-size: 0.92rem;
  text-decoration: none;
  transition: color 0.18s ease;
}

.topbar nav a:hover {
  color: var(--green);
}

.showroom-hero {
  display: grid;
  gap: 0;
  min-height: calc(100svh - 68px);
  background: var(--surface);
}

.hero-media {
  min-height: 360px;
  background: var(--green-soft);
}

.hero-media img,
.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-copy {
  display: grid;
  align-content: center;
  padding: 28px 18px 34px;
}

.eyebrow,
.status-pill {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 30px;
  border-radius: 999px;
  padding: 5px 11px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
}

.status-pill {
  margin-bottom: 12px;
}

h1 {
  max-width: 780px;
  margin-bottom: 14px;
  color: var(--text);
  font-size: clamp(2.45rem, 12vw, 6.1rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 3vw, 2.55rem);
  line-height: 1.12;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.05rem;
}

.body-copy,
.hero-location,
.contact-copy p,
.form-status,
.result-count {
  color: var(--muted);
  line-height: 1.72;
}

.body-copy {
  max-width: 620px;
}

.hero-actions {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.primary-button,
.ghost-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid var(--green);
  border-radius: 999px;
  padding: 11px 18px;
  color: var(--green);
  background: transparent;
  font-weight: 700;
  text-decoration: none;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.primary-button {
  color: var(--surface);
  background: var(--green);
}

.icon-button {
  min-height: 38px;
  padding: 8px 14px;
  font-size: 0.88rem;
}

.primary-button:hover,
.ghost-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(24, 59, 50, 0.13);
}

.showroom-section,
.detail-view,
.contact-section {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.showroom-section {
  padding: 48px 0 56px;
}

.showroom-heading {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.section-heading {
  display: grid;
  gap: 10px;
  align-content: start;
}

.section-heading.wide {
  margin-bottom: 22px;
}

.filter-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(31, 37, 35, 0.05);
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: var(--text);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 13px;
  color: var(--text);
  background: var(--surface);
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.65;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brass);
  box-shadow: 0 0 0 4px rgba(184, 149, 90, 0.14);
}

.property-card-grid {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.property-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(31, 37, 35, 0.05);
  transition:
    border-color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.property-card:hover {
  border-color: rgba(184, 149, 90, 0.7);
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(31, 37, 35, 0.09);
}

.property-card button {
  display: grid;
  width: 100%;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.property-card img {
  width: 100%;
  aspect-ratio: 1.28;
  object-fit: cover;
}

.card-copy {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.card-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.card-copy h3 {
  margin-bottom: 0;
  color: var(--green);
  font-size: 1.28rem;
  line-height: 1.25;
}

.card-copy p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.card-foot {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  color: var(--green);
  font-weight: 700;
}

.empty-note {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--muted);
  background: var(--surface);
  text-align: center;
}

.detail-view {
  padding-bottom: 24px;
}

.back-button {
  margin: 12px 0 18px;
}

.property-hero {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.property-hero .hero-image {
  height: min(62svh, 620px);
  min-height: 320px;
  background: var(--green-soft);
}

.property-hero-copy {
  padding: 22px;
}

.property-hero-copy h2 {
  font-size: clamp(2rem, 8vw, 4.8rem);
  line-height: 0.98;
}

.hero-location {
  margin: 12px 0 0;
}

.price {
  color: var(--green);
  font-size: clamp(1.3rem, 4vw, 2.05rem);
  line-height: 1.1;
}

.snapshot-section,
.content-section {
  padding: 42px 0;
  border-top: 1px solid rgba(229, 222, 210, 0.84);
}

.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.snapshot-card,
.highlight-card,
.detail-list,
.amenity-list,
.map-card,
.landmark-item,
.owner-card,
.lead-form,
.lead-panel,
.lead-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.snapshot-card {
  padding: 16px;
}

.snapshot-card span,
.detail-list dt,
.lead-meta {
  color: var(--muted);
  font-size: 0.86rem;
}

.snapshot-card strong {
  display: block;
  margin-top: 4px;
  color: var(--green);
  font-size: 1.22rem;
  line-height: 1.15;
}

.two-column,
.details-section,
.location-section,
.contact-section {
  display: grid;
  gap: 24px;
}

.highlight-grid {
  display: grid;
  gap: 12px;
}

.highlight-card {
  padding: 15px;
  transition:
    border-color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.highlight-card:hover {
  border-color: rgba(184, 149, 90, 0.75);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(31, 37, 35, 0.08);
}

.highlight-card h3,
.highlight-card p {
  margin-bottom: 0;
}

.highlight-card p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.55;
}

.gallery-grid {
  display: grid;
  gap: 12px;
}

.gallery-item {
  overflow: hidden;
  min-height: 240px;
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  background: var(--green-soft);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  min-height: 240px;
  object-fit: cover;
  transition: transform 0.28s ease;
}

.gallery-item:hover img {
  transform: scale(1.025);
}

.details-layout,
.location-layout {
  display: grid;
  gap: 22px;
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  overflow: hidden;
}

.detail-list div {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.detail-list div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.detail-list dd {
  margin: 4px 0 0;
  color: var(--green);
  font-size: 1.08rem;
  font-weight: 700;
}

.amenity-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding: 16px;
}

.amenity-list span {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--green);
  background: var(--surface-soft);
  font-weight: 600;
}

.map-card {
  position: relative;
  display: block;
  overflow: hidden;
  min-height: 280px;
  padding: 24px;
  background: var(--surface-soft);
}

.mock-map {
  position: absolute;
  inset: 0;
}

.road {
  position: absolute;
  display: block;
  border-radius: 999px;
  background: rgba(184, 149, 90, 0.42);
}

.road-main {
  top: 49%;
  left: -12%;
  width: 125%;
  height: 18px;
  transform: rotate(-9deg);
}

.road-cross {
  top: 8%;
  left: 55%;
  width: 16px;
  height: 100%;
  transform: rotate(18deg);
  background: rgba(24, 59, 50, 0.18);
}

.road-small {
  height: 9px;
  background: rgba(24, 59, 50, 0.14);
}

.road-small.one {
  top: 28%;
  left: 8%;
  width: 44%;
  transform: rotate(12deg);
}

.road-small.two {
  bottom: 22%;
  right: 8%;
  width: 38%;
  transform: rotate(6deg);
}

.map-pin {
  position: absolute;
  top: 43%;
  left: 51%;
  width: 28px;
  height: 28px;
  border: 6px solid var(--green);
  border-radius: 50% 50% 50% 0;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(31, 37, 35, 0.18);
  transform: rotate(-45deg);
}

.map-pin::after {
  position: absolute;
  inset: 5px;
  border-radius: 999px;
  background: var(--brass);
  content: "";
}

.map-label {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  border: 1px solid rgba(229, 222, 210, 0.9);
  border-radius: var(--radius);
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 30px rgba(31, 37, 35, 0.08);
}

.map-label span {
  display: block;
  color: var(--brass);
  font-size: 0.78rem;
  font-weight: 700;
}

.map-label strong {
  display: block;
  margin-top: 4px;
  color: var(--green);
  font-size: 1rem;
  line-height: 1.35;
}

.landmark-list {
  display: grid;
  gap: 10px;
}

.landmark-item {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
}

.landmark-item span {
  color: var(--muted);
}

.contact-section {
  padding: 56px 0 72px;
  border-top: 1px solid rgba(229, 222, 210, 0.84);
}

.owner-card {
  display: grid;
  gap: 8px;
  margin-top: 22px;
  padding: 18px;
}

.owner-card strong {
  color: var(--green);
  font-size: 1.1rem;
}

.owner-card a,
.owner-card span {
  color: var(--muted);
  overflow-wrap: anywhere;
  text-decoration: none;
}

.lead-form,
.property-form {
  display: grid;
  gap: 14px;
}

.lead-form {
  padding: 20px;
}

.form-status {
  min-height: 24px;
  margin: 0;
}

.form-status[data-state="success"] {
  color: var(--green);
}

.form-status[data-state="error"] {
  color: var(--danger);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(31, 37, 35, 0.82);
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: min(1100px, 100%);
  max-height: 82svh;
  border-radius: var(--radius);
  object-fit: contain;
}

.lightbox .icon-button {
  position: fixed;
  top: 18px;
  right: 18px;
  color: var(--surface);
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(31, 37, 35, 0.55);
}

.decision-dialog {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(31, 37, 35, 0.48);
}

.decision-dialog[hidden] {
  display: none;
}

.decision-panel {
  width: min(430px, 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--surface);
  box-shadow: 0 22px 58px rgba(31, 37, 35, 0.18);
}

.decision-panel h2 {
  margin-top: 14px;
  font-size: clamp(1.35rem, 5vw, 2rem);
}

.decision-panel p {
  color: var(--muted);
  line-height: 1.7;
}

.decision-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.edit-drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  justify-content: flex-end;
  background: rgba(31, 37, 35, 0.42);
}

.edit-drawer.is-open {
  display: flex;
}

.drawer-panel {
  width: min(780px, 100%);
  height: 100%;
  overflow: auto;
  padding: 20px;
  background: var(--warm);
  box-shadow: -18px 0 42px rgba(31, 37, 35, 0.16);
}

.drawer-header {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.drawer-header h2 {
  font-size: clamp(1.35rem, 4vw, 2.2rem);
}

.property-form,
.lead-panel {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.form-grid,
.drawer-actions {
  display: grid;
  gap: 12px;
}

.lead-panel {
  margin-top: 18px;
}

.lead-panel-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.lead-panel-heading span {
  color: var(--muted);
}

.lead-list {
  display: grid;
  gap: 10px;
}

.lead-item {
  padding: 14px;
}

.lead-item header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.lead-item p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.lead-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.lead-actions button {
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--green);
  background: var(--surface-soft);
  font-weight: 700;
}

.lead-actions button[data-delete-lead] {
  color: var(--danger);
}

@media (min-width: 700px) {
  .topbar {
    padding: 0 32px;
  }

  .brand {
    max-width: none;
  }

  .topbar nav {
    display: flex;
  }

  .showroom-hero {
    grid-template-columns: 1.12fr 0.88fr;
  }

  .hero-media {
    min-height: calc(100svh - 68px);
  }

  .hero-copy {
    padding: 42px;
  }

  .hero-actions {
    grid-template-columns: repeat(2, max-content);
    align-items: center;
  }

  .showroom-section,
  .detail-view,
  .contact-section {
    width: min(1120px, calc(100% - 64px));
  }

  .showroom-heading {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .filter-panel {
    grid-template-columns: minmax(220px, 1.35fr) repeat(4, minmax(130px, 1fr)) auto;
    align-items: end;
  }

  .property-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .snapshot-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .highlight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-grid {
    grid-template-columns: 1.35fr 1fr 1fr;
    grid-auto-rows: 245px;
  }

  .gallery-item,
  .gallery-item img {
    min-height: 0;
  }

  .gallery-item:first-child {
    grid-row: span 2;
  }

  .form-grid,
  .drawer-actions,
  .decision-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .property-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .property-hero {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
  }

  .property-hero .hero-image {
    height: 620px;
  }

  .property-hero-copy {
    display: grid;
    align-content: center;
    padding: 34px;
  }

  .two-column,
  .details-section,
  .location-section,
  .contact-section {
    grid-template-columns: 0.78fr 1.22fr;
    gap: 56px;
  }

  .details-layout,
  .location-layout {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .topbar {
    gap: 8px;
  }

  .brand {
    min-width: 0;
    flex: 1 1 auto;
  }

  .topbar .ghost-button {
    width: auto;
    flex: 0 0 auto;
    min-height: 40px;
    padding: 8px 12px;
  }

  .hero-actions,
  .drawer-actions {
    grid-template-columns: 1fr;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }

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

  .detail-list div:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }

  .detail-list div:last-child {
    border-bottom: 0;
  }

  .lead-item header,
  .landmark-item {
    display: grid;
  }
}

.detail-view {
  position: relative;
  width: 100%;
  padding-bottom: 24px;
}

.detail-view > .snapshot-section,
.detail-view > .content-section {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.detail-view .back-button {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 4;
  margin: 0;
  border-color: rgba(255, 255, 255, 0.78);
  background: rgba(247, 243, 236, 0.92);
  box-shadow: 0 12px 30px rgba(31, 37, 35, 0.12);
}

.detail-view .property-hero {
  position: relative;
  display: block;
  min-height: calc(100svh - 68px);
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--green-soft);
  box-shadow: none;
}

.detail-view .property-hero .hero-image {
  width: 100%;
  height: calc(100svh - 68px);
  min-height: 620px;
  object-fit: cover;
}

.detail-view .property-hero-copy {
  position: absolute;
  left: 32px;
  bottom: 32px;
  width: min(860px, calc(100% - 64px));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.detail-view .property-hero-copy h2 {
  max-width: 760px;
  font-size: clamp(3.25rem, 7vw, 6.6rem);
  line-height: 0.94;
}

.detail-view .property-hero-copy .price {
  display: block;
  color: var(--green);
  font-size: clamp(1.7rem, 3vw, 2.6rem);
}

@media (min-width: 700px) {
  .detail-view > .snapshot-section,
  .detail-view > .content-section {
    width: min(1120px, calc(100% - 64px));
  }

  .detail-view .property-hero-copy .hero-actions {
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: end;
  }
}

@media (max-width: 700px) {
  .detail-view .property-hero {
    min-height: auto;
    padding-bottom: 24px;
  }

  .detail-view .property-hero .hero-image {
    height: 62svh;
    min-height: 380px;
  }

  .detail-view .property-hero-copy {
    position: relative;
    left: auto;
    bottom: auto;
    width: calc(100% - 32px);
    margin: -52px auto 0;
    padding: 22px;
  }

  .detail-view .property-hero-copy h2 {
    font-size: clamp(2.3rem, 13vw, 4rem);
  }
}
