/* ================================================================
   HOMEFUTURE — RESPONSIVE
   responsive.css: Mobile-first breakpoints
   320 · 375 · 414 · 576 · 768 · 992 · 1200 · 1400
   ================================================================ */

/* ── BASE: 320px (all screens) ─────────────────────────────── */
body { padding-bottom: 64px; }  /* room for mobile bottom nav */
.footer-grid { grid-template-columns: 1fr; gap: 20px; }

/* Gallery grid: 1 cột trên mobile */
.gallery-grid { grid-template-columns: 1fr; grid-template-rows: auto; aspect-ratio: auto; }
.gallery-grid-main { grid-column: 1; grid-row: 1; aspect-ratio: 16/9; }
.gallery-grid-side { display: none; }
.gallery-view-all { display: flex; }

.navbar-nav    { display: none; }
.navbar-toggler { display: flex; }

.hero { padding: 28px 0 36px; }
.hero-stats { display: none; }

.search-filters .form-select { min-width: 100%; }

.filter-panel { display: none; }

.grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

.detail-info-grid { grid-template-columns: 1fr; }

.property-card-list { flex-direction: column; }
.property-card-list .card-img-wrap { width: 100%; padding-top: 56%; }
.property-card-list .card-img-wrap img { position: absolute; }

.chat-layout { height: calc(100vh - 120px); }
.chat-sidebar { width: 100%; min-width: 100%; display: none; }
.chat-sidebar.show { display: flex; }
.chat-main-panel { display: none; }
.chat-main-panel.show { display: flex; }

.admin-sidebar { display: none; }
.admin-sidebar.show { display: flex; flex-direction: column; position: fixed; left: 0; top: 0; z-index: var(--z-fixed); height: 100vh; box-shadow: var(--shadow-lg); }

.bottom-nav { display: block; }
.bottom-nav-inner { display: flex; }

.auth-card { padding: 24px; }

.wizard-steps { overflow-x: auto; padding-bottom: 8px; }

/* ── 375px ─────────────────────────────────────────────────── */
@media (min-width: 375px) {
  .hero-title { font-size: clamp(22px, 6vw, 44px); }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
}

/* ── 414px ─────────────────────────────────────────────────── */
@media (min-width: 414px) {
  .auth-card { padding: 28px; }
}

/* ── SM: 576px ─────────────────────────────────────────────── */
@media (min-width: 576px) {
  /* Gallery grid hiện 2 ảnh phụ */
  .gallery-grid { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 16/9; }
  .gallery-grid-main { grid-column: 1; grid-row: 1 / 3; aspect-ratio: auto; }
  .gallery-grid-side { display: block; }
}
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .hero-stats { display: flex; }
  .detail-info-grid { grid-template-columns: repeat(2, 1fr); }
  .property-card-list { flex-direction: row; }
  .property-card-list .card-img-wrap { width: 200px; min-width: 200px; padding-top: 0; height: 160px; }
  .property-card-list .card-img-wrap img { position: relative; height: 100%; }
  .search-filters .form-select { min-width: 130px; }
  .search-filters { flex-wrap: nowrap; }
  .d-sm-none   { display: none !important; }
  .d-sm-inline { display: inline !important; }
  .d-sm-flex   { display: flex !important; }
  .d-sm-block  { display: block !important; }
}

/* ── MD: 768px ─────────────────────────────────────────────── */
@media (min-width: 768px) {
  body { padding-bottom: 0; }  /* desktop: no bottom nav padding */
  .bottom-nav { display: none; }

  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }

  .navbar-nav { display: flex; }
  .navbar-toggler { display: none; }

  .chat-layout { height: calc(100vh - 80px); }
  .chat-sidebar { display: flex; width: 300px; min-width: 300px; }
  .chat-main-panel { display: flex; }

  .wizard-steps { flex-wrap: nowrap; overflow-x: visible; }

  .filter-panel { display: block; }

  .detail-info-grid { grid-template-columns: repeat(2, 1fr); }

  .admin-sidebar { display: flex; flex-direction: column; position: sticky; }

  .auth-card { padding: 36px; }

  .d-md-none  { display: none !important; }
  .d-md-flex  { display: flex !important; }
  .d-md-block { display: block !important; }
  .d-md-grid  { display: grid !important; }
}

/* ── LG: 992px ─────────────────────────────────────────────── */
@media (min-width: 992px) {
  .footer-grid { grid-template-columns: 2fr repeat(3, 1fr); gap: 32px; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(3, 1fr); }

  .hero { padding: 56px 0 64px; }
  .hero-stats { display: flex; gap: 36px; }
  .hero-title { font-size: clamp(28px, 3.5vw, 44px); }

  .search-box { padding: 24px 24px 20px; }
  .search-main-row { gap: 10px; }

  .detail-info-grid { grid-template-columns: repeat(3, 1fr); }

  .d-lg-none  { display: none !important; }
  .d-lg-flex  { display: flex !important; }
  .d-lg-block { display: block !important; }
  .d-lg-grid  { display: grid !important; }
}

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

  .brand-logo { height: 32px; }

  .d-xl-none  { display: none !important; }
  .d-xl-flex  { display: flex !important; }
  .d-xl-block { display: block !important; }
}

/* ── XXL: 1400px ───────────────────────────────────────────── */
@media (min-width: 1400px) {
  .container { max-width: 1360px; }
}

/* ── MOBILE MENU — hidden by default on all screen sizes ───── */
.navbar-mobile-menu { display: none; }

/* ── MOBILE NAV SHOW ───────────────────────────────────────── */
@media (max-width: 767.98px) {
  .bottom-nav { display: block; }

  /* Mobile drawer menu */
  .navbar-mobile-menu {
    display: block;
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: var(--white); z-index: var(--z-modal);
    padding: 16px;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform .3s var(--ease);
  }
  .navbar-mobile-menu.open { transform: translateX(0); }
  .mobile-menu-close { position: absolute; top: 16px; right: 16px; }
  .mobile-nav-links  { margin-top: 48px; display: flex; flex-direction: column; gap: 4px; }
  .mobile-nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; font-size: var(--size-md); font-weight: 500;
    border-radius: var(--radius-sm); color: var(--text);
    text-decoration: none; transition: var(--transition);
  }
  .mobile-nav-link:hover  { background: var(--primary-light); color: var(--primary); }
  .mobile-nav-link.active { background: var(--primary-light); color: var(--primary); font-weight: 700; }
  .mobile-nav-link i { width: 20px; text-align: center; font-size: 16px; color: var(--text-muted); }

  /* Property card full width */
  .property-card-list { flex-direction: column; }
  .property-card-list .card-img-wrap { width: 100%; padding-top: 56%; height: auto; }

  /* Section adjustments */
  .section-header { flex-direction: column; align-items: flex-start; gap: 8px; }

  /* Chat on mobile */
  .chat-layout { border-radius: 0; height: calc(100vh - 56px); }
  .chat-sidebar { position: absolute; z-index: 10; }

  /* Admin on mobile */
  .admin-topbar { padding: 0 12px; }
  .admin-body   { padding: 12px; }

  /* Filter offcanvas */
  .filter-offcanvas-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5); z-index: var(--z-modal-bg);
  }
  .filter-offcanvas-overlay.show { display: block; }
  .filter-offcanvas {
    display: flex;
    flex-direction: column;
    position: fixed; left: 0; top: 0; bottom: 0;
    width: 300px; background: var(--white);
    z-index: var(--z-modal);
    box-shadow: var(--shadow-lg);
    transform: translateX(-100%);
    transition: transform .3s var(--ease);
    overflow: hidden;
  }
  .filter-offcanvas.open { transform: translateX(0); }
  .filter-panel { display: block; position: static; }

  /* Wizard labels hide on tiny */
  .wizard-step-label { display: none; }
}

@media (max-width: 374.98px) {
  .wizard-step-label { display: none; }
  .section-title { font-size: 16px; }
  .stat-value    { font-size: 22px; }
  .hero-title    { font-size: 20px; }
}

/* ── PRINT ─────────────────────────────────────────────────── */
@media print {
  .navbar, .footer, .bottom-nav, .loading-overlay, .toast-container { display: none !important; }
  body { padding-bottom: 0; }
}
