html { scroll-behavior: smooth; }
* { margin: 0; padding: 0; box-sizing: border-box; font-family: Arial, Helvetica, sans-serif; }
body { background: #f4f6fb; color: #1f2937; }
.navbar { background: white; padding: 18px 45px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 18px rgba(0,0,0,0.08); position: sticky; top: 0; z-index: 99; }
.logo { font-size: 25px; font-weight: 800; color: #2563eb; }
nav a { margin-left: 22px; text-decoration: none; color: #374151; font-weight: 600; }
.hero { min-height: 430px; background: linear-gradient(rgba(15, 23, 42, 0.65), rgba(15, 23, 42, 0.65)), url("https://images.unsplash.com/photo-1600585154340-be6161a56a0c?auto=format&fit=crop&w=1600&q=80"); background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; text-align: center; color: white; padding: 30px; }
.hero-content { max-width: 850px; }
.hero h1 { font-size: 52px; line-height: 1.1; margin-bottom: 18px; }
.hero p { font-size: 21px; color: #e5e7eb; }
.search-box { background: white; max-width: 1180px; margin: -55px auto 45px; padding: 25px; border-radius: 20px; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 14px; box-shadow: 0 15px 40px rgba(0,0,0,0.16); position: relative; z-index: 10; }
input, select, button { padding: 15px; border-radius: 12px; border: 1px solid #d1d5db; font-size: 15px; }
button { border: none; background: #2563eb; color: white; font-weight: bold; cursor: pointer; }
button:hover { background: #1d4ed8; }
.container { max-width: 1220px; margin: auto; padding: 20px; scroll-margin-top: 90px; }
.section-header { margin-bottom: 28px; }
.section-header h2 { font-size: 34px; margin-bottom: 8px; }
.section-header p { color: #6b7280; }
.properties { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 28px; }
.card { background: white; border-radius: 22px; overflow: hidden; box-shadow: 0 10px 28px rgba(0,0,0,0.09); transition: 0.3s ease; }
.card:hover { transform: translateY(-6px); }
.card img { width: 100%; height: 245px; object-fit: cover; display: block; }
.status { position: absolute; top: 15px; left: 15px; background: #16a34a; color: white; padding: 7px 13px; border-radius: 30px; font-size: 13px; font-weight: bold; }
.type { position: absolute; top: 15px; right: 15px; background: rgba(15, 23, 42, 0.88); color: white; padding: 7px 13px; border-radius: 30px; font-size: 13px; }
.card-body { padding: 24px; }
.card-body h3 { font-size: 22px; margin-bottom: 8px; }
.price { color: #2563eb; font-size: 27px; font-weight: 800; margin-bottom: 10px; }
.location { color: #6b7280; margin-bottom: 14px; }
.details { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.details span { background: #eef2ff; color: #1e40af; padding: 8px 10px; border-radius: 10px; font-size: 14px; }
.description { color: #4b5563; line-height: 1.55; margin-bottom: 18px; }
.contact-btn { display: block; background: #25d366; color: white; text-decoration: none; text-align: center; padding: 14px; border-radius: 12px; font-weight: bold; }
.contact-btn:hover { background: #1ebe5d; }
.no-results { background: white; padding: 30px; border-radius: 18px; text-align: center; color: #6b7280; }
footer { margin-top: 60px; background: #111827; color: #d1d5db; text-align: center; padding: 35px 20px; scroll-margin-top: 90px; }
footer h3 { color: white; margin-bottom: 8px; }
@media (max-width: 950px) {
  .navbar { flex-direction: column; gap: 12px; padding: 18px; }
  nav a { margin: 0 8px; }
  .hero h1 { font-size: 36px; }
  .hero p { font-size: 17px; }
  .search-box { grid-template-columns: 1fr; margin: -35px 20px 35px; }
}

/* Dynamic property detail page */
.property-detail-page {
  padding-top: 40px;
  padding-bottom: 50px;
}
.property-detail-card {
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 14px 40px rgba(0,0,0,.10);
  overflow: hidden;
}
.back-link {
  display: inline-block;
  margin: 22px 22px 0;
  text-decoration: none;
  font-weight: 700;
}
.detail-hero img {
  width: 100%;
  height: 430px;
  object-fit: cover;
  display: block;
}
.detail-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  padding: 12px 22px 0;
}
.detail-gallery img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 14px;
}
.detail-content {
  padding: 26px;
}
.detail-content h1 {
  margin: 0 0 8px;
}
.detail-info {
  margin: 18px 0 24px;
}
.detail-description {
  font-size: 1.05rem;
  line-height: 1.7;
}
.detail-whatsapp {
  display: inline-block;
  margin-top: 18px;
}
@media (max-width: 700px) {
  .detail-hero img { height: 280px; }
}

/* Full property detail layout restored */
.rich-detail h2 { font-size: 30px; margin: 34px 0 16px; color: #111827; }
.detail-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 12px 0 28px; }
.summary-box { background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 22px; padding: 30px 18px; text-align: center; }
.summary-box strong { display: block; font-size: 30px; color: #111827; margin-bottom: 10px; }
.summary-box span { display: block; color: #6b7280; font-size: 18px; }
.big-price { color: #2563eb; font-size: clamp(42px, 7vw, 72px); font-weight: 900; line-height: 1.15; margin: 28px 0; }
.big-price span { display: inline-block; font-size: .75em; }
.requirements-box, .interest-box { border-left: 10px solid #fb7c14; background: #fff7ed; border-radius: 22px; padding: 28px; margin: 34px 0; box-shadow: 0 10px 24px rgba(0,0,0,.06); }
.requirements-box ul { margin-left: 24px; line-height: 1.8; font-size: 18px; }
.interest-box { border-left-color: #22c55e; background: #fff; }
.interest-box p { font-size: 18px; line-height: 1.65; margin: 14px 0; }
.interest-box a:not(.contact-btn) { color: #2563eb; font-weight: 800; }
.map-box { position: relative; overflow: hidden; border-radius: 22px; background: #f3f4f6; min-height: 320px; box-shadow: 0 10px 24px rgba(0,0,0,.08); }
.map-box iframe { width: 100%; height: 360px; border: 0; display: block; }
.maps-open { position: absolute; top: 18px; left: 18px; z-index: 2; background: white; color: #2563eb; padding: 11px 14px; border-radius: 9px; text-decoration: none; font-weight: 800; box-shadow: 0 5px 15px rgba(0,0,0,.16); }
.back-home { display: inline-block; margin: 16px 0 0; color: #6b7280; text-decoration: none; font-size: 24px; font-weight: 800; }
.floating-phone { position: fixed; right: 28px; bottom: 28px; width: 72px; height: 72px; border-radius: 50%; background: #22c55e; color: white; display: grid; place-items: center; font-size: 32px; text-decoration: none; box-shadow: 0 12px 25px rgba(0,0,0,.22); z-index: 120; }
@media (max-width: 700px) {
  .property-detail-page { padding: 0; }
  .property-detail-card { border-radius: 0; }
  .detail-content { padding: 24px 22px; }
  .detail-summary-grid { grid-template-columns: 1fr; }
  .summary-box strong { font-size: 28px; }
  .summary-box span, .interest-box p, .requirements-box ul { font-size: 17px; }
  .floating-phone { right: 18px; bottom: 18px; width: 62px; height: 62px; font-size: 28px; }
}

/* Fullscreen photo viewer */
.detail-hero img,
.detail-gallery img {
  cursor: zoom-in;
}
body.lightbox-open {
  overflow: hidden;
}
.photo-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.94);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
}
.photo-lightbox.active {
  display: flex;
}
.photo-lightbox-img {
  max-width: 100%;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 18px 60px rgba(0,0,0,.55);
}
.photo-lightbox-close,
.photo-lightbox-arrow {
  position: fixed;
  border: 0;
  background: rgba(255,255,255,.16);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.photo-lightbox-close {
  top: 18px;
  right: 18px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 34px;
  line-height: 1;
  padding: 0 0 4px;
}
.photo-lightbox-arrow {
  top: 50%;
  transform: translateY(-50%);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  font-size: 48px;
  padding: 0 0 7px;
}
.photo-lightbox-prev { left: 18px; }
.photo-lightbox-next { right: 18px; }
.photo-lightbox-counter {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  background: rgba(255,255,255,.16);
  color: #fff;
  padding: 9px 14px;
  border-radius: 999px;
  font-weight: 800;
}
@media (max-width: 700px) {
  .photo-lightbox { padding: 12px; }
  .photo-lightbox-img { max-height: 82vh; border-radius: 8px; }
  .photo-lightbox-close { top: 12px; right: 12px; width: 44px; height: 44px; font-size: 32px; }
  .photo-lightbox-arrow { width: 46px; height: 46px; font-size: 38px; }
  .photo-lightbox-prev { left: 10px; }
  .photo-lightbox-next { right: 10px; }
  .photo-lightbox-counter { bottom: 14px; }
}


/* Restored property header + stronger mobile details */
.property-top-intro {
  padding: 34px 38px 26px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 26px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}
.property-top-intro h1 {
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.12;
  color: #111827;
  letter-spacing: -0.04em;
  margin: 0 0 16px;
}
.intro-address {
  color: #6b7280;
  font-size: clamp(17px, 2.6vw, 28px);
  font-weight: 800;
  line-height: 1.35;
}
.intro-actions {
  min-width: 230px;
  display: grid;
  gap: 16px;
  justify-items: end;
}
.intro-price {
  color: #2563eb;
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}
.intro-price span {
  color: #6b7280;
  display: block;
  font-size: 15px;
  margin-top: 8px;
  text-align: right;
}
.intro-interest-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 62px;
  padding: 0 30px;
  border-radius: 16px;
  background: #2563eb;
  color: #fff;
  text-decoration: none;
  font-size: 22px;
  font-weight: 900;
  box-shadow: 0 14px 26px rgba(37,99,235,.28);
}
.intro-interest-btn:hover { background: #1d4ed8; }

@media (max-width: 700px) {
  .navbar { position: relative; }
  .property-top-intro {
    padding: 28px 22px 22px;
    display: block;
  }
  .intro-actions {
    min-width: 0;
    justify-items: stretch;
    margin-top: 22px;
  }
  .intro-price {
    font-size: 30px;
  }
  .intro-price span {
    text-align: left;
  }
  .intro-interest-btn {
    width: 100%;
    min-height: 58px;
    font-size: 20px;
  }
  .detail-hero img {
    height: auto;
    max-height: 390px;
    aspect-ratio: 4 / 3;
    border-radius: 20px;
  }
  .detail-hero {
    padding: 0 22px 12px;
  }
  .detail-gallery {
    grid-template-columns: 1fr;
    padding: 0 22px;
    gap: 18px;
  }
  .detail-gallery img {
    height: auto;
    max-height: 390px;
    aspect-ratio: 4 / 3;
    border-radius: 20px;
  }
  .detail-summary-grid {
    gap: 14px;
  }
  .summary-box {
    padding: 26px 16px;
  }
  .rich-detail h2 {
    font-size: 28px;
  }
  .detail-description {
    font-size: 19px;
    line-height: 1.65;
  }
  .requirements-box, .interest-box {
    padding: 24px 20px;
  }
  .map-box iframe {
    height: 300px;
  }
}
.logo-link {
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
}

.logo-link:hover {
  opacity: 0.9;
}



/* ===== Mobile-first responsive improvements added ===== */
html { -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; }
img, iframe { max-width: 100%; }
.image-wrap { position: relative; overflow: hidden; }
.card, .contact-btn, button, .intro-interest-btn, .tour-btn, .btn-whatsapp { -webkit-tap-highlight-color: transparent; }

@media (max-width: 900px) {
  .navbar {
    position: sticky;
    top: 0;
    padding: 14px 16px;
    gap: 12px;
    flex-wrap: wrap;
  }
  .logo {
    font-size: 23px;
    line-height: 1;
  }
  .navbar nav {
    width: 100%;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0 2px;
    scrollbar-width: none;
  }
  .navbar nav::-webkit-scrollbar { display: none; }
  .navbar nav a,
  .navbar nav button {
    flex: 0 0 auto;
    margin: 0;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 12px;
    border-radius: 999px;
    background: #f3f4f6;
    font-size: 14px;
    white-space: nowrap;
  }
  .hero {
    min-height: 380px;
    padding: 42px 18px 78px;
    background-position: center;
  }
  .hero h1 {
    font-size: clamp(32px, 9vw, 44px);
    line-height: 1.05;
    letter-spacing: -0.035em;
  }
  .hero p { font-size: 17px; line-height: 1.45; }
  .search-box {
    width: calc(100% - 24px);
    margin: -58px 12px 30px;
    padding: 16px;
    border-radius: 18px;
    grid-template-columns: 1fr;
    gap: 10px;
  }
  input, select, button {
    width: 100%;
    min-height: 48px;
    font-size: 16px;
  }
  .container {
    width: 100%;
    padding: 16px 12px;
    scroll-margin-top: 128px;
  }
  .section-header {
    margin-bottom: 18px;
    padding: 0 2px;
  }
  .section-header h2 { font-size: 28px; }
  .properties {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .card {
    border-radius: 18px;
    box-shadow: 0 8px 22px rgba(0,0,0,0.08);
  }
  .card:hover { transform: none; }
  .card img {
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
  }
  .card-body { padding: 18px; }
  .card-body h3 { font-size: 20px; line-height: 1.25; }
  .price { font-size: 24px; }
  .location { line-height: 1.45; }
  .details { gap: 8px; }
  .details span {
    font-size: 13px;
    padding: 8px 9px;
  }
  .description {
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .contact-btn {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  footer { margin-top: 38px; padding: 30px 18px; }
}

@media (max-width: 480px) {
  .navbar { padding: 12px; }
  .hero { min-height: 350px; padding-top: 34px; }
  .search-box { width: calc(100% - 18px); margin-left: 9px; margin-right: 9px; }
  .container { padding-left: 9px; padding-right: 9px; }
  .card-body { padding: 16px; }
  .price { font-size: 22px; }
}

/* Dynamic property details mobile tuning */
@media (max-width: 900px) {
  .property-detail-page { padding: 0 0 24px; }
  .property-detail-card { border-radius: 0; box-shadow: none; }
  .property-top-intro { padding: 24px 16px 18px; }
  .property-top-intro h1 { font-size: clamp(28px, 8vw, 38px); }
  .intro-address { font-size: 16px; }
  .intro-actions { width: 100%; }
  .detail-hero { padding: 0 12px 10px; }
  .detail-hero img { width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: 18px; }
  .detail-gallery { grid-template-columns: repeat(2, 1fr); padding: 0 12px; gap: 10px; }
  .detail-gallery img { height: auto; aspect-ratio: 1 / 1; border-radius: 14px; }
  .detail-content { padding: 20px 16px; }
  .detail-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .summary-box { padding: 20px 10px; border-radius: 16px; }
  .summary-box strong { font-size: 24px; }
  .summary-box span { font-size: 14px; }
  .big-price { font-size: clamp(34px, 12vw, 48px); margin: 20px 0; }
  .rich-detail h2 { font-size: 24px; margin: 28px 0 12px; }
  .detail-description { font-size: 16px; line-height: 1.7; }
  .requirements-box, .interest-box { padding: 20px 16px; border-left-width: 6px; border-radius: 16px; }
  .requirements-box ul, .interest-box p { font-size: 16px; }
  .map-box, .map-box iframe { min-height: 280px; }
  .map-box iframe { height: 280px; }
  .maps-open { left: 12px; top: 12px; font-size: 13px; }
  .floating-phone { width: 58px; height: 58px; right: 14px; bottom: 14px; }
}


/* ===== Automatic light/dark mode based on device setting ===== */
:root { color-scheme: light dark; }
@media (prefers-color-scheme: dark) {
  body { background: #0f172a; color: #e5e7eb; }
  .navbar { background: #111827; box-shadow: 0 2px 18px rgba(0,0,0,0.35); }
  .logo { color: #60a5fa; }
  nav a { color: #d1d5db; }
  .navbar nav a, .navbar nav button { background: #1f2937; color: #e5e7eb; }
  .search-box, .card, .no-results, .property-detail-card { background: #111827; color: #e5e7eb; box-shadow: 0 12px 34px rgba(0,0,0,0.38); }
  input, select, button { background: #0b1220; color: #f9fafb; border-color: #334155; }
  input::placeholder { color: #94a3b8; }
  button { background: #2563eb; color: #fff; }
  button:hover { background: #1d4ed8; }
  .section-header p, .location, .description, .intro-address, .intro-price span, .summary-box span, .back-home { color: #cbd5e1; }
  .card-body h3, .section-header h2, .property-top-intro h1, .rich-detail h2, .summary-box strong, .safe-note { color: #f8fafc; }
  .price, .big-price, .interest-box a:not(.contact-btn), .maps-open { color: #60a5fa; }
  .details span { background: #172554; color: #bfdbfe; }
  .summary-box { background: #0f172a; border-color: #334155; }
  .requirements-box { background: #271a0c; border-left-color: #fb923c; }
  .interest-box { background: #111827; border-left-color: #22c55e; }
  .property-top-intro { background: linear-gradient(180deg, #111827 0%, #0f172a 100%); }
  .map-box { background: #111827; box-shadow: 0 10px 24px rgba(0,0,0,.35); }
  .maps-open { background: #0f172a; }
  footer { background: #020617; color: #cbd5e1; }
  footer h3 { color: #fff; }
}
.load-more-btn{display:block;margin:28px auto 10px;padding:14px 26px;border:0;border-radius:999px;font-weight:700;cursor:pointer;background:#111;color:#fff}.image-wrap.no-photo,.no-photo-text{display:grid;place-items:center;background:rgba(120,120,120,.14);color:inherit;min-height:220px}.admin-no-photo{width:96px;height:72px;display:grid;place-items:center;border-radius:12px;background:rgba(120,120,120,.14);font-size:12px}.danger-btn{background:#ffeded!important;color:#9d1111!important;border:1px solid #ffc8c8!important}
