/* =========================================================
   Product Page (product.css)
   Scope: only elements inside .product-page
   Depends on: styles.css for base fonts/colors/header/footer
   Optional CSS variables (with fallbacks):
     --accent, --accent-contrast, --muted, --border, --card
   ========================================================= */

/* ---------- Page & Layout ---------- */
.product-page {
  padding: 1.25rem 1rem 2.5rem;
}

.product-page .product-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* Large screens: gallery + details side by side */
@media (min-width: 900px) {
  .product-page .product-wrap {
    grid-template-columns: minmax(320px, 520px) 1fr;
    gap: 2.25rem;
  }
}

/* ---------- Breadcrumb ---------- */
.product-page .breadcrumb {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  color: var(--muted, #6b7280);
}
.product-page .breadcrumb a {
  color: inherit;
  text-decoration: none;
}
.product-page .breadcrumb a:hover {
  text-decoration: underline;
}

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

/* Main image — consistent size */
.product-page .gallery #mainImage {
  width: 100%;
  height: 420px;                 /* fixed visual height */
  object-fit: contain;           /* was: cover — no cropping */
  object-position: center center;
  border-radius: 10px;
  background: #fff;              /* or var(--card, #f8fafc) */
  border: 1px solid var(--border, #e5e7eb);
  padding: 8px;                  /* breathing room */
  box-sizing: border-box;
  transition: transform 0.25s ease;
}
@media (max-width: 420px) {
  .product-page .gallery #mainImage { height: 320px; }
}

/* Subtle hover zoom (desktop) */
@media (hover: hover) and (pointer: fine) {
  .product-page .gallery #mainImage:hover {
    transform: scale(1.01);
  }
}

/* Thumbnails row */
.product-page .thumbs {
  margin-top: 0.75rem;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(70px, 1fr);
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}
.product-page .thumbs .thumb {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}
.product-page .thumbs .thumb img {
  width: 100%;
  height: 70px;
  object-fit: contain;           /* was: cover — no cropping */
  object-position: center center;
  border-radius: 6px;
  border: 1px solid var(--border, #e5e7eb);
  background: #fff;              /* or var(--card, #f8fafc) */
  padding: 4px;                  /* small inset so edges don't touch */
  box-sizing: border-box;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.product-page .thumbs .thumb img:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(0,0,0,0.07);
}

/* ---------- Details ---------- */
.product-page .details {
  max-width: 560px;
}
.product-page .details #prodName {
  margin: 0 0 0.35rem;
  line-height: 1.15;
  font-size: clamp(1.6rem, 2.5vw, 2.1rem); /* bigger */
  font-weight: 800;
}
.product-page .details #sku {
  margin: 0 0 0.75rem;
  color: var(--muted, #6b7280);
  font-size: 0.95rem;
}
/* Hide SKU since you don't want it visible
.product-page .details #sku { display: none; } */

/* Category badges */
.product-page .badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.25rem 0 0.75rem;
}
.product-page .chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  font-size: 0.8rem;
  border-radius: 999px;
  background: var(--card, #f8fafc);
  border: 1px solid var(--border, #e5e7eb);
}

/* Price block */
.product-page .price {
  margin: 0.75rem 0 1rem;
}
.product-page .price-line {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.product-page .price-current {
  color: var(--accent, #0ea5e9);
  font-weight: 800;
  font-size: 1.55rem;
}
.product-page .price-old {
  color: var(--muted, #6b7280);
  text-decoration: line-through;
  font-size: 1rem;
}
.product-page .price-badge {
  background: var(--accent, #0ea5e9);
  color: var(--accent-contrast, #ffffff);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

/* Description */
.product-page #description {
  margin: 0.85rem 0 1.3rem;
  line-height: 1.65;
  font-size: 1.05rem; /* larger paragraph */
}

/* Buy row */
.product-page .buy {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.product-page .buy label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
}
.product-page .buy input[type="number"] {
  width: 96px;
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  background: #fff;
  font-size: 1rem;
}
.product-page #addToCartBtn {
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--accent, #0ea5e9);
  color: var(--accent-contrast, #fff);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.product-page #addToCartBtn:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}
.product-page .cart-badge {
  background: #111827;
  color: #fff;
  font-size: 0.8rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}

/* ---------- Product Description ---------- */

.product-page .special-info {
  grid-column: 1 / -1;        /* full width under thumbnails/details */
  margin-top: 1.5rem;
  padding: 1.1rem 1rem;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  background: var(--card, #f8fafc);
}
.product-page .special-info h2 {
  margin: 0 0 0.6rem;
  font-size: 1.25rem;
}
.product-page .special-info p {
  margin: 0;
  line-height: 1.65;
  font-size: 1.02rem;
}

.product-page .special-info p + p {
  margin-top: 0.8rem;
}

/* ---------- Related Items ---------- */
.product-page .related {
  margin-top: 2.25rem;
}
.product-page .related h2 {
  margin-bottom: 0.85rem;
}
.product-page .related .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
}

/* Card */
.product-page .related .card {
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.product-page .related .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.06);
}

/* Consistent related image size */
.product-page .related .card img {
  width: 100%;
  height: 160px;                 /* fixed height for uniformity */
  object-fit: contain;           /* was: cover — no cropping */
  object-position: center center;
  background: #fff;              /* or var(--card, #f8fafc) */
  padding: 8px;
  box-sizing: border-box;
}

/* Card body */
.product-page .related .card-body {
  padding: 0.65rem 0.8rem 0.9rem;
}
.product-page .related .card-body h3 {
  font-size: 0.98rem;
  line-height: 1.35;
  margin: 0 0 0.35rem;
  min-height: 2.6em;          /* keep titles balanced across cards */
}
.product-page .related .card-price {
  color: var(--accent, #0ea5e9);
  font-weight: 700;
}

/* ---------- Alerts (errors / warnings from JS) ---------- */
.product-page .alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: #f3f4f6;
  border: 1px solid var(--border, #e5e7eb);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}
.product-page .alert.error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #7f1d1d;
}
.product-page .alert.warn {
  background: #fffbeb;
  border-color: #fde68a;
  color: #78350f;
}
.product-page .muted { color: var(--muted, #6b7280); }

/* ---------- Small helpers ---------- */
.product-page img { display: block; }
.product-page .container { max-width: 1120px; margin: 0 auto; }

.img-contain {
  object-fit: contain;
  object-position: center center;
  background: #fff;              /* or var(--card) */
  padding: 8px;
  box-sizing: border-box;
}