/* ======================================
   OTOFIX - RESPONSIVE TASARIM
   ====================================== */

/* Genel Responsive Ayarlar */
html {
  box-sizing: border-box;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
  overflow-x: clip;
}

body {
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
}

*, *:before, *:after {
  box-sizing: inherit;
}

/* Tüm içerik elementleri için maksimum genişlik */
.container, 
section, 
.hero-container, 
.valuation-form-container, 
.features-grid, 
.testimonials-wrapper {
  max-width: 100%;
}

/* Resimlerin taşmasını engelleme */
img, video, iframe {
  max-width: 100%;
  height: auto;
}

/* Dokunmatik etkileşimleri iyileştirme */
a, button, .btn, input[type="button"], input[type="submit"], select, .nav-menu a {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0,0,0,0.1);
  min-height: 44px;
  min-width: 44px;
  cursor: pointer;
}

input, select, textarea {
  font-size: 16px !important; /* iOS otomatik zoom'u engeller */
}

/* Mobil scrolling iyileştirmesi */
html, body {
  scroll-behavior: smooth;
}

/* Tüm butonlar için dokunmatik dostu boyutlar */
button, .btn, input[type="button"], input[type="submit"] {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 8px;
  touch-action: manipulation;
}

/* Dokunmatik yüzeylerde highlight kontrolü */
a:active, button:active, .btn:active {
  opacity: 0.8;
  transform: scale(0.98);
  transition: transform 0.1s, opacity 0.1s;
}

/* Tablet ve Küçük Dizüstü (1100px ve altı) */
@media (max-width: 1100px) {
  .container {
    width: 95%;
  }
  
  .section-title {
    font-family: 'Barlow Condensed', sans-serif !important;
    font-size: clamp(2rem, 5vw, 2.5rem);
  }
  
  .section-title::before {
    font-size: clamp(3rem, 8vw, 4.5rem);
  }
  
  .section-subtitle {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
  }
  
  /* Hero alanı düzenlemeleri */
  .hero {
    padding: 80px 0;
  }
  
  .hero-content h1 {
    font-size: clamp(1.8rem, 5vw, 3.2rem);
  }
  
  /* Araç grid küçültmesi */
  .vehicles-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
  }
  
  /* Responsive'de araç fotoğrafları */
  .vehicle-image {
    height: 220px !important;
    width: 100% !important;
    aspect-ratio: 16 / 10;
    overflow: hidden;
  }
  
  .vehicle-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    min-width: 100%;
    min-height: 100%;
  }
  
  /* Testimonial ekranı daha kompakt */
  .testimonials-wrapper {
    gap: 30px;
  }
}

/* Tablet (900px ve altı) */
@media (max-width: 900px) {
  /* Nav & Header */
  .main-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background-color: #ffff !important;
  }
  
  /* Nav menü iyileştirmeleri */
  .nav-menu {
    position: relative;
    display: flex !important;
  }
  
  .nav-left, .nav-right {
    display: none;
    flex-direction: column;
    background: #fff;
    width: 100%;
    border-top: 1px solid #eee;
    box-shadow: 0 12px 24px -10px rgba(0,0,0,0.12);
    border-radius: 14px;
    overflow: hidden;
  }
  
  .nav-menu.nav-active .nav-left,
  .nav-menu.nav-active .nav-right {
    display: flex;
  }
  
  .nav-left a, .nav-right a {
    margin: 0;
    padding: 16px 18px;
    border-bottom: 1px solid #f3f3f3;
    min-height: 50px;
    display: flex;
    align-items: center;
  }
  
  .nav-left a:last-child, .nav-right a:last-child {
    border-bottom: none;
  }
  
  .logo-center {
    margin: 0 auto;
    display: flex !important;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
  }
  
  .logo-center img {
    max-height: 60px;
    width: auto;
  }
  
  /* Header container görünürlüğü */
  .main-header .container {
    display: block !important;
    visibility: visible !important;
  }
  
  /* Hero bölümü */
  .hero-container {
    flex-direction: column;
    gap: 30px;
  }
  
  .hero-left {
    width: 100%;
  }
  
  .hero-right {
    width: 100%;
  }
  
  .hero-content {
    text-align: center;
  }
  
  .hero-content h1 {
    font-size: clamp(1.9rem, 6.2vw, 2.4rem);
    line-height: 1.2;
  }
  
  .hero-subtitle {
    font-size: 0.95rem;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
  
  .valuation-form-container {
    max-width: 100%;
    margin: 0 auto;
  }

  /* Özellikler bölümü mobil düzen */
  .features-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }
  
  /* Testimonials mobil ayarları */
  .testimonials-wrapper {
    flex-direction: column;
    gap: 30px;
    width: 100%;
  }
  
  .testimonials-intro {
    max-width: 100%;
    text-align: center;
  }
  
  .testimonials-intro .section-title {
    font-family: 'Barlow Condensed', sans-serif !important;
    text-align: center;
    font-size: 1.8rem;
  }
  
  .testimonials-intro .section-subtitle {
    text-align: center;
    font-size: 0.95rem;
  }
  
  /* Testimonials slider container responsive */
  .testimonials-slider-container {
    flex: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 280px;
    position: relative;
    overflow: hidden !important; /* Mobilde kartların görünmesi için hidden olmalı */
    padding: 0;
    padding-bottom: 50px !important; /* Dots için alan bırak */
    box-sizing: border-box;
  }
  
  .testimonial-slider.mobile-mode {
    flex-direction: row !important;
    display: flex;
    transition: transform 0.5s ease;
    width: 100%;
    height: 100%;
    overflow: visible; /* Slider içinde kartlar görünmeli */
  }
  
  .testimonial-slider.mobile-mode .testimonial-card {
    min-width: 100% !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    margin-right: 0 !important;
    padding: 20px;
    min-height: auto;
    box-sizing: border-box;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    position: relative;
    z-index: 10 !important; /* Yazıların dots'un üstünde olması için */
  }
  
  /* Desktop modunda da responsive olmalı */
  .testimonial-slider:not(.mobile-mode) {
    width: 100%;
  }
  
  .testimonial-slider:not(.mobile-mode) .testimonial-card {
    width: 100%;
    max-width: 100%;
    padding: 20px;
    min-height: 180px;
  }
  
  .slider-nav {
    display: none !important; /* Responsive'de gizle */
  }
  
  .slider-prev, .slider-next {
    display: none !important; /* Responsive'de gizle */
  }
  
  .testimonial-dots {
    display: flex !important;
    gap: 8px;
    justify-content: center;
    position: absolute !important;
    bottom: 10px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin-top: 0 !important;
    z-index: 5 !important; /* Yazıların altında kalması için düşük z-index */
    background: transparent;
  }
  
  .testimonial-dots button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 0;
    background: #d2d2d2;
    padding: 0;
    cursor: pointer;
    transition: background 0.3s ease;
  }
  
  .testimonial-dots button:hover {
    background: #999;
  }
  
  .testimonial-dots button.active {
    background: var(--primary-color);
    width: 12px;
    height: 12px;
  }
  
  /* Footer mobil sütunları */
  .footer-content {
    display: flex;
    flex-direction: column;
    gap: 34px;
    text-align: center;
  }
  
  .footer-column h4::after {
    left: 50%;
    transform: translateX(-50%);
  }
  
  /* Sosyal medya ikonları için daha büyük tıklama alanı */
  .social-icons a {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 5px;
  }
}

/* Mobil (600px ve altı) */
@media (max-width: 600px) {
  body {
    line-height: 1.5;
  }
  
  .section-header {
    margin-bottom: 40px;
  }
  
  /* Testimonials küçük ekranlar için */
  .testimonials-slider-container {
    padding: 0 !important; /* Padding transform hesaplamasını bozuyor */
    padding-bottom: 45px !important; /* Dots için alan bırak */
    min-height: 250px !important;
    overflow: hidden !important;
  }
  
  .testimonial-card {
    padding: 15px !important;
    min-height: auto !important;
  }
  
  .testimonial-text {
    font-size: 0.9rem;
    margin-bottom: 15px;
  }
  
  .testimonials-intro .section-title {
    font-family: 'Barlow Condensed', sans-serif !important;
    font-size: 1.5rem;
  }
  
  .testimonials-intro .section-subtitle {
    font-size: 0.85rem;
  }
  
  /* Modal düzeni */
  .modal-content {
    padding: 22px 20px;
    border-radius: 14px;
    width: 95%;
  }
  
  /* Form düzeni iyileştirmeleri */
  .form-group {
    margin-bottom: 16px;
  }
  
  .form-group input, 
  .form-group select,
  .form-group textarea {
    padding: 14px 12px;
    border-radius: 10px;
    width: 100%;
  }
  
  /* Butonlar */
  .form-buttons {
    gap: 10px;
    flex-wrap: wrap;
  }
  
  .btn-prev, .btn-next, .btn-submit {
    width: 100%;
    justify-content: center;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 16px;
  }
  
  /* İletişim sayfası */
  .contact-container {
    margin: 30px auto !important;
    gap: 25px;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 15px !important;
    box-sizing: border-box !important;
  }
  
  .contact-info, .contact-form {
    padding: 22px 20px;
    width: 100% !important;
    max-width: 100% !important;
    min-width: auto !important;
    flex: 1 1 100% !important;
    box-sizing: border-box !important;
  }
  
  .map-container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 15px !important;
    margin: 30px auto !important;
    box-sizing: border-box !important;
  }
  
  .map-container iframe {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  /* Hakkımızda sayfası */
  .about-mission-vision {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  /* Tüm araçlar sayfası */
  .vehicle-listings {
    grid-template-columns: 1fr;
  }
  
  /* Ekspertiz şeması */
  .expertise-svg-wrapper {
    max-width: 100%;
    padding: 12px;
  }
  
  #expertiseSchema {
    height: 420px;
  }
  
  .parts-list {
    min-width: 100%;
  }
  
  /* Hero alanında ek düzenlemeler */
  .hero {
    padding: 40px 0;
  }
  
  .hero-content h1 {
    font-size: 1.8rem;
    margin-bottom: 15px;
  }
  
  .hero-subtitle {
    font-size: 0.9rem;
    margin-bottom: 20px;
  }
  
  .valuation-form-container {
    padding: 20px 15px;
  }
  
  .valuation-form-container h3 {
    font-size: 1.4rem;
  }
}

/* Çok Küçük Mobil (400px ve altı) */
@media (max-width: 400px) {
  .hero {
    padding: 60px 0;
  }
  
  .hero-content h1 {
    font-size: 1.5rem;
  }
  
  .valuation-form-container {
    padding: 15px;
  }
}

/* Form ve modal spesifik düzeltmeler */
.form-step {
  position: relative;
  padding-top: 48px;
}

.step-back {
  position: absolute;
  top: 8px;
  left: 10px;
  background: #fff;
  border: 1px solid #ddd;
  padding: 8px 14px;
  font-size: 0.8rem;
  border-radius: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: #333;
  min-height: 40px;
  min-width: 44px;
  touch-action: manipulation;
}

.step-back i {
  color: var(--primary-color);
}

/* Fiyat filtresi */
.price-range {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

/* Ekranlara göre görünürlük kontrolleri */
.mobile-only {
  display: none;
}

@media (max-width: 900px) {
  .mobile-only {
    display: block;
  }
  
  .desktop-only {
    display: none;
  }
}

/* Dokunmatik cihazlarda iyileştirilmiş etkileşim */
@media (hover: hover) {
  .vehicle-card:hover {
    transform: translateY(-8px);
  }
}

@media (hover: none) {
  .vehicle-card:active {
    transform: translateY(-3px);
  }
  
  /* Dokunmatik ekranlarda buton durumları */
  .btn:active, 
  button:active,
  .faq-question:active,
  .nav-menu a:active {
    background-color: rgba(0,0,0,0.05);
  }
}

/* Mobil tarayıcılarda sabit başlık için alan oluşturma */
@supports (-webkit-touch-callout: none) {
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }
}
