/* ============================================================
   VitaHomes — Responsive (Mobile-first ek katman)
   Breakpoint'ler: 1280 / 1024 / 768 / 640
   ============================================================ */

/* ---- ≤ 1280px ---- */
@media (max-width: 1280px) {
  :root { --container: 1080px; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1.2fr; }
  .footer-brand { grid-column: 1 / -1; }
}

/* ---- ≤ 1024px (tablet) ---- */
@media (max-width: 1024px) {
  .section { padding: var(--3xl) 0; }
  .grid-3, .why-grid { grid-template-columns: repeat(2,1fr); }
  .loc-grid { grid-template-columns: repeat(2,1fr); }
  .loc-card, .loc-card:nth-child(1), .loc-card:nth-child(6) { aspect-ratio: 4/3; }
  .services-split { grid-template-columns: 1fr; gap: var(--xl); }
  .services-visual { aspect-ratio: 16/9; max-height: 360px; }
  .search-fields { grid-template-columns: 1fr 1fr; }
  .search-fields .btn-gold { grid-column: 1 / -1; }

  /* Mobil menü */
  .nav-toggle { display: block; }
  .header-login { display: none; }
  .main-nav {
    position: fixed; inset: 0 0 0 auto; width: min(82vw, 360px);
    background: #fff; flex-direction: column; align-items: flex-start;
    padding: 100px var(--xl) var(--xl); gap: var(--lg);
    transform: translateX(100%); transition: transform .4s var(--ease);
    box-shadow: var(--sh-lg); z-index: 99;
  }
  body.nav-open .main-nav { transform: translateX(0); }
  body.nav-open::after { content:""; position: fixed; inset: 0; background: rgba(10,37,64,.45); z-index: 98; }
  .main-nav a { color: var(--c-text); font-size: 1.05rem; width: 100%; }
  .nav-mobile-extra { display: block; margin-top: auto; width: 100%; }
  .nav-login-m { display: block; padding: 14px 0; font-weight: 600; color: var(--c-gold-dark); border-top: 1px solid var(--c-border); }
}

/* ---- ≤ 768px ---- */
@media (max-width: 768px) {
  :root { --4xl: 64px; --3xl: 48px; }
  .stats .container { grid-template-columns: repeat(2,1fr); gap: var(--xl); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--xl); }
  .footer-brand { grid-column: 1 / -1; }
  .grid-2 { grid-template-columns: 1fr; }
  .row-between { flex-direction: column; align-items: flex-start; }
  .testimonial-card p { font-size: 1.1rem; }

  /* Liste sayfası: filtre sidebar -> alttan açılır panel */
  .listing-layout { grid-template-columns: 1fr !important; }
  .filter-sidebar {
    position: fixed !important; inset: auto 0 0 0; max-height: 85vh;
    border-radius: var(--r-lg) var(--r-lg) 0 0; transform: translateY(100%);
    transition: transform .4s var(--ease); z-index: 95; overflow-y: auto;
  }
  body.filters-open .filter-sidebar { transform: translateY(0); }
  .filter-mobile-toggle { display: inline-flex !important; }

  /* Detay: sticky sidebar normal akışa */
  .detail-grid { grid-template-columns: 1fr !important; }
  .detail-sidebar { position: static !important; }
  .detail-gallery { grid-template-columns: 1fr; height: auto; }
  .dg-thumbs { display: none; }
  .dg-main { height: 46vh; }

  .contact-grid { grid-template-columns: 1fr; gap: var(--xl); }
  .map-layout { grid-template-columns: 1fr; height: auto; }
  .list-map { height: 50vh; }
  .mg-row { grid-template-columns: 1fr; gap: var(--lg); }
  .dc-attrs, .dc-features { grid-template-columns: 1fr; }
  .list-rows .property-card { flex-direction: column; }
  .list-rows .pc-media, .map-list .pc-media { flex: none; aspect-ratio: 16/10; }

  /* Mobil alt sabit CTA çubuğu (detay sayfası) */
  .mobile-cta-bar { display: flex !important; }
}

/* ---- ≤ 640px (telefon) ---- */
@media (max-width: 640px) {
  :root { --container: 100%; }
  .container { width: calc(100% - 2*var(--md)); }
  h1 { font-size: 2.1rem; }
  h2 { font-size: 1.6rem; }
  .grid-3, .why-grid, .loc-grid { grid-template-columns: 1fr; }
  .stats .container { grid-template-columns: 1fr 1fr; }
  .search-fields { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .btn { padding: 13px 22px; }
  .whatsapp-fab { width: 52px; height: 52px; right: 16px; bottom: 16px; }
  .toast-stack { right: 12px; left: 12px; }
  .toast { min-width: auto; width: 100%; }

  /* Dokunma alanı en az 44px */
  .main-nav a, .btn, .pc-fav, .header-phone { min-height: 44px; }
}

/* ---- Hero arama çubuğu: mobil (zoom'a dayanıklı, fixed YOK) ---- */
@media (max-width: 860px) {
  .hsb-row { grid-template-columns: 1fr 1fr; }
  .hsb-submit { grid-column: 1 / -1; padding: 14px; }
}
@media (max-width: 600px) {
  .hero-search { margin-top: var(--xl); }
  .hsb-row { grid-template-columns: 1fr; }
  .hsb-tabs button { padding: 8px 16px; font-size: .78rem; }
}

/* ---- Zoom / yatay taşma sertleştirmesi ---- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { max-width: 100%; overflow-x: hidden; overscroll-behavior-x: none; }
img, video, iframe, table, .swiper { max-width: 100%; }
.container { max-width: 100%; }
/* Grid/flex çocuklarının taşmasını engelle (zoom'da düzen bozulmasın) */
.grid-2 > *, .grid-3 > *, .hsb-row > *, .footer-grid > *,
.detail-grid > *, .listing-layout > * { min-width: 0; }

/* Hareket azaltma tercihi */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
