/* ========================================
   MASTA XUL AFFILIATE SHOP
   Tema: Hitam | Coklat | Merah | Putih | Hijau
======================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #FFFFFF; /* Putih */
  color: #111111; /* Hitam */
  line-height: 1.5;
  min-height: 100vh;
}

/* ========== HEADER ========== */
header {
  background-color: #111111; /* Hitam */
  color: #FFFFFF; /* Putih */
  text-align: center;
  padding: 28px 16px 24px;
}

.logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 12px;
  border-radius: 12px;
  background-color: #FFFFFF;
  padding: 6px;
}

header h1 {
  font-size: 1.7rem;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

header p {
  font-size: 0.95rem;
  opacity: 0.85;
  color: #FFFFFF;
}

/* ========== MENU / FILTER ========== */
.menu {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 20px 16px 10px;
  background-color: #FFFFFF;
}

.menu button {
  background-color: #FFFFFF;
  color: #111111;
  border: 2px solid #6B4423; /* Coklat */
  padding: 8px 18px;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.menu button:hover {
  background-color: #6B4423; /* Coklat */
  color: #FFFFFF;
}

.menu button.active {
  background-color: #D32F2F; /* Merah */
  border-color: #D32F2F;
  color: #FFFFFF;
}

/* ========== SEARCH BOX ========== */
.search-box {
  max-width: 480px;
  margin: 10px auto 24px;
  padding: 0 16px;
}

.search-box input {
  width: 100%;
  padding: 12px 18px;
  border: 2px solid #6B4423; /* Coklat */
  border-radius: 30px;
  font-size: 1rem;
  outline: none;
  background-color: #FFFFFF;
  color: #111111;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: #D32F2F; /* Merah */
}

.search-box input::placeholder {
  color: #6B4423;
  opacity: 0.7;
}

/* ========== PRODUK GRID ========== */
.produk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  padding: 0 16px 40px;
  max-width: 1200px;
  margin: 0 auto;
}

/* ========== KAD PRODUK ========== */
.produk-card {
  background-color: #FFFFFF;
  border: 2px solid #6B4423; /* Coklat */
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.produk-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(107, 68, 35, 0.25); /* Coklat soft */
}

.produk-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background-color: #FFFFFF;
  border-bottom: 2px solid #6B4423;
}

.produk-info {
  padding: 14px 16px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.produk-nama {
  font-size: 1rem;
  font-weight: 600;
  color: #111111;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
}

.produk-harga {
  font-size: 1.25rem;
  font-weight: 700;
  color: #D32F2F; /* Merah */
  margin-bottom: 4px;
}

.produk-harga-asal {
  font-size: 0.85rem;
  color: #6B4423; /* Coklat */
  text-decoration: line-through;
  margin-bottom: 12px;
}

/* Label HOT */
.label-hot {
  display: inline-block;
  background-color: #D32F2F; /* Merah */
  color: #FFFFFF;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
  width: fit-content;
}

/* Butang Beli */
.btn-beli {
  display: block;
  text-align: center;
  background-color: #D32F2F; /* Merah */
  color: #FFFFFF;
  text-decoration: none;
  padding: 11px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: auto;
  transition: background-color 0.2s;
}

.btn-beli:hover {
  background-color: #111111; /* Hitam */
}

/* Butang WhatsApp (jika ada) */
.btn-whatsapp {
  display: block;
  text-align: center;
  background-color: #2E7D32; /* Hijau */
  color: #FFFFFF;
  text-decoration: none;
  padding: 10px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 8px;
  transition: background-color 0.2s;
}

.btn-whatsapp:hover {
  background-color: #111111;
}

/* ========== FOOTER ========== */
footer {
  background-color: #111111; /* Hitam */
  color: #FFFFFF;
  text-align: center;
  padding: 22px 16px;
  font-size: 0.9rem;
  margin-top: auto;
}

/* ========== EMPTY / LOADING STATE ========== */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 50px 20px;
  color: #6B4423;
  font-size: 1.1rem;
}

/* ========== 3 BUTANG PLATFORM ========== */
.platform-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.btn-platform {
  display: block;
  text-align: center;
  padding: 10px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  color: #FFFFFF;
  transition: background-color 0.2s, transform 0.15s;
}

.btn-platform:hover {
  transform: translateY(-2px);
}

/* TikTok - Hitam */
.btn-tiktok {
  background-color: #111111;
}

.btn-tiktok:hover {
  background-color: #6B4423; /* Coklat */
}

/* Shopee - Merah */
.btn-shopee {
  background-color: #D32F2F;
}

.btn-shopee:hover {
  background-color: #111111;
}

/* Lazada - Coklat */
.btn-lazada {
  background-color: #6B4423;
}

.btn-lazada:hover {
  background-color: #D32F2F;
}

/* Terjual */
.produk-terjual {
  font-size: 0.8rem;
  color: #6B4423;
  margin-bottom: 4px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 600px) {
  header h1 {
    font-size: 1.4rem;
  }

  .logo {
    width: 65px;
    height: 65px;
  }

  .produk-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
  }

  .produk-img {
    height: 150px;
  }

  .menu button {
    padding: 7px 14px;
    font-size: 0.85rem;
  }
}

/* ========== GAMBAR PRODUK ========== */
.produk-img-wrapper {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background-color: #f5f5f5;
  border-bottom: 2px solid #6B4423;
}

.produk-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ========== BUTANG DISABLED ========== */
.btn-disabled {
  background-color: #cccccc !important;
  color: #888888 !important;
  cursor: not-allowed;
  pointer-events: none;
}

/* Pastikan platform-buttons kemas */
.platform-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.btn-platform {
  display: block;
  text-align: center;
  padding: 10px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  color: #FFFFFF;
  transition: all 0.2s;
}

.btn-tiktok { background-color: #111111; }
.btn-tiktok:hover { background-color: #6B4423; }

.btn-shopee { background-color: #D32F2F; }
.btn-shopee:hover { background-color: #111111; }

.btn-lazada { background-color: #6B4423; }
.btn-lazada:hover { background-color: #D32F2F; }

/* ========== FLOATING GOOGLE FORM ========== */
.float-form {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 60px;
  height: 60px;
  background-color: #D32F2F; /* Merah ikut tema */
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 999;
  transition: transform 0.2s;
}

.float-form:hover {
  transform: scale(1.1);
  background-color: #111111;
}

/* ========== BACK TO TOP ========== */
.back-to-top {
  position: fixed;
  bottom: 100px;
  right: 25px;
  width: 45px;
  height: 45px;
  background-color: #111111;
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  display: none;
  z-index: 998;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.back-to-top.show {
  display: block;
}

/* ========== VISITOR COUNTER ========== */
.visitor-counter {
  position: fixed;
  bottom: 25px;
  left: 20px;
  background-color: #111111;
  color: white;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  z-index: 997;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* ========== SHARE BUTTONS DALAM KAD ========== */
.share-buttons {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.btn-share {
  flex: 1;
  min-width: 70px;
  padding: 8px 6px;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  color: white;
  text-align: center;
}

.btn-share-wa { background-color: #2E7D32; }
.btn-share-telegram { background-color: #0088cc; }
.btn-share-other { background-color: #6B4423; }

.btn-share:hover {
  opacity: 0.9;
}

/* ========== PAGINATION ========== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 30px 16px 50px;
  max-width: 1200px;
  margin: 0 auto;
}

.pagination button {
  background-color: #111111;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.pagination button:hover {
  background-color: #D32F2F;
}

.pagination button:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

#pageInfo {
  font-weight: 600;
  color: #111111;
  font-size: 1rem;
}
