/* EcoWorld Marketplace - Shared Styles */
/* Used by: category.html, subcategory.html, product-detail.html, cart.html */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #2d3436; background: #f9fdf9; line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; }

/* Navigation */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(255,255,255,0.97); backdrop-filter: blur(10px);
  border-bottom: 1px solid #e8f5e9;
  padding: 0.8rem 2rem;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-brand { font-weight: 700; font-size: 1.3rem; color: #2e7d32; }
.nav-brand span { color: #66bb6a; }
.nav-links { list-style: none; display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { font-size: 0.9rem; color: #555; font-weight: 500; transition: color 0.3s; }
.nav-links a:hover { color: #2e7d32; }
.nav-cart { position: relative; font-size: 1.1rem; }
.nav-cart .cart-count {
  position: absolute; top: -6px; right: -10px;
  background: #2e7d32; color: #fff; font-size: 0.65rem;
  width: 17px; height: 17px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}

/* Breadcrumb */
.breadcrumb {
  max-width: 1100px; margin: 0 auto; padding: 1rem 1rem 0;
  font-size: 0.85rem; color: #888;
}
.breadcrumb a { color: #2e7d32; transition: color 0.3s; }
.breadcrumb a:hover { color: #1b5e20; text-decoration: underline; }
.breadcrumb .sep { margin: 0 0.4rem; color: #ccc; }

/* Page Header */
.page-header {
  max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem 0.5rem;
}
.page-header h1 {
  font-size: 2rem; font-weight: 700; color: #1b5e20; margin-bottom: 0.5rem;
}
.page-header p { color: #666; font-size: 1rem; max-width: 700px; }

/* Card Grid */
.card-grid {
  max-width: 1100px; margin: 2rem auto; padding: 0 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.card {
  background: #fff; border-radius: 14px;
  border: 1px solid #e8f5e9;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  overflow: hidden; transition: all 0.3s;
  display: flex; flex-direction: column;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(46,125,50,0.1);
  border-color: #a5d6a7;
}
.card-image {
  width: 100%; height: 220px;
  background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.card-image:has(img) { background: #f5f5f5; }
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.card-image .placeholder-icon {
  font-size: 2.5rem; color: #a5d6a7;
}
.card-body { padding: 1.2rem; flex: 1; display: flex; flex-direction: column; }
.card-body h3 { font-size: 1.05rem; color: #2d3436; margin-bottom: 0.4rem; font-weight: 600; }
.card-body p { font-size: 0.85rem; color: #777; flex: 1; margin-bottom: 0.8rem; }
.card-meta { font-size: 0.8rem; color: #999; margin-bottom: 0.5rem; }
.card-footer {
  padding: 0 1.2rem 1.2rem;
}
.card-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: #2e7d32; font-size: 0.9rem; font-weight: 600;
  transition: gap 0.3s;
}
.card-link:hover { gap: 0.7rem; }
.card-link i { font-size: 0.8rem; }

/* Product Count Badge */
.product-count {
  display: inline-block; background: #e8f5e9; color: #2e7d32;
  padding: 0.2rem 0.6rem; border-radius: 10px;
  font-size: 0.75rem; font-weight: 600;
}

/* Info Bar */
.info-bar {
  max-width: 1100px; margin: 2rem auto; padding: 1.5rem;
  background: #fff; border-radius: 12px; border: 1px solid #e8f5e9;
  display: flex; justify-content: center; gap: 2rem; flex-wrap: wrap;
}
.info-bar-item {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.85rem; color: #555;
}
.info-bar-item i { color: #43a047; }

/* Footer */
.site-footer {
  background: #1b5e20; padding: 2rem; text-align: center;
  color: #a5d6a7; margin-top: 3rem;
}
.site-footer a { color: #c8e6c9; font-size: 0.85rem; margin: 0 0.5rem; }
.site-footer a:hover { color: #fff; }
.footer-copy { font-size: 0.78rem; color: #81c784; margin-top: 0.8rem; }

/* Responsive */
@media (max-width: 768px) {
  .nav { padding: 0.6rem 1rem; }
  .nav-links { gap: 0.8rem; }
  .nav-links a { font-size: 0.8rem; }
  .page-header h1 { font-size: 1.6rem; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
  .info-bar { gap: 1rem; padding: 1rem; }
}
@media (max-width: 480px) {
  .card-grid { grid-template-columns: 1fr; }
  .nav-links { gap: 0.5rem; }
  .nav-links a { font-size: 0.75rem; }
  .info-bar { flex-direction: column; align-items: center; }
}
