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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f9f6f0;
  color: #2d2d2d;
  line-height: 1.6;
  padding: 0;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, .logo-text, .btn, .product-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
}

h1 { font-size: 2.2rem; line-height: 1.2; }
h2 { font-size: 1.8rem; margin-bottom: 0.5rem; }
h3 { font-size: 1.2rem; }

/* ===== HEADER ===== */
.app-header {
  background: #2d6a4f;
  color: #fff;
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.logo-icon { font-size: 1.8rem; }
.logo-text {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 6px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.2s;
}
.icon-btn:hover { background: rgba(255,255,255,0.15); }

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #d4a373;
  color: #1e1e1e;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 12px;
  min-width: 20px;
  text-align: center;
  line-height: 1.4;
}

/* Mobile nav */
.mobile-nav {
  display: none;
  background: #2d6a4f;
  padding: 12px 20px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.mobile-nav.open { display: block; }
.mobile-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mobile-nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  padding: 8px 0;
  display: block;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.mobile-nav a:hover { opacity: 0.8; }

/* ===== MAIN ===== */
#mainContent {
  flex: 1;
  padding: 24px 0 40px;
}

/* ===== CARDS & COMPONENTS ===== */
.card {
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
  margin-bottom: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(0,0,0,0.08);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: 50px;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
  min-height: 52px;
  min-width: 48px;
}
.btn-primary {
  background: #2d6a4f;
  color: #fff;
}
.btn-primary:hover {
  background: #1e4d3a;
  transform: scale(1.02);
}
.btn-secondary {
  background: #d4a373;
  color: #1e1e1e;
}
.btn-secondary:hover {
  background: #c4925f;
  transform: scale(1.02);
}
.btn-outline {
  background: transparent;
  color: #2d6a4f;
  border: 2px solid #2d6a4f;
}
.btn-outline:hover {
  background: #2d6a4f;
  color: #fff;
}
.btn-whatsapp {
  background: #25D366;
  color: #fff;
}
.btn-whatsapp:hover {
  background: #1da851;
  transform: scale(1.02);
}

/* ===== GRID PRODUK ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.product-card {
  background: #fff;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.08);
}
.product-card img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 12px;
  background: #f0ebe3;
}
.product-card .product-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: 10px;
  line-height: 1.3;
}
.product-card .product-price {
  font-weight: 700;
  color: #2d6a4f;
  font-size: 1.1rem;
  margin: 4px 0;
}
.product-card .product-seller {
  font-size: 0.8rem;
  color: #6b6b6b;
}
.product-card .product-rating {
  font-size: 0.85rem;
  color: #d4a373;
  margin-top: 4px;
}
.product-card .product-location {
  font-size: 0.7rem;
  background: #f0ebe3;
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  margin-top: 6px;
  align-self: flex-start;
}

/* ===== FILTER ===== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  background: #fff;
  padding: 16px;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.filter-bar select,
.filter-bar input {
  flex: 1 1 120px;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 50px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  background: #fafafa;
  outline: none;
  transition: border 0.2s;
}
.filter-bar select:focus,
.filter-bar input:focus {
  border-color: #2d6a4f;
  box-shadow: 0 0 0 3px rgba(45,106,79,0.15);
}

/* ===== DETAIL PRODUK ===== */
.detail-image {
  width: 100%;
  border-radius: 20px;
  aspect-ratio: 1/1;
  object-fit: cover;
  background: #f0ebe3;
}
.detail-info {
  margin-top: 20px;
}
.detail-info .price {
  font-size: 1.8rem;
  font-weight: 700;
  color: #2d6a4f;
}
.detail-info .seller-link {
  color: #2d6a4f;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
.detail-info .location-tag {
  background: #f0ebe3;
  padding: 4px 14px;
  border-radius: 50px;
  font-size: 0.85rem;
  display: inline-block;
}
.rating-stars {
  color: #d4a373;
  font-size: 1.2rem;
  letter-spacing: 2px;
}

/* ===== ULASAN ===== */
.review-item {
  border-bottom: 1px solid #eee;
  padding: 14px 0;
}
.review-item:last-child { border-bottom: none; }
.review-item .reviewer {
  font-weight: 600;
}
.review-item .review-date {
  font-size: 0.8rem;
  color: #888;
}

/* ===== KERANJANG ===== */
.cart-item {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f0ebe3;
}
.cart-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 12px;
  background: #f0ebe3;
}
.cart-item .item-details {
  flex: 1;
}
.cart-item .item-details .name {
  font-weight: 600;
}
.cart-item .item-details .price {
  color: #2d6a4f;
  font-weight: 600;
}
.cart-item .qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cart-item .qty-control button {
  background: #f0ebe3;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 1.2rem;
  cursor: pointer;
}
.cart-item .qty-control span {
  min-width: 24px;
  text-align: center;
  font-weight: 600;
}

/* ===== SELLER DASHBOARD ===== */
.seller-product-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f0ebe3;
}
.seller-product-item .info { flex: 1; }
.seller-product-item .actions {
  display: flex;
  gap: 8px;
}
.seller-product-item .actions button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px 8px;
  border-radius: 8px;
}
.seller-product-item .actions .edit { color: #2d6a4f; }
.seller-product-item .actions .delete { color: #c0392b; }

/* ===== FORM ===== */
.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 0.9rem;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #ddd;
  border-radius: 16px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  background: #fafafa;
  transition: border 0.2s, box-shadow 0.2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: #2d6a4f;
  box-shadow: 0 0 0 4px rgba(45,106,79,0.1);
  outline: none;
}
.form-group textarea {
  min-height: 80px;
  resize: vertical;
}
.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* ===== EMPTY & SUCCESS STATE ===== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #6b6b6b;
}
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state h3 { margin-bottom: 8px; color: #2d2d2d; }

.success-state {
  background: #e6f7e6;
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  color: #1e4d3a;
}
.success-state .icon { font-size: 2.5rem; }

/* ===== UTILITY ===== */
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }

/* ===== FOOTER ===== */
.app-footer {
  background: #2d6a4f;
  color: #e0e0e0;
  padding: 24px 0 16px;
  margin-top: 20px;
  text-align: center;
  font-size: 0.9rem;
}
.app-footer .footer-tagline {
  color: #d4a373;
  font-weight: 500;
  margin-top: 6px;
}

/* ===== RESPONSIVE ===== */
@media (min-width: 640px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
  }
  .mobile-nav { display: none !important; }
  .menu-toggle { display: none !important; }
}

@media (max-width: 639px) {
  h1 { font-size: 1.8rem; }
  .container { padding: 0 16px; }
  .btn { padding: 12px 20px; font-size: 0.95rem; min-height: 48px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .product-card { padding: 10px; }
}

@media (max-width: 380px) {
  .product-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .header-actions .icon-btn { padding: 4px; }
  .logo-text { font-size: 1.1rem; }
}