:root {
    --primary: #2c3e50;
    --accent: #00C853; /* สีเขียว */
    --bg: #f5f5f5; /* สีพื้นหลังเว็บ (เทาอ่อนๆ) */
    --card-bg: #ffffff;
    --text-main: #333;
}

body {
    font-family: 'Kanit', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Hero Section --- */
.hero-section {
    position: relative;
    height: 320px;
    /* รูปพื้นหลังส่วนหัว */
    background: url('https://gaoukdnqgawneihdqomq.supabase.co/storage/v1/object/public/qr/ks5.jpg') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    border-radius: 0 0 30px 30px; /* โค้งมนด้านล่าง */
}

/* เลเยอร์สีดำจางๆ ทับรูป เพื่อให้อักษรสีขาวอ่านง่าย */
.hero-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4); 
    border-radius: 0 0 30px 30px;
}

.hero-content {
    position: relative;
    z-index: 1;
    margin-bottom: 40px; /* ดันข้อความขึ้นหนีกล่องขาวนิดนึง */
    animation: fadeInDown 1s ease-out;
}

.brand-title {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 700;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.6);
}

.brand-subtitle {
    font-size: 1rem;
    margin-top: 5px;
    font-weight: 300;
    opacity: 0.9;
}

/* --- Main Container (ส่วนสำคัญที่แก้บัค!) --- */
.container {
    max-width: 900px;
    margin: -60px auto 30px; /* ดึงกล่องขึ้นไปทับรูป -60px */
    padding: 30px 20px;
    
    /* 🔥 พื้นหลังสีขาว: ช่วยให้ตัวหนังสือไม่จมหายไปกับรูป */
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    
    width: 90%; /* มือถือให้กว้าง 90% */
    box-sizing: border-box;
    position: relative;
    z-index: 10; /* ลอยอยู่เหนือ Hero Section */
}

.section-title {
    text-align: center;
    margin-bottom: 25px;
}

.section-title h2 {
    font-size: 1.5rem;
    margin-bottom: 5px;
    color: #222;
}

.section-title p {
    color: #666;
    font-size: 0.9rem;
}

/* --- Grid Layout --- */
.house-grid {
    display: grid;
    grid-template-columns: 1fr; /* มือถือ: 1 คอลัมน์ */
    gap: 25px;
}

/* จอใหญ่: 2 คอลัมน์ */
@media (min-width: 768px) {
    .house-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* --- Card Styles --- */
.house-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.house-card:hover {
    transform: translateY(-5px); /* ลอยขึ้น */
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    border-color: var(--accent); /* ขอบเปลี่ยนสี */
}

.img-wrapper {
    width: 100%;
    height: 220px;
    overflow: hidden;
    position: relative;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.house-card:hover .card-img {
    transform: scale(1.1); /* ซูมรูป */
}

.badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 5px 12px;
    border-radius: 30px;
    font-size: 0.75rem;
    backdrop-filter: blur(4px);
}

.card-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.house-name {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--primary);
}

.features {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 0.85rem;
    color: #555;
}

.features i {
    color: var(--accent);
    margin-right: 4px;
}

.house-desc {
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 20px;
    line-height: 1.5;
}

.btn-select {
    margin-top: auto;
    background: var(--primary);
    color: white;
    padding: 12px;
    border-radius: 50px;
    text-align: center;
    font-weight: 500;
    transition: 0.3s;
}

.house-card:hover .btn-select {
    background: var(--accent); /* ปุ่มเปลี่ยนสีเมื่อ hover */
}

.footer {
    text-align: center;
    padding: 30px;
    color: #999;
    font-size: 0.8rem;
    margin-top: auto;
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* เพิ่มส่วนนี้ไว้ใน style.css ของแมนครับ */
.house-card {
    opacity: 0;
    transform: translateY(20px);
}