.dictionary-list-container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
}

.list-header {
  text-align: center;
  margin-bottom: 40px;
}

.list-header h1 {
  color: #0e3d6b;
  font-size: 32px;
  font-weight: 800;
}

/* Alfabe ve Filtreler */
.list-controls {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 30px;
}

.alphabet-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.alphabet-filter button {
  background: #fff;
  border: 1px solid #ddd;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s;
}

.alphabet-filter button.active,
.alphabet-filter button:hover {
  background: #0e3d6b;
  color: #fff;
}

/* Kart Dizilimi */
.additives-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.additive-card {
  display: flex;
  align-items: center;
  background: #fff;
  padding: 20px;
  border-radius: 20px;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s;
  border-left: 5px solid #0e3d6b;
}

.additive-card:hover {
  transform: translateY(-5px);
}

.card-id {
  font-size: 20px;
  font-weight: 800;
  color: #0e3d6b;
  margin-right: 15px;
  min-width: 60px;
}

.card-info h3 {
  font-size: 16px;
  color: #333;
  margin: 0;
}

.card-info .category {
  font-size: 12px;
  color: #777;
}

/* Mobilde Tek Sütun */
@media (max-width: 600px) {
  .additives-grid {
    grid-template-columns: 1fr;
  }
}
/* ==========================================================================
   GIDA SÖZLÜĞÜ LİSTE - FİNAL MOBİL KODU (3'LÜ DİZİLİM & TAM UYUM)
   ========================================================================== */

/* Sayfa genelinde dikey kaydırmayı garantiye al */
html,
body {
  height: auto !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

/* Navbar arkasında içerik kalmaması için ana boşluk */
main {
  padding-top: 75px;
}

@media (max-width: 576px) {
  main {
    padding-top: 65px; /* Mobilde daralan navbar için */
  }

  /* 2. HERO ALANI: Yükseklik ve Hizalama */
  .dictionary-hero {
    height: auto !important;
    min-height: 180px !important;
    padding: 30px 0 !important;
    margin-bottom: 0 !important;
    display: flex !important;
    align-items: center !important;
    border-radius: 0 !important;
  }

  .hero-content h1 {
    font-size: 20px !important;
    line-height: 1.3 !important;
  }

  /* 3. ARAMA ÇUBUĞU: Tam istediğin konum (Hero üzerine biner, karttan ayrılır) */
  .dictionary-search-wrapper {
    margin: -25px 15px 30px 15px !important; /* Alt tarafa 30px boşluk vererek kartları ittik */
    position: relative !important;
    z-index: 100;
    height: 50px !important;
    padding: 5px 5px 5px 15px !important;
  }

  .dictionary-search-wrapper input {
    font-size: 12px !important;
  }

  /* 4. LİSTE KAPSAYICISI: Asılı kalmayı bitirir, yukarı yaslar */
  .dictionary-list-wrapper {
    padding-top: 0 !important;
    margin-top: 0 !important;
    display: block !important; /* Ortalamayı bozar, yukarıdan başlatır */
    overflow: visible !important;
  }

  .dictionary-list-container {
    padding: 0 10px !important;
    margin: 0 auto !important;
  }

  /* 5. 3'LÜ KART DİZİLİMİ */
  .additives-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 12px 8px !important; /* Satır arası 12px boşluk ile nefes alır */
    align-items: start !important;
    padding-top: 0 !important;
  }

  .additive-card {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 12px 5px !important;
    text-align: center !important;
    border-left: none !important;
    border-bottom: 4px solid #0e3d6b !important;
    border-radius: 12px !important;
    min-height: 100px !important;
    background: #fff !important;
  }

  /* 6. KART İÇİ YAZILAR */
  .card-id {
    font-size: 14px !important;
    font-weight: 800 !important;
    margin: 0 0 5px 0 !important;
  }

  .card-info h3 {
    font-size: 10px !important;
    line-height: 1.2 !important;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .card-info .category {
    display: none;
  }

  /* 7. FOOTER */
  footer,
  .main-footer {
    display: block !important;
    position: relative !important;
    margin-top: 40px !important;
    padding: 30px 15px !important;
  }
}

/* Tablet Görünümü */
@media (min-width: 577px) and (max-width: 991px) {
  .additives-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 15px !important;
  }
}
