/* Property Finder — Clean Navy theme, mobile-first, no external assets */

:root {
  --navy-900: #0a1f3d;
  --navy-800: #123057;
  --navy-600: #1f4e8c;
  --navy-500: #2f6bb3;
  --accent: #e0a63a;
  --accent-dark: #c98f26;
  --gray-50: #f7f8fa;
  --gray-100: #eef0f3;
  --gray-200: #dde1e6;
  --gray-400: #9aa3af;
  --gray-600: #667085;
  --gray-800: #344054;
  --white: #ffffff;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(10, 31, 61, 0.08);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

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

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

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

button {
  font-family: inherit;
  cursor: pointer;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-600));
  color: var(--white);
  padding: 40px 16px 32px;
  text-align: center;
}

.hero .logo {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 8px;
}

.hero .tagline {
  margin: 0;
  color: var(--gray-100);
  font-size: 0.95rem;
}

/* Search form */
.search-form {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin: -24px auto 24px;
  max-width: 1100px;
  position: relative;
  z-index: 2;
}

.pill-toggle {
  display: flex;
  gap: 8px;
  background: var(--gray-100);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 16px;
}

.pill-toggle button {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 12px;
  min-height: 44px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-600);
  transition: background 0.15s, color 0.15s;
}

.pill-toggle button.active {
  background: var(--navy-800);
  color: var(--white);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

@media (min-width: 640px) {
  .form-row.budget-row,
  .form-row.two-col {
    grid-template-columns: 1fr 1fr;
  }
}

.field label {
  display: block;
  font-size: 0.85rem;
  color: var(--gray-600);
  margin-bottom: 4px;
}

.field input,
.field select {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 1rem;
  background: var(--white);
  color: var(--gray-800);
}

.field input:focus,
.field select:focus {
  outline: 2px solid var(--navy-500);
  outline-offset: 1px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
}

.btn-primary {
  background: var(--accent);
  color: var(--navy-900);
  width: 100%;
}

.btn-primary:hover {
  background: var(--accent-dark);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Results grid */
.results-section {
  padding: 0 0 40px;
}

#results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(10, 31, 61, 0.14);
}

.card-cover {
  aspect-ratio: 4 / 3;
  background: var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  font-size: 0.85rem;
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy-900);
  margin: 0;
}

.card-price {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-dark);
  margin: 0;
}

.card-district {
  font-size: 0.85rem;
  color: var(--gray-600);
}

.card-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--gray-600);
  margin-top: auto;
}

/* Loading / empty states */
.state-msg {
  display: none;
  text-align: center;
  padding: 40px 16px;
  color: var(--gray-400);
  font-size: 0.95rem;
}

.state-msg.visible {
  display: block;
}

/* Listing detail page */
#gallery {
  margin-bottom: 20px;
}

.gallery-main {
  aspect-ratio: 16 / 10;
  background: var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.gallery-thumbs .thumb {
  flex: 0 0 auto;
  width: 72px;
  height: 56px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--gray-200);
  border: 2px solid transparent;
  cursor: pointer;
}

.gallery-thumbs .thumb.active {
  border-color: var(--navy-600);
}

.gallery-thumbs .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#specs {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

#specs h1 {
  color: var(--navy-900);
  font-size: 1.3rem;
  margin: 0 0 6px;
}

.specs-price {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-dark);
  margin: 0 0 14px;
}

.specs-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  font-size: 0.9rem;
}

.specs-list li strong {
  display: block;
  color: var(--gray-600);
  font-weight: 500;
  font-size: 0.78rem;
}

.specs-desc {
  font-size: 0.95rem;
  color: var(--gray-800);
  white-space: pre-line;
}

.cta-wrap {
  position: sticky;
  bottom: 0;
  background: var(--white);
  padding: 12px 0;
  margin-top: 20px;
}

/* Inquiry form */
#inquiry-form {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-top: 16px;
}

#inquiry-form.hidden {
  display: none;
}

#inquiry-form h2 {
  font-size: 1.1rem;
  color: var(--navy-900);
  margin: 0 0 12px;
}

.inquiry-msg {
  margin-top: 10px;
  font-size: 0.9rem;
}

.inquiry-msg.success {
  color: #1a7f37;
}

.inquiry-msg.error {
  color: #c62828;
}

/* Footer */
footer.site-footer {
  text-align: center;
  padding: 24px 16px;
  color: var(--gray-400);
  font-size: 0.8rem;
}
