/* Basic Reset and Styling */
body {
  font-family: 'Roboto', Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: #f0f0f0 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cdefs%3E%3Cpattern id='diagonalHatch' width='10' height='10' patternUnits='userSpaceOnUse'%3E%3Cpath d='M-1,1 l2,-2 M8,10 l2,-2 M9,0 l2,-2 M-2,9 l2,2 M7,-2 l2,2 M0,0 l10,10 M5,5 l10,-10' stroke='rgba(0,0,0,0.05)' stroke-width='2'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='100%25' height='100%25' fill='url(%23diagonalHatch)'/%3E%3C/svg%3E"); /* Light gray background with subtle pattern */
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* Full viewport height */
}

header {
  background: #E1BEE7; /* Light purple background */
  color: #4A148C; /* Dark purple text color */
  padding: 10px 20px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  text-align: center; /* Center the content */
}

header .header-content {
  /* max-width: 1200px; */
  margin: 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-items: center;
  justify-content: space-between;
}

.logo-and-title {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10em;
  width: 100%;
}

header h1 {
  /* margin: 0 10px; Add spacing around the title */
  font-size: 1.5em;
  font-weight: normal;
  /* text-shadow: 2px 2px 4px #00000040; */
}

.logo {
  max-height: 40px;
  margin-right: 10px;
}

.filters-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  width: 100%;
  /* max-width: 1000px; */
  /* margin: 15px auto 0; */
}

.filter {
  /* background-color: rgba(255, 255, 255, 0.5); Add a background color */
  /* border-radius: 5px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  min-width: 280px;
  max-width: 400px;
  flex: 1; */
}

.filter select {
  padding: 4px 8px; /* Reduced padding */
  border-radius: 5px;
  border: 1px solid #4A148C; /* Dark purple border */
  font-size: 0.8em; /* Reduced font size */
  background: #fff;
  color: #4A148C; /* Dark purple text color */
  flex-grow: 1;
  min-width: 120px;
  margin-right: 10px;
}

.filter-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 0;
}

#reset-btn {
  padding: 6px 15px;
  border-radius: 5px;
  border: 1px solid #4A148C;
  background-color: #757575;
  color: white;
  font-size: 0.9em;
  cursor: pointer;
  transition: background-color 0.2s;
  height: 28px;
  white-space: nowrap;
}

#reset-btn:hover {
  background-color: #616161;
}

nav ul {
  list-style: none;
  padding: 0;
  margin: 20px 0 0 0;
  display: flex;
  justify-content: center;
}

nav ul li {
  margin: 0 20px;
}

nav ul li a {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.2em;
  transition: color 0.3s ease; /* Smooth transition for hover effect */
}

nav ul li a:hover {
  color: #ddd; /* Lighter color on hover */
}

main {
  padding: 30px 15px;
  flex: 1; /* Take up available space */
}

.filtered-count {
  text-align: center;
  margin-bottom: 20px;
  font-size: 1.1rem;
  color: #757575;
  background-color: #f5f5f5;
  padding: 10px;
  border-radius: 5px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.product-grid-container {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  padding: 0 15px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  width: 100%;
}

#product-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Adjusted minmax size for better responsiveness */
  gap: 20px; /* Reduced gap for more compact layout on smaller screens */
  justify-content: center;
  max-width: 1400px; /* Added max-width to center content on large screens */
  margin: 0 auto; /* Center the grid */
}

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 30px;
  background-color: #f8f8f8;
  border-radius: 10px;
  border: 1px solid #e0e0e0;
  color: #757575;
  font-size: 1.2em;
}

.product-card {
  background: #fff;
  border: 2px solid #9c27b0; /* Purple border */
  border-radius: 10px; /* More rounded corners */
  padding: 20px; /* Adjusted padding */
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2); /* More pronounced shadow */
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out; /* Smooth transition for hover effect */
  display: flex;
  flex-direction: column;
  height: auto; /* Changed from 100% to auto */
  margin-bottom: 0; /* Ensure no extra margin causing overlap */
  overflow: hidden; /* Prevent content overflow */
  position: relative; /* Ensure proper stacking */
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  border-color: #4A148C;
}

.product-card h3 {
  margin-top: 0;
  font-size: 1.4em; /* Slightly larger font size for heading */
  color: #4A148C; /* Changed to match theme color */
  margin-bottom: 10px; /* Spacing below heading */
  border-bottom: 1px solid #E1BEE7; /* Light purple border */
  padding-bottom: 8px;
}

.product-card p {
  font-size: 15px;
  line-height: 1.7; /* Improved line height for readability */
  color: #555; /* Slightly darker text color */
  margin-bottom: 8px;
}

.product-card .description {
  margin-top: 10px;
  font-style: italic;
  color: #666;
  flex-grow: 1; /* Allow description to take available space */
}

.category-info {
  margin-bottom: 10px;
}

.category-link {
  color: #9c27b0;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.category-link:hover {
  color: #4A148C;
  text-decoration: underline;
}

/* Summary Cards Section */
#summary-section {
  background-color: #f5f5f5;
  padding: 12px 8px; /* Further reduced padding */
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 10px; /* Add some space below the summary section */
}

.summary-container {
  display: flex;
  justify-content: center;
  gap: 15px; /* Further reduced gap */
  /* max-width: 1200px; */
  margin: 0 auto;
  flex-wrap: wrap;
  padding: 0 5px; /* Add some padding */
}

.summary-card {
  background: white;
  border-radius: 8px; /* Reduced border radius */
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08); /* Lighter shadow */
  padding: 12px 10px; /* Further reduced padding */
  flex: 1;
  /* min-width: 110px; Further reduced min-width */
  /* max-width: 180px; Further reduced max-width */
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-top: 3px solid #4A148C; /* Thinner top border */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.summary-card:hover {
  transform: translateY(-2px); /* Further reduced hover lift */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.summary-icon {
  font-size: 2rem; /* Reduced size */
  margin-bottom: 5px; /* Reduced margin */
}

.summary-number {
  font-size: 2rem; /* Reduced size */
  font-weight: bold;
  color: #4A148C;
  margin-bottom: 3px; /* Reduced margin */
  line-height: 1;
}

.summary-label {
  font-size: 0.8rem; /* Reduced size */
  color: #757575;
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1;
}

/* Custom icons for summary cards */
#products-count .summary-icon {
  color: #9c27b0; /* Purple color for products icon */
}

#categories-count .summary-icon {
  color: #ff9800; /* Orange color for categories icon */
}

#companies-count .summary-icon {
  color: #2196f3; /* Blue color for companies icon */
}

/* Media queries for summary cards */
@media (max-width: 768px) {
  .summary-container {
    gap: 15px;
  }
  
  .summary-card {
    min-width: 100px;
    max-width: 180px;
    padding: 12px;
  }
  
  .summary-icon {
    font-size: 1.8rem;
  }
  
  .summary-number {
    font-size: 1.8rem;
  }
  
  .summary-label {
    font-size: 0.75rem;
  }
}

@media (max-width: 600px) {
  .summary-container {
    gap: 10px;
  }
  
  .summary-card {
    min-width: 90px;
    max-width: 150px;
    padding: 10px;
  }
  
  .summary-icon {
    font-size: 1.5rem;
    margin-bottom: 3px;
  }
  
  .summary-number {
    font-size: 1.5rem;
    margin-bottom: 2px;
  }
  
  .summary-label {
    font-size: 0.7rem;
    letter-spacing: 0.5px;
  }
}

@media (max-width: 480px) {
  #summary-section {
    padding: 10px 5px;
  }
  
  .summary-container {
    flex-direction: row;
    justify-content: space-between;
    gap: 8px;
  }
  
  .summary-card {
    min-width: 0;
    flex: 1;
    padding: 8px 5px;
    border-top-width: 3px;
  }
  
  .summary-icon {
    font-size: 1.3rem;
    margin-bottom: 2px;
  }
  
  .summary-number {
    font-size: 1.3rem;
    margin-bottom: 2px;
  }
  
  .summary-label {
    font-size: 0.65rem;
    letter-spacing: 0;
  }
}

@media (max-width: 320px) {
  .summary-container {
    flex-direction: row; /* Keep as row for small screens */
    align-items: center;
    gap: 5px;
  }
  
  .summary-card {
    padding: 6px 3px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .summary-icon {
    font-size: 1.2rem;
    margin-bottom: 1px;
  }
  
  .summary-number {
    font-size: 1.2rem;
    margin-bottom: 1px;
  }
  
  .summary-label {
    font-size: 0.6rem;
  }
}

/* Media Queries for Responsiveness */
@media (max-width: 768px) {
  header .header-content {
    flex-direction: column;
    align-items: center;
    padding: 10px;
  }

  .logo-and-title {
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
    text-align: center;
    width: auto;
  }

  .filters-row {
    flex-direction: column;
    width: 100%;
    gap: 10px;
    margin-top: 15px;
  }

  .filter {
    width: 100%;
  }

  .filter select {
    width: 100%;
    margin-right: 0;
    margin-bottom: 5px;
    padding: 8px;
    font-size: 1em;
  }
  
  #reset-btn {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    font-size: 1em;
    height: auto;
  }

  .product-grid-container {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
  }
  
  .product-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
  }
  
  #product-list {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    padding: 10px;
  }
  
  .product-card {
    padding: 15px;
  }

  .product-card h3 {
    font-size: 1.2em;
    margin-bottom: 8px;
  }

  .product-card p {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 6px;
  }
}

@media (max-width: 480px) {
  .logo {
    max-height: 30px;
  }
  
  header h1 {
    font-size: 1.2em;
  }
  
  .product-grid-container {
    grid-template-columns: 1fr; /* Single column for very small screens */
    gap: 15px;
  }
  
  .product-grid {
    grid-template-columns: 1fr; /* Single column for very small screens */
    gap: 15px;
  }
  
  #product-list {
    grid-template-columns: 1fr; /* Single column for very small screens */
    gap: 15px;
  }
  
  .product-card {
    padding: 12px;
  }

  .product-card h3 {
    font-size: 1.1em;
  }
}

@media (max-width: 320px) {
  .product-card {
    padding: 10px;
  }
  
  .product-card h3 {
    font-size: 1em;
  }
  
  .product-card p {
    font-size: 13px;
    line-height: 1.4;
  }
}

/* Footer styling */
footer {
  background-color: #4A148C;
  color: white;
  text-align: center;
  padding: 15px;
  margin-top: 30px;
  font-size: 0.9rem;
}

footer p {
  margin: 0;
}
