/* Product page (PDP) only — carried over from the inline <style> block in
   the original product.html. Enqueued only on single product pages. */

/* Clean reading surface: no grid, no grain on this page.
   (This stylesheet only loads on single product pages, so these bare
   html/body selectors are already effectively scoped to the PDP.) */
html { background-image: none; }
body::before, body::after { display: none !important; }

/* ---- Product page layout ---- */
.product-page {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  padding-block: var(--space-8);
}
@media (min-width: 760px) {
  .product-page { grid-template-columns: 1fr 1fr; align-items: start; gap: clamp(3rem, 6vw, 6rem); }
}

/* Gallery */
.product-gallery { display: flex; flex-direction: column; gap: var(--space-3); position: sticky; top: calc(var(--space-8) + 72px); }
.product-gallery__main {
  aspect-ratio: 3/4;
  overflow: hidden;
  border-radius: 4px;
  background: var(--color-surface);
  position: relative;
}
.product-gallery__main img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
  transition: opacity 0.3s ease;
}
.gallery-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.7);
  border: none; cursor: pointer;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-ink);
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 10000; /* above the grain layer */
  backdrop-filter: blur(4px);
}
.product-gallery__main:hover .gallery-arrow { opacity: 1; }
.gallery-arrow--prev { left: 10px; }
.gallery-arrow--next { right: 10px; }
.gallery-arrow:hover { background: rgba(255,255,255,0.95); }
.product-gallery__thumbs { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.product-gallery__thumb {
  width: 72px; height: 96px;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s;
  flex-shrink: 0;
  padding: 0;
  background: none;
}
.product-gallery__thumb.active { border-color: var(--color-ink); }
.product-gallery__thumb img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }

/* Details */
.product-details { display: flex; flex-direction: column; gap: var(--space-5); }

.product-details__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.65rem; font-weight: 400;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--color-text-muted);
}

.product-details__name {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1;
  margin: 0;
}

.product-details__price {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--color-text);
}
/* When JS swaps in a variation's own WC-formatted price HTML */
.product-details__price .woocommerce-Price-amount { font-family: var(--font-mono); font-size: 1.1rem; color: var(--color-text); }
.product-details__price del { opacity: .4; margin-right: .4rem; }
.product-details__price ins { text-decoration: none; }

.product-divider { border: 0; border-top: 1px solid rgba(20,20,20,.12); margin: 0; }

/* Size / variation selector (generic — used for whatever attribute the product has) */
.size-label {
  font-family: var(--font-mono);
  font-size: 0.7rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
  display: block;
}
.size-grid { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.size-btn {
  font-family: var(--font-mono);
  font-size: 0.75rem; font-weight: 400;
  letter-spacing: .05em; text-transform: uppercase;
  padding: .55rem .9rem;
  border: 1.5px solid rgba(20,20,20,.18);
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  color: var(--color-text);
}
.size-btn:hover:not(:disabled) { border-color: var(--color-ink); background: var(--color-ink); color: #fff; }
.size-btn.selected { background: var(--color-ink); border-color: var(--color-ink); color: #fff; }
.size-btn:disabled { opacity: 0.3; cursor: not-allowed; pointer-events: none; }
.color-swatch-grid { gap: .65rem; }
.size-btn.color-swatch {
  width: 2rem; height: 2rem; padding: 0; border-radius: 50%;
  background: var(--swatch-color, #e5e7eb); border: 2px solid rgba(20,20,20,.22);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.55);
}
.size-btn.color-swatch:hover:not(:disabled),
.size-btn.color-swatch.selected { background: var(--swatch-color, #e5e7eb); border-color: var(--color-ink); color: inherit; box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--color-ink); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.stock-notice {
  font-family: var(--font-mono); font-size: .75rem; letter-spacing: .05em;
  color: var(--color-red);
  display: none;
}
.stock-notice.is-visible { display: block; }

.atc-error {
  font-family: var(--font-mono); font-size: .75rem; letter-spacing: .03em;
  color: var(--color-red);
  display: none;
  margin-top: calc(var(--space-3) * -1);
}
.atc-error.is-visible { display: block; }

/* Add to cart */
.atc-row { display: flex; gap: var(--space-3); }
.btn--atc {
  flex: 1;
  font-family: var(--font-display);
  font-size: 0.85rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  padding: 1rem 1.5rem;
  border-radius: 0;
  background: var(--color-red);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}
.btn--atc:hover:not(:disabled) { background: var(--color-red-hover); }
.btn--atc:disabled { opacity: .4; cursor: not-allowed; }
.btn--atc-secondary {
  font-family: var(--font-display);
  font-size: 0.85rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  padding: 1rem 1.5rem;
  border-radius: 0;
  background: transparent;
  color: var(--color-ink);
  border: 2px solid var(--color-ink);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn--atc-secondary:hover { background: var(--color-ink); color: #fff; }

/* Description */
.product-description p {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* Details accordion */
.product-accordion { border-top: 1px solid rgba(20,20,20,.12); }
.accordion-item { border-bottom: 1px solid rgba(20,20,20,.12); }
.accordion-trigger {
  font-family: var(--font-mono);
  font-size: 0.72rem; font-weight: 400;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--color-text);
  background: none; border: none; cursor: pointer;
  width: 100%; text-align: left;
  padding: var(--space-4) 0;
  display: flex; justify-content: space-between; align-items: center;
}
.accordion-trigger svg { transition: transform 0.2s; flex-shrink: 0; }
.accordion-item.open .accordion-trigger svg { transform: rotate(45deg); }
.accordion-body {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.65;
  overflow: hidden;
  padding-bottom: var(--space-4);
}
.accordion-body[hidden] { display: none; }
.accordion-body ul { padding-left: 1.2rem; display: grid; gap: .4rem; }

/* WooCommerce's own attribute-table output, restyled to match the theme
   (used in the Details accordion when a product has spec attributes set) */
.woocommerce-product-attributes {
  width: 100%; border-collapse: collapse;
  font-family: var(--font-body); font-size: 0.9rem; color: var(--color-text-muted);
}
.woocommerce-product-attributes-item { border-bottom: 1px solid rgba(20,20,20,.08); }
.woocommerce-product-attributes-item__label {
  padding: .5rem .75rem .5rem 0; font-weight: 600; color: var(--color-text); width: 40%; vertical-align: top;
}
.woocommerce-product-attributes-item__value { padding: .5rem 0; vertical-align: top; }
.woocommerce-product-attributes-item__value p { margin: 0; }

/* Breadcrumb */
.breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.65rem; letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  display: flex; gap: .5rem; align-items: center;
  padding-block: var(--space-5);
}
.breadcrumb a { color: inherit; text-decoration: none; }
.breadcrumb a:hover { color: var(--color-ink); }

/* Related products */
.related { padding-block: var(--space-8); border-top: 1px solid rgba(20,20,20,.10); }


@media(max-width: 768px){
  .product-gallery {
      position: relative !important;
      top: 0 !important;
  }
}
