/* ═══ Page layout ═══ */
.product-page {
  position: relative;
  isolation: isolate;
  overflow-x: clip;
}

.product-page__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.product-page__spotlight {
  position: absolute;
  left: 50%;
  top: 28%;
  width: min(1000px, 100%);
  max-width: 100%;
  height: min(720px, 90vh);
  transform: translate(-50%, -50%);
  background: radial-gradient(
    ellipse 50% 48% at 50% 50%,
    rgba(255, 196, 140, 0.16) 0%,
    rgba(255, 160, 100, 0.08) 30%,
    rgba(255, 255, 255, 0.04) 50%,
    transparent 72%
  );
  filter: blur(40px);
}

.product-page__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 85% 70% at 50% 24%, black 15%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 85% 70% at 50% 24%, black 15%, transparent 78%);
}

.product-page > :not(.product-page__bg) {
  position: relative;
  z-index: 1;
}

/* ═══ Sticky purchase bar (bottom) ═══ */
body.thenine-product-page {
  --product-sticky-h: 104px;
}

.product-sticky-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 120;
  border-top: 1px solid var(--border-subtle);
  background: rgba(8, 8, 10, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.35);
  padding-block: 14px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
}

.product-sticky-bar__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(20px, 4vw, 48px);
  align-items: center;
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
  box-sizing: border-box;
}

.product-sticky-bar__lead {
  min-width: 0;
}

.product-sticky-bar__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.product-sticky-bar__title {
  margin: 0;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-sticky-bar__aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.product-sticky-bar__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.product-sticky-bar__actions .btn--primary {
  padding-inline: 22px;
  font-weight: 600;
  white-space: nowrap;
}

body.thenine-product-page .site-footer {
  padding-bottom: calc(var(--product-sticky-h) + 20px + env(safe-area-inset-bottom, 0px));
}

.product-intro-header {
  display: none;
}

.product-intro__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.product-intro__title {
  margin: 0;
  font-size: clamp(1.35rem, 5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

/* ═══ Breadcrumb (below title, left-aligned) ═══ */
.product-info__breadcrumb {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin: 0;
  flex-wrap: wrap;
}

.product-info__breadcrumb a {
  color: var(--text-muted);
  transition: color var(--transition);
}

.product-info__breadcrumb a:hover {
  color: var(--text-primary);
}

.product-info__breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.product-info__breadcrumb-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.product-info__breadcrumb-label {
  line-height: 1.2;
}

.product-info__breadcrumb-sep {
  display: inline-flex;
  align-items: center;
  opacity: 0.4;
  color: var(--text-muted);
}

/* ═══ Product showcase (bento) ═══ */
.product-showcase {
  position: relative;
  z-index: 1;
  padding-top: calc(var(--header-h) + 28px);
  padding-bottom: 8px;
}

.product-info__price {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.product-info__note {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: right;
  margin: 0;
  max-width: 320px;
}

.product-info__note a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition);
}

.product-info__note a:hover {
  color: var(--text-primary);
}

.add-to-cart.is-loading {
  opacity: 0.7;
  pointer-events: none;
}

/* ═══ Bento gallery 2×2 ═══ */
.product-bento {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 0;
}

.product-bento__cell {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.product-bento__cell .product-card__media {
  border-radius: 0;
}

.product-bento__cell::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.product-bento__cell:hover {
  border-color: var(--border-default);
  transform: translateY(-2px);
}

.product-bento__cell:hover .product-card__media img {
  transform: scale(1.02);
}

.product-bento__cell--skeleton {
  background: linear-gradient(
    110deg,
    var(--bg-surface) 0%,
    var(--bg-elevated) 45%,
    var(--bg-surface) 90%
  );
  background-size: 200% 100%;
  animation: bento-shimmer 1.4s ease-in-out infinite;
}

@keyframes bento-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ═══ Product sections (stacked) ═══ */
.product-sections-wrap {
  margin-top: 56px;
  padding-bottom: 48px;
}

.product-detail-grid {
  display: block;
}

.product-detail-grid--with-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(240px, 3fr);
  gap: 48px;
  align-items: start;
}

.product-detail-grid__main {
  min-width: 0;
}

.product-detail-grid__sidebar {
  position: sticky;
  top: calc(var(--header-h) + 72px);
  min-width: 0;
}

.product-section-nav {
  position: sticky;
  top: calc(var(--header-h) + 12px);
  z-index: 20;
  display: flex;
  justify-content: center;
  margin-bottom: 48px;
  padding-block: 8px;
}

.product-section-nav__track {
  display: inline-flex;
  gap: 4px;
  max-width: 100%;
  padding: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
}

.product-section-nav__track::-webkit-scrollbar {
  display: none;
}

.product-section-nav__link {
  flex-shrink: 0;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-muted);
  border-radius: var(--radius-full);
  white-space: nowrap;
  transition: color var(--transition), background var(--transition);
}

.product-section-nav__link:hover {
  color: var(--text-primary);
}

.product-section-nav__link.is-active {
  color: var(--accent-on);
  background: var(--accent);
}

.product-section {
  padding-bottom: 40px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border-subtle);
}

.product-detail-grid__main .product-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.product-section__title {
  margin: 0 0 24px;
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.product-section__body {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-secondary);
}

.product-section__prose {
  text-align: left;
}

.product-section__prose > :first-child {
  margin-top: 0;
}

.product-section__prose > :last-child {
  margin-bottom: 0;
}

.product-section__prose p,
.product-section__prose ul,
.product-section__prose ol {
  margin: 0 0 1em;
}

.product-section__prose h3,
.product-section__prose h4 {
  margin: 1.5em 0 0.5em;
  color: var(--text-primary);
}

.product-section__prose a {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Key features — bento cards */
.product-features-bento {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.product-features-bento__card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  min-height: 120px;
  padding: 20px;
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.product-features-bento__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-size: 20px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
}

.product-features-bento__content {
  min-width: 0;
}

.product-features-bento__title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.product-features-bento__desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Changelog timeline */
.product-changelog {
  padding: 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.product-changelog__title {
  margin: 0 0 24px;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.product-changelog__timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 8px;
}

.product-changelog__item {
  position: relative;
  display: flex;
  gap: 16px;
  padding: 0 0 24px 20px;
}

.product-changelog__item:last-child {
  padding-bottom: 0;
}

.product-changelog__item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 10px;
  bottom: 0;
  width: 1px;
  background: var(--border-subtle);
}

.product-changelog__dot {
  position: absolute;
  left: 0;
  top: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.06);
}

.product-changelog__version {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.product-changelog__date {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
}

/* Legacy */
.product-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.product-features__item {
  display: flex;
  gap: 14px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.product-features__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-size: 18px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
}

.product-features__content {
  min-width: 0;
}

.product-features__title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.product-features__desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Tech specs */
.product-specs {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.product-specs th,
.product-specs td {
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  vertical-align: top;
}

.product-specs tr:last-child th,
.product-specs tr:last-child td {
  border-bottom: none;
}

.product-specs th {
  width: 40%;
  padding-right: 24px;
  font-weight: 500;
  color: var(--text-muted);
}

.product-specs td {
  color: var(--text-primary);
  font-weight: 500;
}

/* Support */
.product-support__intro {
  margin: 0 0 20px;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-secondary);
}

.product-support__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Legacy tabs — removed; keep empty selectors out */

/* ═══ Related ═══ */
.product-related {
  padding-block: 48px 48px;
  border-top: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.018) 100%);
}

.product-related__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}

.product-related__title {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.product-related__link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
}

.product-related__link:hover {
  color: var(--text-primary);
}

@media (max-width: 900px) {
  .product-bento {
    gap: 10px;
  }

  .product-page__spotlight {
    top: 18%;
  }

  .product-detail-grid--with-sidebar {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .product-detail-grid__sidebar {
    position: static;
  }

  .product-sections-wrap {
    margin-top: 40px;
  }

  .product-section-nav__link {
    padding: 9px 16px;
    font-size: 13px;
  }

  .product-features-bento {
    grid-template-columns: 1fr;
  }

  .product-specs th {
    width: 46%;
  }
}

@media (max-width: 768px) {
  html:has(body.thenine-product-page) {
    overflow-x: hidden;
  }

  body.thenine-product-page {
    --product-sticky-h: 68px;
    --product-pad-x: var(--gutter);
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body.thenine-product-page #main,
  body.thenine-product-page .product-page {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }

  body.thenine-product-page .site-header .container,
  body.thenine-product-page main .container,
  body.thenine-product-page .site-footer .container {
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
    padding-inline: var(--product-pad-x);
    box-sizing: border-box;
  }

  .product-intro-header {
    display: block;
    margin-bottom: 20px;
  }

  .product-sticky-bar__lead,
  .product-sticky-bar .product-info__note,
  .product-sticky-bar .product-header__preview {
    display: none;
  }

  .product-sticky-bar {
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    left: 0;
    right: 0;
    width: auto;
    box-sizing: border-box;
    padding-inline: var(--product-pad-x);
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    pointer-events: none;
  }

  .product-sticky-bar__inner {
    display: block;
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
    padding-inline: 0;
    pointer-events: none;
  }

  .product-sticky-bar__aside {
    align-items: stretch;
    width: 100%;
    pointer-events: auto;
  }

  .product-sticky-bar__actions {
    justify-content: stretch;
  }

  .product-sticky-bar__actions .add-to-cart {
    width: 100%;
    justify-content: center;
    border-radius: var(--radius-full);
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.5);
  }

  .product-bento {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .product-bento__cell {
    border-radius: var(--radius-lg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-bento__cell:hover,
  .product-bento__cell:hover .product-card__media img {
    transform: none;
  }

  .product-bento__cell--skeleton {
    animation: none;
  }
}
