/* ==========================================================================
   PRODUCT — styles specific to product.html only
   (hero reuses .orbit-hero — same wash/dots/blob background as home/article —
   as a taller "extended" variant: the wash + dots keep going below the
   heading so the product header (gallery/title/price) can sit on top of it.
   It does NOT fill the viewport; it just gives enough room for the header
   block before the page settles into plain --bg, same idea as article.css.)
   ========================================================================== */

/* ---- Extended hero -------------------------------------------------------- */
.orbit-hero--product{
  padding-block: clamp(6.5rem, 13vw, 9.5rem) 0;
}
.orbit-hero--product .orbit-hero__inner{
  min-height: auto;
  display: block;
  place-items: unset;
}
.orbit-hero--product .orbit-hero__dots{
  -webkit-mask-image: radial-gradient(65% 90% at 50% 30%, #000 0%, transparent 80%);
  mask-image: radial-gradient(65% 90% at 50% 30%, #000 0%, transparent 80%);
}

/* ---- Product header: gallery left, purchase panel right, sits on hero -- */
.product-header{
  display: grid;
  grid-template-columns: minmax(0, 460px) 1fr;
  align-items: start;
  gap: clamp(2rem, 5vw, 3.5rem);
}

/* Gallery: big cover + thumbnail strip */
.product-gallery__main{
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/3;
  box-shadow: var(--card-shadow);
  background:
    radial-gradient(120% 140% at 20% 0%, color-mix(in srgb, var(--accent) 55%, #6a5cff 45%) 0%, transparent 55%),
    linear-gradient(135deg, #6a5cff 0%, #2f7bff 55%, #1d3fae 100%);
}
.product-gallery__main img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-gallery__format{
  position: absolute;
  top: 14px; left: 14px;
  background: rgba(20,20,26,0.55);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-pill);
  backdrop-filter: blur(6px);
}
.product-gallery__thumbs{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.product-gallery__thumb{
  display: block;
  width: 100%;
  aspect-ratio: 1/1;
  padding: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease);
}
.product-gallery__thumb img{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-gallery__thumb[aria-current="true"]{
  border-color: var(--accent);
}
.product-gallery__thumb:hover{
  border-color: var(--hairline-strong);
}

/* Purchase panel content */
.product-header__badge{
  display: inline-block;
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-pill);
  margin-bottom: 1rem;
}
/* display: inline-block set directly on the class beats the browser's own
   [hidden]{ display:none } rule at equal specificity — same bug already
   fixed on .article-header/.skel-article-header. Harmless today since the
   badge only ever goes hidden->visible once, but real (a product loaded
   after one with a category, or the loading-skeleton swap below, could
   re-hide it), so it's fixed here defensively while already touching this
   element. */
.product-header__badge[hidden]{
  display: none;
}
.product-header__title{
  font-size: var(--step-3);
  font-weight: 600;
  line-height: 1.15;
  max-width: 22ch;
}
.product-rating{
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.9rem;
}
.product-rating__stars{
  display: inline-flex;
  gap: 2px;
  color: var(--accent);
}
.product-rating__stars svg{ width: 16px; height: 16px; }
.product-rating__count{
  font-size: var(--step--1);
  color: var(--ink-mute);
}
.product-header__desc{
  color: var(--ink-soft);
  font-size: var(--step-1);
  max-width: 48ch;
  margin-top: 1rem;
}
.product-header .meta-row{
  margin-top: 1.25rem;
}

/* Price + CTA block */
.product-buy{
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1.75rem;
}
.product-buy__price-block{
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.product-buy__price-label{
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.product-buy__price-row{
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.product-buy__price-now{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step-3);
  color: var(--ink-text);
}
.product-buy__price-was{
  font-size: var(--step-0);
  color: var(--ink-mute);
  text-decoration: line-through;
}
/* Free product — reuses the site's existing "success" accent color
   (see .newsletter-note[data-state="success"] in components.css/home.css)
   rather than introducing a new color. */
.product-buy__price-now--free,
.product-card__price-now--free,
.buy-card__price-now--free{
  color: var(--accent);
}
[data-theme="dark"] .product-buy__price-now--free,
[data-theme="dark"] .product-card__price-now--free,
[data-theme="dark"] .buy-card__price-now--free{
  color: var(--accent);
}
.product-buy__actions{
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}
.product-buy .btn-solid{
  padding: 0.9rem 1.75rem;
}
.product-wishlist{
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1.5px solid var(--hairline-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-text);
  flex-shrink: 0;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.product-wishlist:hover{
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  transform: scale(1.05);
}
.product-wishlist svg{ width: 19px; height: 19px; }
.product-wishlist.is-saved{
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}
.product-wishlist.is-saved svg{ fill: var(--accent); }
[data-save-toggle-label].is-saved{
  border-color: var(--accent);
  color: var(--accent);
}
[data-save-toggle-label].is-saved svg{ fill: var(--accent); }

@media (max-width: 780px){
  .product-header{
    grid-template-columns: 1fr;
  }
  .product-gallery__main{
    max-width: 420px;
  }
  .product-buy{
    flex-wrap: wrap;
  }
  .product-buy__actions{
    margin-left: 0;
    width: 100%;
  }
  .product-buy .btn-solid{
    flex: 1;
    justify-content: center;
  }
}

/* Space below the header before the plain-bg body content starts */
.product-header-wrap{
  padding-bottom: clamp(3rem, 7vw, 4.5rem);
}

/* ---- Body layout: main details (left) + sticky buy card (right) -------- */
.product-body-grid{
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: clamp(2.5rem, 6vw, 4.5rem);
  align-items: start;
}

/* ---- Product content typography (mirrors .article-content) ------------- */
.product-content{
  max-width: 720px;
}
.product-content > * + *{
  margin-top: 1.4rem;
}
.product-content h2{
  font-size: var(--step-2);
  font-weight: 600;
  margin-top: 2.75rem;
}
.product-content h2:first-child{ margin-top: 0; }
.product-content p{
  color: var(--ink-soft);
  line-height: 1.75;
}
.product-content ul{
  color: var(--ink-soft);
  line-height: 1.75;
  padding-left: 0;
  margin-top: 1.1rem;
  display: grid;
  gap: 0.65rem;
}
.product-content ul li{
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}
.product-content ul li svg{
  width: 20px; height: 20px;
  flex-shrink: 0;
  margin-top: 0.15rem;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 50%;
  padding: 3px;
}

/* Spec table (format, file size, pages, updated, license) */
.product-specs{
  margin-top: 1.1rem;
}
.product-specs__row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--hairline);
  font-size: var(--step--1);
}
.product-specs__label{ color: var(--ink-mute); }
.product-specs__value{ font-weight: 600; color: var(--ink-text); }

/* ---- Sticky buy card (sidebar) ------------------------------------------ */
.buy-card{
  position: sticky;
  top: 100px;
  background: var(--card-bg);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
}
.buy-card__price-row{
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.buy-card__price-now{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step-3);
  color: var(--ink-text);
}
.buy-card__price-was{
  font-size: var(--step-0);
  color: var(--ink-mute);
  text-decoration: line-through;
}
.buy-card__save-badge{
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-pill);
  margin-bottom: 1.1rem;
}
.buy-card .btn-solid{
  width: 100%;
  justify-content: center;
  padding: 0.95rem 1.5rem;
  margin-bottom: 0.75rem;
}
.buy-card .btn-ghost{
  width: 100%;
  justify-content: center;
  padding: 0.85rem 1.5rem;
}
.buy-card__list{
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--hairline);
  display: grid;
  gap: 0.75rem;
}
.buy-card__list li{
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: var(--step--1);
  color: var(--ink-soft);
}
.buy-card__list svg{
  width: 18px; height: 18px;
  flex-shrink: 0;
  color: var(--ink-mute);
}
.buy-card__terms-link{
  display: block;
  margin-top: 0.75rem;
  font-size: var(--step--1);
  color: var(--ink-mute);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.buy-card__terms-link:hover{ color: var(--ink-soft); }

@media (max-width: 960px){
  .product-body-grid{
    grid-template-columns: 1fr;
  }
  .buy-card{
    position: static;
    order: -1;
  }
}

/* ---- Related products (reuses the site's universal .product-card in the
   same 4-up .product-grid used on products.html — no local override, so it
   always matches whatever the main grid looks like). No top divider — the
   section spacing alone separates it from the details/buy-card above. ---- */
.product-related{
  padding-top: clamp(2.5rem, 5vw, 3.5rem);
}
