/* Reset dasar */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background: #fefefe;
  color: #222;
  line-height: 1.6;
}

a {
  color: #007bff;
  text-decoration: none;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: auto;
}

/* Header */
header {
  background: #ff6b6b;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  flex-wrap: wrap;
}

/* Logo dengan mangga */
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo img {
  width: 36px;
  height: 36px;
}

.logo h1 {
  font-size: 1.6rem;
  font-weight: 700;
  user-select: none;
  color: white;
}

/* Navigasi */
nav {
  display: flex;
  gap: 1rem;
}

.menu {
  list-style: none;
  display: flex;
  gap: 1rem;
}

.menu li a {
  color: white;
  font-weight: bold;
  padding: 0.5rem;
  transition: background 0.3s ease;
  border-radius: 4px;
}

.menu li a.active,
.menu li a:hover {
  background: #fff;
  color: #ff6b6b;
}

/* Form pencarian */
.search-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.search-form input[type="search"] {
  padding: 0.4rem;
  border-radius: 4px;
  border: none;
  width: 200px;
}

.search-form button {
  padding: 0.4rem 0.8rem;
  background: #fff;
  border: none;
  color: #ff6b6b;
  font-weight: bold;
  border-radius: 4px;
  cursor: pointer;
}

/* Banner */
.banner img {
  width: 100%;
  height: auto;
  margin: 1rem 0;
  border-radius: 8px;
}

/* Layout utama */
.main-layout {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

/* Sidebar */
.sidebar {
  width: 250px;
  position: relative;
}

.sidebar h2 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

/* Sidebar kategori stylish */
.category-list {
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.category-item {
  display: flex;
  align-items: center;
  padding: 0.6rem 1rem;
  background: #fff3f3;
  border-radius: 6px;
  color: #d62828;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 1px solid #ffd6d6;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
}

.category-item .icon {
  margin-right: 0.5rem;
  font-size: 1.2rem;
}

/* Hover dan active */
.category-item:hover {
  background: #ffebeb;
  border-color: #ffaaaa;
  transform: translateX(4px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.category-item.active {
  background: #d62828;
  color: white;
  border-color: #b22222;
  box-shadow: 0 2px 10px rgba(214,40,40,0.5);
  transform: none;
}

.category-item.active .icon {
  color: white;
}

/* Konten utama */
.content {
  flex: 1;
}

.product {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  margin-bottom: 2rem;
  padding: 1rem;
  text-align: center;
}

.product-img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.price {
  display: block;
  font-weight: bold;
  margin: 0.5rem 0;
  color: #e63946;
}

.btn-buy {
  display: inline-block;
  background: #25d366;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.3s ease;
}

.btn-buy:hover {
  background: #1ebe5d;
}

/* Modal styling */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  text-align: center;
}

.modal-content {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2rem;
  color: white;
  cursor: pointer;
}

/* Footer */
footer {
  background: #222;
  color: #eee;
  text-align: center;
  padding: 2rem 0;
  margin-top: 2rem;
}

footer a {
  color: #ff6b6b;
}

/* Tombol toggle kategori (mobile) */
.toggle-category {
  display: none;
  background: #ff6b6b;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
  .header-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-form input[type="search"] {
    width: 100%;
  }

  nav {
    display: none;
    width: 100%;
    flex-direction: column;
    margin-top: 1rem;
  }

  nav.show {
    display: flex;
  }

  .menu {
    flex-direction: column;
    gap: 0;
  }

  .main-layout {
    flex-direction: column;
  }

  /* Sidebar default disembunyikan kecuali toggle aktif */
  .sidebar {
    width: 100%;
  }

  .sidebar h2,
  .category-list {
    display: none;
  }

  .sidebar.show h2,
  .sidebar.show .category-list {
    display: block;
  }

  .toggle-category {
    display: block;
  }
}
