/* ====== Global ====== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}
body {
  background: #f9f9f9;
  color: #333;
  line-height: 1.6;
  padding-top: 120px !important; /* ini bikin semua konten turun */
}

/* ====== Header / Navbar ====== */

/* ====== Container ====== */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 5rem auto; /* naikkan dari 2rem ke 5rem supaya turun lebih jauh */
  padding-top: 2rem; /* tambahan supaya lebih lega */
  display: flex;
  gap: 2rem;
}

/* ====== Product Grid ====== */
.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}
.product-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
  text-align: center;
  padding-bottom: 1rem;
}
.product-card:hover {
  transform: translateY(-5px);
}
.product-image {
  width: 100%;
  height: 180px;
  background: #ccc;
}
.product-card h4 {
  margin: 1rem 0 0.5rem;
  font-size: 1.1rem;
}
.product-price {
  font-weight: bold;
  color: #5b7553;
}
.buy-button {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  border: none;
  border-radius: 6px;
  background: #5b7553;
  color: #fff;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}
.buy-button:hover {
  background: #3e523c;
}

/* ====== Product Details ====== */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 2rem;
  align-items: start;
}
.product-detail img {
  width: 100%;
  border-radius: 10px;
}
.product-info h1 {
  margin-bottom: 1rem;
}
.product-info form {
  margin: 1rem 0;
}
.product-info input[type="number"] {
  width: 60px;
  padding: 0.3rem;
  margin-left: 0.5rem;
}
.desc-box {
  margin-top: 2rem;
  padding: 1rem;
  background: #f2f2f2;
  border-radius: 8px;
}

/* ====== Cart ====== */
main h2 {
  margin: 1.5rem 0;
}
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}
table th,
table td {
  padding: 0.8rem;
  border: 1px solid #ddd;
  text-align: center;
}
table th {
  background: #5b7553;
  color: #fff;
}
table td img {
  border-radius: 6px;
}
table input[type="number"] {
  width: 60px;
  padding: 0.3rem;
}
button[name="update_cart"] {
  padding: 0.5rem 1.2rem;
  background: #5b7553;
  border: none;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
}
button[name="update_cart"]:hover {
  background: #3e523c;
}
h3 {
  margin-top: 1rem;
}
/* ====== Layout Shop (Sidebar + Products) ====== */
.container {
  display: flex;
  gap: 2rem;
  margin: 2rem auto;
  max-width: 1200px;
}

/* Sidebar */
.sidebar {
  flex: 0 0 250px;
  background: #fff;
  padding: 1rem;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  height: fit-content;
}

.filter-box h2 {
  margin-bottom: 0.8rem;
  font-size: 1.2rem;
}

.chip {
  display: inline-block;
  background: #5b7553;
  color: #fff;
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  margin: 0.2rem;
  font-size: 0.9rem;
}

.filter-section {
  margin: 1rem 0;
}

.filter-section h3 {
  margin-bottom: 0.5rem;
  font-size: 1rem;
  color: #333;
}

.filter-section label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.95rem;
}

.price-range {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-top: 0.5rem;
  color: #555;
}

.sidebar button,
.filter-section button {
  width: 100%;
  padding: 0.6rem;
  background: #292b28;
  border: #292b28;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font-weight: 500;
}
.sidebar button:hover {
  background: #3e523c;
}

/* Products (kanan) */
.products {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}

/* ====== Responsive ====== */
@media (max-width: 768px) {
  .product-detail {
    grid-template-columns: 1fr;
  }
  .nav-links {
    gap: 1rem;
  }
}
/* ====== Responsive ====== */

/* Tablet (<= 992px) */
@media (max-width: 992px) {
  .container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    margin-bottom: 1.5rem;
  }

  .products {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

/* Mobile (<= 768px) */
@media (max-width: 768px) {
  body {
    padding-top: 80px !important; /* navbar lebih kecil */
  }

  .product-detail {
    grid-template-columns: 1fr;
    margin: 1rem;
  }

  .product-card {
    padding: 0.8rem;
  }

  .product-card h4 {
    font-size: 1rem;
  }

  .product-card img,
  .product-image {
    height: 150px;
  }

  .buy-button {
    width: 100%;
    padding: 0.7rem;
    font-size: 0.95rem;
  }
}

/* Extra Small (<= 480px) */
@media (max-width: 480px) {
  .products {
    grid-template-columns: 1fr;
  }

  .container {
    margin: 1rem auto;
    gap: 1rem;
  }

  .section-title {
    font-size: 1.4rem;
  }

  .buy-button {
    font-size: 0.9rem;
    padding: 0.6rem;
  }
}
