/* Real Estate Custom Styles */
.property-meta {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.meta-item {
    display: inline-block;
    margin-right: 30px;
    margin-bottom: 10px;
    font-size: 16px;
}

.meta-item.price {
    color: #e74c3c;
    font-weight: bold;
    font-size: 18px;
}

.property-gallery .main-image {
    margin-bottom: 20px;
}

.property-gallery img {
    border-radius: 8px;
}

/* Archive page grid */
.real-estate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

.property-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.property-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.property-card-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.property-card-content {
    padding: 20px;
}

.property-card-price {
    color: #e74c3c;
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 10px;
}

.property-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #666;
}

/* Search form */
.real-estate-search {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}

.search-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

.search-form-grid .form-group {
    margin-bottom: 0;
}

.search-form-grid input,
.search-form-grid select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.search-form-grid button {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
}
/* --- BIẾN MÀU (Tùy chỉnh tại đây) --- */
:root {
    --primary-color: #0073e6;
    --secondary-color: #ff6600;
    --text-color: #333;
    --text-light: #777;
    --border-color: #e0e0e0;
    --bg-light: #f9f9f9;
    --white: #ffffff;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --border-radius: 8px;
}

/* --- CSS CHUNG CHO TRANG CHỦ --- */
.homepage-main .section-padding {
    padding: 60px 0;
}
.homepage-main .alt-bg {
    background-color: var(--bg-light);
}
.homepage-main .section-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-color);
    text-align: center;
    margin-bottom: 15px;
}
.homepage-main .section-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    text-align: center;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.homepage-main .section-footer {
    text-align: center;
    margin-top: 40px;
}
.btn {
    display: inline-block;
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}
.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}
.btn-primary:hover {
    background-color: #005bb5;
    color: var(--white);
}
.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--white);
}
.btn-secondary:hover {
    background-color: #cc5200;
    color: var(--white);
}

/* --- SECTION 1: HERO & SEARCH --- */
.hero-section {
    position: relative;
    padding: 100px 0;
    background-image: url('https://via.placeholder.com/1920x600.png?text=Hero+Background+Image'); /* Thay ảnh nền tại đây */
    background-size: cover;
    background-position: center;
    color: var(--white);
    min-height: 500px;
    display: flex;
    align-items: center;
}
.hero-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.5); /* Lớp phủ tối */
}
.hero-section .ast-container {
    position: relative;
    z-index: 2;
    text-align: center;
}
.hero-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.hero-subtitle {
    font-size: 1.25rem;
    color: var(--white);
    margin-bottom: 30px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.hero-search-form {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}
/* CSS cho form tìm kiếm (advanced-search.php) */
.hero-search-form .advanced-property-search {
    padding: 0;
}
.hero-search-form .search-header {
    display: none; /* Ẩn tiêu đề của form tìm kiếm */
}
.hero-search-form .search-form-main {
    background: transparent;
    border: none;
    padding: 0;
}
.hero-search-form .search-row {
    gap: 15px;
}
.hero-search-form .search-group {
    flex-basis: 20%;
}
.hero-search-form .search-actions {
    margin-top: 15px;
    justify-content: center;
}

/* --- SECTION 2: CATEGORIES --- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}
.category-card {
    text-decoration: none;
    color: var(--text-color);
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    overflow: hidden;
}
.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}
.category-card-inner {
    padding: 25px 20px;
    text-align: center;
}
.category-icon {
    font-size: 2.5rem;
    line-height: 1;
    display: block;
    margin-bottom: 15px;
}
.category-card h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}
.category-count {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 5px;
}

/* --- SECTION 3 & 4: PROPERTIES GRID --- */
.properties-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

/* --- TEMPLATE PART: PROPERTY CARD --- */
.property-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}
.property-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-5px);
}
.property-card-image {
    position: relative;
    height: 200px; /* Chiều cao cố định cho ảnh */
}
.property-card-image a {
    display: block;
    width: 100%;
    height: 100%;
}
.property-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Đảm bảo ảnh lấp đầy khung */
}
.property-status-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--primary-color);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}
.btn-toggle-favorite {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.btn-toggle-favorite svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-color);
    fill: none;
}
.btn-toggle-favorite:hover,
.btn-toggle-favorite.favorited {
    background: #ffc107;
}
.btn-toggle-favorite.favorited svg {
    fill: #dc3545;
    stroke: #dc3545;
}
.property-card-content {
    padding: 15px;
}
.property-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}
.property-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 5px;
    flex: 1;
}
.property-card-title a {
    text-decoration: none;
    color: var(--text-color);
}
.property-card-title a:hover {
    color: var(--primary-color);
}
.property-card-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary-color);
    white-space: nowrap;
}
.property-card-location {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.property-card-location svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.property-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-color);
}
.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.meta-item svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-light);
}
.property-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    margin-top: 15px;
    border-top: 1px solid var(--border-color);
}
.property-card-author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
}
.property-card-author img {
    border-radius: 50%;
}
.property-card-date {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* --- SECTION 6: CTA --- */
.cta-section {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 60px 0;
    text-align: center;
}
.cta-content h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 15px;
}
.cta-content p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    opacity: 0.9;
}
.cta-content .btn-secondary {
    background-color: var(--white);
    color: var(--primary-color);
    font-weight: 700;
}
.cta-content .btn-secondary:hover {
    background-color: var(--bg-light);
    color: var(--primary-color);
}
.site-content .ast-container{
    display: block;
}
/* --- RESPONSIVE --- */
@media (max-width: 992px) {
    .properties-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
    .hero-search-form .search-group {
        flex-basis: 48%;
    }
}

@media (max-width: 768px) {
    .homepage-main .section-padding {
        padding: 40px 0;
    }
    .hero-title {
        font-size: 2.2rem;
    }
    .hero-subtitle {
        font-size: 1.1rem;
    }
    .properties-grid {
        grid-template-columns: 1fr;
    }
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .hero-search-form .search-row {
        flex-direction: column;
        gap: 15px;
    }
}