/* ============================================================
   Mobil İyileştirmeler (P0 + P1) — tüm sitede ortak
   header.ejs (public) ve header-dashboard.ejs (panel) linkler
   ============================================================ */

/* ---------- P0-1: iOS odak-zoom'unu engelle ----------
   16px altı input'lar mobilde odaklanınca sayfa zıplar.
   Mobilde tüm form alanlarını min 16px yap. */
@media (max-width: 768px) {
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea,
  .form-control,
  .form-select {
    font-size: 16px !important;
  }
}

/* ---------- P0-2: Dokunma hedefleri (min ~44px) ---------- */
@media (max-width: 768px) {
  .btn,
  button.btn,
  .nav-link,
  .dropdown-item,
  .page-link {
    min-height: 44px;
  }
  .btn-sm,
  .btn-group-sm > .btn {
    min-height: 40px;
  }
  /* İkon-only aksiyon butonları: kare ve ortalı */
  .btn-action,
  .btn-icon,
  .action-btn,
  .kt-btn,
  td .btn-sm,
  td a.btn,
  td button.btn {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* ---------- P0-3: Tablo taşması — güvenli yatay kaydırma ---------- */
@media (max-width: 768px) {
  .table-responsive,
  .dataTables_wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ---------- P1-1: Modal'lar küçük ekranda alanı kullansın ---------- */
@media (max-width: 576px) {
  .modal-dialog:not(.modal-fullscreen) {
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
  }
  .modal-body {
    padding: 18px !important;
  }
}

/* ---------- P1-2: Çentik / home-bar güvenli alanı ---------- */
.mobile-bottom-nav {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* ---------- P1-3: Görsel ve uzun metin taşması ---------- */
img {
  max-width: 100%;
  height: auto;
}
@media (max-width: 768px) {
  body {
    overflow-wrap: break-word;
    word-wrap: break-word;
  }
  /* Yatay kaydırmaya neden olan nowrap'leri mobilde gevşet */
  .breadcrumb {
    flex-wrap: wrap;
  }
}

/* ---------- Yüzen WhatsApp butonu ---------- */
.whatsapp-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 56px;
  height: 56px;
  background: #25D366;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  z-index: 1050;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.whatsapp-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 22px rgba(0,0,0,0.3);
  color: #fff;
}
.whatsapp-fab i { line-height: 1; }
@media (max-width: 768px) {
  .whatsapp-fab { bottom: calc(20px + env(safe-area-inset-bottom, 0)); }
  /* Veli panelinde alt navigasyon varsa butonu yukarı al */
  body:has(.mobile-bottom-nav) .whatsapp-fab { bottom: calc(86px + env(safe-area-inset-bottom, 0)); }
}
