/* CATEGORY STYLING */
#fruits {
  background-color: #eaf8f0;
}
#vegetables {
  background-color: #f0faf3;
}
#drinks {
  background-color: #fff7f7;
}
#fresh-nuts {
  background-color: #f7f7f2;
}
#spices {
  background-color: #fff9e8;
}

.categories-section {
  padding: 80px 80px 60px;
  max-width: 1200px;
  margin: 0 auto;
}

.categories-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 40px;
}

.categories-header h2 {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--text);
}

.categories-header .green-text {
  color: var(--primary);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 22px;
}

.category-card {
  border-radius: 12px;
  padding: 22px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid rgba(0, 0, 0, 0.03);
}
.category-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

/* --- NEW RULE ADDED HERE --- */
.category-card img {
  max-width: 100%;
  height: auto;
  margin-bottom: 16px;
  border-radius: 4px;
}
/* -------------------------- */

.category-card h3 {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 6px;
  color: var(--text);
}
.category-card p {
  color: var(--muted);
}

/* POPULAR PRODUCTS SECTION */
.products-section {
  padding: 80px 80px 60px;
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  font-size: 2.5rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 40px;
  color: var(--text);
}

/* ====== Categories: Mobile tweaks ====== */
@media (max-width: 767px) {
  .categories-section {
    padding: 48px 20px 40px;
  }

  .categories-header {
    flex-direction: column; /* stack title and button */
    align-items: flex-start; /* left-align */
    gap: 16px;
    margin-bottom: 28px;
  }

  .categories-header h2 {
    font-size: 1.9rem; /* smaller title on phones */
    line-height: 1.15;
    margin: 0;
  }

  /* make the CTA compact and tidy */
  .categories-header .shop-button {
    padding: 10px 18px;
    font-size: 0.95rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* ultra-small devices */
@media (max-width: 400px) {
  .categories-header h2 {
    font-size: 1.6rem;
  }
  .categories-header .shop-button {
    width: 100%; /* full-width pill under the title */
  }
}
