* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

button {
  font-family: inherit; /* pakai font-family dari parent (body = Poppins) */
}

main {
  flex: 1; /* konten utama biar ngisi ruang */
}

/* Navbar */
nav {
  width: 100%;
  height: 80px;
  background-color: #FEFEA4;
  color: #4A2C2C;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 70px;
  position: sticky; /* tetap di atas saat discroll */
  top: 0;
  left: 0;
  z-index: 1100; /* di atas overlay/cart */
}

nav h2 {
  font-weight: 600;
}

nav a {
  color: #4A2C2C;
  text-decoration: none;
}

.cart-icon {
  font-size: 24px;
  cursor: pointer;
  position: relative; /* penting untuk badge */
}

/* Sidebar Cart */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: -350px; /* hidden default */
  width: 350px;
  height: 100%;
  background-color: #fff;
  box-shadow: -2px 0 8px rgba(0,0,0,0.2);
  transition: right 0.3s ease;
  z-index: 2001;
  display: flex;
  flex-direction: column;
}

.cart-sidebar.active {
  right: 0;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #ddd;
}

.cart-header h3 {
  margin: 0;
}

.close-btn {
  font-size: 1.5rem;
  cursor: pointer;
}

/* Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  display: none;
  z-index: 1000;
}

.overlay.active {
  display: block;
}

.cart-content {
  padding: 20px;
}

.cart-content p {
  margin-bottom: 20px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

/* Cart footer */
.cart-footer {
  margin-top: 20px;
  padding-top: 10px;
  border-top: 1px solid #ddd;
  text-align: center;
}

.cart-footer .total {
  font-weight: bold;
  margin-bottom: 10px;
}

.cart-footer button {
  padding: 10px 20px;
  background: green;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s;
  margin-bottom: 20px;
}

.cart-footer button:hover {
  background: darkgreen;
}

/* Tombol hapus item */
.cart-item .remove {
  color: red;
  cursor: pointer;
  margin-left: 10px;
  font-weight: bold;
}

/* Badge notif cart */
.cart-count {
  position: absolute;
  top: -10px;
  right: -20px; /* sesuaikan supaya tepat di pojok ikon */
  background: red;
  color: white;
  font-size: 0.7rem;
  font-weight: bold;
  padding: 3px 7px;
  border-radius: 50%;
  display: none; /* default sembunyi */
}


/* Hero Header */
header {
  position: relative;
  width: 100%;
  min-height: 70vh;
  background: url("image/laukayambanner.png") no-repeat center center/cover;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  padding: 0 20px;
}

/* Overlay supaya teks terbaca */
header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(16, 16, 21, 0.6);
  z-index: 0;
}

header h2,
header p,
header a {
  position: relative; /* supaya di atas overlay */
  z-index: 1;
}

header h2 {
  font-size: 2.5rem;
  font-weight: 600;
  margin-bottom: 15px;
}

header p {
  font-size: 1.2rem;
  margin-bottom: 30px;
  max-width: 700px;
}

/* Tombol */
header a {
  display: inline-block;
  margin: 5px 10px;
  padding: 12px 25px;
  border-radius: 30px;
  background: #FFDC76;
  color: #4A2C2C;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

header a:hover {
  background: white;
  color: #4A2C2C;
  transform: translateY(-2px);
}

/* Produk Grid */
main h3 {
  text-align: center;
  margin-top: 20px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  padding: 40px 20px;
}

.product-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  overflow: hidden;
  text-align: center;
  transition: transform 0.3s ease;
}

.product-card:hover {
  transform: translateY(-5px);
}

.product-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.product-card h4 {
  font-size: 1.2rem;
  margin: 15px 0 5px;
}

.product-card .price {
  color: #4A2C2C;
  font-weight: 600;
  margin-bottom: 15px;
}

.product-card .actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 15px;
}

.product-card button {
  padding: 8px 15px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.detail-btn {
  background: #D3504A;
  color: white;
}

.detail-btn:hover {
  background: #7f2f2b;
}

.cart-btn {
  background: green;
  color: white;
}

.cart-btn:hover {
  background: black;
}

/* Footer tetap di bawah */
footer {
  background-color: #4A2C2C;
  color: white;
  padding: 40px 20px 20px;
  margin-top: auto; /* kunci supaya selalu di bawah */
}

footer div,
footer p {
  margin-bottom: 20px;
}

/* Grid layout */
footer {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 30px;
}

footer div li {
  list-style: none;
  margin-bottom: 10px;
  cursor: pointer;
  transition: color 0.3s ease;
}

/* Link di footer */
footer a {
  color: white;             /* warna default putih */
  text-decoration: none;    /* hilangkan garis bawah */
  transition: color 0.3s ease;
}

footer a:hover {
  color: #FEFEA4;           /* warna hover kuning */
}

footer p {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.8;
  margin-top: 20px;
}

/* Social media icons */
footer .social-icons {
  display: flex;
  gap: 15px;
}

footer .social-icons a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: white;
  color: #4A2C2C;
  text-decoration: none;
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

footer .social-icons a:hover {
  background: #FEFEA4;
  color: #4A2C2C;
}

/* Popup */
.popup {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 2000;
  background-color: rgba(0,0,0,0.4);
}

.popup-overlay {
  position: absolute;
  width: 100%; height: 100%;
  z-index: 1;
}

.popup-content {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  padding: 20px 30px;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  text-align: center;
  min-width: 280px;
  z-index: 2;
}

.popup-content p {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #4A2C2C;
}

.popup-content .close {
  position: absolute;
  top: 10px; right: 15px;
  font-size: 1.3rem;
  cursor: pointer;
}

/* Checkout popup */
.popup-content.checkout {
  max-height: 80vh;
  width: 50%;
  overflow-y: auto;
  text-align: left;
  z-index: 4000;
}

.checkout-items {
  margin-bottom: 10px;
  padding: 10px;
  background: #f9f9f9;
  border-radius: 6px;
  font-size: 0.9rem;
}

.checkout-total {
  font-weight: bold;
  margin: 10px 0 20px;
  text-align: right;
}

#checkoutForm {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#checkoutForm input,
#checkoutForm select {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: 'Poppins', sans-serif;
}

.agree-btn {
  margin-top: 10px;
  padding: 10px;
  background: green;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

.agree-btn:hover {
  background: darkgreen;
}

/* Popup Detail Produk */
.popup-content.detail {
  width: 50%;
  text-align: left;
  max-height: 80vh;   /* batasi tinggi maksimum */
  overflow-y: auto;   /* aktifkan scroll jika konten lebih panjang */
}

.popup-content.detail img {
  margin-bottom: 15px;
}

.popup-content.detail h3 {
  margin-bottom: 10px;
}

/* Hanya untuk popup detail */
.popup-content.detail p {
  margin-bottom: 12px;
  font-size: 0.95rem;
  line-height: 1.5;
  font-weight: normal;
  color: #333;
}

.cara-beli {
  max-width: 800px;
  margin: 40px auto;
  padding: 20px;
  line-height: 1.8;
  text-align: center; /* semua tulisan di tengah */
}

.cara-beli h2 {
  margin-bottom: 20px;
  font-weight: 600;
}

.cara-beli p {
  margin-bottom: 15px;
  font-size: 16px;
}

.kontak {
  text-align: center;
  padding: 40px 20px;
}

.kontak h2 {
  font-size: 28px;
  margin-bottom: 20px;
}

.kontak-info p {
  margin: 8px 0;
  font-size: 18px;
}

.about {
  max-width: 800px;
  margin: 40px auto;
  text-align: center;
  line-height: 1.8;
}

.shipping-time {
  max-width: 800px;
  margin: 40px auto;
  text-align: center;
  line-height: 1.8;
}
.shipping-time strong {
  color: #4A2C2C; /* biar lebih menonjol */
}

/* Responsive */
@media (max-width: 600px) {

  header h2 {
    font-size: 2rem;
  }

  header p {
    font-size: 1rem;
  }

  header a {
    display: block;
    margin: 10px auto;
    width: 70%;
  }

  footer {
    text-align: center;
  }

  footer .social-icons {
    margin-top: 5px;
    justify-content: center;
  }

  footer div li {
    margin-top: 5px;
  }

  .popup-content.checkout {
    max-height: 80vh;
    width: 80%;
    overflow-y: auto;
    text-align: left;
    z-index: 4000;
  }

  .popup-content.detail {
    width: 90%;
    max-height: 80vh;
  }
}