:root {
  --color-primary: #1a5f4a;
  --color-primary-dark: #0f3d30;
  --color-accent: #c9a227;
  --color-bg: #f8f9fa;
  --color-card: #fff;
  --color-text: #333;
  --color-text-muted: #666;
  --font-sans: 'Segoe UI', system-ui, sans-serif;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Layout with left/right ads */
.layout-with-ads {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 1rem;
}
.layout-with-ads .ad-slot-left,
.layout-with-ads .ad-slot-right {
  flex-shrink: 0;
  width: 160px;
  position: sticky;
  top: 1rem;
}
.layout-with-ads .main-content {
  flex: 1;
  min-width: 0;
}
.ad-slot {
  background: linear-gradient(135deg, #f0f0f0 0%, #e5e5e5 100%);
  border: 1px dashed #bbb;
  border-radius: var(--radius);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  overflow: hidden;
}
.ad-slot-left .ad-slot,
.ad-slot-right .ad-slot {
  min-height: 250px;
}
.ad-slot-middle {
  margin: 1.5rem 0;
  min-height: 92px;
}
.ad-slot-middle .ad-slot {
  min-height: 90px;
  height: 90px;
  max-width: 728px;
  margin: 0 auto;
  flex-shrink: 0;
}
.ad-slot img,
.ad-slot video {
  max-width: 100%;
  max-height: 100%;
  min-height: 90px;
  object-fit: contain;
  display: block;
}
.ad-slot-middle .ad-slot img {
  min-height: 90px;
  width: auto;
  height: 90px;
  object-fit: contain;
}

/* Mobile/tablet: keep ads visible but never covering content */
@media (max-width: 992px) {
  .layout-with-ads {
    flex-direction: column;
    align-items: stretch;
  }
  .layout-with-ads .ad-slot-left,
  .layout-with-ads .ad-slot-right {
    width: 100%;
    position: static;
    top: auto;
  }
  .layout-with-ads .ad-slot-left .ad-slot,
  .layout-with-ads .ad-slot-right .ad-slot {
    max-width: 360px;
    margin: 0 auto;
  }
}
/* Bottom ad: full-width bar above footer (728×90 scales down; no side crop on narrow viewports) */
.ad-slot-bottom {
  width: 100%;
  min-height: 0;
  height: auto;
  padding: 0;
  background: #e8ecef;
  display: flex;
  justify-content: center;
  align-items: center;
}
.ad-slot-bottom .ad-slot {
  width: 100%;
  height: auto;
  min-height: 0;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.ad-slot-bottom .ad-slot img {
  width: 100%;
  max-width: 728px;
  height: auto;
  min-height: 0;
  display: block;
  margin: 0 auto;
  object-fit: contain;
  object-position: center;
}

/* Home: full-width ad below hero filters (~25% viewport height) */
.hero-ad-band {
  width: 100%;
  margin: 0;
  padding: 0;
  background: #e8ecef;
}
.hero-ad-slot {
  width: 100%;
  min-height: 0;
  height: auto;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero-ad-slot img,
.hero-ad-slot video.hero-ad-video {
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
  object-fit: contain;
  object-position: center;
  display: block;
}
.home-main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.site-header {
  background: var(--color-primary);
  color: #fff;
  padding: 0.75rem 0;
  box-shadow: var(--shadow);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-logo {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.site-logo-img {
  height: 32px;
  max-height: 32px;
  max-width: 120px;
  width: auto;
  object-fit: contain;
  display: block;
  border-radius: 4px;
}

.site-logo:hover {
  text-decoration: none;
  color: var(--color-accent);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: #fff;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

main {
  min-height: 60vh;
  padding: 2rem 0;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  color: #fff;
  padding: 3rem 0;
  min-height: 160px;
  text-align: center;
  margin-bottom: 2rem;
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: 2rem;
}

.hero .tagline {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 0;
}

.filters-bar-hero {
  margin-top: 1.5rem;
  text-align: left;
  justify-content: center;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  background: #fff;
  color: var(--color-text);
  padding: 1.25rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.filters-bar-hero .filter-group label {
  color: var(--color-text-muted);
}
.filters-bar-hero .btn {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.filters-bar-hero .btn:hover {
  background: var(--color-primary-dark);
  color: #fff;
}

.filters-bar-hero .filter-group-budget {
  min-width: 280px;
  flex: 1 1 320px;
  max-width: 460px;
}
.emi-calculator-wrap {
  margin: -0.5rem 0 1.5rem;
}
.emi-calculator-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem;
}
.emi-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}
.emi-grid .filter-group {
  flex: 1 1 220px;
}
.emi-grid .filter-actions {
  flex: 0 0 auto;
}
.emi-result {
  margin-top: 0.9rem;
  font-weight: 600;
  color: var(--color-primary-dark);
  background: #f1f7f4;
  border: 1px solid #d8e9e0;
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem;
}
.budget-select-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.budget-select-row select {
  min-width: 0;
}

/* Footer */
.site-footer {
  background: var(--color-primary-dark);
  color: #fff;
  padding: 2rem 0 1rem;
  margin-top: 3rem;
}

.site-footer a {
  color: var(--color-accent);
}

.site-footer .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 600px) {
  .site-footer .container {
    grid-template-columns: 1fr;
  }
}

.footer-brand {
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.footer-address {
  font-size: 0.9rem;
  line-height: 1.6;
  opacity: 0.9;
}

.footer-social {
  margin-top: 1rem;
}
.footer-social-title {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  opacity: 0.9;
}
.footer-social-links {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.footer-social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
  transition: background 0.2s, color 0.2s;
}
.footer-social-links a:hover {
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
}
.footer-social-links svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.copyright {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.8;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.2);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.2s;
  text-decoration: none;
}

.btn:hover {
  opacity: 0.9;
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.phone-otp-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.phone-otp-row input {
  flex: 1;
  min-width: 140px;
}

/* Property grid & cards */
.property-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.property-card {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.property-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.property-card .card-images {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  min-height: 80px;
}

.property-card .card-images-thumb {
  display: block;
  padding: 0;
  min-height: 180px;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(135deg, #e8e8e8 0%, #d0d0d0 100%);
}
.property-card .card-images-thumb img,
.property-card .card-images-thumb .card-image-slot {
  width: 100%;
  height: 180px;
  min-height: 180px;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Single image in card: fill container (no grey gaps) */
.property-card .card-images:has(img:only-child),
.property-card .card-images:has(.card-image-slot:only-child) {
  display: block;
  padding: 0;
  min-height: 180px;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(135deg, #e8e8e8 0%, #d0d0d0 100%);
}
.property-card .card-images img:only-child,
.property-card .card-images .card-image-slot:only-child {
  width: 100% !important;
  height: 180px !important;
  min-height: 180px !important;
  max-width: none !important;
  object-fit: cover !important;
  object-position: center;
  display: block;
}

.property-card .card-images img:not(:only-child),
.property-card .card-images .card-image-slot:not(:only-child) {
  width: calc(25% - 4px);
  min-width: 60px;
  height: 60px;
  object-fit: cover;
  flex-shrink: 0;
}

.property-card .card-image-slot {
  background: linear-gradient(135deg, #e0e0e0 0%, #bdbdbd 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.65rem;
}

.property-card .card-body {
  padding: 1.25rem;
}

.property-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.property-card .location {
  font-size: 0.85rem;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.property-card .description {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Filters */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.filter-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
}
.filter-group input,
.filter-group select {
  padding: 0.5rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  font-size: 0.95rem;
  min-width: 140px;
}
.filter-actions {
  margin-left: auto;
}
.filter-actions .btn {
  padding: 0.5rem 1rem;
}

.sell-cta-box {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  border: 1px solid #81c784;
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.sell-cta-box .btn { vertical-align: middle; }

.section-title {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--color-primary-dark);
}

.section-title--center {
  text-align: center;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  max-width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: var(--radius);
  font-family: inherit;
  box-sizing: border-box;
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.images-hint {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

.login-box {
  max-width: 360px;
  margin: 2rem auto;
  padding: 2rem;
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.login-box h2 {
  margin-top: 0;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.alert-error {
  background: #fee;
  color: #c00;
}

.alert-success {
  background: #efe;
  color: #060;
}

.hidden {
  display: none !important;
}

.text-muted {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* Mobile */
@media (max-width: 768px) {
  .site-header {
    padding: 0.5rem 0;
  }
  .site-header .container {
    gap: 0.5rem;
  }
  .site-logo {
    font-size: 1rem;
    gap: 0.4rem;
  }
  .site-logo-img {
    height: 28px;
    max-height: 28px;
    max-width: 90px;
  }
  .nav-links {
    gap: 0.75rem;
    flex-wrap: wrap;
  }
  .nav-links a {
    font-size: 0.9rem;
  }
  .hero {
    padding: 2rem 0;
    min-height: 140px;
  }
  .hero h1 {
    font-size: 1.5rem;
  }
  .hero .tagline {
    font-size: 1rem;
  }
  main {
    padding: 1.5rem 0;
  }
  .layout-with-ads {
    padding: 0 0.75rem;
  }
  .layout-with-ads .main-content {
    width: 100%;
    min-width: 0;
  }
  .property-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .property-card .card-images-thumb,
  .property-card .card-images-thumb img,
  .property-card .card-images-thumb .card-image-slot {
    min-height: 200px;
    height: 200px;
  }
  .property-card .card-images:has(img:only-child),
  .property-card .card-images:has(.card-image-slot:only-child) {
    min-height: 200px;
  }
  .property-card .card-images img:only-child,
  .property-card .card-images .card-image-slot:only-child {
    height: 200px !important;
    min-height: 200px !important;
  }
  .ad-slot-middle .ad-slot {
    max-width: 100%;
  }
  .section-title {
    font-size: 1.25rem;
  }
  .filters-bar-hero .filter-group-budget {
    min-width: 100%;
    max-width: none;
    flex-basis: 100%;
  }
  .budget-select-row {
    grid-template-columns: 1fr;
  }
}

/* Property detail (Show details) — images fit page, not full native size */
.property-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.55);
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  box-sizing: border-box;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .property-card:hover {
    transform: none;
  }
}
.property-detail-modal {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  max-width: min(920px, 100%);
  width: 100%;
  max-height: calc(100vh - 2rem);
  margin: 0.5rem auto 2rem;
  padding: 1rem 1.25rem 1.5rem;
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}
.property-detail-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 50%;
  background: #eee;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.property-detail-close:hover {
  background: #ddd;
}
.property-detail-slider {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.property-detail-prev,
.property-detail-next {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid #ccc;
  border-radius: var(--radius);
  background: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.property-detail-prev:hover,
.property-detail-next:hover {
  background: var(--color-bg);
}
.property-detail-viewport {
  flex: 1;
  min-width: 0;
  min-height: 200px;
  max-height: min(48vh, 420px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
  border-radius: var(--radius);
  overflow: hidden;
}
.property-detail-img {
  max-width: 100%;
  max-height: min(48vh, 420px);
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  vertical-align: middle;
}
.property-detail-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  margin-bottom: 1rem;
}
.property-detail-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: #ccc;
  cursor: pointer;
  padding: 0;
}
.property-detail-dot.active {
  background: var(--color-primary);
}
.property-detail-title {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  color: var(--color-primary-dark);
}
.property-detail-loc {
  color: var(--color-primary);
  font-size: 0.9rem;
  margin: 0 0 0.75rem;
}
.property-detail-desc {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--color-text);
  white-space: pre-wrap;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.property-detail-actions {
  margin-top: auto;
  padding-top: 1.25rem;
  padding-bottom: 0.25rem;
  border-top: 1px solid #eee;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.property-detail-interested {
  padding: 0.65rem 2rem;
  font-size: 1.05rem;
}
/* Home page — Show details (no Admin in nav) */
.property-card-details {
  display: inline-block;
  margin-top: 0.85rem;
  padding: 0.5rem 1.1rem;
  background: var(--color-primary);
  color: #fff !important;
  text-decoration: none !important;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
}
.property-card-details:hover {
  opacity: 0.92;
  color: #fff !important;
}

@media (max-width: 480px) {
  .property-detail-viewport {
    max-height: min(40vh, 320px);
  }
  .property-detail-img {
    max-height: min(40vh, 320px);
  }
}
