/* Tata Letak Utama Halaman Produk */
.product-page-container {
  display: grid;
  grid-template-columns: 1fr; /* Default untuk mobile, satu kolom */
  gap: 2rem;
  padding: 2rem 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Tampilan 2 kolom untuk tablet dan desktop */
@media(min-width: 768px) {
  .product-page-container {
    grid-template-columns: 280px 1fr; /* Lebar sidebar 280px, sisanya untuk konten */
  }
}

/* Styling untuk Sidebar Kategori */
.sidebar {
  background-color: #f9fafb;
  padding: 1.5rem;
  border-radius: 1rem;
  border: 1px solid #e5e7eb;
  height: fit-content; /* Agar tinggi sidebar menyesuaikan konten */
  position: sticky;
  top: 120px; /* Sesuaikan dengan tinggi header Anda + sedikit jarak */
}

.sidebar h3 {
  color: #dc2626; /* text-red */
  margin-top: 0;
  font-size: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #f3f4f6;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar .category-list > li > a {
  font-weight: 600; /* Bold untuk kategori utama */
}

.sidebar ul li a {
  display: block;
  padding: 0.75rem 0.5rem;
  text-decoration: none;
  color: #111827;
  border-radius: 0.5rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar ul li a:hover {
  background-color: #fef2f2; /* Warna latar hover yang soft */
  color: #dc2626;
}

.sidebar .sub-category-list {
  padding-left: 1.25rem; /* Indentasi untuk sub-kategori */
  margin-top: 0.5rem;
}

/* Styling untuk Grid Produk */
.product-grid {
  width: 100%;
}

.product-grid h4 {
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  padding-left: 0.5rem;
  border-left: 4px solid #dc2626;
}

.products {
  display: grid;
  /* Membuat kolom responsif: minimal 200px, dan akan mengisi ruang yang tersedia */
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
}

/* Styling untuk Kartu Produk */
.product-card {
  background-color: white;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.product-card img {
  width: 100%;
  height: 200px; /* Menyamakan tinggi gambar */
  object-fit: cover; /* Agar gambar tidak gepeng */
  border-bottom: 1px solid #e5e7eb;
}

.product-card .product-info {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* Agar bagian info ini mengisi sisa ruang */
}

.product-card h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
  border-left: none; /* Hapus border dari h4 di dalam kartu */
  padding-left: 0;
}

.product-card .product-price {
  font-size: 1.2rem;
  font-weight: bold;
  color: #dc2626; /* text-red */
  margin-top: auto; /* Mendorong harga ke bawah, di atas tombol */
  padding-top: 0.5rem;
}

.product-card .btn-detail {
  display: block;
  background-color: transparent;
  color: #dc2626;
  border: 2px solid #dc2626;
  text-align: center;
  padding: 0.6rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 600;
  margin-top: 1rem;
  transition: background-color 0.3s, color 0.3s;
}

.product-card .btn-detail:hover {
  background-color: #dc2626;
  color: white;
}
/* === TAMPILAN SIDEBAR KHUSUS MOBILE === */
@media (max-width: 768px) {
  .sidebar {
    position: relative; /* Matikan sticky di mobile agar tidak menutupi layar */
    top: 0;
    margin-bottom: 2rem;
    cursor: pointer; /* Memberi tanda bahwa ini bisa diklik */
  }

  .sidebar h3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none; /* Hilangkan garis bawah saat tertutup */
    margin-bottom: 0;
    padding-bottom: 0;
  }

  /* Menambahkan ikon panah menggunakan CSS (memerlukan FontAwesome) */
  .sidebar h3::after {
    content: '\f078'; /* Kode unik icon Chevron Down FontAwesome */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 1rem;
    transition: transform 0.3s ease;
  }

  /* Sembunyikan daftar kategori secara default di mobile */
  .sidebar .category-list {
    display: none;
    margin-top: 1rem;
    border-top: 2px solid #f3f4f6;
    padding-top: 1rem;
    animation: fadeIn 0.3s ease;
  }

  /* === KEADAAN SAAT SIDEBAR DIBUKA (ACTIVE) === */
  .sidebar.active .category-list {
    display: block; /* Munculkan daftar saat class active ada */
  }

  .sidebar.active h3::after {
    transform: rotate(180deg); /* Putar panah ke atas */
  }
}

/* Animasi halus saat muncul */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}