/* =============================
   RESET & BASE
============================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f9fa;
}

/* =============================
   LINKS
============================= */
a, a:visited {
  color: inherit;
  text-decoration: none;
}

a:hover {
  opacity: 0.85;
}

/* =============================
   BUTTONS
============================= */
.btn {
  padding: 0.7rem 1.5rem;
  border-radius: 5px;
  font-weight: bold;
  transition: background-color 0.3s, transform 0.3s;
  display: inline-block;
}

.btn-secondary {
  background-color: #6b9932;
  color: white;
}

.btn-primary {
  background-color: #2d5016;
  color: white;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* =============================
   HEADER
============================= */
.header {
  background: linear-gradient(135deg, #2d5016, #4a7c23);
  color: white;
  padding: 1rem 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.8rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: white;
}

.logo::before {
  content: "🌱";
  font-size: 2rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: white;
  font-weight: 500;
}

.nav-links a:hover {
  opacity: 0.8;
}

.auth-buttons {
  display: flex;
  gap: 1rem;
}

/* =============================
   HERO SECTION
============================= */
.hero {
  background: linear-gradient(135deg, #4a7c23 60%, #6b9932 100%);
  color: white;
  text-align: center;
  padding: 4rem 2rem 2.5rem 2rem;
  border-radius: 18px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.13);
  margin: 2rem auto 2.5rem auto;
  max-width: 1200px;
  position: relative;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  opacity: 0.95;
  font-weight: 500;
}

.stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
  min-width: 120px;
}

.stat-number {
  font-size: 2rem;
  font-weight: bold;
  display: block;
}

.stat-label {
  font-size: 0.95rem;
  opacity: 0.8;
}

/* =============================
   SEARCH BAR (FIXED)
============================= */
.search-bar {
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  align-items: stretch;
  background: #fff;
  border-radius: 32px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  padding: 0;
  position: relative;
  overflow: hidden;
}

.search-input {
  flex: 1;
  border: none;
  padding: 0.95rem 1.2rem;
  font-size: 1.08rem;
  outline: none;
  border-radius: 32px 0 0 32px;
  background: transparent;
  min-width: 0;
  color: #333;
  font-weight: 500;
  height: 100%;
}

.search-input::placeholder {
  color: #b2b2b2;
  font-weight: 400;
  opacity: 1;
}

.search-btn {
  background: linear-gradient(135deg, #ff6b35 60%, #ff914d 100%);
  color: #fff;
  border: none;
  padding: 0 1.5rem;
  font-size: 1.35rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 32px 32px 0;
  height: auto;
  box-shadow: 0 2px 8px rgba(255,107,53,0.08);
  transition: background 0.2s;
  margin: 0;
}

.search-btn:hover {
  background: linear-gradient(135deg, #ff914d 60%, #ff6b35 100%);
}

/* =============================
   FILTER BAR
============================= */
.filter-bar {
  background: white;
  padding: 1.5rem;
  border-radius: 15px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  margin-bottom: 2rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-select {
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: white;
  cursor: pointer;
}

.filter-tag {
  background-color: #e8f5e8;
  color: #2d5016;
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* =============================
   MAIN CONTENT
============================= */
.main-content {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 2rem;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* =============================
   PRODUCT / PRODUCER CARDS
============================= */
.products-grid,
.producer-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.product-card,
.producer-card {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.product-card:hover,
.producer-card:hover {
  transform: translateY(-5px);
}

.product-image {
  height: 200px;
  background: linear-gradient(45deg, #4a7c23, #6b9932);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}

.product-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #ff6b35;
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: bold;
}

.product-info {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #2d5016;
}

.product-producer {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.product-location {
  color: #888;
  font-size: 0.8rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.product-price {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.current-price {
  font-size: 1.2rem;
  font-weight: bold;
  color: #2d5016;
}

.original-price {
  text-decoration: line-through;
  color: #999;
  font-size: 0.9rem;
}

.savings {
  background-color: #e8f5e8;
  color: #2d5016;
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: bold;
}

.product-expires {
  background-color: #fff3e0;
  color: #f57c00;
  padding: 0.5rem;
  border-radius: 8px;
  text-align: center;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.add-to-cart {
  width: 100%;
  background-color: #2d5016;
  color: white;
  padding: 0.8rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.3s;
  margin-top: auto;
}

.add-to-cart:hover {
  background-color: #1a3009;
}

/* =============================
   CATEGORIES
============================= */
.categories {
  margin: 3rem 0;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.section-title {
  font-size: 1.8rem;
  color: #2d5016;
  margin-bottom: 1.5rem;
  text-align: center;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.category-card {
  background: white;
  padding: 1.5rem;
  border-radius: 15px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: transform 0.3s;
  cursor: pointer;
}

.category-card:hover {
  transform: translateY(-3px);
}

.category-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.category-name {
  font-weight: 600;
  color: #2d5016;
}

/* =============================
   IMPACT SECTION
============================= */
.impact-section {
  background: linear-gradient(135deg, #e8f5e8, #f0f8f0);
  padding: 3rem 2rem;
  border-radius: 20px;
  margin: 3rem auto;
  text-align: center;
  max-width: 1200px;
}

.impact-title {
  font-size: 2rem;
  color: #2d5016;
  margin-bottom: 1rem;
}

.impact-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.impact-stat {
  background: white;
  padding: 1.5rem;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  min-width: 150px;
}

.impact-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.impact-number {
  font-size: 1.5rem;
  font-weight: bold;
  color: #2d5016;
}

.impact-label {
  color: #666;
  font-size: 0.9rem;
}

/* =============================
   FOOTER
============================= */
.footer {
  background-color: #2d5016;
  color: white;
  padding: 3rem 2rem 1rem;
  text-align: center;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  margin-bottom: 1rem;
  color: #a5d46a;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section ul li a {
  color: white;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.3s;
}

.footer-section ul li a:hover {
  opacity: 1;
}

.footer-bottom {
  border-top: 1px solid #4a7c23;
  padding-top: 1rem;
  opacity: 0.8;
}

/* =============================
   ANIMATIONS
============================= */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 1.5s ease-in-out forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =============================
   RESPONSIVE
============================= */
@media (max-width: 1100px) {
  .main-content,
  .hero,
  .filter-bar,
  .products-grid,
  .categories,
  .impact-section,
  .footer-content {
    max-width: 98vw;
    padding-left: 1vw;
    padding-right: 1vw;
  }
}

@media (max-width: 900px) {
  .stats,
  .impact-stats {
    flex-direction: column;
    gap: 1.2rem;
    align-items: center;
  }
  .products-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .hero {
    padding: 2.2rem 0.7rem 1.5rem 0.7rem;
    border-radius: 12px;
  }
  .search-bar {
    max-width: 100%;
  }
  .search-input {
    padding: 0.7rem 0.7rem;
    font-size: 1rem;
  }
  .search-btn {
    padding: 0 1rem;
    font-size: 1.1rem;
  }
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    gap: 0.7rem;
  }
  .categories-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-content {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}
