/* Search Container Styles */
.product-search-container {
  margin-top: 10px;
  margin-bottom: 0;
  width: 100%;
}

.product-search-form-container {
  display: flex;
  position: relative;
  border: 1px solid #ddd;
  padding: 10px 25px;
  border-radius: 40px;
  background-color: #f0f0f0;
  margin-left: 20px;
  margin-right: 20px;
  width: calc(100% - 40px);
}

input[type=text].product-search-input {
  flex: 1;
  padding: 10px 40px 10px 10px;
  border: none;
  border-bottom: 2px solid #ddd;
  width: 100%;
  font-size: 16px;
  background: transparent;
  transition: border-color 0.3s ease;
}

input[type=text].product-search-input:focus {
  outline: none;
}

button[type=submit].product-search-button {
  background: transparent;
  color: #555;
  border: none;
  position: absolute;
  right: 25px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 16px;
  padding: 5px 10px;
}

.search-icon {
  vertical-align: middle;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 20px;
  margin-bottom: 30px;
}

.product-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.product-card-link:hover .product-card {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transform: translateY(-5px);
  transition: all 0.3s ease;
}

.product-card {
  /* border: 1px solid #eaeaea; */
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
}

.product-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.product-info {
  padding: 15px;
}

.product-title {
  font-weight: bold;
  font-size: 16px;
  margin-bottom: 5px;
  color: #333;
}

.product-school {
  font-size: 14px;
  color: #666;
}

/* Responsive design */
@media (max-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: repeat(1, 1fr);
  }
}

/* Voting widget styles */
.product-voting {
  display: flex;
  align-items: center;
  margin-top: 8px;
}

.vote-button {
  display: flex;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px 10px 5px 5px;
  border-radius: 20px;
  transition: background-color 0.2s;
  line-height: 1;
}

button.vote-button:hover,
button.vote-button:focus {
  background-color: rgba(255, 107, 107, 0.1);
}

.vote-heart-icon {
  margin-right: 5px;
  color: #666;
  transition: all 0.2s;
}

.vote-button.voted .vote-heart-icon {
  color: #ff6b6b;
}

.vote-text {
  font-size: 14px;
  color: #666;
}

.vote-count {
  font-size: 14px;
  color: #666;
  margin-left: 5px;
  line-height: 1;
}

/* Make sure the vote button doesn't interfere with the card link */
.product-card-link {
  text-decoration: none !important;
  color: inherit;
  position: relative;
}

/* Prevent the entire card from being clickable over the vote button */
.vote-button {
  position: relative;
  z-index: 10;
}

.vote-loader {
  width: 14px;
  height: 14px;
  border: 2px solid #aaa;
  border-bottom-color: transparent;
  border-radius: 50%;
  margin-left: 10px;
  display: inline-block;
  box-sizing: border-box;
  animation: rotation 1s linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

@keyframes rotation {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}
