/* Modern Product Card Styles */

.products {
  padding: 80px 0;
  background-color: #f9f9f9;
}

.section-header.text-center {
  text-align: center;
  margin-bottom: 40px;
}

.section-header h2 {
  font-size: 36px;
  margin-bottom: 15px;
}

.section-header h2 span {
  color: #7ED957;
}

.section-subtitle {
  font-size: 20px;
  color: #333;
  margin-bottom: 10px;
}

.products-description {
  max-width: 700px;
  margin: 0 auto 30px;
  color: #666;
}

.product-filter {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.filter-btn {
  background-color: transparent;
  border: none;
  padding: 10px 20px;
  margin: 0 5px 10px;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  color: #555;
  border: 1px solid #e0e0e0;
}

.filter-btn:hover {
  background-color: rgba(126, 217, 87, 0.1);
  color: #7ED957;
  border-color: #7ED957;
}

.filter-btn.active {
  background-color: #7ED957;
  color: white;
  border-color: #7ED957;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 20px;
}

.product-item {
  transition: all 0.3s ease;
}

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

.modern-product-card {
  background-color: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}

.modern-product-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.modern-product-card::before {
  content: '';
  height: 6px;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  background-color: #7ED957;
}

/* Category-specific colors */
.cattle-card::before {
  background-color: #68B030;
}

.poultry-card::before {
  background-color: #FFA726;
}

.swine-card::before {
  background-color: #AB47BC;
}

.aqua-card::before {
  background-color: #29B6F6;
}

.product-image-container {
  padding: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  background-color: #f9f9f9;
  position: relative;
  z-index: 1;
}

.product-image-container img {
  max-height: 100%;
  max-width: 100%;
  object-fit: cover;
  transition: all 0.3s ease;
}

/* Primary and hover image styling */
.primary-image {
  display: block;
  position: relative;
  z-index: 1;
  /* Always keep the primary image visible */
  opacity: 1;
  width: 100%;
  height: auto;
}

.hover-image {
  position: absolute;
  /* Center the hover image */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  /* Make the hover image smaller and circular */
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  /* Semi-transparent by default so both images blend */
  opacity: 0;
  z-index: 3;
  border: 4px solid white;
  box-shadow: 0 5px 15px rgba(0,0,0,0.25);
  transition: all 0.3s ease;
}

.modern-product-card:hover .hover-image {
  /* Make hover image fully visible */
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

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

.product-content {
  padding: 20px;
  flex-grow: 1;
}

.product-content h3 {
  font-size: 20px;
  margin-bottom: 10px;
  color: #333;
}

.product-short-desc {
  color: #666;
  font-size: 14px;
  line-height: 1.5;
}

.product-hover-overlay {
  padding: 0 20px 20px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.9);
  z-index: 2;
}

.modern-product-card:hover .product-hover-overlay {
  opacity: 1;
  transform: translateY(0);
}

/* Mobile-specific styles */
@media (max-width: 768px) {
  .product-hover-overlay {
    /* Less transparent background for better readability on mobile */
    background: rgba(255, 255, 255, 0.95);
    /* Smaller padding to take less space */
    padding: 0 15px 15px;
    /* Always visible on mobile without requiring hover */
    opacity: 1;
    transform: translateY(0);
    /* Only cover the bottom portion of the product card */
    height: auto;
    bottom: 0;
  }
  
  .product-content {
    /* Ensure proper spacing between content and overlay */
    padding-bottom: 60px;
  }
  
  .modern-product-card:hover {
    /* No upward movement on mobile */
    transform: none;
  }
  
  .quote-btn {
    /* Make the button more prominent on mobile */
    width: 100%;
    padding: 12px 15px;
  }
  
  /* Special handling for product images on mobile */
  .primary-image {
    opacity: 1;
    position: relative;
    z-index: 1;
    width: 100%;
    height: auto;
  }
  
  .hover-image {
    /* Always visible on mobile */
    opacity: 1;
    position: absolute;
    /* Center the hover image on mobile */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    z-index: 3;
    border: 4px solid white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.25);
    /* Add a subtle animation for mobile devices */
    animation: pulse 2s infinite alternate;
  }
  
  @keyframes pulse {
    0% {
      transform: translate(-50%, -50%) scale(0.95);
      box-shadow: 0 3px 8px rgba(0,0,0,0.15);
      opacity: 0.8;
    }
    100% {
      transform: translate(-50%, -50%) scale(1.05);
      box-shadow: 0 8px 20px rgba(0,0,0,0.3);
      opacity: 1;
    }
  }
}

.quote-btn {
  background-color: #7ED957;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  width: 100%;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.quote-btn:hover {
  background-color: #68B030;
}

/* Category-specific button colors */
.cattle-card .quote-btn {
  background-color: #68B030;
}

.cattle-card .quote-btn:hover {
  background-color: #548E26;
}

.poultry-card .quote-btn {
  background-color: #FFA726;
}

.poultry-card .quote-btn:hover {
  background-color: #FB8C00;
}

.swine-card .quote-btn {
  background-color: #AB47BC;
}

.swine-card .quote-btn:hover {
  background-color: #8E24AA;
}

.aqua-card .quote-btn {
  background-color: #29B6F6;
}

.aqua-card .quote-btn:hover {
  background-color: #039BE5;
}

/* Responsive styles */
@media (max-width: 992px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  .section-header h2 {
    font-size: 28px;
  }
  
  .section-subtitle {
    font-size: 18px;
  }
  
  .product-filter {
    margin-bottom: 30px;
  }
  
  .filter-btn {
    padding: 8px 15px;
    font-size: 14px;
  }
}

@media (max-width: 576px) {
  .products-grid {
    grid-template-columns: 1fr;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
  }
}
