body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    margin: 0;
    padding: 0;
    overflow: hidden;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation;
  }
  
  #map {
    width: 100%;
    height: calc(100vh - 70px);
    height: calc(var(--vh, 1vh) * 100 - 70px);
  }
  
  /* Google tarzı arama kontrol alanı */
  #controls {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    background-color: #fff;
    border-bottom: 1px solid #dfe1e5;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 999;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
    left: 0;
    top: 0;
  }
  
  /* Google tarzı arama kutusu */
  .search-container {
    position: relative;
    width: 100%;
    max-width: 584px;
    flex: 1;
    min-width: 0;
  }
  
  #searchBox {
    width: 100%;
    padding: 12px 50px;
    font-size: 16px;
    border: 1px solid #dfe1e5;
    border-radius: 24px;
    outline: none;
    box-shadow: 0 1px 3px rgba(32, 33, 36, 0.08);
    transition: box-shadow 200ms cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-appearance: none;
  }
  
  #searchBox:hover {
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
    border-color: rgba(223, 225, 229, 0);
  }
  
  #searchBox:focus {
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
    border-color: rgba(223, 225, 229, 0);
  }
  
  .search-icon {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    color: #9aa0a6;
    width: 20px;
    height: 20px;
    pointer-events: none;
  }
  
  .clear-icon {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: none;
    z-index: 10;
    -webkit-tap-highlight-color: transparent;
  }
  
  /* Öneri kutusu stilleri */
  #suggestionBox {
    position: absolute;
    top: 55px;
    left: 50%;
    transform: translateX(-50%);
    width: 584px;
    max-width: 90vw;
    max-height: 70vh; /* Add max height to limit vertical size */
    background: white;
    border-radius: 0 0 24px 24px;
    box-shadow: 0 4px 6px rgba(32, 33, 36, 0.28);
    overflow-y: auto; /* Enable vertical scrolling */
    display: none;
    z-index: 1001;
    -webkit-overflow-scrolling: touch;
  }
  .suggestion-item {
    padding: 12px 16px 12px 48px;
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s;
    -webkit-tap-highlight-color: transparent;
  }
  
  .suggestion-item:hover {
    background-color: #f1f3f4;
  }
  
  .suggestion-item:active {
    background-color: #e8f0fe;
  }
  
  .suggestion-item.selected {
    background-color: #eef3fd;
  }
  
  .suggestion-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
  }
  
  .suggestion-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .suggestion-text .highlight {
    color: #1a73e8;
    font-weight: bold;
  }
  
  .keyboard-hints {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    font-size: 13px;
    color: #70757a;
    border-top: 1px solid #e8eaed;
  }
  
  .keyboard-key {
    background-color: #f1f3f4;
    border-radius: 3px;
    border: 1px solid #dadce0;
    color: #202124;
    display: inline-block;
    font-size: 11px;
    line-height: 16px;
    margin: 0 4px;
    min-height: 20px;
    min-width: 20px;
    padding: 1px 6px;
    text-align: center;
  }
  
  /* Arama butonu */
  #searchButton {
    margin-left: 15px;
    background-color: #1a73e8;
    color: white;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    padding: 0 20px;
    height: 40px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
  }
  
  #searchButton:hover {
    background-color: #1765cc;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  }
  
  #searchButton:active {
    background-color: #1a5fba;
    transform: scale(0.98);
  }
  
  /* Konum butonu - Sağ Alt Pozisyon */
  #locateButton {
    position: fixed;
    bottom: calc(20px + env(safe-area-inset-bottom));
    right: 20px;
    z-index: 2001;
    padding: 10px 12px;
    background-color: white;
    color: #1a73e8;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    margin-bottom: env(safe-area-inset-bottom);
  }
  
  #locateButton:hover {
    background-color: #f1f3f4;
  }
  
  #locateButton:active {
    background-color: #e8eaed;
  }
  
  #locateButton svg {
    margin-right: 6px;
  }
  
  .loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.8);
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    display: none;
    text-align: center;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
  }
  
  .loading-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(26, 115, 232, 0.3);
    border-radius: 50%;
    border-top-color: #1a73e8;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
  }
  
  @keyframes spin {
    to { transform: rotate(360deg); }
  }
  
  @-webkit-keyframes spin {
    to { -webkit-transform: rotate(360deg); }
  }
  
  .notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    border-radius: 8px;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    font-weight: 500;
    max-width: 90%;
    box-sizing: border-box;
    word-break: break-word;
  }
  
  .notification.info {
    background-color: #1a73e8;
    color: white;
  }
  
  .notification.error {
    background-color: #ea4335;
    color: white;
  }
  
  .notification-icon {
    margin-right: 8px;
    flex-shrink: 0;
  }
  
  /* Mobil uyumluluk */
/* Mobil uyumluluk */
/* Mobil uyumluluk */
@media (max-width: 768px) {
    #suggestionBox {
        top: 60px; /* Adjust top position for mobile */
        max-height: 50vh; /* More limited height on mobile */
      }
    #controls {
      padding: 10px;
      position: relative;
      z-index: 999;
      display: flex;
      align-items: center;
      justify-content: flex-start; /* Öğeleri sola hizala (YENİDEN DÜZENLENDİ) */
    }
  
    .search-container {
      width: auto;
      flex-grow: 1;
      margin-right: 10px;
    }
  
    #searchBox {
      font-size: 14px;
      padding: 10px 40px;
    }
  
    #searchButton {
      min-width: 60px;
      padding: 0 12px;
      font-size: 13px;
    }
  
    #searchButton svg {
      margin-right: 4px;
      width: 16px;
      height: 16px;
    }
  
    #map {
      height: calc(100vh - 60px);
      height: calc(var(--vh, 1vh) * 100 - 60px);
    }
  
    /* Mobilde sol üst köşede konum butonu (FLEXBOX ile YENİDEN KONUMLANDIRMA - BASİTLEŞTİRİLDİ) */
    #locateButton {
        left: 20px;           /* Sağdan sola kaydırma */
        right: auto;          /* Sağ kenardan uzaklaştırma */
        bottom: 20px;         /* Alt kenara yaklaştırma */
        padding: 8px 10px;    /* İç boşluğu azaltma */
        font-size: 12px;      /* Font boyutunu küçültme */
        border-radius: 6px;   /* Köşe yuvarlaklığını azaltma */
      }
  
    /* Safari için ekstra düzeltmeler */
    .store-popup {
      max-width: 90vw;
    }
  }
  /* Küçük mobil cihazlar için ek düzenlemeler */
  @media (max-width: 375px) {
    #suggestionBox {
        top: 50px;
        max-height: 40vh;
      }
    #controls {
      padding: 8px;
      z-index: 999;
    }
    
    #searchBox {
      font-size: 14px;
      padding: 10px 40px;
    }
    
    #searchButton {
      min-width: 36px;
      font-size: 0;
      padding: 0;
      width: 36px;
      height: 36px;
      border-radius: 50%;
    }
    
    #searchButton svg {
      margin-right: 0;
      width: 18px;
      height: 18px;
    }
    
    #locateButton {
        padding: 6px 8px;     /* Daha da küçük iç boşluk */
        font-size: 0;         /* Yazıyı gizle, sadece ikon görünsün */
        width: 36px;          /* Sabit genişlik */
        height: 36px;         /* Sabit yükseklik */
        border-radius: 50%;   /* Yuvarlak buton */
        left: 15px;           /* Biraz daha sola */
        bottom: 15px;         /* Biraz daha aşağı */
        justify-content: center; /* İkonu ortala */
      }
      
      #locateButton svg {
        margin-right: 0;      /* İkonun sağ boşluğunu kaldır */
      }
    
    .suggestion-item {
      padding: 10px 10px 10px 40px;
      font-size: 14px;
    }
    
    .suggestion-icon {
      left: 12px;
    }
    
    /* Popup içeriğini küçük ekranlar için optimize et */
    .store-popup .leaflet-popup-content-wrapper {
      padding: 0;
    }
    
    .store-popup .leaflet-popup-content {
      margin: 10px !important;
      max-width: 250px;
    }
    
    .store-image {
      width: 150px !important;
      height: 200px !important;
    }
  }
  
  /* iPhone X/11/12/13/14 notch ve home indicator desteği */
  @supports (padding-bottom: env(safe-area-inset-bottom)) {
    #map {
      padding-bottom: env(safe-area-inset-bottom);
      padding-top: env(safe-area-inset-top);
    }
    
    #controls {
      padding-left: env(safe-area-inset-left);
      padding-right: env(safe-area-inset-right);
      z-index: 999;
    }
    
    /* Konum butonunun home indicator'dan yukarıda olmasını sağla */
    #locateButton {
      bottom: calc(20px + env(safe-area-inset-bottom));
      z-index: 2001;
    }
  }
  
  /* iPhone SE ve daha küçük ekranlar için ek düzenlemeler */
  @media (max-width: 320px) {
    #searchBox {
      font-size: 13px;
      padding: 8px 35px;
    }
    
    #controls {
      padding: 6px;
      z-index: 999;
    }
    
    #searchButton {
      width: 32px;
      height: 32px;
    }
    
    #locateButton {
      width: 32px;
      height: 32px;
      bottom: 10px;
      right: 10px;
      z-index: 2001;
    }
  }
  
  /* Yatay mod (landscape) için düzenlemeler */
  @media (max-height: 500px) and (orientation: landscape) {
    #map {
      height: calc(100vh - 50px);
      height: calc(var(--vh, 1vh) * 100 - 50px);
    }
    
    #controls {
      padding: 5px 10px;
      z-index: 999;
    }
    
/* Yatay modda konum butonunun pozisyonu */
#locateButton {
    bottom: 15px;
    right: 15px;
    z-index: 2001;
  }
}

/* Tablet Optimizasyonu */
@media (min-width: 768px) and (max-width: 1024px) {
  #controls {
    padding: 12px 15px;
    z-index: 999;
  }
  
  .search-container {
    max-width: 650px;
  }
  
  /* Tablet modunda konum butonu */
  #locateButton {
    bottom: 30px;
    right: 20px;
    padding: 10px 15px;
    font-size: 14px;
    z-index: 2001;
  }
}

/* Safari Özel Düzeltmeleri */
@supports (-webkit-overflow-scrolling: touch) {
  /* iOS Safari uyumluluğu için */
  #searchBox, #searchButton, #locateButton {
    -webkit-appearance: none;
    appearance: none;
  }
  
  .suggestion-item {
    cursor: pointer;
  }
}

/* iPadOS için ek düzenlemeler */
@media (min-width: 768px) and (max-width: 1024px) and (-webkit-min-device-pixel-ratio: 2) {
  #searchBox {
    font-size: 15px;
  }
  
  #controls {
    padding: 12px 20px;
    z-index: 999;
  }
  
  #locateButton {
    bottom: 30px;
    right: 20px;
    z-index: 2001;
  }
}