/* === RESET DAN DASAR === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  background-color: #fff;
  color: #333;
  transition: background-color 0.5s, color 0.5s;
  scroll-behavior: smooth;
}

/* === NAVBAR === */
header {
  background-color: #222;
  color: #fff;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.logo {
  font-size: 1.6em;
  font-weight: bold;
  letter-spacing: 1px;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 25px;
}

.nav-links a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: #f2c94c;
}

/* === KANAN NAVBAR === */
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

#searchInput {
  padding: 7px 10px;
  border-radius: 5px;
  border: none;
  width: 160px;
}

.cart-icon {
  cursor: pointer;
  position: relative;
  font-size: 18px;
}

#cartCount {
  position: absolute;
  top: -8px;
  right: -10px;
  background: red;
  color: white;
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 12px;
  font-weight: bold;
}

#darkModeToggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: #fff;
}

/* === HERO SECTION === */
.hero {
  background: url('https://images.unsplash.com/photo-1605478571927-5fbc9b79d9b7?auto=format&fit=crop&w=1400&q=80') center/cover no-repeat;
  color: white;
  text-align: center;
  padding: 100px 20px;
}

.hero-text {
  background: rgba(0, 0, 0, 0.5);
  display: inline-block;
  padding: 25px 45px;
  border-radius: 10px;
  animation: fadeIn 1.5s ease;
}

.hero-text h2 {
  font-size: 1.8em;
}

.btn {
  display: inline-block;
  margin-top: 15px;
  padding: 12px 25px;
  background-color: #f2c94c;
  color: #222;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  transition: background 0.3s;
}

.btn:hover {
  background-color: #e5b93f;
}

/* === SECTION DASAR === */
.about, .produk, .review {
  padding: 60px 20px;
  text-align: center;
}

h2 {
  margin-bottom: 15px;
  font-size: 1.8em;
}

/* === PRODUK === */
.filter {
  margin: 20px auto;
}

.produk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 25px;
  margin-top: 30px;
}

.produk-card {
  background: #f8f8f8;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  padding: 18px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: fadeUp 0.8s ease;
}

.produk-card:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.produk-card img {
  width: 100%;
  border-radius: 10px;
  margin-bottom: 10px;
}

.price {
  font-weight: bold;
  color: #e67e22;
}

.btn-cart {
  background-color: #f2c94c;
  border: none;
  padding: 10px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  width: 100%;
  margin-top: 8px;
  transition: background 0.3s;
}

.btn-cart:hover {
  background-color: #e5b93f;
}

.review-link {
  display: block;
  margin-top: 10px;
  color: #3498db;
  text-decoration: none;
}

.review-link:hover {
  text-decoration: underline;
}

/* === REVIEW SECTION === */
.review-box {
  background: #fafafa;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  margin-top: 20px;
}

/* === FOOTER === */
footer {
  background: #222;
  color: white;
  text-align: center;
  padding: 20px 0;
  margin-top: 40px;
  font-size: 14px;
}

/* === MODAL KERANJANG === */
.cart-modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.cart-content {
  background: white;
  padding: 25px;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
}

.cart-content h3 {
  margin-bottom: 15px;
}

#cartItems li {
  text-align: left;
  margin: 8px 0;
}

/* === ANIMASI === */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === DARK MODE === */
body.dark-mode {
  background-color: #121212;
  color: #eaeaea;
}

body.dark-mode header {
  background-color: #1f1f1f;
}

body.dark-mode .produk-card {
  background-color: #2a2a2a;
}

body.dark-mode .btn-cart {
  background-color: #cda72e;
}

/* === MENU RESPONSIVE (MOBILE) === */
.menu-toggle {
  display: none;
  background: none;
  font-size: 22px;
  color: white;
  border: none;
  cursor: pointer;
}

@media (max-width: 768px) {
  /* Navbar lebih rapi di HP */
  header {
    flex-wrap: wrap;
    padding: 10px 15px;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    background: #333;
    position: absolute;
    top: 60px;
    right: 0;
    width: 70%;
    padding: 15px;
    border-radius: 0 0 0 15px;
  }

  .nav-links.active {
    display: flex;
    animation: slideDown 0.3s ease;
  }

  @keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .menu-toggle {
    display: block;
  }

  .nav-right {
    width: 100%;
    justify-content: space-between;
    margin-top: 10px;
  }

  #searchInput {
    width: 100%;
  }

  /* Hero Section lebih pas */
  .hero {
    background-position: center top;
    padding: 60px 15px;
  }

  .hero-text {
    padding: 20px;
    width: 90%;
  }

  .hero-text h2 {
    font-size: 1.4em;
  }

  /* Produk dan tombol besar */
  .btn-cart, .btn {
    padding: 14px;
    font-size: 16px;
  }

  .produk-card {
    padding: 12px;
  }

  /* Modal menyesuaikan */
  .cart-content {
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
  }
}
