:root {
    --color-primary: #1a7f5a;
    --color-primary-dark: #145c42;
    --color-bg: #f7f8f6;
    --color-card: #ffffff;
    --color-text: #1f2620;
    --color-muted: #6b7570;
    --color-border: #e2e6e2;
    --radius: 12px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Sarabun", "Segoe UI", sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
}

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

/* Header */
.site-header {
    background: var(--color-card);
    border-bottom: 1px solid var(--color-border);
    padding: 14px 0;
}
.header-inner { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.logo { display: inline-flex; align-items: center; text-decoration: none; }
.logo__img { height: 72px; width: 72px; border-radius: 10px; display: block; }

/* Hero */
.hero {
    text-align: center;
    background-size: cover;
    background-position: center;
    background-color: #1f2620;
    border-radius: var(--radius);
    margin-top: 20px;
    overflow: hidden;
}
.hero__overlay {
    background: linear-gradient(180deg, rgba(20,26,20,0.35) 0%, rgba(20,26,20,0.75) 100%);
    padding: 90px 20px;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.hero h1 { font-size: 2.1rem; margin: 0 0 10px; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,0.4); }
.hero p { color: #f0f2ef; margin: 0; font-size: 1.1rem; }
@media (min-width: 768px) {
    .hero__overlay { padding: 140px 20px; min-height: 440px; }
    .hero h1 { font-size: 3rem; }
    .hero p { font-size: 1.25rem; }
}

/* Filter bar */
.filter-bar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    background: var(--color-card);
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    margin-top: 20px;
    margin-bottom: 24px;
}
.filter-bar input,
.filter-bar select {
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
    width: 100%;
}
@media (min-width: 768px) {
    .filter-bar { grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr auto; align-items: center; }
}

/* Inline variant: filter bar sits in the header, on the same row as the
   logo, instead of as its own card below it. */
.filter-bar--inline {
    flex: 1 1 640px;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-secondary { background: #fff; color: var(--color-primary-dark); border: 1px solid var(--color-primary); }

.result-count { color: var(--color-muted); margin-bottom: 12px; }

/* Property grid */
.property-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    padding-bottom: 40px;
}
@media (min-width: 640px) {
    .property-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 992px) {
    .property-grid { grid-template-columns: repeat(3, 1fr); }
}

.property-card {
    background: var(--color-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--color-border);
    text-decoration: none;
    color: inherit;
    display: block;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.property-card:hover { box-shadow: 0 8px 20px rgba(0,0,0,0.08); transform: translateY(-2px); }

.property-card__image {
    height: 180px;
    background-size: cover;
    background-position: center;
    background-color: #e9ece9;
    position: relative;
    display: flex; align-items: center; justify-content: center;
}
.no-image { color: var(--color-muted); font-size: 0.9rem; }

.badge {
    position: absolute; top: 10px; left: 10px;
    padding: 4px 10px; border-radius: 999px;
    font-size: 0.75rem; font-weight: 600; color: #fff;
}
.badge--available { background: #2c9a5f; }
.badge--reserved { background: #d99a2b; }
.badge--rented_sold { background: #9a2b2b; }
.badge--pending { background: #6b7570; }

.property-card__body { padding: 14px 16px; }
.property-card__body h3 { margin: 0 0 4px; font-size: 1.1rem; }
.property-card__address { color: var(--color-muted); font-size: 0.9rem; margin: 0 0 8px; }
.property-card__specs { font-size: 0.9rem; color: var(--color-muted); margin: 0 0 8px; }
.property-card__price { font-weight: 700; color: var(--color-primary-dark); margin: 0; }

.empty-state { color: var(--color-muted); padding: 40px 0; text-align: center; grid-column: 1 / -1; }

/* Detail page */
.back-link { display: inline-block; margin: 20px 0; color: var(--color-primary-dark); text-decoration: none; }
.detail-layout { display: grid; grid-template-columns: 1fr; gap: 24px; padding-bottom: 40px; }
@media (min-width: 768px) {
    .detail-layout { grid-template-columns: 1fr 1fr; }
}
.detail-image {
    min-height: 280px;
    background-size: cover;
    background-position: center;
    background-color: #e9ece9;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
}
.detail-body h1 { margin: 8px 0 4px; }
.detail-address { color: var(--color-muted); }
.detail-price { font-size: 1.4rem; font-weight: 700; color: var(--color-primary-dark); margin: 16px 0; }
.detail-specs { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 20px; }
.detail-specs li { background: var(--color-card); border: 1px solid var(--color-border); padding: 6px 12px; border-radius: 8px; font-size: 0.9rem; }
.detail-description { margin-bottom: 20px; }
.detail-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

/* Footer */
.site-footer { padding: 24px 0; text-align: center; color: var(--color-muted); font-size: 0.9rem; }

/* Floating chat buttons */
.chat-fab-group { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 10; }
.chat-fab {
    width: 56px; height: 56px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 0.8rem;
    text-decoration: none; box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.chat-fab--line { background: #06c755; }
.chat-fab--fb { background: #0866ff; }
