/* ============================================================
   TERRANOVA — LAYOUT CSS
   Grids, Sidebars, Responsive, Admin Shell
   ============================================================ */

/* ── PAGE SECTIONS ───────────────────────────────────────── */
.section {
  padding: var(--space-3xl) 0;
}

.section-sm { padding: var(--space-3xl) 0; }
.section-lg { padding: calc(var(--space-4xl) * 1.5) 0; }

/* ── HERO ────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.65);
}

.hero__bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(7, 11, 24, 0.9) 0%,
    rgba(7, 11, 24, 0.4) 40%,
    rgba(7, 11, 24, 0.7) 100%
  );
}

.hero__bg-gradient {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 40%;
  background: linear-gradient(to top, var(--bg-deep), transparent);
}

.hero__content {
  position: relative;
  z-index: 1;
  padding-top: clamp(90px, 14vw, 130px);
  padding-bottom: var(--space-3xl);
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin-bottom: var(--space-lg);
}

.hero__headline {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 8vw, 5.5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-lg);
}

.hero__headline .highlight {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__sub {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 560px;
  margin-bottom: var(--space-2xl);
  line-height: 1.7;
}

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  margin-top: var(--space-3xl);
}

.hero__stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero__stat-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--gold);
}

.hero__stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero__search-wrap {
  margin-top: var(--space-3xl);
}

/* ── STICKY SEARCH BAR ───────────────────────────────────── */
.sticky-search {
  position: sticky;
  top: 76px;
  z-index: calc(var(--z-nav) - 1);
}

/* ── CATEGORY GRID ───────────────────────────────────────── */
.category-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: clamp(20px, 4vw, 32px);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.category-card::before {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold-muted) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.category-card:hover::before { opacity: 1; }
.category-card:hover {
  border-color: var(--border-gold);
  transform: translateY(-6px);
  box-shadow: var(--shadow-gold);
}

.category-card__icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: var(--gold-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: var(--space-xl);
  transition: transform var(--transition-normal);
}

.category-card:hover .category-card__icon { transform: scale(1.1) rotate(-5deg); }

.category-card__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.category-card__desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
  line-height: 1.6;
}

.subcategory-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.category-card:hover .subcategory-grid {
  max-height: 300px;
}

.subcategory-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.subcategory-item:hover {
  border-color: var(--border-gold);
  color: var(--gold);
}

/* ── LISTING CAROUSEL ────────────────────────────────────── */
.carousel-wrap {
  position: relative;
}

.carousel-track {
  display: flex;
  gap: var(--space-xl);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: var(--space-sm);
}

.carousel-track::-webkit-scrollbar { display: none; }

.carousel-track .property-card {
  min-width: 320px;
  flex-shrink: 0;
  scroll-snap-align: start;
}

.carousel-controls {
  display: flex;
  gap: var(--space-sm);
  position: absolute;
  top: -56px;
  right: 0;
}

.carousel-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
}

.carousel-btn:hover {
  border-color: var(--border-gold);
  color: var(--gold);
}

/* ── TESTIMONIALS MASONRY ────────────────────────────────── */
.testimonials-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

.testimonial-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: all var(--transition-normal);
}

.testimonial-card:hover {
  border-color: var(--border-gold);
  transform: translateY(-4px);
}

.testimonial-card__video {
  position: relative;
  height: 160px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: var(--space-lg);
  background: var(--bg-surface);
  cursor: pointer;
}

.testimonial-card__video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.4);
  transition: background var(--transition-fast);
}

.testimonial-card__video-overlay:hover { background: rgba(0,0,0,0.2); }

.play-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(201,168,76,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--bg-deep);
  transition: transform var(--transition-fast);
}

.testimonial-card__video-overlay:hover .play-btn { transform: scale(1.1); }

/* ── PROPERTY DETAIL ─────────────────────────────────────── */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
  align-items: start;
}

.detail-sidebar {
  position: static;
  top: 90px;
}

.detail-sidebar__card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.spec-item {
  background: var(--bg-card);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.spec-item__label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  font-weight: 700;
}

.spec-item__value {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.spec-item__icon { font-size: 1.25rem; color: var(--gold); }

/* ── CUSTOMER DASHBOARD ──────────────────────────────────── */
.dashboard-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  min-height: calc(100vh - 80px);
}

.dashboard-sidebar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: var(--space-xl) 0;
  position: static;
  height: auto;
  overflow-y: auto;
}

.sidebar-nav__item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 12px var(--space-xl);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  border-left: 3px solid transparent;
}

.sidebar-nav__item:hover {
  color: var(--text-primary);
  background: var(--bg-glass-light);
}

.sidebar-nav__item.active {
  color: var(--gold);
  border-left-color: var(--gold);
  background: var(--gold-muted);
}

.sidebar-nav__item .icon { font-size: 1rem; }

.dashboard-content {
  padding: var(--space-2xl);
  min-width: 0;
}

/* ── ADMIN SHELL ─────────────────────────────────────────── */
.admin-shell {
  display: block;
}

.admin-sidebar {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 280px;
  z-index: calc(var(--z-nav) + 20);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.admin-sidebar.open {
  transform: translateX(0);
}

.admin-sidebar__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: calc(var(--z-nav) + 19);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.admin-sidebar__overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.admin-sidebar__logo {
  padding: var(--space-lg) var(--space-xl);
  margin-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.admin-sidebar__section-label {
  padding: var(--space-md) var(--space-xl) var(--space-sm);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.admin-sidebar__nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 10px var(--space-xl);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  border-left: 3px solid transparent;
  text-decoration: none;
}

.admin-sidebar__nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-glass-light);
  border-left-color: var(--border);
}

.admin-sidebar__nav-item.active {
  color: var(--gold);
  background: var(--gold-muted);
  border-left-color: var(--gold);
}

.admin-sidebar__nav-item .icon { font-size: 1rem; width: 20px; }

.admin-main {
  margin-left: 0;
  min-height: 100vh;
}

.admin-topbar {
  height: 64px;
  background: rgba(13,18,32,0.95);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-xl);
  padding: 0 var(--space-xl);
  position: sticky;
  top: 0;
  z-index: calc(var(--z-nav) - 1);
  backdrop-filter: blur(20px);
}

.admin-page {
  padding: var(--space-2xl);
}

/* ── ANALYTICS GRID ──────────────────────────────────────── */
.analytics-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

/* ── CHART CONTAINER ─────────────────────────────────────── */
.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
}

/* ── TWO COL LAYOUT ──────────────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
}

.three-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

/* ── RESPONSIVE (MOBILE FIRST) ──────────────────────────── */

@media (min-width: 768px) {
  .section { padding: var(--space-4xl) 0; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .subcategory-grid { grid-template-columns: repeat(2, 1fr); }
  .testimonials-grid { grid-template-columns: repeat(2, 1fr); }
  .specs-grid { grid-template-columns: repeat(3, 1fr); }
  .two-col { grid-template-columns: 1fr 1fr; }
  .three-col { grid-template-columns: repeat(2, 1fr); }
  .analytics-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .detail-layout { grid-template-columns: 1fr 380px; }
  .detail-sidebar { position: sticky; }
  
  .dashboard-layout { grid-template-columns: 260px 1fr; }
  .dashboard-sidebar {
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    border-right: 1px solid var(--border);
    border-bottom: none;
  }
  
  .testimonials-grid { grid-template-columns: repeat(3, 1fr); }
  .three-col { grid-template-columns: repeat(3, 1fr); }
  
  .admin-shell { grid-template-columns: 280px 1fr; }
  .admin-sidebar {
    transform: translateX(0);
    transition: none;
    background: var(--bg-card);
    width: 280px;
    position: fixed;
    top: 0; bottom: 0;
    overflow-y: auto;
    z-index: var(--z-nav);
  }
  .admin-sidebar__overlay {
    display: none;
  }
  .admin-topbar .hamburger {
    display: none;
  }
  .admin-main { margin-left: 280px; }
}

@media (min-width: 1200px) {
  .analytics-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ════════════════════════════════════════════════════════════
   ANDROID / MOBILE — Full Coverage (360px → 480px)
   ════════════════════════════════════════════════════════════ */

/* ── Touch target minimum (Google recommendation: 48×48dp) ── */
@media (pointer: coarse) {
  .btn, .navbar__nav a, .admin-sidebar__nav-item,
  .subcategory-tab, .bhk-pill, .property-card__wishlist,
  .toggle-switch, .form-select, .form-input,
  .mobile-nav a, .tab-btn {
    min-height: 44px;
    min-width: 44px;
  }

  /* Remove hover effects on touch — use touch-active instead */
  .property-card:hover { transform: none; box-shadow: none; }
  .property-card.touch-active {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  }

  .btn:hover { opacity: 1; }
  .btn.touch-active { opacity: 0.85; transform: scale(0.97); }

  /* Faster transitions for touch */
  * { transition-duration: 0.12s !important; }
  .animate-fade-up, .animate-fade-in { transition-duration: 0.25s !important; }
}

/* ── Disable tap highlight (Android Chrome blue flash) ────── */
* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
input, textarea, select, a, button {
  -webkit-tap-highlight-color: transparent;
}

/* ── touch-action for smooth scrolling, no delay ─────────── */
html { touch-action: manipulation; }
.carousel-track,
.subcategory-tabs,
.bhk-strip,
.kanban-board-wrap { touch-action: pan-x; }

/* ── Prevent pull-to-refresh interfering with hero swipe ──── */
body { overscroll-behavior-y: contain; }

/* ── 480px — Large Android (Pixel 6A, Samsung A series) ───── */
@media (max-width: 480px) {
  .hero__headline { font-size: 2rem; }
  .search-widget__row { flex-direction: column; align-items: stretch; }
  .search-divider { display: none; }
  .carousel-track .property-card { min-width: 280px; }

  /* Page hero compact */
  .page-hero { min-height: 35vh !important; padding-top: 80px !important; }
  .page-hero .hero__headline { font-size: 1.8rem !important; }

  /* Filter sidebar full width */
  .listing-layout { grid-template-columns: 1fr !important; }
  .filter-sidebar { position: static !important; width: 100% !important; }

  /* Compare bar full width */
  .compare-bar { border-radius: 0 !important; left: 0 !important; right: 0 !important; transform: none !important; bottom: 60px !important; }

  /* Admin table horizontal scroll */
  .data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 640px; }

  /* Modal full screen on Android */
  .modal-overlay .modal {
    max-width: 100% !important;
    width: 100% !important;
    max-height: 95vh !important;
    margin: auto 0 0 0 !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-top-left-radius: var(--radius-2xl) !important;
    border-top-right-radius: var(--radius-2xl) !important;
  }
  .modal-overlay {
    align-items: flex-end !important;
  }
}

/* ── 412px — Samsung Galaxy S22/S23, Pixel 7 ───────────── */
@media (max-width: 412px) {
  .container { padding: 0 16px; }
  .hero__headline { font-size: 1.85rem; line-height: 1.1; }
  .hero__sub { font-size: 0.9rem; }
  .btn-lg { padding: 14px 24px; font-size: 0.9rem; }

  .property-card__meta { flex-wrap: wrap; gap: 0.35rem; }
  .stat-card { padding: 1rem; }
  .stat-card__value { font-size: 1.5rem; }

  /* Kanban cards narrower */
  .kanban-column { min-width: 170px !important; }

  /* Category grid icons */
  .category-grid { gap: 1rem; }
}

/* ── 390px — iPhone 14 Pro / standard Android (most common) ─ */
@media (max-width: 390px) {
  :root {
    --space-xl:  1.25rem;
    --space-2xl: 1.75rem;
    --space-3xl: 2.5rem;
    --space-4xl: 3.5rem;
  }
  .hero__headline { font-size: 1.75rem; }
  .section-title { font-size: 1.5rem !important; }

  .search-widget { padding: 1rem; }
  .search-widget__actions { flex-direction: column; }
  .search-widget__actions .btn { width: 100%; }

  .detail-media { height: 240px !important; }
  .detail-media img { height: 240px; }

  .bhk-strip { gap: 0.4rem; }
  .bhk-pill { padding: 6px 12px; font-size: 0.75rem; }
}

/* ── 375px — Older Android / mid-range (Redmi, Moto G) ───── */
@media (max-width: 375px) {
  .hero__headline { font-size: 1.65rem; }
  .navbar__logo-text { font-size: 1rem; }

  .property-card__price { font-size: 1.1rem; }
  .property-card__title { font-size: 0.85rem; }

  /* Wizard steps: tighter */
  #wizardStepIndicator { display: none; }

  /* 2-col stat strip → single col */
  .listing-stats-grid { grid-template-columns: 1fr 1fr !important; }
}

/* ── 360px — Small Android (Redmi 9, Galaxy A12) ─────────── */
@media (max-width: 360px) {
  .container { padding: 0 12px; }
  .hero__headline { font-size: 1.5rem; }
.section { padding: var(--space-4xl) 0; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .subcategory-grid { grid-template-columns: repeat(2, 1fr); }
  .testimonials-grid { grid-template-columns: repeat(2, 1fr); }
  .specs-grid { grid-template-columns: repeat(3, 1fr); }
  .two-col { grid-template-columns: 1fr 1fr; }
  .three-col { grid-template-columns: repeat(2, 1fr); }
  .analytics-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .detail-layout { grid-template-columns: 1fr 380px; }
  .detail-sidebar { position: sticky; }
  
  .dashboard-layout { grid-template-columns: 260px 1fr; }
  .dashboard-sidebar {
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    border-right: 1px solid var(--border);
    border-bottom: none;
  }
  
  .testimonials-grid { grid-template-columns: repeat(3, 1fr); }
  .three-col { grid-template-columns: repeat(3, 1fr); }
  
  .admin-shell { grid-template-columns: 280px 1fr; }
  .admin-sidebar {
    transform: translateX(0);
    transition: none;
    background: var(--bg-card);
    width: 280px;
    position: fixed;
    top: 0; bottom: 0;
    overflow-y: auto;
    z-index: var(--z-nav);
  }
  .admin-sidebar__overlay {
    display: none;
  }
  .admin-topbar .hamburger {
    display: none;
  }
  .admin-main { margin-left: 280px; }
}

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

/* ════════════════════════════════════════════════════════════
   ANDROID / MOBILE — Full Coverage (360px → 480px)
   ════════════════════════════════════════════════════════════ */

/* ── Touch target minimum (Google recommendation: 48×48dp) ── */
@media (pointer: coarse) {
  .btn, .navbar__nav a, .admin-sidebar__nav-item,
  .subcategory-tab, .bhk-pill, .property-card__wishlist,
  .toggle-switch, .form-select, .form-input,
  .mobile-nav a, .tab-btn {
    min-height: 44px;
    min-width: 44px;
  }

  /* Remove hover effects on touch — use touch-active instead */
  .property-card:hover { transform: none; box-shadow: none; }
  .property-card.touch-active {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  }

  .btn:hover { opacity: 1; }
  .btn.touch-active { opacity: 0.85; transform: scale(0.97); }

  /* Faster transitions for touch */
  * { transition-duration: 0.12s !important; }
  .animate-fade-up, .animate-fade-in { transition-duration: 0.25s !important; }
}

/* ── Disable tap highlight (Android Chrome blue flash) ────── */
* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
input, textarea, select, a, button {
  -webkit-tap-highlight-color: transparent;
}

/* ── touch-action for smooth scrolling, no delay ─────────── */
html { touch-action: manipulation; }
.carousel-track,
.subcategory-tabs,
.bhk-strip,
.kanban-board-wrap { touch-action: pan-x; }

/* ── Prevent pull-to-refresh interfering with hero swipe ──── */
body { overscroll-behavior-y: contain; }

/* ── 480px — Large Android (Pixel 6A, Samsung A series) ───── */
@media (max-width: 480px) {
  .hero__headline { font-size: 2rem; }
  .search-widget__row { flex-direction: column; align-items: stretch; }
  .search-divider { display: none; }
  .carousel-track .property-card { min-width: 280px; }

  /* Page hero compact */
  .page-hero { min-height: 35vh !important; padding-top: 80px !important; }
  .page-hero .hero__headline { font-size: 1.8rem !important; }

  /* Filter sidebar full width */
  .listing-layout { grid-template-columns: 1fr !important; }
  .filter-sidebar { position: static !important; width: 100% !important; }

  /* Compare bar full width */
  .compare-bar { border-radius: 0 !important; left: 0 !important; right: 0 !important; transform: none !important; bottom: 60px !important; }

  /* Admin table horizontal scroll */
  .data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 640px; }

  /* Modal full screen on Android */
  .modal-overlay .modal {
    max-width: 100% !important;
    width: 100% !important;
    max-height: 95vh !important;
    margin: auto 0 0 0 !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-top-left-radius: var(--radius-2xl) !important;
    border-top-right-radius: var(--radius-2xl) !important;
  }
  .modal-overlay {
    align-items: flex-end !important;
  }
}

/* ── 412px — Samsung Galaxy S22/S23, Pixel 7 ───────────── */
@media (max-width: 412px) {
  .container { padding: 0 16px; }
  .hero__headline { font-size: 1.85rem; line-height: 1.1; }
  .hero__sub { font-size: 0.9rem; }
  .btn-lg { padding: 14px 24px; font-size: 0.9rem; }

  .property-card__meta { flex-wrap: wrap; gap: 0.35rem; }
  .stat-card { padding: 1rem; }
  .stat-card__value { font-size: 1.5rem; }

  /* Kanban cards narrower */
  .kanban-column { min-width: 170px !important; }

  /* Category grid icons */
  .category-grid { gap: 1rem; }
}

/* ── 390px — iPhone 14 Pro / standard Android (most common) ─ */
@media (max-width: 390px) {
  :root {
    --space-xl:  1.25rem;
    --space-2xl: 1.75rem;
    --space-3xl: 2.5rem;
    --space-4xl: 3.5rem;
  }
  .hero__headline { font-size: 1.75rem; }
  .section-title { font-size: 1.5rem !important; }

  .search-widget { padding: 1rem; }
  .search-widget__actions { flex-direction: column; }
  .search-widget__actions .btn { width: 100%; }

  .detail-media { height: 240px !important; }
  .detail-media img { height: 240px; }

  .bhk-strip { gap: 0.4rem; }
  .bhk-pill { padding: 6px 12px; font-size: 0.75rem; }
}

/* ── 375px — Older Android / mid-range (Redmi, Moto G) ───── */
@media (max-width: 375px) {
  .hero__headline { font-size: 1.65rem; }
  .navbar__logo-text { font-size: 1rem; }

  .property-card__price { font-size: 1.1rem; }
  .property-card__title { font-size: 0.85rem; }

  /* Wizard steps: tighter */
  #wizardStepIndicator { display: none; }

  /* 2-col stat strip → single col */
  .listing-stats-grid { grid-template-columns: 1fr 1fr !important; }
}

/* ── 360px — Small Android (Redmi 9, Galaxy A12) ─────────── */
@media (max-width: 360px) {
  .container { padding: 0 12px; }
  .hero__headline { font-size: 1.5rem; }
  .hero__eyebrow { font-size: 0.65rem; }

  .btn { padding: 10px 18px; font-size: 0.8rem; }
  .btn-lg { padding: 12px 20px; }

  .subcategory-tab { padding: 8px 12px; font-size: 0.72rem; }
  .bhk-pill { padding: 5px 10px; font-size: 0.7rem; }

  .property-card__body { padding: 0.875rem; }
  .modal .modal__header h3 { font-size: 0.95rem; }

  /* Pipeline stats: 3 columns instead of 5 */
  #pipelineStats { grid-template-columns: repeat(3, 1fr) !important; }
}

/* ── Landscape Android (any phone rotated) ────────────────── */
@media (max-height: 480px) and (orientation: landscape) {
  .hero, .page-hero {
    min-height: 100svh;
    padding-top: 70px;
  }
  .hero__headline { font-size: 1.6rem; }
  .hero__search-wrap { margin-top: 1rem; }
}

/* ── PWA Standalone mode (installed on Android home screen) ── */
@media (display-mode: standalone) {
  body { padding-bottom: env(safe-area-inset-bottom, 0px); }
  .pwa-standalone .navbar { top: env(safe-area-inset-top, 0px); }
}

/* ── Safe area insets (notch/punch-hole Android phones) ────── */
@supports (padding: env(safe-area-inset-top)) {
  .navbar {
    padding-top: calc(var(--space-md) + env(safe-area-inset-top, 0px));
  }
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

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

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

/* ── TABLE RESPONSIVENESS ────────────────────────────────── */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
