/*
Theme Name: NhaDatVIF Modern
Theme URI: https://nhadatvif.com
Author: NhaDatVIF Team
Author URI: https://nhadatvif.com
Description: Modern real estate theme for NhaDatVIF — clean, fast, and inspired by professional portals like batdongsan.com.vn. Built from scratch with minimal plugins.
Version: 2.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nhadatvif
Tags: real-estate, property, vietnam, responsive, clean
*/

/* ============================================
   BASE + DESIGN TOKENS (batdongsan-inspired)
   ============================================ */

:root {
  --primary: #0a4d8c;        /* Deep professional blue */
  --primary-dark: #063a6b;
  --accent: #e30613;         /* Red accent for price/CTA like many VN portals */
  --text: #1f2937;
  --text-light: #4b5563;
  --bg: #ffffff;
  --bg-light: #f8fafc;
  --border: #e5e7eb;
  --success: #059669;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-light);
  margin: 0;
  padding: 0;
}

body,
input,
select,
textarea,
button {
  letter-spacing: 0;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.3;
  color: #111827;
}

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

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 768px) {
  .container {
    padding: 0 24px;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
  text-decoration: none;
}

.btn-accent {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-accent:hover {
  background: #c10511;
  color: #fff;
  text-decoration: none;
}

.btn-outline {
  background: #fff;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

/* Cards */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--border);
}

/* Property card for listings */
.property-card {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.property-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}

.property-card .thumb {
  position: relative;
  height: 190px;
  overflow: hidden;
  background: #f1f5f9;
}

.property-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.property-card-placeholder {
  height: 100%;
  background: linear-gradient(135deg, #e2e8f0, #f1f5f9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 13px;
}

.property-card-transaction {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #fff;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 4px;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,.1);
}

.property-card-body {
  padding: 12px 14px 14px;
}

.property-card .price {
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
}

.property-card h3 {
  margin: 6px 0 4px;
  min-height: 38px;
  color: #1e2937;
  font-size: 14.5px;
  line-height: 1.3;
  font-weight: 600;
}

.property-card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  color: var(--text-light);
}

.property-card .meta span + span::before {
  content: "·";
  margin-right: 6px;
  color: #94a3b8;
}

.property-card-address {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 12.5px;
  line-height: 1.4;
}

.property-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
}

.property-card-footer strong {
  color: var(--primary);
  font-size: 12px;
  white-space: nowrap;
}

/* Section headers */
.section-title {
  font-size: 20px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
}

/* Utility */
.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  background: #e0f2fe;
  color: var(--primary);
}

.badge-verified {
  background: #d1fae5;
  color: #065f46;
}

.badge-rent {
  background: #fef3c7;
  color: #92400e;
}

/* Forms */
input, select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(10, 77, 140, 0.1);
}

/* Responsive grid helper */
.grid {
  display: grid;
  gap: 20px;
}

@media (min-width: 640px) {
  .grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Old content cleanup - we can remove later */
.clear, .mar_t { display: none !important; } /* kill old classes if any old templates leak */

/* Gallery thumbs on single property */
.ndv-gallery-thumb {
    transition: border-color 0.15s ease;
}
.ndv-gallery-thumb.active,
.ndv-gallery-thumb:hover {
    border-color: var(--primary) !important;
}

/* Make single property look even closer to professional portals */
.ndv-property-single .card {
    border: 1px solid #e5e7eb;
}

/* ============================================
   NEW HEADER STYLES (modern + old elements)
   ============================================ */

.ndv-header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
}

.ndv-topbar {
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    padding: 6px 0;
    font-size: 13px;
    color: #475569;
}

.ndv-topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.ndv-topbar-company {
    color: #64748b;
    text-align: right;
}

.ndv-topbar a {
    color: #0a4d8c;
    font-weight: 600;
}

.ndv-header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 10px 0;
    min-height: 68px;
}

.ndv-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-size: 20px;
    font-weight: 800;
    color: #0a4d8c;
}

.ndv-logo img {
    max-height: 52px;
    width: auto;
    display: block;
}

.ndv-main-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 4px;
}

.ndv-main-nav > ul > li {
    position: relative;
}

.ndv-main-nav a {
    display: block;
    padding: 8px 14px;
    font-size: 14.5px;
    font-weight: 500;
    color: #1e2937;
    border-radius: 6px;
    white-space: nowrap;
}

.ndv-main-nav a:hover {
    background: #f1f5f9;
    text-decoration: none;
    color: #0a4d8c;
}

/* Dropdown */
.ndv-main-nav .has-dropdown .dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 210px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    padding: 8px 0;
    display: none;
    z-index: 200;
}

.ndv-main-nav .has-dropdown:hover .dropdown {
    display: block;
}

.ndv-main-nav .has-dropdown:focus-within .dropdown {
    display: block;
}

.ndv-main-nav .dropdown li a {
    padding: 7px 16px;
    font-size: 14px;
}

.ndv-main-nav .arrow {
    font-size: 11px;
    margin-left: 2px;
    color: #64748b;
}

/* Header Banner (right side - using original animated GIF) */
.ndv-header-banner {
    flex-shrink: 0;
    max-width: 260px;
}

.ndv-header-banner img {
    display: block;
    max-height: 52px;
    width: auto;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

/* Homepage */
.ndv-home-hero {
    background-color: #eef5f9;
    background-image:
        linear-gradient(90deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.84) 48%, rgba(255,255,255,0.50) 100%),
        linear-gradient(180deg, rgba(255,255,255,0.30) 0%, rgba(248,250,252,0.34) 100%),
        url("assets/images/home-hero-hanoi-real-estate.webp");
    background-position: center;
    background-size: cover;
    border-bottom: 1px solid #e5e7eb;
}

.ndv-home-hero-content {
    max-width: 820px;
    padding: 74px 0 58px;
    text-align: center;
    margin: 0 auto;
}

.ndv-home-hero h1 {
    margin: 0;
    font-size: 34px;
    line-height: 1.18;
    font-weight: 800;
    color: #111827;
}

.ndv-home-hero p {
    max-width: 720px;
    margin: 16px auto 0;
    color: #475569;
    font-size: 16px;
}

.ndv-hero-search {
    max-width: 920px;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 150px 150px 160px;
    gap: 10px;
    padding: 18px;
    margin: 26px auto 0;
}

.ndv-hero-search input,
.ndv-hero-search select {
    min-height: 44px;
}

.ndv-hero-search .btn {
    min-height: 44px;
    width: 100%;
}

.ndv-hero-quick-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.ndv-hero-quick-links a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #b8d4ea;
    border-radius: 6px;
    background: rgba(255,255,255,0.86);
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
}

.ndv-hero-quick-links a:hover {
    background: #fff;
    text-decoration: none;
}

.ndv-home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    padding-top: 34px;
    padding-bottom: 54px;
}

.ndv-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.ndv-section-heading .section-title {
    margin: 0;
}

.ndv-section-heading p {
    margin: 8px 0 0;
    color: #64748b;
}

.ndv-section-heading > a {
    flex: 0 0 auto;
    font-size: 14px;
    font-weight: 600;
}

.ndv-property-grid {
    align-items: stretch;
}

.ndv-empty-state {
    grid-column: 1 / -1;
    padding: 24px;
}

.ndv-empty-state p {
    margin: 0;
}

.ndv-location-section {
    margin-top: 42px;
}

.ndv-section-heading-compact {
    align-items: flex-start;
}

.ndv-location-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ndv-location-chips .btn {
    padding: 7px 14px;
    font-size: 13px;
}

.ndv-seo-summary {
    margin-top: 38px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.ndv-seo-summary h2 {
    margin: 0;
    font-size: 21px;
}

.ndv-seo-summary p {
    max-width: 920px;
    margin: 10px 0 0;
    color: #64748b;
}

.ndv-home-sidebar-wrap {
    min-width: 0;
}

.ndv-home-sidebar-wrap .ndv-sidebar {
    position: sticky;
    top: 94px;
}

/* Footer */
.ndv-footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 40px 0 30px;
    margin-top: 40px;
    font-size: 14px;
}

.ndv-footer-grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr 1fr 1fr;
    gap: 30px;
}

.ndv-footer h2 {
    margin: 0 0 10px;
    color: #fff;
    font-size: 16px;
    line-height: 1.35;
}

.ndv-footer p {
    margin: 6px 0;
}

.ndv-footer a {
    color: #cfe5ff;
}

.ndv-footer nav a {
    display: block;
    margin-bottom: 6px;
    color: inherit;
}

.ndv-footer nav a:hover {
    color: #fff;
}

.ndv-footer-bottom {
    border-top: 1px solid #334155;
    margin-top: 30px;
    padding-top: 20px;
    font-size: 12px;
    text-align: center;
}

@media (max-width: 1100px) {
    .ndv-header-banner {
        display: none;
    }
}

@media (max-width: 900px) {
    .ndv-header-main {
        flex-wrap: wrap;
        gap: 12px;
    }
    .ndv-main-nav ul {
        flex-wrap: wrap;
        gap: 2px;
    }

    .ndv-topbar-inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }

    .ndv-topbar-company {
        text-align: left;
    }

    .ndv-home-hero-content {
        padding: 48px 0 40px;
        text-align: left;
    }

    .ndv-home-hero h1 {
        font-size: 29px;
    }

    .ndv-hero-search {
        grid-template-columns: 1fr;
        padding: 14px;
    }

    .ndv-hero-quick-links {
        justify-content: flex-start;
    }

    .ndv-home-layout {
        grid-template-columns: 1fr;
    }

    .ndv-section-heading {
        display: block;
    }

    .ndv-section-heading > a {
        display: inline-flex;
        margin-top: 8px;
    }

    .ndv-home-sidebar-wrap .ndv-sidebar {
        position: static;
    }

    .ndv-footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .ndv-footer-grid {
        grid-template-columns: 1fr;
    }
}

/* Sidebar styles */
.ndv-sidebar .card {
    border: 1px solid #e5e7eb;
}

.ndv-sidebar a {
    text-decoration: none;
}

.ndv-sidebar a:hover {
    text-decoration: none;
}

.ndv-sidebar {
    display: grid;
    gap: 16px;
}

.ndv-sidebar-banner {
    display: block;
    padding: 0;
    overflow: hidden;
}

.ndv-sidebar-banner img {
    width: 100%;
    height: auto;
    display: block;
}

.ndv-contact-card {
    padding: 0;
}

.ndv-contact-card-head {
    background: var(--primary);
    color: #fff;
    padding: 14px 16px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.ndv-contact-card-head span {
    display: block;
    font-size: 12px;
    opacity: 0.85;
}

.ndv-contact-card-head h2 {
    margin: 2px 0 0;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
}

.ndv-contact-card-body {
    padding: 16px;
}

.ndv-contact-card-body .btn {
    width: 100%;
    justify-content: center;
    padding: 10px;
    font-size: 14px;
}

.ndv-contact-card-body .btn + .btn {
    margin-top: 8px;
}

.ndv-contact-card-body p {
    margin: 12px 0 0;
    color: #64748b;
    text-align: center;
    font-size: 12px;
}

.ndv-sidebar-featured {
    padding: 14px;
}

.ndv-sidebar-featured h2 {
    margin: 0 0 10px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 700;
}

.ndv-sidebar-featured-item {
    display: block;
    color: inherit;
    padding: 0 0 9px;
    margin-bottom: 9px;
    border-bottom: 1px solid #f1f5f9;
}

.ndv-sidebar-featured-item:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: 0;
}

.ndv-sidebar-featured-item span {
    display: block;
    color: #1e2937;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
}

.ndv-sidebar-featured-item strong {
    display: block;
    margin-top: 1px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
}

.ndv-sidebar-empty {
    margin: 0;
    color: #64748b;
    font-size: 12px;
}

/* Responsive two-column layouts (homepage + archive + similar) */
@media (max-width: 900px) {
    .container > div[style*="grid-template-columns: 1fr 320px"],
    .container > div[style*="grid-template-columns: 1fr 320px"] {
        grid-template-columns: 1fr !important;
    }

    .ndv-sidebar {
        margin-top: 24px;
    }
}
