/* ============================================
   TEAMTECHSOFT - GLOBAL RESPONSIVE FIX
   Tüm sayfalarda mobil uyumluluk için
   ============================================ */

/* --- GENEL OVERFLOW KORUMASI --- */
html {
  overflow-x: hidden !important;
  width: 100% !important;
}

body {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100vw !important;
  min-width: 0 !important;
}

/* XL mode'u mobilde devre dışı bırak */
@media (max-width: 1199px) {
  body.u-xl-mode .u-sheet {
    width: 90% !important;
    max-width: 100% !important;
  }
}

/* Tüm section'lar viewport'u aşmasın (header hariç - dropdown menüler için) */
section, footer, .u-section, .u-footer {
  max-width: 100vw !important;
  overflow-x: hidden !important;
}

/* Header overflow açık kalmalı - dropdown menüler görünsün */
header, .u-header {
  max-width: 100vw !important;
  overflow: visible !important;
}

.u-header .u-sheet {
  overflow: visible !important;
}

/* Navigasyon dropdown düzeltmeleri */
.u-nav-container {
  overflow: visible !important;
}

.u-nav-item {
  overflow: visible !important;
}

.u-nav-popup {
  overflow: visible !important;
  z-index: 9999 !important;
}

.u-nav-popup ul {
  overflow: visible !important;
}

.u-menu {
  overflow: visible !important;
}

.u-menu-dropdown {
  overflow: visible !important;
}

/* --- TABLET (max-width: 991px) --- */
@media (max-width: 991px) {
  .u-sheet {
    width: 90% !important;
    max-width: 100% !important;
  }

  .u-layout-wrap {
    overflow: hidden !important;
  }

  .u-layout-cell {
    min-width: 0 !important;
  }

  /* Header ve menü düzeltmeleri */
  .u-header .u-sheet {
    width: 100% !important;
    padding: 0 15px !important;
    box-sizing: border-box !important;
  }

  .u-header .u-image-1 {
    max-width: 150px !important;
    height: auto !important;
  }

  /* Carousel/Slider düzeltmeleri */
  .u-carousel .u-sheet {
    padding: 0 20px !important;
    box-sizing: border-box !important;
  }

  .u-carousel h2 {
    font-size: 1.8rem !important;
  }

  .u-carousel .u-text-2 {
    font-size: 0.95rem !important;
  }
}

/* --- MOBİL (max-width: 767px) --- */
@media (max-width: 767px) {
  .u-sheet {
    width: 95% !important;
    max-width: 100% !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    box-sizing: border-box !important;
  }

  /* Layout row'ları dikey yap */
  .u-layout-row {
    display: flex !important;
    flex-direction: column !important;
  }

  .u-layout-cell {
    width: 100% !important;
    min-width: 0 !important;
  }

  /* Size sınıflarını mobilde full genişlik yap */
  [class*="u-size-"] {
    flex-basis: 100% !important;
    max-width: 100% !important;
  }

  /* Görseller responsive */
  img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Header düzeltmeleri */
  .u-header .u-sheet {
    width: 100% !important;
    padding: 0 10px !important;
  }

  .u-header .u-image-1 {
    max-width: 120px !important;
    height: auto !important;
  }

  /* Navigasyon */
  .u-nav-container {
    display: none !important;
  }

  .menu-collapse {
    display: block !important;
  }

  .u-sidenav {
    width: 280px !important;
    max-width: 85vw !important;
  }

  /* Carousel/Slider mobil */
  .u-carousel,
  .u-slide {
    min-height: 300px !important;
  }

  .u-carousel .u-sheet {
    padding: 20px 15px !important;
    box-sizing: border-box !important;
  }

  .u-carousel h2,
  .u-carousel .u-text-1 {
    font-size: 1.4rem !important;
    word-wrap: break-word !important;
  }

  .u-carousel .u-text-2,
  .u-carousel ul {
    font-size: 0.85rem !important;
  }

  .u-carousel-control {
    width: 40px !important;
    height: 40px !important;
    padding: 8px !important;
  }

  /* Section düzeltmeleri - header hariç */
  section:not(.u-header) {
    overflow: hidden !important;
  }

  section .u-sheet {
    min-height: 100px !important;
  }

  /* Metin taşmalarını engelle */
  h1, h2, h3, h4, h5, h6, p, li, span, a {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
  }

  h1, .u-text h1 {
    font-size: 1.8rem !important;
  }

  h2, .u-text h2 {
    font-size: 1.4rem !important;
  }

  h3, .u-text h3 {
    font-size: 1.2rem !important;
  }

  /* Genişlik taşmalarını düzelt - form ve liste container'ları hariç */
  .u-layout-cell > .u-container-layout {
    overflow: hidden !important;
  }

  /* Sabit genişlikli elementleri sınırla - iframe ve map hariç */
  .u-group[style*="width"],
  .u-image[style*="width"] {
    max-width: 100% !important;
  }

  /* Footer düzeltmeleri */
  footer .u-sheet {
    width: 95% !important;
  }

  footer .u-layout-row {
    flex-direction: column !important;
  }

  footer .u-layout-cell {
    width: 100% !important;
    margin-bottom: 20px !important;
  }

  /* Anasayfa logo grid - mobilde gizle */
  .u-section-2 .u-layout-cell-1 [class*="u-image-"][class*="u-opacity-20"] {
    display: none !important;
  }

  /* Form elementleri */
  input, textarea, select, button {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .u-form {
    width: 100% !important;
    max-width: 100% !important;
  }

  .u-form .u-btn {
    width: 100% !important;
  }

  /* Tablo responsive */
  table {
    display: block !important;
    overflow-x: auto !important;
    max-width: 100% !important;
  }

  /* Gutter düzeltmeleri */
  .u-gutter-0 {
    margin: 0 !important;
  }
}

/* --- CAROUSEL BACKGROUND FIX --- */
@media (max-width: 767px) {
  [class*="u-section-1-"] {
    background-size: cover !important;
    background-position: center center !important;
  }

  .u-carousel-item {
    min-height: 280px !important;
  }

  .u-carousel-item .u-sheet {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    min-height: 280px !important;
    padding: 20px !important;
  }
}

/* --- KÜÇÜK MOBİL (max-width: 575px) --- */
@media (max-width: 575px) {
  .u-sheet {
    width: 100% !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    box-sizing: border-box !important;
  }

  /* Carousel küçük ekranda */
  .u-carousel,
  .u-slide {
    min-height: 250px !important;
  }

  .u-carousel .u-sheet {
    padding: 15px 10px !important;
  }

  .u-carousel h2,
  .u-carousel .u-text-1 {
    font-size: 1.2rem !important;
  }

  .u-carousel .u-text-2,
  .u-carousel ul {
    font-size: 0.8rem !important;
  }

  .u-carousel-indicators {
    bottom: 5px !important;
  }

  .u-carousel-indicators li {
    width: 8px !important;
    height: 8px !important;
  }

  /* Header */
  .u-header .u-image-1 {
    max-width: 90px !important;
  }

  .u-header .u-sheet {
    padding: 5px 10px !important;
  }

  /* Butonlar */
  .u-btn {
    padding: 8px 16px !important;
    font-size: 0.85rem !important;
    white-space: normal !important;
  }

  /* Section minimum yükseklik - çok yüksek değerleri düşür ama tamamen kaldırma */
  [class*="u-section-"] .u-sheet {
    min-height: 150px !important;
  }

  /* Layout hücre padding */
  .u-layout-cell > .u-container-layout {
    padding: 15px 10px !important;
  }

  /* Expanded width kontrol */
  .u-expanded-width {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
  }
}

/* --- ÇÖZÜM ORTAKLARI / REFERANSLAR LOGO GRID --- */
@media (max-width: 767px) {
  /* Logo/referans gridleri 2 sütun */
  .u-repeater {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .u-repeater > * {
    width: 100% !important;
    margin: 0 !important;
  }

  .u-repeater img {
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
  }
}

/* --- İLETİŞİM SAYFASI ÖZEL --- */
@media (max-width: 767px) {
  .iti {
    width: 100% !important;
  }

  .iti__flag-container {
    position: absolute !important;
  }

  .iti input {
    width: 100% !important;
    padding-left: 52px !important;
  }

  /* Google Maps responsive */
  .u-map {
    width: 100% !important;
    height: 300px !important;
  }

  .u-map .embed-responsive {
    width: 100% !important;
    height: 100% !important;
  }

  .u-map iframe {
    width: 100% !important;
    height: 300px !important;
  }
}

/* --- BLOG SAYFASI ÖZEL --- */
@media (max-width: 767px) {
  .u-blog-post {
    width: 100% !important;
    margin-bottom: 20px !important;
  }

  .u-post-content {
    padding: 10px !important;
  }
}
