/*
Theme Name: RealHomes Cantho
Theme URI: https://nhadatcanthoinfo.vn
Description: Child theme for nhadatcanthoinfo.vn - Modern real estate
Author: Jan
Template: realhomes
Version: 1.0.0
Text Domain: realhomes-cantho
*/

/* === RESET & BASE === */
:root {
  --primary: #1a5276;
  --primary-light: #2471a3;
  --cta: #e67e22;
  --cta-hover: #d35400;
  --text: #2c3e50;
  --text-light: #7f8c8d;
  --bg: #f8f9fa;
  --white: #ffffff;
  --border: #e0e0e0;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --radius: 8px;
}

/* === FIX HEADER DUPLICATION === */
.rh_header_var_1 + .rh_header_var_1,
.rh_header_responsive + .rh_header_responsive,
#rh_header + #rh_header,
.site-header + .site-header { display: none !important; }

/* === HEADER === */
.rh_header_var_1, #rh_header { background: var(--primary) !important; }
.rh_wrap--header { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* Hotline + Zalo in header */
.cantho-header-contact {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; color: #fff;
}
.cantho-header-contact a {
  color: #fff; text-decoration: none; display: flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,0.15); padding: 5px 12px; border-radius: 20px;
  transition: background .2s;
}
.cantho-header-contact a:hover { background: var(--cta); }
.cantho-header-contact .zalo-btn { background: #0068ff; }

/* === HERO SECTION === */
.cantho-hero {
  background: linear-gradient(135deg, var(--primary) 0%, #154360 60%, #1a252f 100%);
  padding: 64px 16px 80px; text-align: center; position: relative;
  overflow: hidden;
}
.cantho-hero::before {
  content: ''; position: absolute; inset: 0;
  background: url('https://nhadatcanthoinfo.vn/wp-content/uploads/2021/09/Banner.jpg') center/cover no-repeat;
  opacity: 0.15;
}
.cantho-hero-inner { position: relative; max-width: 800px; margin: 0 auto; }
.cantho-hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.8rem); color: #fff; font-weight: 800;
  line-height: 1.3; margin-bottom: 12px; text-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.cantho-hero .subtitle {
  color: rgba(255,255,255,.85); font-size: 1.1rem; margin-bottom: 32px;
}
.cantho-search-bar {
  background: #fff; border-radius: 12px; padding: 16px;
  display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.2); max-width: 860px; margin: 0 auto 20px;
}
.cantho-search-bar input,
.cantho-search-bar select {
  border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; font-size: 15px; color: var(--text);
  width: 100%; outline: none; transition: border .2s;
}
.cantho-search-bar input:focus,
.cantho-search-bar select:focus { border-color: var(--primary); }
.cantho-search-bar .btn-search {
  background: var(--cta); color: #fff; border: none; border-radius: var(--radius);
  padding: 12px 24px; font-size: 15px; font-weight: 700; cursor: pointer;
  white-space: nowrap; transition: background .2s;
}
.cantho-search-bar .btn-search:hover { background: var(--cta-hover); }
.cantho-hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cantho-hero-ctas a {
  padding: 12px 28px; border-radius: 30px; font-weight: 700; font-size: 15px;
  text-decoration: none; transition: all .2s;
}
.btn-primary-cta { background: var(--cta); color: #fff; }
.btn-primary-cta:hover { background: var(--cta-hover); transform: translateY(-1px); }
.btn-outline-cta { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.7); }
.btn-outline-cta:hover { background: rgba(255,255,255,.15); }

/* === QUICK FILTER PILLS === */
.cantho-quick-filter {
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 14px 16px; overflow-x: auto; white-space: nowrap;
}
.cantho-quick-filter-inner { max-width: 1200px; margin: 0 auto; display: flex; gap: 8px; }
.cantho-filter-pill {
  display: inline-block; padding: 7px 18px; border-radius: 20px;
  border: 1.5px solid var(--border); color: var(--text); text-decoration: none;
  font-size: 14px; font-weight: 500; transition: all .2s; background: #fff;
}
.cantho-filter-pill:hover, .cantho-filter-pill.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}

/* === SECTION LAYOUT === */
.cantho-section { padding: 56px 16px; }
.cantho-section-alt { background: var(--bg); }
.cantho-section-title {
  text-align: center; margin-bottom: 36px;
}
.cantho-section-title h2 {
  font-size: clamp(1.4rem, 3vw, 2rem); color: var(--text); font-weight: 800;
  margin-bottom: 8px;
}
.cantho-section-title p { color: var(--text-light); font-size: 1rem; }
.cantho-section-title .line {
  width: 50px; height: 3px; background: var(--cta); margin: 12px auto 0; border-radius: 2px;
}
.cantho-container { max-width: 1200px; margin: 0 auto; }

/* === PROPERTY CARD === */
.cantho-card-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.cantho-prop-card {
  background: #fff; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
}
.cantho-prop-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.cantho-card-thumb {
  position: relative; aspect-ratio: 4/3; overflow: hidden;
}
.cantho-card-thumb img {
  width: 100%; height: 100%; object-fit: cover; transition: transform .3s; display: block;
}
.cantho-prop-card:hover .cantho-card-thumb img { transform: scale(1.04); }
.cantho-card-badge {
  position: absolute; top: 10px; left: 10px;
  padding: 4px 10px; border-radius: 4px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
}
.badge-new { background: #27ae60; color: #fff; }
.badge-hot { background: var(--cta); color: #fff; }
.cantho-card-body { padding: 16px; }
.cantho-card-price {
  font-size: 1.25rem; font-weight: 800; color: var(--cta); margin-bottom: 6px;
}
.cantho-card-title {
  font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  line-height: 1.4;
}
.cantho-card-title a { color: inherit; text-decoration: none; }
.cantho-card-title a:hover { color: var(--primary); }
.cantho-card-address {
  font-size: 13px; color: var(--text-light); margin-bottom: 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cantho-card-meta {
  display: flex; gap: 12px; font-size: 13px; color: var(--text-light);
  border-top: 1px solid var(--border); padding-top: 10px; margin-bottom: 12px;
}
.cantho-card-meta span { display: flex; align-items: center; gap: 4px; }
.cantho-card-cta {
  display: block; text-align: center; background: var(--primary); color: #fff;
  padding: 9px; border-radius: var(--radius); font-size: 14px; font-weight: 600;
  text-decoration: none; transition: background .2s;
}
.cantho-card-cta:hover { background: var(--cta); color: #fff; }

/* === DISTRICTS GRID === */
.cantho-districts-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.cantho-district-card {
  background: #fff; border-radius: var(--radius); padding: 24px 16px; text-align: center;
  text-decoration: none; border: 1.5px solid var(--border); transition: all .2s;
}
.cantho-district-card:hover {
  border-color: var(--primary); background: var(--primary); color: #fff;
  transform: translateY(-2px); box-shadow: var(--shadow);
}
.cantho-district-card .icon { font-size: 2.2rem; margin-bottom: 10px; display: block; }
.cantho-district-card .name { font-weight: 700; font-size: 15px; color: var(--text); margin-bottom: 4px; }
.cantho-district-card:hover .name, .cantho-district-card:hover .count { color: #fff; }
.cantho-district-card .count { font-size: 13px; color: var(--text-light); }

/* === WHY US === */
.cantho-why-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
}
.cantho-why-item { text-align: center; padding: 24px 16px; }
.cantho-why-item .icon {
  width: 60px; height: 60px; background: rgba(26,82,118,.1); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; margin: 0 auto 14px;
}
.cantho-why-item h4 { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.cantho-why-item p { font-size: 13px; color: var(--text-light); line-height: 1.6; }

/* === LEAD FORM === */
.cantho-lead-section {
  background: linear-gradient(135deg, var(--primary), #154360); padding: 64px 16px; color: #fff;
}
.cantho-lead-section h2 { text-align: center; font-size: 1.8rem; margin-bottom: 8px; }
.cantho-lead-section p { text-align: center; opacity: .85; margin-bottom: 32px; }
.cantho-lead-form {
  max-width: 600px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.cantho-lead-form input,
.cantho-lead-form select {
  padding: 13px 16px; border-radius: var(--radius); border: none;
  font-size: 15px; width: 100%; background: rgba(255,255,255,.1);
  color: #fff; border: 1.5px solid rgba(255,255,255,.3);
}
.cantho-lead-form input::placeholder { color: rgba(255,255,255,.6); }
.cantho-lead-form input:focus, .cantho-lead-form select:focus {
  outline: none; border-color: rgba(255,255,255,.8); background: rgba(255,255,255,.15);
}
.cantho-lead-form select option { color: var(--text); }
.cantho-lead-form .full-col { grid-column: 1 / -1; }
.cantho-lead-form .btn-lead {
  grid-column: 1 / -1; background: var(--cta); color: #fff; border: none;
  padding: 15px; border-radius: var(--radius); font-size: 16px; font-weight: 700;
  cursor: pointer; transition: background .2s;
}
.cantho-lead-form .btn-lead:hover { background: var(--cta-hover); }

/* === STICKY MOBILE BAR === */
.cantho-sticky-bar {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
  background: #fff; border-top: 1px solid var(--border);
  grid-template-columns: 1fr 1fr; height: 56px; box-shadow: 0 -4px 16px rgba(0,0,0,.1);
}
.cantho-sticky-bar a {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; font-size: 15px; text-decoration: none; height: 100%;
}
.cantho-sticky-call { background: var(--primary); color: #fff; }
.cantho-sticky-zalo { background: #0068ff; color: #fff; }

/* === FOOTER === */
.rh_footer { background: #1a252f !important; color: #bdc3c7; }
.cantho-footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px;
  max-width: 1200px; margin: 0 auto; padding: 48px 16px 32px;
}
.cantho-footer-brand img { max-width: 160px; margin-bottom: 14px; }
.cantho-footer-brand p { font-size: 14px; line-height: 1.7; color: #95a5a6; }
.cantho-footer-links h4 { color: #fff; font-size: 15px; margin-bottom: 14px; font-weight: 700; }
.cantho-footer-links ul { list-style: none; padding: 0; margin: 0; }
.cantho-footer-links li { margin-bottom: 8px; }
.cantho-footer-links a { color: #95a5a6; text-decoration: none; font-size: 14px; transition: color .2s; }
.cantho-footer-links a:hover { color: var(--cta); }
.cantho-footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08); padding: 16px;
  text-align: center; font-size: 13px; color: #7f8c8d;
  max-width: 1200px; margin: 0 auto;
}

/* === SINGLE PROPERTY === */
.cantho-single-layout {
  display: grid; grid-template-columns: 1fr 340px; gap: 24px;
  max-width: 1200px; margin: 0 auto; padding: 24px 16px;
}
.cantho-gallery { margin-bottom: 20px; }
.cantho-gallery-main {
  aspect-ratio: 16/10; border-radius: var(--radius); overflow: hidden; margin-bottom: 8px;
}
.cantho-gallery-main img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.cantho-gallery-thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.cantho-gallery-thumbs img {
  width: 72px; height: 52px; object-fit: cover; border-radius: 4px;
  cursor: pointer; opacity: .7; transition: opacity .2s;
}
.cantho-gallery-thumbs img:hover, .cantho-gallery-thumbs img.active { opacity: 1; border: 2px solid var(--primary); }
.cantho-sticky-sidebar {
  background: #fff; border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow); position: sticky; top: 80px; height: fit-content;
}
.cantho-sidebar-price { font-size: 2rem; font-weight: 800; color: var(--cta); margin-bottom: 16px; }
.cantho-sidebar-meta { margin-bottom: 16px; }
.cantho-sidebar-meta li {
  display: flex; justify-content: space-between; padding: 8px 0;
  border-bottom: 1px solid var(--border); font-size: 14px;
}
.cantho-sidebar-meta li span:first-child { color: var(--text-light); }
.cantho-sidebar-meta li span:last-child { font-weight: 600; color: var(--text); }
.cantho-sidebar-ctas { display: flex; flex-direction: column; gap: 10px; }
.cantho-sidebar-ctas a {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px; border-radius: var(--radius); font-weight: 700; font-size: 15px;
  text-decoration: none; transition: all .2s;
}
.btn-call-now { background: var(--primary); color: #fff; }
.btn-call-now:hover { background: #154360; }
.btn-zalo-now { background: #0068ff; color: #fff; }
.btn-zalo-now:hover { background: #0056d6; }

/* === LISTING PAGE === */
.cantho-filter-bar {
  background: #fff; border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); margin-bottom: 24px;
  display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end;
}
.cantho-filter-bar select, .cantho-filter-bar input {
  padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius);
  font-size: 14px; min-width: 160px; flex: 1;
}
.cantho-filter-bar .btn-filter {
  background: var(--primary); color: #fff; border: none; border-radius: var(--radius);
  padding: 10px 24px; font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .cantho-card-grid { grid-template-columns: repeat(2, 1fr); }
  .cantho-why-grid { grid-template-columns: repeat(2, 1fr); }
  .cantho-single-layout { grid-template-columns: 1fr; }
  .cantho-footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .cantho-search-bar { grid-template-columns: 1fr; }
  .cantho-districts-grid { grid-template-columns: repeat(2, 1fr); }
  .cantho-lead-form { grid-template-columns: 1fr; }
  .cantho-sticky-bar { display: grid; }
  body { padding-bottom: 56px; }
  .cantho-footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .cantho-card-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .cantho-hero { padding: 40px 16px 60px; }
  .cantho-why-grid { grid-template-columns: 1fr; }
}

/* === FIX LOGO SIZE === */
.rh_logo img, .site-logo img, .custom-logo, .rh_logo a img {
  max-height: 60px !important;
  width: auto !important;
  max-width: 180px !important;
}
.rh_logo, .site-logo { display: flex; align-items: center; }

/* === FIX HERO - push below header === */
.cantho-hero {
  position: relative;
  z-index: 1;
  margin-top: 0;
}

/* === FIX CARD BODY - ensure visible === */
.cantho-prop-card .cantho-card-body {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  padding: 16px !important;
}
.cantho-card-price,
.cantho-card-title,
.cantho-card-address,
.cantho-card-meta,
.cantho-card-cta {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}
.cantho-card-meta {
  display: flex !important;
}

/* === FIX HERO OVERLAP WITH REALHOMES HEADER PHONE === */
.rh_header_meta_phone,
.rh_header_phone,
.rh_nav__phone { display: none !important; }

/* === MOBILE HEADER FIX === */
@media (max-width: 768px) {
  .rh_logo img, .site-logo img, .custom-logo {
    max-height: 44px !important;
    max-width: 140px !important;
  }
  /* Hide duplicate nav elements */
  .rh_header_var_1 .rh_header_meta,
  .rh_header_var_1 .rh_header_top { display: none !important; }
}

/* === FORCE CARD BODY VISIBLE - override RealHomes === */
article.cantho-prop-card > .cantho-card-body,
.cantho-prop-card .cantho-card-body,
.cantho-card-grid .cantho-card-body {
  display: block !important;
  visibility: visible !important;
  overflow: visible !important;
  height: auto !important;
  max-height: none !important;
  clip: unset !important;
  opacity: 1 !important;
  position: static !important;
  transform: none !important;
}
.cantho-card-grid .cantho-card-price { display: block !important; }
.cantho-card-grid .cantho-card-title { display: -webkit-box !important; }
.cantho-card-grid .cantho-card-meta { display: flex !important; }
.cantho-card-grid .cantho-card-cta { display: block !important; }

/* === FIX CARD THUMB HEIGHT === */
.cantho-card-thumb {
  display: block !important;
  aspect-ratio: 4/3;
  overflow: hidden;
  max-height: 240px;
}
.cantho-card-thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

/* === HIDE REALHOMES PHONE IN HEADER (dùng sticky bar thay) === */
.rh_menu__user_phone,
.rh_header_contact_phone,
.rh_header__phone,
.contact-number,
.rh_menu__contacts { display: none !important; }

/* === FIX LOGO POSITION - không overlap hero === */
.rh_header.rh_header_responsive {
  position: relative !important;
  z-index: 100;
}
.rh_header_responsive .rh_logo_inner img,
.rh_header_responsive .rh_logo img {
  max-height: 48px !important;
  width: auto !important;
  max-width: 160px !important;
}
/* Logo không absolute overlay vào hero */
.rh_logo_wrapper { position: static !important; }

/* === HERO phải bắt đầu SAU header, không bị overlay === */
.cantho-hero {
  margin-top: 0 !important;
  position: relative !important;
  z-index: 1 !important;
  clear: both !important;
}
/* Nếu RealHomes dùng absolute header thì push hero xuống */
@media (max-width: 768px) {
  .site-content > .cantho-hero:first-child,
  main > .cantho-hero:first-child {
    margin-top: 0 !important;
  }
}
