/* ============================================================
   TEMAD Emlak - Global Responsive System
   Desktop / Notebook / Tablet / Phone uyum katmani
   Bu dosya tum sayfalarda ortak responsive davranis saglar.
   ============================================================ */

:root {
  --rs-gap: 16px;
  --rs-radius: 12px;
  --rs-control-h: 42px;
}

/* Footer ve sayfa alt kısmı beyaz tema */
html { background: #fff; }
.site-footer { background: #fff !important; color: #333 !important; }
.site-footer .container-xl { background: #fff; }
.site-footer .footer-links { list-style: none; padding: 0; margin: 0; }
.site-footer .footer-links a { color: #555 !important; text-decoration: none; }
.site-footer .footer-links a:hover { color: #C35B28 !important; }
.site-footer .footer-title { color: #1A1A2E !important; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.site-footer .footer-links li { color: #666; line-height: 2; }
.site-footer .sosyal-btn { color: #1A1A2E !important; border-color: #ddd !important; }
.site-footer .sosyal-btn:hover { color: #fff !important; background: #C35B28 !important; border-color: #C35B28 !important; }
.site-footer p.small { color: #555 !important; }
.site-footer hr { border-color: #e5e7eb !important; opacity: 1; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
}

img,
video,
canvas,
svg {
  max-width: 100%;
  height: auto;
}

.container,
.container-xl,
.container-lg,
.container-md,
.container-sm {
  width: min(100%, 1320px);
  padding-left: clamp(12px, 1.6vw, 24px);
  padding-right: clamp(12px, 1.6vw, 24px);
}

/* Genel kontrol elemanlari */
button,
.btn,
input,
select,
textarea {
  min-height: var(--rs-control-h);
}

.form-control,
.form-select,
.btn {
  font-size: clamp(13px, 1.2vw, 15px);
}

/* Genel grid ailesi */
.ilan-grid,
.bayi-grid,
.ekip-grid,
.stats-cards,
.admin-stat-grid,
.listings-grid {
  gap: var(--rs-gap);
}

/* Tablolar tasmasin */
.table-responsive,
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Harita ve medya bloklari */
#ilanlarHaritasi,
#bayiHarita,
.map-wrap,
.harita-wrap {
  width: 100%;
}

/* =========================
   NOTEBOOK (1200-1439)
   ========================= */
@media (max-width: 1439px) {
  :root {
    --rs-gap: 14px;
    --rs-control-h: 40px;
  }

  .container,
  .container-xl,
  .container-lg,
  .container-md,
  .container-sm {
    width: min(100%, 1180px);
  }

  .header-nav {
    gap: 4px;
  }

  .header-nav a {
    font-size: 14px;
    padding: 6px 10px;
  }

  .header-actions .btn {
    padding: 0.45rem 0.9rem;
    border-radius: 10px;
  }

  .ilan-grid,
  .listings-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* =========================
   TABLET (768-1199)
   ========================= */
@media (max-width: 1199px) {
  :root {
    --rs-gap: 12px;
    --rs-control-h: 38px;
  }

  .container,
  .container-xl,
  .container-lg,
  .container-md,
  .container-sm {
    width: min(100%, 100%);
    padding-left: 14px;
    padding-right: 14px;
  }

  .header-nav a {
    font-size: 13px;
    padding: 6px 8px;
  }

  .header-actions {
    gap: 8px;
  }

  .ilan-grid,
  .listings-grid,
  .bayi-grid,
  .ekip-grid,
  .stats-cards,
  .admin-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-hero,
  .listele-layout,
  .ilan-detay-layout,
  .wizard-layout,
  .auth-layout {
    grid-template-columns: 1fr !important;
  }

  .filtre-sidebar {
    width: 260px;
  }

  #ilanlarHaritasi,
  #bayiHarita {
    min-height: 380px;
    height: 50vh;
  }
}

/* =========================
   PHONE (<=767)
   ========================= */
@media (max-width: 767px) {
  :root {
    --rs-gap: 10px;
    --rs-control-h: 36px;
  }

  .container,
  .container-xl,
  .container-lg,
  .container-md,
  .container-sm {
    padding-left: 10px;
    padding-right: 10px;
  }

  h1 { font-size: clamp(21px, 7vw, 28px); }
  h2 { font-size: clamp(18px, 6vw, 24px); }
  h3 { font-size: clamp(16px, 5vw, 20px); }

  .header-logo img,
  .header-logo-img {
    height: 42px !important;
    max-height: 42px !important;
  }

  .header-logo-text,
  .header-brand-text,
  .brand-text {
    font-size: 1.55rem !important;
  }

  .header-nav { display: none !important; }

  .header-actions .btn {
    padding: 0.4rem 0.72rem;
    font-size: 0.85rem;
  }

  .ilan-grid,
  .listings-grid,
  .bayi-grid,
  .ekip-grid,
  .stats-cards,
  .admin-stat-grid,
  .secim-grid-4,
  .form-satir-2,
  .form-satir-3,
  .grid-cols-2 {
    grid-template-columns: 1fr !important;
  }

  .ilan-karti,
  .listing-card,
  .content-card,
  .stat-card,
  .filtre-sidebar,
  .auth-form-alani {
    border-radius: 10px;
  }

  .filtre-sidebar {
    position: fixed !important;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100% !important;
    max-height: 78vh;
    overflow-y: auto;
    z-index: 1200;
    border-radius: 16px 16px 0 0;
  }

  #ilanlarHaritasi,
  #bayiHarita {
    min-height: 280px;
    height: 42vh;
  }

  .modal-dialog {
    margin: 0.5rem;
  }

  .panel-layout {
    padding-top: 64px;
  }

  .panel-main {
    margin-left: 0 !important;
    padding: 14px !important;
  }

  .panel-sidebar {
    width: 88vw !important;
    max-width: 320px;
    top: 64px !important;
    transform: translateX(-100%);
  }

  .panel-sidebar.active {
    transform: translateX(0);
  }
}

/* =========================
   SMALL PHONE (<=420)
   ========================= */
@media (max-width: 420px) {
  .header-logo-text,
  .header-brand-text,
  .brand-text {
    font-size: 1.38rem !important;
  }

  .header-actions .btn {
    font-size: 0.8rem;
    padding: 0.36rem 0.58rem;
  }

  .btn,
  .form-control,
  .form-select {
    font-size: 13px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   TEMAD — 2026-04-18 MOBILE MASTER FIX
   Mobil cihaz uyumu, dinamik ölçülendirme, grid düzeni
   ═══════════════════════════════════════════════════════════════ */

/* ─── Viewport dinamik yükseklik (iOS Safari safe area) ─── */
:root {
  --vh: 1vh;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

/* ─── PHONE ≤767: Header buton gizle ─── */
@media (max-width: 767px) {

  /* İlan Ver + Giriş Yap butonlarını header'dan gizle (bottom nav kullanılıyor) */
  .site-header #ilanVerBtn,
  .site-header .header-actions > a.btn,
  .site-header .header-actions #auth-widget > a.btn,
  .site-header .header-actions #auth-widget {
    display: none !important;
  }

  /* Sadece hamburger menü butonu görünsün */
  .site-header .header-actions #mobileMenuToggle {
    display: inline-flex !important;
  }

  /* Header kompakt */
  .site-header .container-xl {
    padding-left: 10px;
    padding-right: 10px;
    min-height: 52px;
  }

  /* ─── İlanlar sayfası: Sıralama kutucuğu düzeni ─── */
  .siralama-bar {
    padding: 0.5rem 0.6rem;
    gap: 8px;
    border-radius: 10px;
    border: 1px solid #e2d9d2;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
  }

  .siralama-bar > span {
    font-size: 0.78rem;
  }

  .siralama-bar .d-flex {
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .siralama-bar .gorunum-toggle {
    width: 100%;
    display: flex;
  }

  .siralama-bar .gorunum-btn {
    flex: 1;
    justify-content: center;
    padding: 0.4rem 0.5rem;
    font-size: 0.78rem;
    border-radius: 8px;
  }

  .siralama-bar label {
    font-size: 0.75rem;
    margin-bottom: 2px;
  }

  .siralama-bar #siralamaSelect {
    font-size: 0.82rem;
    min-height: 38px;
    height: 38px;
    padding: 0.35rem 0.6rem;
    border: 1.5px solid #e2d9d2;
    border-radius: 10px;
    background: #fff;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
  }

  .siralama-bar #siralamaSelect:focus {
    border-color: #c35b28;
    box-shadow: 0 0 0 3px rgba(195, 91, 40, 0.15);
    outline: none;
  }

  /* ─── İlanlar sayfası: Üst arama çubuğu düzeni ─── */
  .bg-white.border.rounded-3.p-3.mb-3 {
    padding: 0.6rem !important;
    gap: 6px !important;
    flex-direction: column !important;
  }

  .bg-white.border.rounded-3.p-3.mb-3 #aramaInput {
    max-width: 100%;
    width: 100%;
  }

  .bg-white.border.rounded-3.p-3.mb-3 #tipFilter {
    max-width: 100%;
    width: 100%;
  }

  .bg-white.border.rounded-3.p-3.mb-3 #hizliAraBtn {
    width: 100%;
  }

  /* ─── Grid boşluk düzeltme (ilanlar) ─── */
  .ilanlar-layout .ilan-grid {
    gap: 6px;
  }

  /* ─── Anasayfa grid boşluk düzeltme ─── */
  #oneCikanGrid {
    --bs-gutter-x: 6px;
    --bs-gutter-y: 6px;
  }

  /* ─── Tüm sayfaların genişliği ekrana sığsın ─── */
  body {
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .container,
  .container-xl,
  .container-lg,
  .container-md,
  .container-sm {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: clamp(8px, 2.5vw, 16px);
    padding-right: clamp(8px, 2.5vw, 16px);
  }

  /* ─── Hero section mobil düzeni ─── */
  .hero-section {
    padding: 1.2rem 0 1rem;
  }

  .hero-title {
    font-size: clamp(1.3rem, 6vw, 1.8rem);
    line-height: 1.25;
    margin-bottom: 0.3rem;
  }

  .hero-subtitle {
    font-size: clamp(0.82rem, 3.5vw, 0.95rem) !important;
    margin-bottom: 0.8rem;
  }

  /* ─── Arama kutusu mobil ─── */
  .arama-kutusu {
    padding: 1rem;
    border-radius: 12px;
  }

  .arama-form {
    flex-direction: column;
    gap: 8px;
  }

  .arama-field {
    width: 100%;
    min-width: 100% !important;
  }

  .arama-btn {
    width: 100%;
  }

  /* ─── Kategori bar mobil ─── */
  .kategori-bar {
    gap: 8px;
    scrollbar-width: none;
  }

  .kategori-chip {
    font-size: 0.82rem;
    white-space: nowrap;
    padding: 0.4rem 0.9rem;
  }

  /* ─── Footer mobil düzeni — layout-lock-master.css yönetir ─── */

  /* ─── Bottom nav boşluk ─── */
  body {
    padding-bottom: calc(56px + var(--safe-bottom, 0px));
  }

  /* ─── Section padding mobil ─── */
  section.py-5 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }

  section.py-4 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
  }
}

/* ─── TABLET ≤1024: Grid ve form düzeni ─── */
@media (max-width: 1024px) {

  /* İlanlar 3 sütun grid */
  .ilanlar-layout .ilan-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  /* Anasayfa 3 sütun */
  #oneCikanGrid {
    --bs-gutter-x: 8px;
    --bs-gutter-y: 8px;
  }
}

/* ─── PHONE ≤480: Ekstra küçük ekranlar ─── */
@media (max-width: 480px) {

  /* İlanlar 2 sütun */
  .ilanlar-layout .ilan-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
  }

  .header-logo span {
    font-size: 1.25rem !important;
  }

  /* Sayfalama kompakt */
  .sayfalama {
    gap: 4px;
    margin-top: 16px;
    padding: 1rem 0;
  }

  .sayfa-btn {
    min-width: 32px;
    height: 32px;
    font-size: 12px;
  }

  /* Hero daha kompakt */
  .hero-section {
    padding: 0.8rem 0 0.6rem;
  }

  /* Ücretsiz İlan Ver butonu mobil */
  .hero-content .mt-3 > a {
    width: 100%;
    justify-content: center;
    text-align: center;
    padding: 0.55rem 1rem;
    font-size: 0.9rem;
    border-radius: 10px;
  }

  .hero-content .mt-3 {
    flex-direction: column;
    gap: 6px !important;
    align-items: stretch !important;
  }

  .hero-content .mt-3 > span {
    text-align: center;
    font-size: 0.75rem;
  }

  /* Bottom nav icon büyüklüğü */
  .temad-bottom-nav a i {
    font-size: 18px;
    display: block;
    margin: 0 auto;
    margin-bottom: 2px;
  }

  .temad-bottom-nav a span {
    font-size: 9px;
  }
}

/* ─── VERY SMALL PHONE ≤360 ─── */
@media (max-width: 360px) {

  .header-logo span {
    font-size: 1.1rem !important;
  }

  .container,
  .container-xl {
    padding-left: 6px;
    padding-right: 6px;
  }

  .ilanlar-layout .ilan-grid {
    gap: 3px;
  }

  #oneCikanGrid {
    --bs-gutter-x: 4px;
    --bs-gutter-y: 4px;
  }

  .siralama-bar {
    padding: 0.35rem 0.4rem;
  }
}

/* ─── LANDSCAPE PHONE ─── */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-section {
    padding: 0.5rem 0;
  }

  .hero-title {
    font-size: 1.2rem;
  }

  .temad-bottom-nav {
    display: none !important;
  }

  body {
    padding-bottom: 0;
  }
}

/* ─── DESKTOP ≥768: Grid boşluk düzeltme ─── */
@media (min-width: 768px) {

  /* Anasayfa grid — boşluk olmasın */
  #oneCikanGrid {
    --bs-gutter-x: 10px;
    --bs-gutter-y: 10px;
  }

  /* İlanlar grid — tüm hücreler eşit */
  .ilanlar-layout .ilan-grid {
    gap: 10px;
  }

  /* İlan kartları yüksekliği eşitlensin */
  .ilan-karti {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .ilan-bilgi {
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  .ilan-fiyat {
    margin-top: auto;
  }
}

/* ═══════════════════════════════════════════════════════════════
   OFİS LOGOSU — Dinamik Responsive Boyutlandırma
   Logo ilan kartında her ekran boyutuna göre ölçeklenir
   ═══════════════════════════════════════════════════════════════ */

/* Ofis logosu — tüm sayfalarda küçük köşe badge */
.ilan-karti .ilan-foto-wrap .ilan-ofis-logo {
  opacity: 1 !important;
  pointer-events: none !important;
  display: block !important;
  position: absolute !important;
  bottom: 4px !important;
  left: 4px !important;
  width: 28px !important;
  height: 28px !important;
  max-width: 28px !important;
  max-height: 28px !important;
  border-radius: 6px !important;
  object-fit: contain !important;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(0,0,0,0.08);
  padding: 1px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  z-index: 3;
}

/* Logo kapak img override'ını engelle — src bazlı gizlemeyi kaldır */
.ilan-karti .ilan-foto-wrap img[src*="firma_logo_"],
.ilan-karti .ilan-foto-wrap img[src*="bayi_logo_"],
.ilan-karti .ilan-foto-wrap img[src*="/uploads/logos/"] {
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Tablet ≤1024 */
@media (max-width: 1024px) {
  .ilan-karti .ilan-foto-wrap .ilan-ofis-logo {
    width: 26px !important;
    height: 26px !important;
    max-width: 26px !important;
    max-height: 26px !important;
  }
}

/* Phone ≤767 */
@media (max-width: 767px) {
  .ilan-karti .ilan-foto-wrap .ilan-ofis-logo {
    width: 22px !important;
    height: 22px !important;
    max-width: 22px !important;
    max-height: 22px !important;
    bottom: 3px !important;
    left: 3px !important;
    border-radius: 5px !important;
    padding: 1px !important;
  }
}

/* Small phone ≤480 */
@media (max-width: 480px) {
  .ilan-karti .ilan-foto-wrap .ilan-ofis-logo {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    bottom: 2px !important;
    left: 2px !important;
    border-radius: 4px !important;
  }
}

/* Very small phone ≤360 */
@media (max-width: 360px) {
  .ilan-karti .ilan-foto-wrap .ilan-ofis-logo {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
    bottom: 2px !important;
    left: 2px !important;
    border-radius: 3px !important;
  }
}

