/* ===== GLOBAL RESET & VARIABLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
  background: #f5f7fa;
  color: #1e293b;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== HEADER & NAVIGASI ===== */
.header {
  background: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  padding: 1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.logo {
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: -0.5px;
  color: #0f172a;
}
.logo span {
  color: #2563eb;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  text-decoration: none;
  color: #334155;
  font-weight: 500;
  transition: color 0.2s;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.nav-link:hover,
.nav-link.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

.cart-icon-wrapper {
  position: relative;
  cursor: pointer;
  background: #f1f5f9;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  transition: background 0.2s;
  border: none;
  color: #0f172a;
  font-size: 0.95rem;
}

.cart-icon-wrapper:hover {
  background: #e2e8f0;
}

.cart-count {
  background: #2563eb;
  color: white;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

/* ===== MAIN LAYOUT ===== */
.main-container {
  flex: 1;
  padding: 1.8rem 1.5rem;
  max-width: 1300px;
  margin: 0 auto;
  width: 100%;
}

/* ===== HALAMAN (PAGE) ===== */
.page {
  display: none;
}

.page.active {
  display: block;
}

/* ===== HOME PAGE ===== */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-radius: 2rem;
  padding: 2.5rem 2rem;
  color: white;
  margin-bottom: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.hero h1 {
  font-size: 2.2rem;
  font-weight: 700;
}

.hero p {
  color: #cbd5e1;
  max-width: 600px;
  font-size: 1.1rem;
}

.btn-shop {
  background: white;
  color: #0f172a;
  border: none;
  padding: 0.7rem 1.8rem;
  border-radius: 2rem;
  font-weight: 600;
  margin-top: 0.8rem;
  cursor: pointer;
  align-self: flex-start;
  transition: 0.2s;
  font-size: 0.95rem;
}

.btn-shop:hover {
  background: #e2e8f0;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.2rem;
  margin-top: 1rem;
}

/* ===== PRODUCT CARD ===== */
.product-card {
  background: white;
  border-radius: 1.2rem;
  padding: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  border: 1px solid #f1f5f9;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.08);
}

.product-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f8fafc;
  border-radius: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  margin-bottom: 0.8rem;
  color: #475569;
}

.product-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.product-price {
  font-weight: 700;
  color: #2563eb;
  margin-top: 0.3rem;
  font-size: 1.1rem;
}

.product-meta {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 0.2rem;
}

/* ===== HALAMAN DAFTAR PRODUK ===== */
.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
}

/* ===== DETAIL PRODUK ===== */
.detail-container {
  background: white;
  border-radius: 1.5rem;
  padding: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.detail-img {
  flex: 1 1 280px;
  background: #f1f5f9;
  border-radius: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  min-height: 250px;
}

.detail-info {
  flex: 1 1 300px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-title {
  font-size: 2rem;
  font-weight: 700;
}

.detail-price {
  font-size: 1.8rem;
  font-weight: 700;
  color: #2563eb;
}

.detail-desc {
  color: #475569;
  line-height: 1.7;
}

.btn-add-cart {
  background: #2563eb;
  color: white;
  border: none;
  padding: 0.9rem 2rem;
  border-radius: 2.5rem;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  width: fit-content;
  margin-top: 0.8rem;
}

.btn-add-cart:hover {
  background: #1d4ed8;
}

.back-link {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 1rem;
  display: inline-block;
  cursor: pointer;
}

/* ===== CART PAGE ===== */
.cart-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.cart-items {
  flex: 2 1 500px;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.cart-item {
  background: white;
  border-radius: 1rem;
  padding: 1.2rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  flex-wrap: wrap;
}

.cart-item-img {
  font-size: 2.4rem;
  background: #f8fafc;
  width: 65px;
  height: 65px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.8rem;
}

.cart-item-details {
  flex: 1;
}

.cart-item-title {
  font-weight: 600;
}

.cart-item-price {
  color: #2563eb;
  font-weight: 600;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.qty-btn {
  background: #e2e8f0;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remove-btn {
  background: none;
  border: none;
  color: #b91c1c;
  font-weight: 500;
  cursor: pointer;
  margin-left: 0.5rem;
}

.cart-summary {
  flex: 1 1 260px;
  background: white;
  border-radius: 1.2rem;
  padding: 1.8rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.05);
  height: fit-content;
  position: sticky;
  top: 6rem;
}

.total-line {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  margin: 1rem 0;
  font-size: 1.2rem;
}

.btn-checkout {
  background: #25D366; /* Warna hijau WhatsApp */
  color: white;
  border: none;
  width: 100%;
  padding: 1rem;
  border-radius: 2.5rem;
  font-weight: 700;
  font-size: 1rem;
  margin-top: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.btn-checkout:hover {
  background: #128C7E; /* Hijau WhatsApp lebih gelap */
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.btn-checkout:active {
  transform: translateY(0);
}
.empty-cart {
  text-align: center;
  padding: 3rem;
  color: #64748b;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .header {
    padding: 0.9rem 1rem;
  }
  .nav-links {
    gap: 1rem;
  }
  .hero {
    padding: 1.8rem 1.2rem;
  }
  .hero h1 {
    font-size: 1.7rem;
  }
  .detail-container {
    flex-direction: column;
  }
  .cart-item {
    flex-direction: column;
    align-items: flex-start;
  }
}