/* ==========================================================================
   Product Gallery — factory production photo grids + lightbox
   Used by all category pages. Prefix: pg-
   ========================================================================== */

.pg-section {
  padding: clamp(48px, 6vw, 80px) 0;
  background: var(--color-bg, #FAF7F2);
}
.pg-section + .pg-section { padding-top: 0; }

.pg-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 40px;
}
.pg-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-primary, #B5603A);
  margin: 0 0 10px;
  font-weight: 600;
}
.pg-title {
  font-family: var(--font-display, Georgia, serif);
  font-size: clamp(1.6rem, 3.4vw, 2.3rem);
  line-height: 1.25;
  color: var(--color-text, #2C2416);
  margin: 0 0 12px;
  font-weight: 500;
}
.pg-sub {
  color: var(--color-text-mid, #6B5E4A);
  font-size: 0.95rem;
  line-height: 1.7;
  margin: 0;
}

/* Group (one per product sub-category) */
.pg-group { margin-bottom: 44px; }
.pg-group:last-child { margin-bottom: 0; }
.pg-group-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--color-border, #DDD4C4);
}
.pg-group-title {
  font-family: var(--font-display, Georgia, serif);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--color-text, #2C2416);
  margin: 0;
}
.pg-group-count {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-light, #A08E78);
  font-weight: 600;
}

/* Grid */
.pg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.pg-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius, 4px);
  background: var(--color-bg-alt, #F2EDE4);
  aspect-ratio: 1 / 1;
  cursor: zoom-in;
  box-shadow: 0 1px 6px rgba(44, 36, 22, 0.06);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.pg-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md, 0 8px 32px rgba(44, 36, 22, 0.12));
  z-index: 2;
}
.pg-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.pg-item:hover img { transform: scale(1.05); }
.pg-item::after {
  content: "\1F50D";
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.pg-item:hover::after { opacity: 1; }

/* Gallery closing CTA */
.pg-cta {
  margin-top: 40px;
  padding: 28px 24px;
  background: var(--color-white, #fff);
  border: 1px solid var(--color-border, #DDD4C4);
  border-radius: var(--radius-lg, 12px);
  text-align: center;
}
.pg-cta p {
  color: var(--color-text-mid, #6B5E4A);
  margin: 0 0 18px;
  font-size: 0.95rem;
  line-height: 1.7;
}
.pg-cta-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Lightbox ---------- */
.pg-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 17, 14, 0.92);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px 60px;
}
.pg-lightbox.is-open { display: flex; }
.pg-lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.pg-lb-close,
.pg-lb-nav {
  position: absolute;
  background: rgba(255, 255, 255, 0.12);
  border: 0;
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease;
}
.pg-lb-close:hover,
.pg-lb-nav:hover { background: rgba(255, 255, 255, 0.28); }
.pg-lb-close {
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  font-size: 24px;
  line-height: 1;
}
.pg-lb-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  font-size: 26px;
  line-height: 1;
}
.pg-lb-prev { left: 14px; }
.pg-lb-next { right: 14px; }
.pg-lb-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}
.pg-lb-caption {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.88rem;
  letter-spacing: 0.05em;
}

@media (max-width: 768px) {
  .pg-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .pg-lightbox { padding: 20px 14px 60px; }
  .pg-lb-nav { width: 38px; height: 38px; font-size: 20px; }
  .pg-lb-prev { left: 6px; }
  .pg-lb-next { right: 6px; }
}
