.products-section {
  width: 115%; /* control max width */
  margin-left: -50px; /* shift section 50px to the left */
  margin-right: auto; /* keep right margin automatic */
  padding-left: 20px; /* optional padding inside section */
  padding-right: 20px; /* optional padding inside section */
  position: relative; /* required if using left for positioning */
}

.title-box {
  text-align: center;
  margin-bottom: 40px;
}

.main-title {
  margin-top: -10px;
  font-size: 2.5rem;
  font-weight: bold;
  color: #222;
}

.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 0 0 24px 0;
}

.category-btn {
  padding: 8px 14px;
  border: 1px solid #16a34a;
  background: #fff;
  color: #16a34a;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.2s ease-in-out;
}

.category-btn:hover {
  background: #16a34a10;
}

.category-btn.active {
  background: #16a34a;
  color: #fff;
}

.subtitle {
  color: #777;
  margin-top: 10px;
  font-size: 1.1rem;
}

.products-grid {
  display: grid;
  gap: 25px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Card Styles */
.product-card {
  position: relative;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  transform: translateY(40px);
  opacity: 0;
  transition: all 0.6s ease;
}

.product-card.visible {
  transform: translateY(0);
  opacity: 1;
}

.image-box {
  height: 220px;
  overflow: hidden;
}

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

.product-card:hover img {
  transform: scale(1.1);
}

.card-content {
  padding: 16px;
  height: 150px;
}

.card-content h2 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #222;
  margin-bottom: 8px;
  transition: color 0.3s ease;
}

.card-content p {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.4;
  max-height: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Hover Overlay */
.hover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.product-card:hover .hover-overlay {
  opacity: 1;
}

.hover-overlay button {
  padding: 10px 20px;
  background: #16a34a;
  border: none;
  color: white;
  font-size: 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.hover-overlay button:hover {
  background: #0f7a35;
}
/* Responsive Typography and Layout Adjustments */
@media (max-width: 1024px) {
  .products-section {
    width: 100%;
    margin-left: 0; /* remove left shift on smaller screens */
    padding-left: 15px;
    padding-right: 15px;
  }

  .products-grid {
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

@media (max-width: 768px) {
  .card-content {
    height: auto;
  }

  .card-content p {
    max-height: 90px;
  }

  .main-title {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .products-section {
    width: 95%;
    margin-left: 0;
    padding-left: 10px;
    padding-right: 10px;
  }

  .main-title {
    font-size: 1.6rem;
  }

  .products-grid {
    gap: 18px;
    grid-template-columns: 1fr; /* Single column for small screens */
  }

  .image-box {
    height: 180px;
  }

  .hover-overlay button {
    padding: 10px 18px;
    font-size: 0.9rem;
  }
}

.product-detail-page {
  max-width: 900px;
  width: 90%;
  margin: 40px auto;
  padding: 20px;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.back-btn {
  background-color: #16a34a;
  color: white;
  border: none;
  padding: 10px 18px;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 20px;
  transition: background-color 0.3s ease;
}

.back-btn:hover {
  background-color: #0f7a35;
}

.detail-image-box {
  width: 100%;
  max-height: 450px;
  overflow: hidden;
  border-radius: 16px;
  margin-bottom: 20px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.detail-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
  transition: transform 0.4s ease;
}

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

.detail-content {
  font-size: 1.1rem;
  color: #333;
  line-height: 1.6;
}

.detail-content h2 {
  font-size: 2rem;
  margin-bottom: 15px;
  font-weight: bold;
  color: #222;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .product-detail-page {
    width: 95%;
    padding: 15px;
    margin: 30px auto;
  }

  .detail-image-box {
    max-height: 300px;
  }

  .detail-content h2 {
    font-size: 1.6rem;
  }

  .detail-content {
    font-size: 1rem;
  }

  .back-btn {
    padding: 9px 16px;
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .product-detail-page {
    margin: 20px 10px;
    padding: 10px;
  }

  .detail-image-box {
    max-height: 220px;
  }

  .detail-content h2 {
    font-size: 1.3rem;
  }

  .detail-content {
    font-size: 0.95rem;
  }

  .back-btn {
    width: 100%;
    padding: 12px 0;
    font-size: 1rem;
  }
}
.back-arrow {
  margin-right: 8px;
  font-size: 1.2rem;
  vertical-align: middle;
}
