/* ============================================================
   BoomRealties — Site-Wide CSS
   Design System + Layout Components
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/icon?family=Material+Icons|Material+Icons+Outlined|Material+Icons+Round');

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  --green:        #1A6B3C;
  --green-dark:   #145530;
  --green-light:  #E8F5EE;
  --blue:         #2B5F8E;
  --blue-dark:    #1E4A70;
  --blue-light:   #EBF2F8;
  --sky:          #56A8D8;
  --sky-light:    #EBF5FB;
  --white:        #FFFFFF;
  --surface:      #F4F8FB;
  --text:         #1A1A2E;
  --muted:        #6B7280;
  --light:        #9CA3AF;
  --success:      #1A6B3C;
  --warning:      #F59E0B;
  --error:        #DC2626;
  --crypto:       #F7931A;
  --crypto-light: #FEF3E0;
  --border:       rgba(86,168,216,0.15);
  --shadow-sm:    0 1px 4px rgba(0,0,0,0.06);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:    0 8px 32px rgba(0,0,0,0.10);
  --shadow-green: 0 4px 16px rgba(26,107,60,0.18);
  --radius:       10px;
  --radius-sm:    6px;
  --radius-lg:    16px;
  --radius-xl:    24px;
  --font-display: 'Plus Jakarta Sans', sans-serif;
  --font-body:    'Inter', sans-serif;
  --transition:   200ms ease;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Content Protection */
body, body * {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
input, textarea, select, [contenteditable] {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  user-select: text !important;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: var(--green);
  transition: box-shadow var(--transition);
}
.navbar--scrolled { box-shadow: 0 2px 20px rgba(0,0,0,0.15); }
.navbar__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.navbar__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}
.navbar__logo .material-icons { font-size: 26px; opacity: 0.9; }
.logo-accent { color: #A8DFBF; }
.navbar__links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
}
.nav-link {
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  transition: all var(--transition);
}
.nav-link:hover, .nav-link--active {
  color: #fff;
  background: rgba(255,255,255,0.12);
}
.navbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.btn-nav-outline {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 7px;
  border: 1.5px solid rgba(255,255,255,0.4);
  transition: all var(--transition);
}
.btn-nav-outline:hover { border-color: #fff; background: rgba(255,255,255,0.08); }
.btn-nav-solid {
  color: var(--green);
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 7px;
  transition: all var(--transition);
}
.btn-nav-solid:hover { background: #E8F5EE; transform: translateY(-1px); box-shadow: var(--shadow-green); }
.navbar__burger {
  display: none;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px;
}
.navbar__burger .material-icons { font-size: 26px; }
.navbar__mobile {
  display: none;
  flex-direction: column;
  background: var(--green-dark);
  padding: 16px 24px 20px;
  gap: 4px;
}
.navbar__mobile--open { display: flex; }
.navbar__mobile .nav-link { padding: 10px 14px; }
.navbar__mobile-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.w-full { width: 100%; }
.text-center { text-align: center; }

@media (max-width: 900px) {
  .navbar__links { display: none; }
  .navbar__actions .btn-nav-solid { display: none; }
  .navbar__actions .btn-nav-outline { font-size: 11px; padding: 5px 10px; }
  .navbar__burger { display: flex; }
}

/* ── Page offset for fixed navbar ──────────────────────────── */
.page-top { padding-top: 68px; }

/* ── Footer ─────────────────────────────────────────────────── */
.footer { background: var(--blue); color: rgba(255,255,255,0.85); }
.footer__top {
  max-width: 1280px;
  margin: 0 auto;
  padding: 60px 24px 40px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 40px;
}
.footer__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 12px;
}
.footer__logo .material-icons { font-size: 22px; }
.footer__tagline { font-size: 14px; color: rgba(255,255,255,0.65); line-height: 1.7; margin-bottom: 20px; }
.footer__payment-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.payment-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}
.payment-badge--crypto { border-color: rgba(247,147,26,0.3); background: rgba(247,147,26,0.08); }
.footer__col h4 {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 16px;
}
.footer__col a {
  display: block;
  color: rgba(255,255,255,0.65);
  font-size: 14px;
  margin-bottom: 10px;
  transition: color var(--transition);
}
.footer__col a:hover { color: #fff; }
.footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}
.footer__trust { display: flex; align-items: center; gap: 6px; }

@media (max-width: 900px) {
  .footer__top { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer__brand { grid-column: 1 / -1; }
  .footer__bottom { flex-direction: column; gap: 12px; text-align: center; }
}
@media (max-width: 540px) {
  .footer__top { grid-template-columns: 1fr; }
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 24px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); transform: translateY(-1px); box-shadow: var(--shadow-green); }
.btn-secondary { background: var(--blue); color: #fff; }
.btn-secondary:hover { background: var(--blue-dark); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--green); border: 2px solid var(--green); }
.btn-outline:hover { background: var(--green); color: #fff; }
.btn-outline-blue { background: transparent; color: var(--blue); border: 2px solid var(--blue); }
.btn-outline-blue:hover { background: var(--blue); color: #fff; }
.btn-crypto { background: var(--crypto); color: #fff; font-weight: 700; }
.btn-crypto:hover { background: #e07d0e; transform: translateY(-1px); }
.btn-lg { padding: 15px 32px; font-size: 16px; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-block { width: 100%; }
.btn .material-icons { font-size: 18px; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

/* ── Property Card ───────────────────────────────────────────── */
.property-card { cursor: pointer; }
.property-card__img {
  position: relative;
  height: 210px;
  overflow: hidden;
  background: var(--surface);
}
.property-card__img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}
.property-card:hover .property-card__img img { transform: scale(1.04); }
.property-card__badges {
  position: absolute;
  top: 12px; left: 12px;
  display: flex; gap: 6px;
}
.property-card__save {
  position: absolute;
  top: 12px; right: 12px;
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 50%;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}
.property-card__save:hover { background: #fff; transform: scale(1.1); }
.property-card__save .material-icons { font-size: 18px; color: var(--muted); }
.property-card__save.saved .material-icons { color: var(--error); }
.property-card__body { padding: 16px; }
.property-card__price {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--green);
  margin-bottom: 4px;
}
.property-card__price span { font-size: 13px; font-weight: 500; color: var(--muted); }
.property-card__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.property-card__location {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}
.property-card__location .material-icons { font-size: 14px; color: var(--sky); }
.property-card__meta {
  display: flex;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--surface);
}
.property-card__meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.property-card__meta-item .material-icons { font-size: 14px; color: var(--sky); }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.badge-rent { background: var(--blue-light); color: var(--blue); }
.badge-sale { background: var(--green-light); color: var(--green); }
.badge-verified { background: var(--green-light); color: var(--green); border: 1px solid rgba(26,107,60,0.2); }
.badge-verified .material-icons { font-size: 11px; }
.badge-type { background: var(--sky-light); color: var(--sky); }
.badge-pending { background: #FEF3C7; color: #92400E; }
.badge-crypto { background: var(--crypto-light); color: var(--crypto); }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.form-label .required { color: var(--error); margin-left: 2px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #E5E7EB;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-user-select: text !important;
  user-select: text !important;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(26,107,60,0.1);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--light); }
.form-textarea { resize: vertical; min-height: 120px; }
.form-error { font-size: 12px; color: var(--error); margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.form-error .material-icons { font-size: 13px; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.input-icon-wrap { position: relative; }
.input-icon-wrap .material-icons {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 18px;
  pointer-events: none;
}
.input-icon-wrap .form-input { padding-left: 40px; }

/* ── Section ────────────────────────────────────────────────── */
.section { padding: 72px 0; }
.section--surface { background: var(--surface); }
.section--green { background: var(--green); color: #fff; }
.section--blue { background: var(--blue); color: #fff; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.section-header { text-align: center; margin-bottom: 48px; }
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--sky);
  margin-bottom: 12px;
}
.section-label .material-icons { font-size: 14px; }
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.5px;
}
.section-title--white { color: #fff; }
.section-subtitle { font-size: 16px; color: var(--muted); margin-top: 12px; max-width: 560px; margin-left: auto; margin-right: auto; }
.section-subtitle--white { color: rgba(255,255,255,0.75); }

/* ── Grid ───────────────────────────────────────────────────── */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ── Stars ───────────────────────────────────────────────────── */
.stars { display: inline-flex; gap: 1px; color: #F59E0B; }
.stars .material-icons { font-size: 15px; }

/* ── Alert ───────────────────────────────────────────────────── */
.alert { padding: 14px 16px; border-radius: var(--radius); font-size: 14px; display: flex; align-items: flex-start; gap: 10px; }
.alert .material-icons { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: #D1FAE5; color: #065F46; border: 1px solid #6EE7B7; }
.alert-warning { background: #FEF3C7; color: #92400E; border: 1px solid #FCD34D; }
.alert-error { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; }
.alert-info { background: var(--blue-light); color: var(--blue); border: 1px solid rgba(43,95,142,0.2); }
.alert-crypto { background: var(--crypto-light); color: #92400E; border: 1px solid rgba(247,147,26,0.3); }

/* ── Tabs ────────────────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 2px solid var(--surface); gap: 0; margin-bottom: 28px; }
.tab-btn {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}
.tab-btn .material-icons { font-size: 16px; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--green); border-bottom-color: var(--green); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Pagination ──────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 40px; }
.page-btn {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  background: var(--white);
  cursor: pointer;
  transition: all var(--transition);
}
.page-btn:hover { border-color: var(--green); color: var(--green); }
.page-btn.active { background: var(--green); color: #fff; border-color: var(--green); }
.page-btn .material-icons { font-size: 16px; }

/* ── Filter Chip ─────────────────────────────────────────────── */
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: var(--white);
  cursor: pointer;
  transition: all var(--transition);
}
.filter-chip:hover { border-color: var(--sky); color: var(--sky); }
.filter-chip.active { border-color: var(--green); background: var(--green-light); color: var(--green); font-weight: 600; }

/* ── Spinner ────────────────────────────────────────────────── */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid rgba(26,107,60,0.15);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: rgba(26,107,60,0.25); border-radius: 3px; }

/* ── Utility ─────────────────────────────────────────────────── */
.text-green { color: var(--green); }
.text-blue { color: var(--blue); }
.text-sky { color: var(--sky); }
.text-muted { color: var(--muted); }
.text-crypto { color: var(--crypto); }
.font-display { font-family: var(--font-display); }
.fw-800 { font-weight: 800; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.hidden { display: none !important; }

/* ── Responsive Grid Utilities ──────────────────────────────── */
/* Use these classes on inline-styled grids so they collapse on mobile */
.resp-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.resp-2col-start { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.resp-sidebar-layout { display: grid; grid-template-columns: 1fr 300px; gap: 32px; align-items: start; }
.resp-detail-layout { display: grid; grid-template-columns: 1fr 360px; gap: 28px; align-items: start; }

@media (max-width: 900px) {
  .resp-2col, .resp-2col-start { grid-template-columns: 1fr !important; gap: 32px !important; }
  .resp-sidebar-layout { grid-template-columns: 1fr !important; gap: 24px !important; }
  .resp-detail-layout { grid-template-columns: 1fr !important; gap: 24px !important; }
}

/* ── Global Responsive Overrides ────────────────────────────── */

/* Dashboard layout — sidebar slides in on mobile */
@media (max-width: 900px) {
  .dash-layout { grid-template-columns: 1fr !important; }
  .dash-sidebar {
    position: fixed !important;
    left: -280px !important;
    top: 68px !important;
    z-index: 500 !important;
    height: calc(100vh - 68px) !important;
    transition: left .3s !important;
    width: 260px !important;
  }
  .dash-sidebar.open { left: 0 !important; }
  .dash-main { padding: 16px !important; }
  .dash-mobile-toggle {
    display: flex !important;
  }
}
@media (min-width: 901px) {
  .dash-mobile-toggle { display: none !important; }
}
.dash-mobile-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--blue);
  color: #fff;
  border: none;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  margin-bottom: 16px;
  border-radius: var(--radius);
  width: 100%;
}
.dash-mobile-toggle .material-icons { font-size: 20px; }
.dash-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 499;
}
.dash-overlay.open { display: block; }

/* Stat cards — 2 cols on mobile */
@media (max-width: 640px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr) !important; }
}

/* Property detail layout */
@media (max-width: 900px) {
  .detail-layout { grid-template-columns: 1fr !important; }
  .detail-sidebar { order: -1; }
}
@media (max-width: 640px) {
  .gallery-main { height: 240px !important; }
  .gallery-thumbs { grid-template-columns: repeat(4, 1fr) !important; }
  .prop-meta-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .amenities-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* Form grids */
@media (max-width: 640px) {
  .form-grid-2 { grid-template-columns: 1fr !important; }
  .form-grid-3 { grid-template-columns: 1fr !important; }
  .amenity-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .image-previews { grid-template-columns: repeat(3, 1fr) !important; }
  .step-progress { flex-direction: column !important; }
  .step-item { border-right: none !important; border-bottom: 1px solid var(--border); }
  .step-item:last-child { border-bottom: none !important; }
}

/* Properties map page */
@media (max-width: 900px) {
  .map-layout { grid-template-columns: 1fr !important; }
  .map-filters { position: static !important; max-height: none !important; }
  #mainMap { height: 400px !important; }
}

/* Tabs — scroll horizontally on small screens */
@media (max-width: 640px) {
  .tabs { overflow-x: auto; flex-wrap: nowrap; }
  .tab-btn { white-space: nowrap; padding: 10px 16px; font-size: 13px; }
}

/* Listings header */
@media (max-width: 640px) {
  .listings-header { flex-direction: column; align-items: flex-start !important; }
}

/* Profile pages */
@media (max-width: 900px) {
  .profile-layout { grid-template-columns: 1fr !important; }
  .profile-sidebar { text-align: center; }
}

/* Admin pages */
@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr !important; }
  .admin-sidebar {
    position: fixed !important;
    left: -280px !important;
    top: 68px !important;
    z-index: 500 !important;
    height: calc(100vh - 68px) !important;
    transition: left .3s !important;
    width: 260px !important;
  }
  .admin-sidebar.open { left: 0 !important; }
}

/* Table overflow on mobile */
@media (max-width: 768px) {
  .table-wrap, .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 600px; }
}

/* Modal full-screen on mobile */
@media (max-width: 640px) {
  .modal-box, .modal__box {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
  }
  .modal { align-items: flex-end !important; }
}

/* Section padding on mobile */
@media (max-width: 640px) {
  .section { padding: 48px 0; }
  .container { padding: 0 16px; }
}

/* ── iPhone / small device global safety net ─────────────────── */
@media (max-width: 480px) {
  /* Prevent any element from overflowing the viewport */
  body { overflow-x: hidden; }
  * { max-width: 100%; box-sizing: border-box; }

  /* Font size floors — nothing below 11px */
  p, span, div, a, li { font-size: max(11px, inherit); }

  /* Buttons full-width when stacked */
  .btn-stack-mobile { width: 100% !important; }

  /* Cards — reduce padding on tiny screens */
  .card, .dash-card, .section-card, .sidebar-card, .form-card {
    padding: 16px !important;
  }

  /* Property card image height */
  .property-card__img { height: 180px !important; }

  /* Detail page gallery */
  .gallery-main { height: 220px !important; }
  .gallery-thumbs { grid-template-columns: repeat(4, 1fr) !important; }

  /* Profile stats — 2 col */
  .profile-stats { grid-template-columns: repeat(2, 1fr) !important; }

  /* Prop meta grid — 2 col */
  .prop-meta-grid { grid-template-columns: repeat(2, 1fr) !important; }

  /* Stat cards — 2 col */
  .stat-cards { grid-template-columns: repeat(2, 1fr) !important; }

  /* Amenities — 1 col */
  .amenities-grid { grid-template-columns: 1fr !important; }

  /* Respect grids */
  .resp-2col, .resp-2col-start, .resp-sidebar-layout, .resp-detail-layout {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  /* Trust bar stack */
  .trust-inner { flex-direction: column; }
  .trust-methods { justify-content: center; }

  /* CTA banner */
  .cta-banner { padding: 28px 16px !important; flex-direction: column; text-align: center; }
  .cta-actions { flex-direction: column; align-items: stretch; }
  .cta-actions .btn { width: 100%; justify-content: center; }

  /* Section headers */
  .section-header { margin-bottom: 28px; }
  .section-title { font-size: 1.4rem !important; }

  /* Map page sidebar height on very small screens */
  .map-sidebar { height: 240px !important; }

  /* Tabs overflow */
  .tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .tab-btn { white-space: nowrap; flex-shrink: 0; }

  /* Dashboard */
  .dash-title { font-size: 1.2rem !important; }
  .dash-main { padding: 12px !important; }
}
