/* ============================================================
   Product Detail Page Styles
   ============================================================ */

.product-section {
  padding: 40px 0 60px;
  overflow: hidden;
}
.product-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: start;
}
.product-gallery,
.product-info { min-width: 0; max-width: 100%; }

/* ── Gallery ─────────────────────────────────────────────── */
.product-gallery { position: relative; }

.gallery-main {
  position: relative;
  background: var(--bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  aspect-ratio: 4/3;
}
.gallery-main img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  transition: opacity 0.3s;
}
.gallery-main .product-labels { top: 16px; right: 16px; }

.gallery-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.gallery-thumb {
  width: 80px; height: 60px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 3px solid transparent;
  transition: border-color 0.2s, opacity 0.2s;
  opacity: 0.7;
}
.gallery-thumb:hover  { opacity: 1; border-color: var(--brand-start); }
.gallery-thumb.active { opacity: 1; border-color: var(--brand-start); }

/* ── Product Info ────────────────────────────────────────── */
.product-info { padding-top: 8px; }

.product-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 12px;
  line-height: 1.3;
}
.product-price-row {
  margin-bottom: 12px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.price-main {
  font-size: 30px;
  font-weight: 700;
  color: var(--brand-start);
}
.price-sale {
  font-size: 30px;
  font-weight: 700;
  color: var(--red);
}
.price-original {
  font-size: 18px;
  color: var(--text-light);
  text-decoration: line-through;
}
.price-badge {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 8px;
  vertical-align: middle;
}

.stock-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
}
.stock-badge.in-stock  { background: #d4edda; color: #155724; }
.stock-badge.out-of-stock { background: #f8d7da; color: #721c24; }

.product-description {
  color: var(--text-mid);
  line-height: 1.85;
  margin-bottom: 24px;
  font-size: 15px;
}

/* ── Gallery Prev / Next buttons ────────────────────────── */
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.45);
  color: #fff;
  border: none;
  width: 44px; height: 44px;
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
}
.gallery-main:hover .gallery-nav { opacity: 1; }
.gallery-nav:hover { background: rgba(0,0,0,0.72); }
.gallery-prev { left: 12px; }
.gallery-next { right: 12px; }

/* ── Lightbox ────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000;
  transition: background 0.25s;
}
.lightbox.open { background: rgba(0,0,0,0.88); }

.lightbox-inner {
  position: relative;
  max-width: 92vw;
  max-height: 92vh;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-img {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  display: block;
}
.lightbox-close {
  position: fixed;
  top: 18px; right: 22px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  width: 42px; height: 42px;
  border-radius: 50%;
  font-size: 26px;
  cursor: pointer;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.3); }

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  width: 52px; height: 52px;
  border-radius: 50%;
  font-size: 34px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.3); }
.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }

.lightbox-counter {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.75);
  font-size: 14px;
  background: rgba(0,0,0,0.4);
  padding: 4px 14px;
  border-radius: 20px;
}

/* ── Variant Selectors ───────────────────────────────────── */
.variant-selectors { margin-bottom: 24px; }
.variant-group { margin-bottom: 16px; }
.variant-label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-dark);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.variant-select {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  color: var(--text-dark);
  background: var(--white);
  cursor: pointer;
  transition: border-color 0.2s;
}
.variant-select:hover,
.variant-select:focus {
  border-color: var(--brand-start);
  outline: none;
}

/* ── Shopify Buy Button ──────────────────────────────────── */
.shopify-buy-button {
  margin-bottom: 24px;
}
.no-buy-button {
  padding: 14px 20px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 14px;
  text-align: center;
}

/* ── Product Meta ────────────────────────────────────────── */
.product-meta {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: 20px;
}
.product-meta p {
  color: var(--text-mid);
  font-size: 14px;
  margin-bottom: 6px;
}
.product-meta strong { color: var(--text-dark); }

/* ── Description (inline in right column) ────────────────── */
.product-description-inline {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.description-heading {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--brand-start);
  display: inline-block;
}
.product-description-body p {
  color: var(--text-dark);
  font-size: 15px;
  line-height: 1.8;
  margin-bottom: 14px;
}
.product-description-body p:last-child { margin-bottom: 0; }

/* ── Related Products ────────────────────────────────────── */
.related-section {
  background: var(--white);
  padding: 50px 0;
  border-top: 1px solid var(--border);
}
.related-section h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 28px;
  color: var(--text-dark);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.related-card {
  background: var(--bg);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  box-shadow: var(--shadow-sm);
}
.related-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}
.related-card-image {
  position: relative;
  height: 160px;
  overflow: hidden;
}
.related-card-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.35s;
}
.related-card:hover .related-card-image img { transform: scale(1.06); }
.related-card-info { padding: 12px; }
.related-card-info h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 4px;
  line-height: 1.4;
}
.related-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--brand-start);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .product-container { grid-template-columns: 1fr; gap: 30px; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 580px) {
  .product-title { font-size: 24px; }
  .price-main, .price-sale { font-size: 24px; }
  .related-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .gallery-thumb { width: 60px; height: 46px; }
}
