/* ══════════════════════════════════════════════════════
   EMINEM EMLAK — UI Stability & Mobile Excellence
   Kapsamlı responsive, dokunmatik & erişilebilirlik
   ══════════════════════════════════════════════════════ */

/* ── TEMEL MOBİL DÜZELTMELER ──────────────────────────── */
*{-webkit-tap-highlight-color:transparent;-webkit-font-smoothing:antialiased}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
input,select,textarea,button{font-family:inherit;font-size:inherit}

/* iOS input zoom engeli — 16px altı font-size */
@media(max-width:768px){
  input[type="text"],input[type="email"],input[type="tel"],
  input[type="number"],input[type="url"],select,textarea{
    font-size:16px !important;
  }
}

/* Dokunmatik hedef büyüklüğü (WCAG 2.5.8) */
a,button,[role="button"]{min-height:44px;min-width:44px}
/* İnce linklerde override */
.nav-links a,.f-list a,.breadcrumb a,.brand{min-height:unset;min-width:unset}

/* ── YATAY SCROLL ENGELİ ──────────────────────────────── */
body{overflow-x:hidden;max-width:100vw}
.hero,.stats-bar,.portfolio,section{max-width:100vw;overflow-x:hidden}

/* ── NAVBAR MOBİL ─────────────────────────────────────── */
@media(max-width:768px){
  nav#navbar{padding:10px 4% !important;gap:12px}
  nav#navbar.scrolled{padding:8px 4% !important}
  .brand-title{font-size:15px !important}
  .brand-sub{display:none !important}
  .brand-mark{width:38px !important;height:38px !important}
}

/* ── HERO MOBİL ───────────────────────────────────────── */
@media(max-width:768px){
  .hero{min-height:100svh;padding-top:80px;padding-bottom:20px}
  .hero-container{width:94%;padding:0 0 20px}
  .hero-text h1{font-size:clamp(1.65rem,6.5vw,2.3rem) !important;line-height:1.12;margin-bottom:12px}
  .hero-brand-block p{font-size:.88rem !important;line-height:1.65;margin-bottom:22px}

  /* Arama motoru tam responsive */
  .se-wrap{border-radius:14px;margin:0}
  .se-tabs{padding:5px 5px;gap:4px}
  .se-tab{padding:10px 6px;font-size:11.5px;gap:5px;border-radius:8px}
  .se-form{flex-direction:column;padding-bottom:0}
  .se-field{padding:12px 16px;flex:unset;width:100%;border-bottom:1px solid #f0f0f0}
  .se-field-price{flex:unset;width:100%}
  .se-sep{display:none}
  .se-btn-search{width:100%;padding:15px;justify-content:center;border-left:none;font-size:14px;border-radius:0 0 14px 14px}
  .se-footer{padding:8px 16px}
  .se-reset-link{font-size:11px}
}

/* ── STATS BAR MOBİL ──────────────────────────────────── */
@media(max-width:768px){
  .stats-bar{
    grid-template-columns:repeat(2,1fr) !important;
    gap:12px !important;
    padding:28px 5% !important;
  }
  .stat-item{min-width:unset}
}
@media(max-width:380px){
  .stats-bar{grid-template-columns:repeat(2,1fr) !important}
}

/* ── PORTFÖY KARTLARI ─────────────────────────────────── */
@media(max-width:768px){
  .p-grid{
    grid-template-columns:1fr !important;
    gap:16px !important;
    padding:0 !important;
  }
  /* İlan detay görseli */
  .p-img{height:200px !important}
}
@media(min-width:480px) and (max-width:768px){
  .p-grid{grid-template-columns:repeat(2,1fr) !important;gap:12px !important}
}

/* ── LİSTİNGS SAYFA ───────────────────────────────────── */
@media(max-width:768px){
  .listings-layout{flex-direction:column !important;padding:12px 4% 0 !important}
  .listings-hero{padding:100px 5% 32px !important}
  .listings-hero h1{font-size:clamp(1.5rem,5.5vw,2rem) !important}
  .filter-toggle-bar{
    display:flex !important;
    align-items:center;gap:10px;
    padding:12px 4%;
    background:#fff;border-bottom:1px solid #eee;
  }
}

/* ── DETAY SAYFASI MOBİL ──────────────────────────────── */
@media(max-width:768px){
  .detail-body{padding:16px 4% calc(80px + 20px) !important}
  .detail-grid{grid-template-columns:1fr !important}
  .detail-sidebar{order:-1 !important}
  .detail-img-wrap{height:250px !important;border-radius:14px !important}
  .detail-specs-grid{grid-template-columns:repeat(2,1fr) !important;gap:10px !important}
  .detail-contact-card{
    display:grid !important;
    grid-template-columns:1fr 1fr !important;
    gap:10px !important;
  }
  .detail-contact-head{grid-column:1/-1 !important}
  .dc-btn{font-size:13px !important;padding:12px 8px !important}
  /* Harita */
  #detailMap{height:200px !important}
  /* Breadcrumb */
  nav.breadcrumb{padding:10px 4% !important;font-size:12px}
  /* Galeri thumbnails */
  .gallery-thumbs .thumb{width:52px !important;height:38px !important}
  /* İlgili ilanlar */
  .related-grid{grid-template-columns:1fr 1fr !important;gap:12px}
}
@media(max-width:480px){
  .detail-contact-card{grid-template-columns:1fr !important}
  .detail-specs-grid{grid-template-columns:repeat(2,1fr) !important}
  .related-grid{grid-template-columns:1fr !important}
}

/* ── HAKKIMIZDA MOBİL ─────────────────────────────────── */
@media(max-width:768px){
  .about-story-grid{grid-template-columns:1fr !important;gap:32px !important}
  .about-kpi-grid{grid-template-columns:1fr 1fr !important;gap:12px !important}
  .about-values-grid{grid-template-columns:1fr !important}
  .about-team-grid{grid-template-columns:repeat(2,1fr) !important;gap:16px !important}
  .about-cta-btns{flex-direction:column !important;align-items:stretch !important}
  .about-cta-btns a{text-align:center !important;justify-content:center !important}
  /* About hero */
  [style*="padding:140px 8% 64px"]{padding:110px 5% 40px !important}
  /* About story */
  [style*="grid-template-columns:1fr 1fr;gap:56px"]{
    grid-template-columns:1fr !important;gap:32px !important;
  }
  [style*="grid-template-columns:1fr 1fr;gap:16px"]{
    grid-template-columns:1fr 1fr !important;
  }
}

/* ── HİZMETLER MOBİL ──────────────────────────────────── */
@media(max-width:768px){
  .services-grid{grid-template-columns:1fr !important}
  [style*="padding:88px 0 80px"]{padding:52px 0 48px !important}
  [style*="padding:100px 0 90px"]{padding:52px 0 48px !important}
}

/* ── DANIŞMANLAR MOBİL ────────────────────────────────── */
@media(max-width:768px){
  .advisors-grid-v2{grid-template-columns:repeat(2,1fr) !important;gap:14px !important;padding:0 4% !important}
  .advisors-hero{padding:100px 5% 36px !important}
  .advisors-hero h1{font-size:clamp(1.5rem,5.5vw,2rem) !important}
}
@media(max-width:480px){
  .advisors-grid-v2{grid-template-columns:1fr !important}
}

/* ── İLETİŞİM MOBİL ───────────────────────────────────── */
@media(max-width:768px){
  .cnt-hero-inner{padding:100px 5% 40px !important}
  .cnt-body{padding:36px 4% 100px !important}
  .cnt-grid{grid-template-columns:1fr !important;gap:20px !important}
  .cnt-grid2{grid-template-columns:1fr !important;gap:10px !important}
  .cnt-strip-inner{flex-wrap:wrap;gap:0}
  .cnt-strip-item{border-right:none !important;border-bottom:1px solid rgba(255,255,255,.06);padding:14px 0 !important;width:100%}
  .cnt-form-body{padding:20px !important}
  .cnt-form-header{padding:20px !important}
}

/* ── KARŞILAŞTIRMA MOBİL ──────────────────────────────── */
@media(max-width:768px){
  .compare-table{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch}
  .compare-table table{min-width:500px}
}

/* ── FOOTER MOBİL ─────────────────────────────────────── */
@media(max-width:768px){
  .f-grid{grid-template-columns:1fr !important;gap:28px !important}
  .f-bottom{flex-direction:column !important;text-align:center !important;gap:10px !important}
  footer{padding:40px 5% 32px !important}
}

/* ── CONTACT STRIP MOBİL ──────────────────────────────── */
@media(max-width:768px){
  .contact-strip .section-wrap{
    flex-direction:column !important;
    gap:20px !important;
    text-align:center !important;
    padding:32px 5% !important;
  }
  .contact-actions{
    flex-direction:column !important;
    width:100% !important;
    gap:10px !important;
  }
  .contact-actions a{
    justify-content:center !important;
    width:100% !important;
  }
}

/* ── MODAL MOBİL (Bottom Sheet) ───────────────────────── */
@media(max-width:768px){
  #propModal{
    align-items:flex-end !important;
    padding:0 !important;
  }
  .modal-content{
    grid-template-columns:1fr !important;
    max-width:100% !important;
    width:100% !important;
    border-radius:20px 20px 0 0 !important;
    max-height:88vh !important;
    overflow-y:auto !important;
    -webkit-overflow-scrolling:touch !important;
  }
  .modal-media{
    height:200px !important;
    border-radius:20px 20px 0 0 !important;
    overflow:hidden !important;
  }
  .modal-media img{height:200px !important;object-fit:cover !important;width:100% !important}
  .modal-body{padding:20px !important}
  .modal-price{font-size:1.3rem !important}
  .modal-actions{flex-direction:column !important;gap:8px !important}
  .btn-modal{width:100% !important;justify-content:center !important}
  /* İlk sütun (büyük görsel) gizle — sadece bilgi */
  .modal-content > div:first-child:not(.modal-body){display:none !important}
}

/* ── FLASH MESAJLAR MOBİL ─────────────────────────────── */
@media(max-width:768px){
  .flash-container{left:12px;right:12px;max-width:unset;top:auto;bottom:calc(74px + 12px)}
  .flash{font-size:13px;padding:12px 14px}
}

/* ── CİNEMATİK GALERİ MOBİL ──────────────────────────── */
@media(max-width:768px){
  #cgTrack{padding:16px 5% 28px !important;gap:14px !important}
  .cg-card{flex:0 0 82vw !important;height:300px !important;border-radius:16px !important}
}
@media(max-width:400px){
  .cg-card{flex:0 0 90vw !important;height:270px !important}
}

/* ── DANIŞMAN KARTLARI MOBİL (index) ──────────────────── */
@media(max-width:768px){
  [style*="repeat(auto-fill,minmax(260px"]{
    grid-template-columns:repeat(2,1fr) !important;
    gap:12px !important;
  }
}
@media(max-width:480px){
  [style*="repeat(auto-fill,minmax(260px"]{
    grid-template-columns:1fr !important;
  }
}

/* ── HİZMETLER BENTO MOBİL ───────────────────────────── */
@media(max-width:768px){
  /* Başlık grid → tek sütun */
  [style*="grid-template-columns:auto 1fr;gap:48px"]{
    grid-template-columns:1fr !important;
    gap:20px !important;
  }
  /* Bento grid → tek sütun */
  [style*="grid-template-columns:repeat(6,1fr);grid-template-rows"]{
    grid-template-columns:1fr !important;
    grid-template-rows:unset !important;
  }
  /* Span ayarları sıfırla */
  [style*="grid-column:span 2"],[style*="grid-column:span 3"]{
    grid-column:unset !important;
    grid-row:unset !important;
  }
  /* 5 adım bar — yatay kaydırma */
  [style*="grid-template-columns:repeat(5"]{
    display:flex !important;
    overflow-x:auto !important;
    scrollbar-width:none !important;
    -webkit-overflow-scrolling:touch !important;
    gap:0 !important;
    padding-bottom:8px;
  }
  [style*="grid-template-columns:repeat(5"] > *{
    flex:0 0 140px !important;
  }
  /* FAQ bar */
  [style*="grid-template-columns:1fr 1fr;gap:40px"]{
    grid-template-columns:1fr !important;
    gap:24px !important;
  }
}

/* ── DASHBOARD & ADMIN MOBİL ──────────────────────────── */
@media(max-width:768px){
  .kpi-grid{grid-template-columns:repeat(2,1fr) !important;gap:10px !important}
  [style*="grid-template-columns:1fr 1fr;gap:14px"]{
    grid-template-columns:1fr !important;
  }
  [style*="grid-template-columns:1fr 250px 220px"]{
    grid-template-columns:1fr !important;
  }
  [style*="grid-template-columns:250px 220px 1fr"]{
    grid-template-columns:1fr !important;
  }
  .sidebar{display:none}
  .content-area{margin-left:0 !important;padding:12px !important}
}

/* ── TABLET (769–1024px) ──────────────────────────────── */
@media(min-width:769px) and (max-width:1024px){
  nav#navbar{padding:14px 5%}
  nav#navbar.scrolled{padding:11px 5% !important}
  .p-grid{grid-template-columns:repeat(2,1fr) !important;gap:16px !important}
  .f-grid{grid-template-columns:1fr 1fr !important;gap:28px !important}
  .hero-text h1{font-size:clamp(2rem,4.5vw,3rem) !important}
  .advisors-grid-v2{grid-template-columns:repeat(2,1fr) !important}
  [style*="grid-template-columns:repeat(6,1fr)"]{
    grid-template-columns:repeat(3,1fr) !important;
  }
  [style*="grid-column:span 2"]{grid-column:span 1 !important}
  [style*="grid-column:span 3"]{grid-column:span 3 !important}
}

/* ── YAZICI MODU ──────────────────────────────────────── */
@media print{
  nav#navbar,.mob-nav,.wa-float,.mobile-drawer,footer,
  .contact-strip,.flash-container{display:none !important}
  body{padding-bottom:0 !important}
  .hero{min-height:unset;padding:20px}
}

/* ── PWA / STANDALONE MODU ────────────────────────────── */
@media(display-mode:standalone){
  nav#navbar{padding-top:max(20px,env(safe-area-inset-top)) !important}
  .hero{padding-top:max(90px,calc(env(safe-area-inset-top) + 60px)) !important}
  .mob-nav{
    height:calc(64px + env(safe-area-inset-bottom)) !important;
    padding-bottom:env(safe-area-inset-bottom) !important;
  }
}

/* ── DARK MODE HAZIRLIĞI ──────────────────────────────── */
@media(prefers-color-scheme:dark){
  /* Şimdilik — ileride aktif edilebilir */
}

/* ── AZALTILMIŞ HAREKET ───────────────────────────────── */
@media(prefers-reduced-motion:reduce){
  *{animation:none !important;transition:none !important}
  .mob-nav,.mob-nav-cta-ring{animation:none !important}
}

/* ── KÜÇÜK EKRAN KARTI OPTİMİZASYONU ─────────────────── */
@media(max-width:360px){
  .se-tab{font-size:10.5px;padding:9px 5px}
  .brand-title{font-size:14px !important}
  .mob-nav-label{font-size:8px}
  .mob-nav-cta-ring{width:46px;height:46px}
  .stats-bar{gap:8px !important;padding:20px 4% !important}
}

/* ── YÜKSEK DPI / RETİNA ──────────────────────────────── */
@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){
  .brand-mark img,.mob-nav img{image-rendering:-webkit-optimize-contrast}
}
