:root {
  --primary-color: #5f633b;
  --secondary-color: #f5f2e6;
  --accent-color: #f39c12;
  --text-color: #333;
  --light-bg: #f8f9fa;
  --card-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: var(--secondary-color);
  color: var(--text-color);
  line-height: 1.6;
}

header {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: var(--text-dark);
  padding: 120px 0 80px;
  text-align: center;
}

header h1 {
  font-size: 3rem;
  margin-bottom: 20px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

header p {
  font-size: 1.2rem;
  max-width: 800px;
  margin: 0 auto;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Enhanced Filter Bar */
.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1.2rem;
  background-color: white;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  animation: fadeInUp 0.5s ease forwards;
}

.filter-bar:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.search-box {
  flex: 1;
  min-width: 250px;
  position: relative;
}

.search-box::before {
  content: "\f002"; /* Font Awesome search icon - requires Font Awesome */
  font-family: "Font Awesome 5 Free", sans-serif;
  font-weight: 900;
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  transition: color 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.search-box input {
  width: 100%;
  padding: 0.9rem 1rem 0.9rem 2.8rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background-color: var(--secondary-color);
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(95, 99, 59, 0.1);
}

.filter-options {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.filter-options select {
  padding: 0.9rem 2rem 0.9rem 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  background-color: var(--secondary-color);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23131313%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem top 50%;
  background-size: 0.65rem auto;
  transition: all 0.3s ease;
  min-width: 150px;
}

.filter-options select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(95, 99, 59, 0.1);
}

.filter-options select:hover {
  border-color: var(--primary-color);
}

/* Option items animation */
.filter-options select option {
  padding: 10px;
}
/* Animation for when an option is selected */
@keyframes selectPulse {
  0% {
    background-color: rgba(95, 99, 59, 0.1);
  }
  100% {
    background-color: transparent;
  }
}

.filter-options select:focus option:checked {
  animation: selectPulse 1s ease;
}

/* Add animation for filter bar on page load */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Search input animation */
@keyframes expandWidth {
  from {
    width: 95%;
  }
  to {
    width: 100%;
  }
}

.search-box input:focus {
  animation: expandWidth 0.3s ease forwards;
}

/* Add this to your existing media query */
@media (max-width: 768px) {
  .filter-bar {
    padding: 1.2rem;
    gap: 1rem;
    flex-direction: column;
  }

  .search-box {
    width: 100%;
  }

  .filter-options {
    width: 100%;
    justify-content: space-between;
  }

  .filter-options select {
    flex: 1;
  }
}
/* Clear input button - optional enhancement */
.search-box {
  position: relative;
}

.search-box .clear-input {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.search-box input:not(:placeholder-shown) ~ .clear-input {
  opacity: 1;
}

.search-box .clear-input:hover {
  color: var(--accent-color);
  transform: translateY(-50%) rotate(90deg);
}

/* Dropdown transition effects */
#categoryFilter option,
#sortFilter option {
  transition: background-color 0.3s ease;
}

/* Selected state for dropdowns */
.filter-options select option:checked {
  font-weight: bold;
  background-color: rgba(95, 99, 59, 0.1);
}
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.product-card {
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.product-image {
  height: 200px;
  overflow: hidden;
  position: relative;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-image:hover img {
  transform: scale(1.05);
}

.discount-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: var(--accent-color);
  color: white;
  padding: 0.3rem 0.6rem;
  border-radius: 20px;
  font-weight: bold;
  font-size: 0.9rem;
}

.product-info {
  padding: 1.5rem;
}

.product-category {
  color: var(--primary-color);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.product-title {
  font-size: 1.2rem;
  margin-bottom: 0.7rem;
  font-weight: 600;
  height: 3em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.7rem;
}

.stars {
  color: #f39c12;
  font-size: 1rem;
}

.rating-count {
  color: #777;
  font-size: 0.9rem;
}

.product-price {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.5rem;
}

.current-price {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-color);
}

.original-price {
  font-size: 1rem;
  color: #999;
  text-decoration: line-through;
}

.cta-buttons {
  display: flex;
  gap: 0.8rem;
}

.buy-now-btn {
  flex: 1;
  padding: 0.8rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.buy-now-btn:hover {
  background-color: var(--secondary-color);
  color: var(--primary-color);
}

.more-info-btn {
  padding: 0.8rem;
  background-color: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.more-info-btn:hover {
  background-color: var(--primary-color);
  color: white;
}

.pagination {
  display: flex;
  justify-content: center;
  margin-top: 3rem;
  gap: 0.5rem;
}

.pagination button {
  width: 40px;
  height: 40px;
  border: 1px solid #ddd;
  background-color: white;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.pagination button.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.pagination button:hover:not(.active) {
  background-color: #f1f1f1;
}

/* Footer Styles */
footer {
  background-color: var(--primary-color);
  color: var(--secondary-color);
  padding: 5px;
  text-align: center;
}

.footer-content {
  max-width: 1200px;
  margin-top: 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.footer-logo {
  font-size: 24px;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-logo img {
  height: 40px;
  width: auto;
  border-radius: 50%;
}

.social-icons {
  display: flex;
  gap: 15px;
}

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: var(--white);
  font-size: 18px;
  transition: background-color 0.3s;
}

.social-icon:hover {
  background-color: var(--primary-color);
}

footer p {
  color: #bbb;
  font-size: 14px;
  margin: 0;
}

footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

footer a:hover {
  text-shadow: #333;
}

.footer-bottom {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid #333;
  color: #bbb;
  font-size: 14px;
}

@media (max-width: 768px) {
  header h1 {
    font-size: 2rem;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

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

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
  background-color: white;
  margin: 10% auto;
  padding: 2rem;
  border-radius: 8px;
  max-width: 800px;
  position: relative;
}

.close-modal {
  position: absolute;
  right: 20px;
  top: 15px;
  font-size: 1.8rem;
  font-weight: bold;
  cursor: pointer;
}

.product-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.product-detail-image {
  flex: 1;
  min-width: 300px;
}

.product-detail-image img {
  width: 100%;
  border-radius: 8px;
}

.product-detail-info {
  flex: 1;
  min-width: 300px;
}

.product-detail-title {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.product-detail-description {
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.product-features {
  margin-bottom: 1.5rem;
}

.product-features h3 {
  margin-bottom: 0.8rem;
}

.product-features ul {
  padding-left: 1.5rem;
}

.product-features li {
  margin-bottom: 0.5rem;
}

.buy-section {
  background-color: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  margin-top: 1.5rem;
}
