/* Explore By Need Page Styles */

body {
  background: white;
  margin: 0;
  padding: 0;
}

/* Expand Button Styles */
.expand-button-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 20px 30px 20px;
  background: white;
  border-bottom: 1px solid #e9ecef;
  margin: 0;
}

.expand-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 32px;
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.expand-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.expand-btn:active {
  transform: translateY(0);
}

.expand-btn.expanded {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  padding: 20px 40px;
  box-shadow: 0 6px 25px rgba(220, 53, 69, 0.4);
}

.arrow-icon {
  width: 24px;
  height: 24px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.expand-btn.expanded .arrow-icon {
  transform: rotate(180deg);
}

.btn-text {
  transition: opacity 0.3s ease;
}

/* Products Section */
.products-section {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.6s ease,
              padding 0.6s ease;
  padding: 0 50px;
  background: white;
  /* Ensure section stays in document flow */
  position: relative;
  z-index: 1;
}

.products-section.expanded {
  max-height: 5000px;
  opacity: 1;
  padding: 60px 50px;
  background: white;
}

/* Search Bar */
.search-container {
  position: relative;
  max-width: 600px;
  margin: 0 auto 40px;
}

.search-input {
  width: 100%;
  padding: 16px 50px 16px 20px;
  font-size: 16px;
  border: 2px solid #e9ecef;
  border-radius: 50px;
  background: white;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.search-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

.search-icon {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: #6c757d;
  pointer-events: none;
}

.no-results {
  text-align: center;
  padding: 60px 20px;
  color: #6c757d;
}

.no-results svg {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  color: #dc3545;
}

.no-results p {
  font-size: 18px;
  font-weight: 500;
}

.section-title {
  font-size: 36px;
  margin-bottom: 40px;
  color: #1a3a52;
  text-align: center;
  font-weight: 700;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  max-width: 1400px;
  margin: 0 auto;
  /* Prevent grid from collapsing during updates */
  min-height: 200px;
  /* Ensure grid stays in flow */
  position: relative;
}

.product-card {
  background: white;
  border-radius: 16px;
  padding: 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border: 1px solid #e9ecef;
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.product-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.product-content {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }
.product-card:nth-child(6) { animation-delay: 0.6s; }

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border-color: #007bff;
}

.product-name {
  font-size: 18px;
  font-weight: 700;
  color: #1a3a52;
  margin-bottom: 12px;
  line-height: 1.4;
  min-height: 50px;
}

.product-composition {
  font-size: 13px;
  color: #6c757d;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 8px;
  font-weight: 500;
}

.product-price {
  font-size: 22px;
  font-weight: 700;
  color: #28a745;
  margin-bottom: 12px;
}

.product-uses {
  font-size: 13px;
  color: #495057;
  line-height: 1.6;
  margin-bottom: 16px;
  max-height: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.product-link {
  display: block;
  padding: 12px 20px;
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  text-align: center;
  margin-top: auto;
}

.product-link:hover {
  background: linear-gradient(135deg, #0056b3 0%, #003d82 100%);
  transform: scale(1.05);
}

/* View More/Less Button */
.view-more-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 50px;
  padding: 20px;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.view-more-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.875rem 2rem;
  background: #ffffff;
  color: #000000;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.view-more-btn span,
.view-more-btn .btn-text,
.chevron-icon {
  position: relative;
  z-index: 1;
}

/* Radial gradient ripple effect on hover */
.view-more-btn::before {
  content: "";
  position: absolute;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.4) 0%, rgba(16, 185, 129, 0.2) 50%, transparent 100%);
  width: 0;
  height: 0;
  left: var(--xPos, 50%);
  top: var(--yPos, 50%);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  transition: width 0.6s ease-out, height 0.6s ease-out;
  pointer-events: none;
}

.view-more-btn:hover::before {
  width: 400px;
  height: 400px;
}

.view-more-btn.less::before {
  background: radial-gradient(circle, rgba(249, 115, 22, 0.4) 0%, rgba(249, 115, 22, 0.2) 50%, transparent 100%);
}

.view-more-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.view-more-btn:active {
  transform: translateY(0);
}

.chevron-icon {
  width: 22px;
  height: 22px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 1;
}

.view-more-btn.less .chevron-icon {
  transform: rotate(180deg);
}

/* Smooth fade-in for new products */
.product-card.fade-in {
  animation: fadeInUp 0.6s ease forwards;
}

/* Smooth append animation for dynamically added products */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Apply to newly appended products */
.product-card:nth-last-child(-n+4) {
  animation: slideInUp 0.5s ease forwards;
}

/* Header - Always visible */
header {
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Removed header.hidden rule - header should always be visible */


/* Responsive Design */
@media (max-width: 768px) {
  .products-grid {
    grid-template-columns: 1fr;
  }
  
  .section-title {
    font-size: 28px;
  }
  
  .products-section.expanded {
    padding: 40px 20px;
  }
}

.exploreByNeed-inline-1 {
  margin: 0; padding: 0;
}

.exploreByNeed-inline-2 {
  display: flex; justify-content: center; align-items: center; padding: 10px 20px 30px 20px; background: white; border-bottom: 1px solid #e9ecef; margin: 0;
}

.exploreByNeed-inline-3 {
  display: none;
}


