/* Genel yapı */
body {
  font-family: "Segoe UI", sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f8f9fa;
}

main {
  padding: 20px;
}

.market {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

/* Kategoriler */
.categories {
  flex: 1 1 200px;
  background-color: #ffffff;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
  height: fit-content;
}

.categories h2 {
  margin-top: 0;
  font-size: 20px;
  color: #333;
}

.categories ul {
  list-style: none;
  padding: 0;
}

.categories li {
  padding: 10px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  transition: background 0.3s, color 0.3s;
}

.categories li:hover {
  background-color: #007bff;
  color: white;
}

/* Ürünler */
.products {
  flex: 3 1 600px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.product-card {
  background-color: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.3s ease;
}

.product-card:hover {
  transform: translateY(-5px);
}
.product-card:hover img {
  transform: scale(1.1);
}

.product-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-card h3 {
  margin: 10px;
  font-size: 18px;
  color: #222;
}

.product-card p {
  margin: 0 10px 10px 10px;
  font-size: 14px;
  color: #555;
}

.details-content {
  display: none;
  padding: 10px;
  font-size: 14px;
  color: #444;
  background-color: #f1f1f1;
  border-top: 1px solid #ddd;
  border-radius: 0 0 10px 10px;
}

.details-toggle {
  margin: 10px;
  padding: 5px 10px;
  font-size: 14px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.details-toggle:hover {
  background-color: #0056b3;
}

/* Responsive */
@media (max-width: 768px) {
  .market {
    flex-direction: column;
  }

  .categories {
    width: 100%;
  }

  .products {
    flex: 3 1 300px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
  }

  .product-card {
    display: flex;
    flex-direction: column;
    height: auto; /* Yüksekliği otomatik hale getir */
    overflow: hidden;
    max-height: 380px; /* Maksimum yükseklik sınırlaması ekleyerek uzunluğu engelle */
  }

  .product-card img {
    height: 180px; /* Görsel boyutunu sabit tut */
    object-fit: cover;
  }

  .product-card h3 {
    font-size: 16px;
    margin: 10px;
  }

  .product-card p {
    font-size: 14px;
    margin: 0 10px 10px;
  }

  .details-toggle {
    margin: 10px;
    padding: 6px 10px;
    font-size: 13px;
  }

  .details-content {
    display: none; /* Detaylar başlangıçta gizli */
    font-size: 13px;
    padding: 10px;
    max-height: 200px; /* Detaylar kısmı da küçük ekranlarda sınırlı */
    overflow: hidden;
    transition: max-height 0.3s ease-in-out; /* Geçiş animasyonu */
  }

  /* Detaylar açıldığında */
  .product-card.open .details-content {
    display: block;
    max-height: 200px; /* Detaylar açıldığında daha fazla alan */
  }
}

@media (max-width: 468px) {
  .market {
    flex-direction: column;
  }

  .categories {
    width: 100%;
    margin-bottom: 20px;
  }

  .products {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }

 .product-card {
  width: 90%;
  max-height: 600px; /* Kart maksimum yüksekliği */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid #ddd;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: max-height 0.3s ease;
}

.details-content {
  max-height: 150px;  /* Detay alanı yüksekliği */
  overflow-y: auto;   /* Detaylarda scroll */
  padding: 10px;
  background: #f1f1f1;
  border-top: 1px solid #ddd;
  border-radius: 0 0 10px 10px;
}



  .product-card img {
    width: 100%;
    height: 400px; /* Sabit yükseklik */
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
  }

  .product-card:hover img {
    transform: scale(1.02);
  }

  .product-card h3 {
    font-size: 15px;
    padding: 8px 10px 5px;
    margin: 0;
  }

  .product-card p {
    font-size: 13px;
    padding: 0 10px 5px;
    margin: 0;
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .details-toggle {
    margin: 5px 10px;
    padding: 5px 10px;
    font-size: 13px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
  }

  .details-toggle:hover {
    background-color: #0056b3;
  }

  .details-content {
    display: none;
    padding: 10px;
    font-size: 13px;
    color: #444;
    background-color: #f1f1f1;
    border-top: 1px solid #ddd;
    transition: max-height 0.3s ease-in-out;
  }

  .product-card.open .details-content {
    display: block;
  }
}
