/* ==========================================================================
   produk.css — Halaman Produk UMKM
   Styles for: hero image, category filters, and product grid.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Page Hero Section
   -------------------------------------------------------------------------- */
.produk-hero {
  position: relative;
  width: 100%;
  height: 420px;
  background-image: url('/assets/images/hero/produk-hero.jpg');
  background-color: var(--color-primary-dark);
  background-size: cover;
  background-position: center top;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

@media (min-width: 768px) {
  .produk-hero {
    height: 480px;
  }
}

@media (max-width: 480px) {
  .produk-hero {
    height: 300px;
  }
}

.produk-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.30) 0%,
    rgba(0, 0, 0, 0.55) 60%,
    rgba(0, 0, 0, 0.70) 100%
  );
  z-index: 1;
}

.produk-hero-content {
  position: relative;
  z-index: 2;
  color: #ffffff;
  padding: 0 var(--spacing-6);
  max-width: 700px;
}

.produk-hero-content h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 5vw, 3.5rem);
  font-weight: 700;
  color: #ffffff;
  margin-bottom: var(--spacing-4);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  letter-spacing: -0.01em;
}

.produk-hero-content p {
  font-size: var(--text-lg);
  line-height: 1.65;
  opacity: 0.92;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
  max-width: 540px;
  margin: 0 auto;
}

.produk-hero-wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  z-index: 3;
  line-height: 0;
}

/* --------------------------------------------------------------------------
   2. Catalog & Filters
   -------------------------------------------------------------------------- */
.produk-catalog {
  background-color: var(--color-light); /* #F8F9F4 matching wave */
  padding: var(--spacing-12) 0 var(--spacing-16);
}

.produk-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-3);
  margin-bottom: var(--spacing-12);
  padding: 0 var(--spacing-4);
}

.filter-btn {
  background-color: #EAECE5; /* Light gray matching image */
  color: var(--color-dark);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: 0.4rem 1.25rem;
  border-radius: 2rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background-color: #DDE0D6;
}

.filter-btn.active {
  background-color: var(--color-primary-dark); /* Dark green */
  color: var(--color-white);
}

/* --------------------------------------------------------------------------
   3. Products Grid
   -------------------------------------------------------------------------- */
.products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-8);
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--spacing-4);
  align-items: stretch;
}

@media (min-width: 640px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-8);
  }
}

/* --------------------------------------------------------------------------
   4. Product Card
   -------------------------------------------------------------------------- */
.product-card {
  background-color: var(--color-white);
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid rgba(26, 92, 42, 0.08);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border-color: rgba(26, 92, 42, 0.14);
}

.prod-img-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  flex-shrink: 0;
}

.prod-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

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

.prod-badge-tersedia,
.prod-badge-habis {
  position: absolute;
  top: var(--spacing-3);
  right: var(--spacing-3);
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
  line-height: 1.2;
  z-index: 1;
}

.prod-badge-tersedia {
  background: rgba(27, 67, 50, 0.88);
  color: white;
  backdrop-filter: blur(4px);
}

.prod-badge-habis {
  background-color: #E53E3E;
  color: white;
}

.prod-body {
  padding: var(--spacing-6);
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: var(--spacing-4);
  min-height: 0;
}

.prod-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.prod-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-3);
  flex: 1;
}

.prod-title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-dark);
  margin: 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.prod-price {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-primary-dark);
  margin: 0;
}

.prod-desc {
  font-size: var(--text-sm);
  color: var(--color-gray-600);
  line-height: 1.65;
  margin: 0;
  flex: 1;
  max-height: calc(var(--text-sm, 0.875rem) * 1.65 * 5);
  overflow: hidden;
  position: relative;
  transition: max-height 0.4s ease;
}

.prod-desc.expanded {
  max-height: 2000px;
}

.prod-desc p {
  margin: 0 0 0.6em 0;
}

.prod-desc p:last-child {
  margin-bottom: 0;
}

.prod-read-more {
  display: none;
  background: none;
  border: none;
  color: var(--color-primary-dark, #2e7d32);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  padding: 0.35rem 0 0;
  transition: color 0.2s ease;
}

.prod-read-more:hover {
  color: var(--color-primary, #43a047);
  text-decoration: underline;
}

.prod-read-more.visible {
  display: inline-block;
}

.prod-footer {
  margin-top: auto;
  padding-top: var(--spacing-4);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.prod-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-2);
  width: 100%;
  box-sizing: border-box;
  background-color: var(--color-whatsapp);
  color: white;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 0.65rem var(--spacing-4);
  border-radius: 0.625rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.3;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.prod-btn:hover {
  background-color: var(--color-whatsapp-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
}

.prod-btn svg {
  flex-shrink: 0;
}

/* Tombol Maps produk */
.prod-btn--maps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-2);
  width: 100%;
  box-sizing: border-box;
  background-color: #4285F4;
  color: white;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 0.65rem var(--spacing-4);
  border-radius: 0.625rem;
  text-decoration: none;
  line-height: 1.3;
  margin-top: 0.5rem;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.prod-btn--maps:hover {
  background-color: #3367D6;
  color: white;
  transform: translateY(-1px);
}

/* Jarak antar tombol di footer card */
.prod-footer {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* --------------------------------------------------------------------------
   Product Image Slider
   -------------------------------------------------------------------------- */
.prod-slides {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.prod-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.prod-slide.active {
  opacity: 1;
}

.prod-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Single foto — img langsung di dalam wrap (bukan slider) */
.prod-img-wrap:not(.prod-img-wrap--slider) img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.product-card:hover .prod-img-wrap:not(.prod-img-wrap--slider) img {
  transform: scale(1.05);
}

/* Panah navigasi */
.prod-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.85);
  color: #1a1a1a;
  font-size: 1.2rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
  padding: 0;
}

.prod-img-wrap--slider:hover .prod-arrow {
  opacity: 1;
}

.prod-arrow:hover {
  background: white;
}

.prod-arrow--prev { left: 8px; }
.prod-arrow--next { right: 8px; }

/* Dots */
.prod-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 5px;
}

.prod-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  transition: background 0.2s, transform 0.2s;
  cursor: pointer;
}

.prod-dot.active {
  background: white;
  transform: scale(1.3);
}
