/* ==========================================================================
   JOYBEAN — Product listings and product detail
   A loop-friendly card grid: any number of cards flows into the columns.
   Loaded by archive-product.html, category-*.html and single-product.html.
   ========================================================================== */

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

.product-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.product-card:hover {
  border-color: #f0cdc9;
  box-shadow: var(--shadow-sm);
  transform: translateY(-4px);
}

.product-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: #f5f0eb;
}

.product-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.4;
  text-transform: uppercase;
}

.product-media .product-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.product-summary > .product-badge {
  margin-top: 4px;
}

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

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

.product-body {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
}

.product-body h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1.35;
}

.product-arrow {
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 50%;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.product-card:hover .product-arrow {
  color: #fff;
  background: var(--primary);
}

/* Responsive */

@media (max-width: 1100px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (max-width: 520px) {
  .product-body {
    padding: 14px 16px;
  }

  .product-body h3 {
    font-size: 13.5px;
  }
}

/* ==========================================================================
   Product detail page
   Two-column hero, Swiper gallery, spec table and long-form product guide.
   ========================================================================== */

.product-hero {
  padding: clamp(28px, 3.6vw, 46px) 0 clamp(56px, 7vw, 88px);
  background:
    radial-gradient(circle at 12% 8%, rgba(228, 33, 27, 0.07), transparent 34%),
    linear-gradient(180deg, var(--bg-warm) 0%, var(--bg) 100%);
}

.product-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}

/* --------------------------------------------------------------------------
   Gallery
   -------------------------------------------------------------------------- */

.product-gallery {
  min-width: 0;
}

.product-gallery-swiper {
  overflow: hidden;
  background: #f5f0eb;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.product-gallery-swiper .swiper-slide {
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: #f5f0eb;
}

.product-gallery-swiper .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-gallery-swiper .swiper-button-prev,
.product-gallery-swiper .swiper-button-next {
  --swiper-navigation-size: 15px;
  width: 42px;
  height: 42px;
  margin-top: -21px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  transition: color 0.2s ease, background-color 0.2s ease;
}

.product-gallery-swiper .swiper-button-prev:hover,
.product-gallery-swiper .swiper-button-next:hover {
  color: #fff;
  background: var(--primary);
}

.product-gallery-swiper .swiper-button-prev {
  left: 16px;
}

.product-gallery-swiper .swiper-button-next {
  right: 16px;
}

.product-gallery-thumbs {
  margin-top: 12px;
}

.product-gallery-thumbs .swiper-slide {
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: #f5f0eb;
  border: 2px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}

.product-gallery-thumbs .swiper-slide:hover {
  opacity: 0.9;
}

.product-gallery-thumbs .swiper-slide-thumb-active {
  border-color: var(--primary);
  opacity: 1;
}

.product-gallery-thumbs .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --------------------------------------------------------------------------
   Summary
   -------------------------------------------------------------------------- */

.product-summary {
  min-width: 0;
  padding-top: 4px;
}

.product-summary h1 {
  margin: 12px 0 16px;
  font-size: clamp(2.1rem, 3.8vw, 3.1rem);
  font-weight: 850;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.product-summary-lead {
  margin: 0;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.78;
}

.product-summary-lead p {
  margin: 0;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

.product-summary-lead p + p {
  margin-top: 12px;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.product-meta li {
  position: relative;
  padding-left: 15px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.product-meta li::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 5px;
  height: 5px;
  background: var(--primary);
  border-radius: 50%;
  transform: translateY(-50%);
}

.product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

/* --------------------------------------------------------------------------
   Specifications table
   -------------------------------------------------------------------------- */

.spec-table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
}

.spec-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

.spec-table th,
.spec-table td {
  padding: 17px 24px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.spec-table tr:last-child th,
.spec-table tr:last-child td {
  border-bottom: 0;
}

.spec-table th {
  width: 26%;
  color: var(--ink);
  background: #faf7f4;
  font-size: 13px;
  font-weight: 750;
}

.spec-table td {
  color: var(--muted);
  font-size: 13.8px;
  line-height: 1.68;
}

/* --------------------------------------------------------------------------
   Long-form product guide
   -------------------------------------------------------------------------- */

.product-article {
  max-width: 900px;
  margin: 0 auto;
}

.product-article h2 {
  margin: 12px 0 18px;
  font-size: clamp(1.9rem, 3.2vw, 2.7rem);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.02em;
}

.product-article h3 {
  margin: 36px 0 10px;
  font-size: clamp(1.15rem, 1.8vw, 1.4rem);
  font-weight: 800;
  line-height: 1.3;
}

.product-article p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.78;
}

.product-article .check-list {
  margin-top: 14px;
}

.product-article .check-list strong {
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   Industry application cards
   -------------------------------------------------------------------------- */

.industry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.industry-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: 20px;
  background: #f2ece6;
}

.industry-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(24, 18, 14, 0) 44%, rgba(24, 18, 14, 0.74) 100%);
  pointer-events: none;
}

.industry-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

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

.industry-card span {
  position: absolute;
  bottom: 20px;
  left: 22px;
  z-index: 1;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* --------------------------------------------------------------------------
   Related products
   -------------------------------------------------------------------------- */

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

/* --------------------------------------------------------------------------
   Product detail responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1000px) {
  .product-hero-grid {
    grid-template-columns: 1fr;
  }

  .product-gallery {
    max-width: 640px;
  }
}

@media (max-width: 900px) {
  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (max-width: 760px) {
  .industry-grid {
    grid-template-columns: 1fr;
  }

  .industry-card {
    aspect-ratio: 16 / 10;
  }
}

@media (max-width: 560px) {
  .product-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .spec-table th,
  .spec-table td {
    padding: 14px 16px;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }
}
