/* ============================================================
   PRODUCT PAGE — Popy Floppy
   Individual product layout, image gallery, details
   ============================================================ */

.product-page {
  max-width: 1100px;
  margin: 2.5rem auto;
  padding: 0 var(--gap);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

/* ============================================================
   IMAGE GALLERY
   ============================================================ */

.product-gallery {
  position: sticky;
  top: calc(73px + 1.5rem); /* header height + gap */
}

/* Back button */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--ease), transform var(--ease);
}

.back-btn:hover {
  color: var(--purple);
  transform: translateX(-3px);
}

.back-arrow {
  font-size: 1.1rem;
  line-height: 1;
}

.gallery-main {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: var(--radius);
  background-color: var(--surface);
  margin-bottom: 0.75rem;
  cursor: zoom-in;
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s ease;
}

.gallery-main img.swapping {
  opacity: 0;
}

.gallery-thumbs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.gallery-thumb {
  width: calc(25% - 0.375rem);
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  background: none;
  padding: 0;
  transition: border-color var(--ease);
  flex-shrink: 0;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-thumb.active,
.gallery-thumb:hover {
  border-color: var(--purple);
}

/* ============================================================
   PRODUCT DETAILS
   ============================================================ */

.product-details {
  padding-top: 0.5rem;
}

.product-breadcrumb {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.product-breadcrumb a {
  color: var(--muted);
  transition: color var(--ease);
}

.product-breadcrumb a:hover {
  color: var(--purple);
}

.product-breadcrumb span {
  margin: 0 0.4rem;
  opacity: 0.5;
}

.product-details h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.product-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.product-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.product-tag.tag-style { color: var(--purple); border-color: var(--purple); }
.product-tag.tag-type  { color: var(--green);  border-color: var(--green);  }

.product-description {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 2rem;
}

/* Specs table */
.product-specs {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2rem;
}

.spec-row {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.spec-row:last-child {
  border-bottom: none;
}

.spec-label {
  width: 40%;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  background-color: var(--surface-2);
}

.spec-value {
  flex: 1;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  color: var(--text);
  background-color: var(--surface);
}

/* CTA area */
.product-cta {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}

.product-cta p {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.btn-enquire {
  display: inline-block;
  background-color: var(--purple);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.75rem 2rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: background-color var(--ease), transform var(--ease);
  text-decoration: none;
}

.btn-enquire:hover {
  background-color: var(--green);
  transform: translateY(-2px);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
  .product-page {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 1.5rem auto;
  }

  .product-gallery {
    position: static;
  }

  .gallery-thumb {
    width: calc(25% - 0.375rem);
  }
}

/* ============================================================
   LIGHTBOX OVERLAY
   ============================================================ */

#lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

#lightbox-overlay.open {
  display: flex;
}

.lb-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 92vw;
  max-height: 92vh;
}

.lb-img {
  max-width: 80vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 0 60px rgba(0,0,0,0.8);
  transition: opacity 0.15s ease;
}

.lb-img.swapping {
  opacity: 0;
}

.lb-close,
.lb-prev,
.lb-next {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--ease);
}

.lb-close:hover,
.lb-prev:hover,
.lb-next:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lb-close {
  position: absolute;
  top: -3rem;
  right: 0;
  font-size: 1.5rem;
}

@media (max-width: 600px) {
  .lb-img {
    max-width: 95vw;
  }

  .lb-prev,
  .lb-next {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
}
