/* Styling khusus untuk halaman produk (produk.php) */

/* Products Hero Section */
.products-hero {
  text-align: center;
  padding: 50px 20px;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  border-radius: 20px;
  margin-bottom: 50px;
  box-shadow: 0 10px 40px rgba(255, 51, 51, 0.2);
}

.products-hero h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  font-weight: 700;
}

.products-hero p {
  font-size: 1.1rem;
  opacity: 0.95;
  max-width: 550px;
  margin: 0 auto;
}

/* Category Filter */
.category-filter {
  margin-bottom: 50px;
  text-align: center;
}

.category-filter h3 {
  margin-bottom: 25px;
  color: var(--dark-color);
  font-size: 1.5rem;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
}

.filter-btn {
  padding: 10px 20px;
  border: 1px solid #ddd;
  border-radius: 50px;
  background-color: white;
  color: var(--text-color);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-btn:hover {
  background-color: #f0f0f0;
  border-color: #ccc;
}

.filter-btn.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(0);
  box-shadow: 0 5px 15px rgba(255, 51, 51, 0.2);
}

.filter-btn i {
  font-size: 1rem;
}

/* Category Section Header */
.category-section {
  margin-bottom: 60px;
}

.category-section.hidden {
  display: none;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--light-gray);
}

.category-header h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--dark-color);
  margin: 0;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-header h2 i {
  color: var(--primary-color);
}

.product-count {
  background-color: var(--primary-color);
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  place-items: center; /* Center items within their grid cells */
}

/* Product Card */
.product-card {
  background-color: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  max-width: 300px; /* Added max-width here */
  width: 100%; /* Ensure it takes full width up to max-width */
}

.product-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

.product-image {
  width: 100%;
  height: 220px;
  overflow: hidden;
  border-bottom: 1px solid #eee;
}

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

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

.product-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--dark-color);
  margin-bottom: 10px;
  line-height: 1.3;
}

.product-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-top: auto; /* Pushes action buttons to the bottom */
  margin-bottom: 15px;
}

.action-buttons {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.btn-detail,
.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 15px;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  text-decoration: none;
  font-size: 0.9rem;
  flex-grow: 1;
}

.btn-detail {
  background-color: #f0f0f0;
  color: var(--dark-color);
  border: 1px solid #ddd;
  white-space: nowrap; /* Prevent text wrapping */
}

.btn-detail:hover {
  background-color: #e0e0e0;
  border-color: #ccc;
}

.btn-whatsapp {
  background-color: #25d366;
  color: white;
  border: 1px solid #25d366;
}

.btn-whatsapp:hover {
  background-color: #128c7e;
  border-color: #128c7e;
}

.btn-whatsapp i {
  margin-right: 5px;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
  .products-hero {
    padding: 40px 15px;
    margin-bottom: 40px;
  }

  .products-hero h1 {
    font-size: 2rem;
  }

  .products-hero p {
    font-size: 1rem;
  }

  .category-filter {
    margin-bottom: 40px;
  }

  .category-filter h3 {
    font-size: 1.3rem;
  }

  .filter-buttons {
    gap: 10px;
  }

  .filter-btn {
    padding: 8px 15px;
    font-size: 0.85rem;
  }

  .category-section {
    margin-bottom: 40px;
  }

  .category-header {
    margin-bottom: 20px;
  }

  .category-header h2 {
    font-size: 1.8rem;
  }

  .product-count {
    padding: 4px 10px;
    font-size: 0.8rem;
  }

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

  .product-image {
    height: 180px;
  }

  .product-info {
    padding: 15px;
  }

  .product-title {
    font-size: 1.1rem;
  }

  .product-price {
    font-size: 1rem;
  }

  .btn-detail,
  .btn-whatsapp {
    padding: 8px 12px;
    font-size: 0.8rem;
  }
}

@media (max-width: 768px) {
  .products-hero {
    border-radius: 15px;
  }

  .products-hero h1 {
    font-size: 1.8rem;
  }

  .products-hero p {
    font-size: 0.9rem;
  }

  .category-filter h3 {
    font-size: 1.2rem;
  }

  .filter-buttons {
    /* justify-content: flex-start; */
    overflow-x: auto;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
  }

  .filter-buttons::-webkit-scrollbar {
    /* Chrome, Safari, Opera */
    display: none;
  }

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

  .product-image {
    height: 150px;
  }

  .product-info {
    padding: 12px;
  }

  .product-title {
    font-size: 1rem;
  }

  .product-price {
    font-size: 0.9rem;
  }

  .action-buttons {
    flex-direction: column;
    gap: 8px;
  }

  .btn-detail,
  .btn-whatsapp {
    padding: 10px;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .products-hero {
    padding: 30px 10px;
    margin-bottom: 30px;
  }

  .products-hero h1 {
    font-size: 1.5rem;
  }

  .products-hero p {
    font-size: 0.8rem;
  }

  .category-filter {
    margin-bottom: 30px;
  }

  .category-filter h3 {
    font-size: 1rem;
  }

  .filter-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  .category-section {
    margin-bottom: 30px;
  }

  .category-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 15px;
  }

  .category-header h2 {
    font-size: 1.5rem;
  }

  .product-count {
    align-self: flex-end;
  }

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

  .product-image {
    height: 200px; /* Make images larger in single column view */
  }

  .product-info {
    padding: 10px;
  }

  .product-title {
    font-size: 1.1rem;
  }

  .product-price {
    font-size: 1rem;
  }

  .btn-detail,
  .btn-whatsapp {
    padding: 8px;
    font-size: 0.8rem;
  }
}
