/* === Global Styles & Variables === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Kanit', sans-serif;
}

body {
    background: #ffffff;
    color: #252525;
    overflow-x: hidden;
    will-change: scroll-position;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* === Header === */
header {
    background: linear-gradient(90deg, #1a3c34, #2e7d32);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    padding: 1rem 2rem;
    transition: all 0.3s ease;
    will-change: background, padding;
}

header.scrolled {
    background: rgba(26, 60, 52, 0.92);
    backdrop-filter: blur(12px);
    padding: 0.8rem 2rem;
}

nav {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #a5d6a7;
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(45deg, #a5d6a7, #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 1px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 3rem;
}

nav a {
    color: #e0e7ff;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 400;
    position: relative;
    transition: all 0.3s ease;
    will-change: color, transform;
}

nav a:hover {
    color: #a5d6a7;
    transform: translateY(-2px);
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: -6px;
    left: 0;
    background: linear-gradient(90deg, #4caf50, #a5d6a7);
    transition: width 0.3s ease;
    will-change: width;
}

nav a:hover::after {
    width: 100%;
}

/* === Hamburger Menu (for Mobile) === */
.nav-toggle {
    display: none;
}

.nav-toggle-label {
    display: none;
    cursor: pointer;
    width: 30px;
    height: 24px;
    position: relative;
    z-index: 1100;
}

.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
    content: '';
    display: block;
    background-color: #e0e7ff;
    height: 3px;
    width: 100%;
    border-radius: 2px;
    position: absolute;
    left: 0;
    transition: all 0.3s ease-in-out;
    will-change: transform, background-color;
}

.nav-toggle-label span { top: 50%; transform: translateY(-50%); }
.nav-toggle-label span::before { top: -8px; }
.nav-toggle-label span::after { bottom: -8px; }


/* === Page: Index.html Sections === */
.featured-projects {
    padding: 8rem 0.5rem 4rem;
    max-width: 1440px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 1;
}

.featured-projects::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://images.unsplash.com/photo-1600585154340-be6161a56a0c') no-repeat center center/cover;
    opacity: 0.1;
    z-index: -1;
}

.featured-projects h1 {
    font-size: 2.5rem;
    animation: slideIn 1s ease-out;
    will-change: opacity, transform;
}

.featured-projects p {
    font-size: 1.5rem;
    font-weight: 300;
    color: #252525;
    margin-bottom: 3rem;
    animation: slideIn 1.2s ease-out;
    will-change: opacity, transform;
}

.project-grid { display: flex; gap: 2rem; align-items: stretch; }
.project-card-large { flex: 1; background: #43474d; border-radius: 20px; overflow: hidden; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); will-change: transform, box-shadow; }
.project-card-large img { width: 100%; height: 600px; object-fit: cover; }
.project-card-small-grid { flex: 1; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.project-card-small { position: relative; overflow: hidden; border-radius: 20px; will-change: transform, box-shadow; }
.project-card-small img { width: 100%; height: 400px; object-fit: cover; border-radius: 20px; }
.project-info { padding: 1.5rem; }
.project-info h3 { font-size: 1.4rem; font-weight: 600; margin-bottom: 0.5rem; color: #a5d6a7; }
.project-info p { font-size: 1.1rem; font-weight: 300; color: #94a3b8; margin-bottom: 1rem; }
.btn-project-details { display: inline-block; margin-top: 1rem; padding: 0.8rem 1.8rem; background-color: #4CAF50; color: #ffffff; text-decoration: none; border-radius: 25px; font-weight: 600; font-size: 1rem; transition: all 0.3s ease; box-shadow: 0 2px 5px rgba(0,0,0,0.15); will-change: background-color, transform, box-shadow; }
.btn-project-details:hover { background-color: #a5d6a7; color: #1a3c34; transform: translateY(-3px); box-shadow: 0 4px 10px rgba(0,0,0,0.25); }
.properties { padding: 4rem 0.5rem; max-width: 1440px; margin: -40px auto 0; }
.properties h2, .featured-projects h1 { font-weight: 700; text-align: center; margin-bottom: 1rem; background: linear-gradient(45deg, #29792b, #6fd872); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.properties h2 { font-size: 2.5rem; margin-bottom: 4rem; }
.property-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 2.5rem; }
.property-card { background: #1e293b; border-radius: 20px; overflow: hidden; transition: all 0.4s ease; position: relative; cursor: pointer; box-shadow: 0 5px 15px rgba(0,0,0,0.2); will-change: transform, box-shadow; }
.property-card:hover { transform: translateY(-15px); box-shadow: 0 15px 30px rgba(0,0,0,0.4); }
.property-card img { width: 100%; height: 280px; object-fit: cover; transition: transform 0.5s ease; will-change: transform; }
.property-card:hover img { transform: scale(1.1); }
.property-info { padding: 2rem; }
.property-info h3 { font-size: 2rem; font-weight: 600; margin-bottom: 0.8rem; color: #a5d6a7; }
.property-details-custom p { color: #94a3b8; margin-bottom: 0.75rem; font-size: 1.1rem; font-weight: 300; line-height: 1.6; }
.property-details-custom p:last-child { margin-bottom: 0; }
.project-price { margin-top: 1rem; font-size: 1.05rem; color: #94a3b8; }
.price-inline { font-weight: 700; color: #a5d6a7; }
.project-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.8rem; margin: 1rem 0 1.2rem; padding: 0.5rem 0; border-top: 1px solid rgba(148, 163, 184, 0.2); border-bottom: 1px solid rgba(148, 163, 184, 0.2); }
.feature-item { display: flex; align-items: center; font-size: 0.9rem; }
.feature-text { color: #FFFFFF; }
.property-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(135deg, rgba(26,60,52,0.9), rgba(46,125,50,0.7)); opacity: 0; display: flex; align-items: center; justify-content: center; transition: opacity 0.4s ease; will-change: opacity; }
.property-card:hover .property-overlay { opacity: 1; }
.property-overlay a { background: #ffffff; color: #1a3c34; padding: 1rem 2.5rem; border-radius: 50px; text-decoration: none; font-size: 1.2rem; font-weight: 600; transition: all 0.3s ease; will-change: background, color, transform; }
.property-overlay a:hover { background: #a5d6a7; color: #ffffff; transform: scale(1.05); }

/* === Page: Project-Details.html & project-updates.html === */
.page-title-section {
    padding: 140px 1rem 4rem;
    text-align: center;
    background: linear-gradient(45deg, rgba(26, 60, 52, 0.05), rgba(46, 125, 50, 0.1));
}
.page-title-section h1 {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(45deg, #29792b, #6fd872);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}
.page-title-section p {
    font-size: 1.3rem;
    color: #555;
    max-width: 700px;
    margin: 0 auto;
}

.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.house-types-grid-container {
    display: flex;
    flex-direction: column;
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
}

.house-type-section {
    padding: 4rem 2rem;
    overflow-x: clip;
    min-width: 0;
}
.house-type-section.alt-bg {
    background-color: #f8f9fa;
}
.house-type-title-overlay {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 10;
    background-color: rgba(26, 60, 52, 0.8);
    color: #ffffff;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-size: 2.2rem;
    font-weight: 700;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.house-type-header {
    text-align: center;
    margin-bottom: 3rem;
}

.house-type-header h2 {
    font-size: 2.8rem;
    font-weight: 700;
    color: #1a3c34;
    margin-bottom: 0.5rem;
}

.house-type-header p {
    font-size: 1.2rem;
    color: #6c757d;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

/* --- Unified Gallery --- */
.unified-gallery-container {
    max-width: 900px;
    margin: 0 auto 3rem auto;
}
.main-media-display {
    width: 100%;
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    background-color: #e0e0e0;
    aspect-ratio: 16 / 9;
    will-change: transform, opacity;
}
.main-media-display .media-item {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    display: none;
}
.main-media-display .media-item.active { display: block; }
.main-media-display iframe,
.main-media-display img {
    width: 100%; height: 100%;
    object-fit: cover;
    border: 0;
}

/* --- Thumbnail Gallery --- */
.thumbnail-wrapper {
    position: relative;
    margin-top: 1.5rem;
    padding: 0 22px;
}
.thumbnail-scroll-container {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f1f1f1;
    will-change: scroll-position;
}
.thumbnail-scroll-container::-webkit-scrollbar { height: 8px; }
.thumbnail-scroll-container::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; }
.thumbnail-scroll-container::-webkit-scrollbar-thumb { background: #ccc; border-radius: 10px; }
.thumbnail-scroll-container::-webkit-scrollbar-thumb:hover { background: #aaa; }

.thumbnail-grid { display: flex; flex-wrap: nowrap; gap: 1rem; }
.thumbnail {
    width: 140px; height: 90px;
    flex-shrink: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    border: 3px solid transparent;
    will-change: border-color, transform, opacity;
}
.thumbnail.active { border-color: #2e7d32; transform: scale(1.05); }
.thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.thumbnail:hover { opacity: 0.8; }

.play-icon-overlay {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}
.play-icon-overlay::after {
    content: '▶';
    font-size: 30px;
    color: white;
}

.scroll-arrow {
    position: absolute; top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background-color: rgba(26, 60, 52, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 38px; height: 38px;
    font-size: 20px;
    cursor: pointer;
    will-change: opacity;
    transition: background-color 0.3s ease, opacity 0.3s ease;
}
.scroll-arrow:hover { background-color: #2e7d32; }
.scroll-arrow.hidden { opacity: 0; pointer-events: none; }
.scroll-arrow.left-arrow { left: 0; }
.scroll-arrow.right-arrow { right: 0; }

/* --- Details Section --- */
.details-section-wrapper {
    margin-top: 3rem;
    padding-top: 2.5rem;
    border-top: 1px solid #e0e0e0;
    /* Removed flex properties to ensure features-grid displays as its own grid */
}

.details-header-block {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 2.5rem auto;
}

.details-header-block h2 { font-size: 2.8rem; }
.details-header-block .house-type-subtitle { font-size: 1.5rem; margin-bottom: 1.5rem; }
.details-header-block .house-type-description { font-size: 1.2rem; line-height: 1.8; }

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2.5rem;
}
.feature-box {
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}
.feature-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}
.feature-box i {
    font-size: 1.6rem;
    color: #2e7d32;
    margin-bottom: 0.6rem;
}
.feature-box h4 { font-size: 1.2rem; margin: 0; color: #343a40; }
.feature-box p { font-size: 0.85rem; color: #6c757d; margin-top: 0.25rem; }

.cta-container { text-align: center; }
.cta-button {
    display: inline-block;
    padding: 1rem 3rem;
    background-color: #2e7d32;
    color: #ffffff;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
    will-change: background-color, transform, box-shadow;
    border: none;
    cursor: pointer;
}
.cta-button:hover {
    background-color: #1a3c34;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* --- Project Updates Page Styles --- */
.update-grid {
    max-width: none;
    margin: 4rem 1rem;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}
.update-card {
    background: #f8f9fa;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%; /* Ensure card fills the grid cell height */
}
.update-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}
.update-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}
.update-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Allow content to grow to fill space */
}
.update-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1a3c34;
}
.update-content .update-meta {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 1rem;
}
.update-content p {
    font-size: 1rem;
    color: #495057;
    line-height: 1.6;
    margin-bottom: 1rem;
    /* ใช้ flex-grow เพื่อให้ยืดหยุ่น */
    flex-grow: 1;
     display: -webkit-box;
    -webkit-line-clamp: 3; /* กำหนดให้แสดงข้อความได้สูงสุด 3 บรรทัด */
    -webkit-box-orient: vertical;
    overflow: hidden; /* ซ่อนข้อความที่เกิน */
    text-overflow: ellipsis; /* เพิ่ม '...' ที่ท้ายข้อความที่ถูกตัด */
}
.update-content a.read-more-btn {
    display: inline-block;
    margin-top: auto; /* ผลักปุ่มไปอยู่ล่างสุด */
    padding: 0.7rem 1.5rem;
    background-color: #2e7d32;
    color: #ffffff;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: background-color 0.3s ease;
    align-self: flex-start; /* Align button to the start (left) */
}
.update-content a.read-more-btn:hover { background-color: #1a3c34; }
.update-card .hidden-content { display: none; }

/* --- Styles for Filter & Pagination Controls --- */
.update-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-sort-group {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.filter-dropdown {
    padding: 0.75rem 1.2rem;
    border-radius: 8px;
    border: 1px solid #dcdcdc;
    font-size: 1rem;
    background-color: #ffffff;
    color: #252525;
    transition: all 0.3s ease;
}
.filter-dropdown:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.2);
}
.pagination-controls-container {
    margin-top: 3rem;
    margin-bottom: 5rem;
    display: flex;
    justify-content: center;
}
.pagination-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.page-link {
    background-color: #ffffff;
    border: 1px solid #dcdcdc;
    color: #1a3c34;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}
.page-link:hover:not(:disabled) {
    background-color: #f0f0f0;
    border-color: #c4c4c4;
}
.page-link.active {
    background-color: #2e7d32;
    color: #ffffff;
    border-color: #2e7d32;
}
.page-link:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* --- Quick View Panel Styles --- */
.quick-view-overlay {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 2000;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.4s ease, visibility 0s 0.4s;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}
.quick-view-overlay.active {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.4s ease;
}
.quick-view-panel {
    position: relative;
    width: 95%;
    max-width: 900px;
    max-height: 90vh;
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    transform: scale(0.8);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.quick-view-overlay.active .quick-view-panel { transform: scale(1); }
.close-panel-btn {
    position: absolute; top: 15px; right: 20px;
    background: none; border: none;
    font-size: 2.5rem;
    color: #888;
    cursor: pointer;
    line-height: 1;
    z-index: 2001;
    transition: color 0.3s ease;
}
.close-panel-btn:hover { color: #252525; }
.panel-content { padding-top: 1rem; }
.panel-text-content { margin-top: 2rem; }
.panel-text-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a3c34;
    margin-bottom: 0.5rem;
}
.panel-text-content p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #495057;
    margin-bottom: 1rem;
}
#panel-main-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border-radius: 12px;
}
#panel-thumbnails .thumbnail {
    width: 120px;
    height: 80px;
}

/* === QR Code Modal Styles === */
.modal-overlay {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
    will-change: opacity, visibility;
}
.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}
.modal-content {
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    position: relative;
    max-width: 90%;
    width: 400px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    will-change: transform;
}
.modal-overlay.visible .modal-content { transform: scale(1); }
.modal-content h3 { font-size: 1.5rem; color: #1a3c34; margin-bottom: 1.5rem; }
.qr-code-image { max-width: 100%; height: auto; border-radius: 10px; }
.close-modal-button {
    position: absolute; top: 10px; right: 20px;
    font-size: 30px;
    font-weight: bold;
    color: #888;
    cursor: pointer;
    line-height: 1;
}
.close-modal-button:hover { color: #252525; }

/* === Footer === */
.site-footer {
    background-color: #1e293b;
    color: #cbd5e1;
    padding: 3rem 2rem;
    text-align: left;
    border-top: 5px solid #a5d6a7;
}
.footer-container {
    max-width: 1440px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1.5fr 1fr;
    gap: 2rem;
    align-items: start;
}
.footer-column h3, .footer-column h4 { color: #a5d6a7; font-weight: 600; margin-bottom: 1rem; }
.footer-column h3 { font-size: 1.6rem; }
.footer-column h4 { font-size: 1.2rem; }
.footer-column p { margin-bottom: 1rem; line-height: 1.6; font-weight: 300; font-size: 0.95rem; }
.cta-button-footer {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.7rem 1.8rem;
    background-color: #a5d6a7;
    color: #1a3c34;
    text-decoration: none;
    font-weight: 700;
    border-radius: 50px;
    transition: all 0.3s ease;
    will-change: background-color, transform;
}
.cta-button-footer:hover { background-color: #ffffff; transform: translateY(-2px); }
.footer-social a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.3s ease;
    margin-bottom: 1rem;
    will-change: color;
}
.footer-social a:hover { color: #a5d6a7; }
.footer-align-right { text-align: right; }
.footer-align-right .footer-social a { justify-content: flex-end; }
.copyright { font-size: 0.85rem; color: #94a3b8; margin-top: 2rem; }

/* === General Animations === */
@keyframes slideIn {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === Responsive Design (Media Queries) === */
@media (max-width: 1024px) {
    .featured-projects h1 { font-size: 3rem; }
    .featured-projects p { font-size: 1.3rem; }
    .project-grid { flex-direction: column; }
    .property-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
    .project-card-large img { height: 450px; }
    .project-card-small img { height: 260px; }
    .property-card img { height: 240px; }
}

@media (max-width: 992px) {
    .footer-container {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    .footer-column, .footer-align-right { text-align: center; }
    .footer-align-right .footer-social a { justify-content: center; }
    .house-types-grid-container { display: block; }
}
@media (min-width: 992px) {
    .house-types-grid-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .logo-img { width: 48px; height: 48px; }
    .logo-text { font-size: 1.5rem; }

    .nav-toggle-label { display: block; }
    .nav-menu { position: fixed; top: 0; left: 0; right: 0; background: rgba(26,60,52,0.98); backdrop-filter: blur(10px); flex-direction: column; align-items: center; width: 100%; padding: 80px 0 0 0; gap: 0; max-height: 0; overflow: hidden; transition: max-height 0.4s ease-out; z-index: 1050; will-change: max-height; }
    .nav-toggle:checked ~ .nav-menu { max-height: 100vh; }
    .nav-menu li { width: 100%; text-align: center; border-bottom: 1px solid rgba(165,214,167,0.1); }
    .nav-menu li:last-child { border-bottom: none; }
    nav a { display: block; padding: 1.2rem 1rem; font-size: 1.1rem; width: 100%; }
    nav a:hover { background-color: rgba(165,214,167,0.15); transform: translateY(0); }
    nav a::after { display: none; }

    .nav-toggle-label span, .nav-toggle-label span::before, .nav-toggle-label span::after { top: 0; bottom: 0; margin: auto; }
    .nav-toggle:checked ~ .nav-toggle-label span { background-color: transparent; }
    .nav-toggle:checked ~ .nav-toggle-label span::before { transform: translateY(-50%) rotate(45deg); top: 50%; }
    .nav-toggle:checked ~ .nav-toggle-label span::after { transform: translateY(-50%) rotate(-45deg); top: 50%; }

    .featured-projects h1 { font-size: 2.5rem; }
    .featured-projects p { font-size: 1.1rem; }
    .project-card-large img { height: 400px; }
    .project-card-small img { height: 220px; }
    .properties h2 { font-size: 2.8rem; }
    .project-info h3, .property-info h3 { font-size: 1.8rem; }

    .page-title-section { padding: 120px 1rem 3rem; }
    .house-type-header h2 { font-size: 2.2rem; }
    .house-type-header p { font-size: 1rem; }
    .details-header-block h2 { font-size: 2.4rem; }
    .details-header-block .house-type-subtitle { font-size: 1.3rem; }
    .details-header-block .house-type-description { font-size: 1.1rem; }
    .house-type-title-overlay { font-size: 1.8rem; padding: 0.6rem 1.2rem; bottom: 15px; left: 15px; }

    .scroll-arrow { opacity: 0.7; pointer-events: auto; }
    .scroll-arrow.left-arrow { left: 5px; }
    .scroll-arrow.right-arrow { right: 5px; }
    .scroll-arrow.hidden { display: none; }

    .features-grid { grid-template-columns: repeat(2, 1fr); gap: 0.8rem; }
    .feature-box i { font-size: 1.4rem; }
    .feature-box h4 { font-size: 1.1rem; }
    .thumbnail { width: 120px; height: 80px; }
    .scroll-arrow { width: 32px; height: 32px; font-size: 18px; }

    .quick-view-panel { max-width: 95%; padding: 1rem; }
    .panel-text-content h2 { font-size: 2rem; }
    .panel-text-content p { font-size: 1rem; }

    /* Updated update-grid for mobile */
    .update-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; padding: 2rem 1rem; }
}

@media (max-width: 576px) {
    .features-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
}

@media (max-width: 480px) {
    .logo-img { width: 40px; height: 40px; }
    .logo-text { font-size: 1.2rem; }
    .featured-projects h1 { font-size: 2rem; }
    .featured-projects p { font-size: 1rem; }
    .project-card-small-grid { grid-template-columns: 1fr; }
    .project-card-large img { height: 350px; }
    .project-card-small img, .property-card img { height: 200px; }
    .project-info h3, .property-info h3 { font-size: 1.5rem; }
    .house-type-header h2 { font-size: 2rem; }
    .house-type-title-overlay { font-size: 1.4rem; padding: 0.5rem 1rem; }
    .features-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
    .update-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}

@media (min-width: 768px) {
    .update-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 2rem;
        padding: 2rem 2rem;
    }
}

@media (min-width: 1400px) {
    .update-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 2.5rem;
        padding: 2rem 2.5rem;
    }
}
.house-status-badges {
    display: flex;
    justify-content: center;
    gap: 1rem; /* เพื่อให้มีระยะห่างระหว่างปุ่ม */
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.2rem;
    border-radius: 50px; /* ทำให้ปุ่มมีลักษณะเป็นเม็ดยา */
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.status-badge i {
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

.status-badge:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.total-badge {
    background-color: #2e7d32; /* สีเขียว */
}

.sold-badge {
    background-color: #dc3545; /* สีแดง */
}

/* New CSS for Sold Out Badge */
.sold-out-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-20deg); /* Rotate for a dynamic look */
    background-color: rgba(220, 53, 69, 0.9); /* Red with some transparency */
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-size: 2rem; /* Large font size */
    font-weight: 700; /* Bold */
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 10; /* Ensure it's above the image */
    pointer-events: none; /* Allow clicks to pass through to the underlying image if needed */
    white-space: nowrap; /* Prevent text from wrapping */
}

/* Apply to main media display and thumbnails for Type D */
#house-type-d .main-media-display .media-item,
#house-type-d .thumbnail {
    position: relative; /* Ensure children can be positioned absolutely relative to this */
}

/* Price Tag Styling */
.price-tag {
    font-size: 2rem; /* Make it large and prominent */
    font-weight: 700;
    color: #1a3c34; /* Dark green/blue for contrast */
    background: linear-gradient(90deg, #a5d6a7, #c8e6c9); /* Light green gradient background */
    padding: 1rem 2rem;
    border-radius: 12px;
    margin-bottom: 2rem; /* Space below the price tag */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: fit-content; /* Adjust width to content */
    /* Updated for centering after removing flex from parent */
    display: block;
    margin: 1.5rem auto 2rem auto;
}

/* Adjust for smaller screens */
@media (max-width: 768px) {
    .price-tag {
        font-size: 1.5rem;
        padding: 0.8rem 1.5rem;
    }
}